@betterbugs/web-sdk 0.0.47 → 0.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/logs-capture.js +1 -1
- package/package.json +1 -1
- package/recorder.js +1 -1
package/logs-capture.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Betterbugs=t():e.Betterbugs=t()}(this,function(){return function(){var e={7753:function(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,s=Array.isArray;function a(e,t){return"object"!=typeof t||o(t).forEach(function(n){e[n]=t[n]}),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var l=Object.getPrototypeOf,u={}.hasOwnProperty;function c(e,t){return u.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(l(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach(function(n){p(e,n,t[n])})}var d=Object.defineProperty;function p(e,t,n,r){d(e,t,a(n&&c(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function f(e){return{from:function(t){return e.prototype=Object.create(t.prototype),p(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}var m=Object.getOwnPropertyDescriptor,g=[].slice;function y(e,t,n){return g.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function S(e,t){if("string"==typeof t&&c(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=S(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return null==a?void 0:S(a,t.substr(s+1))}}function C(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)C(e,t[r],n[r])}else{var o,a,l=t.indexOf(".");-1!==l?(o=t.substr(0,l),""===(a=t.substr(l+1))?void 0===n?s(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:C(l=(l=e[o])&&c(e,o)?l:e[o]={},a,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function k(e){var t,n={};for(t in e)c(e,t)&&(n[t]=e[t]);return n}var x=[].concat;function I(e){return x.apply([],e)}var O="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(I([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return i[e]}),E=new Set(O.map(function(e){return i[e]})),R=null;function _(e){return R=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=R.get(t);if(n)return n;if(s(t)){n=[],R.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(E.has(t.constructor))n=t;else{var o,a=l(t);for(o in n=a===Object.prototype?{}:Object.create(a),R.set(t,n),t)c(t,o)&&(n[o]=e(t[o]))}return n}(e),R=null,e}var A={}.toString;function M(e){return A.call(e).slice(8,-1)}var T="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",N="symbol"==typeof T?function(e){var t;return null!=e&&(t=e[T])&&t.apply(e)}:function(){return null};function P(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var D={};function L(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===D&&"string"==typeof e)return[e];if(i=N(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var B="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},F=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(le=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),j={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function K(e,t){this.name=e,this.message=t}function z(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function U(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=z(e,t)}function q(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=z(e,this.failures)}f(K).from(Error).extend({toString:function(){return this.name+": "+this.message}}),f(U).from(K),f(q).from(K);var V=F.reduce(function(e,t){return e[t]=t+"Error",e},{}),W=K,G=F.reduce(function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=j[t]||n,this.inner=null)}return f(r).from(W),e[t]=r,e},{});G.Syntax=SyntaxError,G.Type=TypeError,G.Range=RangeError;var H=le.reduce(function(e,t){return e[t+"Error"]=G[t],e},{}),Y=F.reduce(function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=G[t]),e},{});function Z(){}function X(e){return e}function J(e,t){return null==e||e===X?t:function(n){return t(e(n))}}function $(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Q(e,t){return e===Z?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?$(r,this.onsuccess):r),i&&(this.onerror=this.onerror?$(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===Z?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?$(n,this.onsuccess):n),r&&(this.onerror=this.onerror?$(r,this.onerror):r)}}function te(e,t){return e===Z?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?$(i,this.onsuccess):i),o&&(this.onerror=this.onerror?$(o,this.onerror):o),void 0===r?void 0===n?void 0:n:a(r,n)}}function ne(e,t){return e===Z?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===Z?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}Y.ModifyError=U,Y.DexieError=K,Y.BulkError=q;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var se={},ae=100,le=(O="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,l(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,l(t),e]}(),O[0]),ue=(F=O[1],O=O[2],F=F&&F.then,le&&le.constructor),ce=!!O,he=function(e,t){be.push([e,t]),pe&&(queueMicrotask(_e),pe=!1)},de=!0,pe=!0,fe=[],me=[],ge=X,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Z,pgp:!1,env:{},finalize:Z},ve=ye,be=[],we=0,Se=[];function Ce(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ve;if("function"!=typeof e){if(e!==se)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Ie(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Ae();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof Ce?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,Oe(t)),r&&Me()}},Ie.bind(null,t))}catch(n){Ie(t,n)}}(this,e)}var ke={get:function(){var e=ve,t=je;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==je),s=o&&!qe(),a=new Ce(function(t,a){Ee(i,new xe(Ze(n,e,o,s),Ze(r,e,o,s),t,a,e))});return this._consoleTask&&(a._consoleTask=this._consoleTask),a}return n.prototype=se,n},set:function(e){p(this,"then",e&&e.prototype===se?ke:{get:function(){return e},set:ke.set})}};function xe(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function Ie(e,t){var n,r;me.push(t),null===e._state&&(n=e._lib&&Ae(),t=ge(t),e._state=!1,e._value=t,r=e,fe.some(function(e){return e._value===r._value})||fe.push(r),Oe(e),n&&Me())}function Oe(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ee(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===we&&(++we,he(function(){0==--we&&Te()},[]))}function Ee(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++we,he(Re,[n,e,t])}else e._listeners.push(t)}function Re(e,t,n){try{var r,i=t._value;!t._state&&me.length&&(me=[]),r=ie&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),t._state||-1!==me.indexOf(i)||function(e){for(var t=fe.length;t;)if(fe[--t]._value===e._value)return fe.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--we&&Te(),--n.psd.ref||n.psd.finalize()}}function _e(){Ye(ye,function(){Ae()&&Me()})}function Ae(){var e=de;return pe=de=!1,e}function Me(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);pe=de=!0}function Te(){var e=fe;fe=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=Se.slice(0),n=t.length;n;)t[--n]()}function Ne(e){return new Ce(se,!1,e)}function Pe(e,t){var n=ve;return function(){var r=Ae(),i=ve;try{return Ge(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{Ge(i,!1),r&&Me()}}}h(Ce.prototype,{then:ke,_then:function(e,t){Ee(this,new xe(null,null,e,t,ve))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,function(e){return(e instanceof t?n:Ne)(e)}):this.then(null,function(e){return(e&&e.name===t?n:Ne)(e)})},finally:function(e){return this.then(function(t){return Ce.resolve(e()).then(function(){return t})},function(t){return Ce.resolve(e()).then(function(){return Ne(t)})})},timeout:function(e,t){var n=this;return e<1/0?new Ce(function(r,i){var o=setTimeout(function(){return i(new G.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&p(Ce.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=He(),h(Ce,{all:function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return Ce.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof Ce?e:e&&"function"==typeof e.then?new Ce(function(t,n){e.then(t,n)}):new Ce(se,!0,e)},reject:Ne,race:function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){e.map(function(e){return Ce.resolve(e).then(t,n)})})},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return je}},newPSD:ze,usePSD:Ye,scheduler:{get:function(){return he},set:function(e){he=e}},rejectionMapper:{get:function(){return ge},set:function(e){ge=e}},follow:function(e,t){return new Ce(function(n,r){return ze(function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=$(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},Se.push(function t(){e(),Se.splice(Se.indexOf(t),1)}),++we,he(function(){0==--we&&Te()},[])},r.finalize),e()},t,n,r)})}}),ue&&(ue.allSettled&&p(Ce,"allSettled",function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach(function(e,i){return Ce.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),ue.any&&"undefined"!=typeof AggregateError&&p(Ce,"any",function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach(function(e,o){return Ce.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(new AggregateError(i))})})})}),ue.withResolvers&&(Ce.withResolvers=ue.withResolvers));var De={awaits:0,echoes:0,id:0},Le=0,Be=[],Fe=0,je=0,Ke=0;function ze(e,t,n,r){var i=ve,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Ke,ye.env,o.env=ce?{Promise:Ce,PromiseProp:{value:Ce,configurable:!0,writable:!0},all:Ce.all,race:Ce.race,allSettled:Ce.allSettled,any:Ce.any,resolve:Ce.resolve,reject:Ce.reject}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Ye(o,e,n,r),0===o.ref&&o.finalize(),r}function Ue(){return De.id||(De.id=++Le),++De.awaits,De.echoes+=ae,De.id}function qe(){return!!De.awaits&&(0==--De.awaits&&(De.id=0),De.echoes=De.awaits*ae,!0)}function Ve(e){return De.echoes&&e&&e.constructor===ue?(Ue(),e.then(function(e){return qe(),e},function(e){return qe(),Je(e)})):e}function We(){var e=Be[Be.length-1];Be.pop(),Ge(e,!1)}function Ge(e,t){var n,r=ve;(t?!De.echoes||Fe++&&e===ve:!Fe||--Fe&&e===ve)||queueMicrotask(t?function(e){++je,De.echoes&&0!=--De.echoes||(De.echoes=De.awaits=De.id=0),Be.push(ve),Ge(e,!0)}.bind(null,e):We),e!==ve&&(ve=e,r===ye&&(ye.env=He()),ce&&(n=ye.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function He(){var e=i.Promise;return ce?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ye(e,t,n,r,i){var o=ve;try{return Ge(e,!0),t(n,r,i)}finally{Ge(o,!1)}}function Ze(e,t,n,r){return"function"!=typeof e?e:function(){var i=ve;n&&Ue(),Ge(t,!0);try{return e.apply(this,arguments)}finally{Ge(i,!1),r&&queueMicrotask(qe)}}}function Xe(e){Promise===ue&&0===De.echoes?0===Fe?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+F).indexOf("[native code]")&&(Ue=qe=Z);var Je=Ce.reject,$e=String.fromCharCode(65535),Qe="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var st={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function at(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=_(t))[e],t}}function lt(){throw G.Type()}function ut(e,t){try{var n=ct(e),r=ct(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ht(e),ht(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var s=ut(e[o],t[o]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function ct(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=M(e))?"binary":e}function ht(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var dt=(pt.prototype._trans=function(e,t,n){var r=this._tx||ve.trans,i=this.name,o=ie&&"undefined"!=typeof console&&console.createTask&&void 0;function s(e,n,r){if(!r.schema[i])throw new G.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=Ae();try{var l=r&&r.db._novip===this.db._novip?r===ve.trans?r._promise(e,s,n):ze(function(){return r._promise(e,s,n)},{trans:r,transless:ve.transless||ve}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ve.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,i)})):Je(o)}return o._promise(n,function(e,t){return ze(function(){return ve.trans=o,i(e,t,o)})}).then(function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then(function(){return e})})}if(t._state.openComplete)return Je(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Je(new G.DatabaseClosed);t.open().catch(Z)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],s);return o&&(l._consoleTask=o,l=l.catch(function(e){return Je(e)})),l}finally{a&&Me()}},pt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Je(new G.Type("Invalid argument to Table.get()")):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},pt.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==$e){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}var i=this.schema.idxByName;function a(e,t){return 0===ut(e,t)}var l=t.reduce(function(t,n){var r=t[0],o=t[1],l=(t=i[n],e[n]);return[r||t,r||!t?ot(o,t&&t.multi?function(e){return e=S(e,n),s(e)&&e.some(function(e){return a(l,e)})}:function(e){return a(l,S(e,n))}):o]},[null,null]);return r=l[0],l=l[1],r?this.where(r.name).equals(e[r.keyPath]).filter(l):n?this.filter(l):this.where(t).equals("")},pt.prototype.filter=function(e){return this.toCollection().and(e)},pt.prototype.count=function(e){return this.toCollection().count(e)},pt.prototype.offset=function(e){return this.toCollection().offset(e)},pt.prototype.limit=function(e){return this.toCollection().limit(e)},pt.prototype.each=function(e){return this.toCollection().each(e)},pt.prototype.toArray=function(e){return this.toCollection().toArray(e)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof lt&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var s=new Set,a=t.prototype;a;a=l(a))Object.getOwnPropertyNames(a).forEach(function(e){return s.add(e)});function u(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=u,this.hook("reading",u),t},pt.prototype.defineClass=function(){return this.mapToClass(function(e){a(this,e)})},pt.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=at(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{C(e,o,t)}catch(t){}return t})},pt.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=S(e,this.schema.primKey.keyPath))?Je(new G.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},pt.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=at(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{C(e,o,t)}catch(t){}return t})},pt.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):void 0})},pt.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:st})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):void 0})},pt.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},pt.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=(a=r.schema.primKey).auto;if((a=a.keyPath)&&i)throw new G.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,a=a&&n?e.map(at(a)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:a,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new q("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)})})},pt.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=(a=r.schema.primKey).auto;if((a=a.keyPath)&&i)throw new G.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,a=a&&n?e.map(at(a)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:a,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new q("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)})})},pt.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),i=e.map(function(e){return e.changes}),o=[];return this._trans("readwrite",function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then(function(a){var l=[],u=[];e.forEach(function(e,n){var r=e.key,i=e.changes,s=a[n];if(s){for(var c=0,h=Object.keys(i);c<h.length;c++){var d=h[c],p=i[d];if(d===t.schema.primKey.keyPath){if(0!==ut(p,r))throw new G.Constraint("Cannot update primary key in bulkUpdate()")}else C(s,d,p)}o.push(n),l.push(r),u.push(s)}});var c=l.length;return n.mutate({trans:s,type:"put",keys:l,values:u,updates:{keys:r,changeSpecs:i}}).then(function(e){var n=e.numFailures,r=e.failures;if(0===n)return c;for(var i=0,s=Object.keys(r);i<s.length;i++){var a,l=s[i],u=o[Number(l)];null!=u&&(a=r[l],delete r[l],r[u]=a)}throw new q("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(c," operations failed"),r)})})})},pt.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new q("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)})},pt);function pt(){}function ft(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=a;for(var r=1,i=arguments.length;r<i;++r)a(arguments[r]);return t;function a(e,r,i){if("object"!=typeof e){var l;r=r||ne;var u={subscribers:[],fire:i=i||Z,subscribe:function(e){-1===u.subscribers.indexOf(e)&&(u.subscribers.push(e),u.fire=r(u.fire,e))},unsubscribe:function(e){u.subscribers=u.subscribers.filter(function(t){return t!==e}),u.fire=u.subscribers.reduce(r,i)}};return n[e]=t[e]=u}o(l=e).forEach(function(e){var t=l[e];if(s(t))a(e,l[e][0],l[e][1]);else{if("asap"!==t)throw new G.InvalidArgument("Invalid event config");var n=a(e,X,function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){w(function(){e.apply(null,t)})})})}})}}function mt(e,t){return f(t).from({prototype:e}),t}function gt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function yt(e,t){e.filter=ot(e.filter,t)}function vt(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function bt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new G.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function wt(e,t,n){var r=bt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function St(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},s=function(e,n,r){var s,a;i&&!i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||("[object ArrayBuffer]"==(a=""+(s=n.primaryKey))&&(a=""+new Uint8Array(s)),c(o,a)||(o[a]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),Ct(wt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return Ct(wt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function Ct(e,t,n,r){var i=Pe(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=Z},function(t){e.fail(t),n=Z})||i(e.value,e,function(e){return n=e}),n()})})}var kt=(xt.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},xt);function xt(e){this["@@propmod"]=e}var It=(Ot.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Je.bind(null,n.error)):n.table._trans("readonly",e).then(t)},Ot.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Je.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Ot.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},Ot.prototype._iterate=function(e,t){return St(this._ctx,e,t,this._ctx.table.core)},Ot.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},Ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ot.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return St(t,e,n,t.table.core)})},Ot.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(gt(n,!0))return r.count({trans:e,query:{index:bt(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return St(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},Ot.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){return ut(o(e,i),o(t,i))*s}return this.toArray(function(e){return e.sort(a)}).then(t)},Ot.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&>(n,!0)&&0<n.limit){var r=n.valueMapper,i=bt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){return e=e.result,r?e.map(r):e})}var o=[];return St(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},Ot.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,gt(t)?vt(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):vt(t,function(){var t=e;return function(){return--t<0}})),this},Ot.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),vt(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},Ot.prototype.until=function(e,t){return yt(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},Ot.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},Ot.prototype.last=function(e){return this.reverse().first(e)},Ot.prototype.filter=function(e){var t;return yt(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=ot(t.isMatch,e),this},Ot.prototype.and=function(e){return this.filter(e)},Ot.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Ot.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ot.prototype.desc=function(){return this.reverse()},Ot.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},Ot.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Ot.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},Ot.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},Ot.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&>(t,!0)&&0<t.limit)return this._read(function(e){var n=bt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},Ot.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Ot.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},Ot.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Ot.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return yt(this._ctx,function(e){var n=e.primaryKey.toString();return e=c(t,n),t[n]=!0,!e}),this},Ot.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var i,s,a;a="function"==typeof e?e:(i=o(e),s=i.length,function(t){for(var n=!1,r=0;r<s;++r){var o=i[r],a=e[o],l=S(t,o);a instanceof kt?(C(t,o,a.execute(l)),n=!0):l!==a&&(C(t,o,a),n=!0)}return n});var l,u=n.table.core,c=(l=u.schema.primaryKey).outbound,h=l.extractKey,d=200;function p(e,t){var n=t.failures;t=t.numFailures,m+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];f.push(n[s])}}(l=t.db._options.modifyChunkSize)&&(d="object"==typeof l?l[u.name]||l["*"]||200:l);var f=[],m=0,g=[];return t.clone().primaryKeys().then(function(t){function i(n){var s=Math.min(d,t.length-n);return u.getMany({trans:r,keys:t.slice(n,n+s),cache:"immutable"}).then(function(l){for(var f=[],m=[],g=c?[]:null,y=[],v=0;v<s;++v){var b=l[v],w={value:_(b),primKey:t[n+v]};!1!==a.call(w,w.value,w)&&(null==w.value?y.push(t[n+v]):c||0===ut(h(b),h(w.value))?(m.push(w.value),c&&g.push(t[n+v])):(y.push(t[n+v]),f.push(w.value)))}return Promise.resolve(0<f.length&&u.mutate({trans:r,type:"add",values:f}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);p(f.length,e)})).then(function(){return(0<m.length||o&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:g,values:m,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then(function(e){return p(m.length,e)})}).then(function(){return(0<y.length||o&&e===Et)&&u.mutate({trans:r,type:"delete",keys:y,criteria:o,isAdditionalChunk:0<n}).then(function(e){return p(y.length,e)})}).then(function(){return t.length>n+s&&i(n+d)})})}var o=gt(n)&&n.limit===1/0&&("function"!=typeof e||e===Et)&&{index:n.index,range:n.range};return i(0).then(function(){if(0<f.length)throw new U("Error modifying one or more objects",f,m,g);return t.length})})})},Ot.prototype.delete=function(){var e=this._ctx,t=e.range;return gt(e)&&(e.isPrimKey||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then(function(e){var n=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new U("Could not delete some values",Object.keys(n).map(function(e){return n[e]}),t-e);return t-e})})}):this.modify(Et)},Ot);function Ot(){}var Et=function(e,t){return t.value=null};function Rt(e,t){return e<t?-1:e===t?0:1}function _t(e,t){return t<e?-1:e===t?0:1}function At(e,t,n){return(e=e instanceof Dt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Mt(e){return new e.Collection(e,function(){return Pt("")}).limit(0)}function Tt(e,t,n,r){var i,o,s,a,l,u,c,h=n.length;if(!n.every(function(e){return"string"==typeof e}))return At(e,et);function d(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?Rt:_t;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return s(e.lower,t.lower)});a=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),c="next"===(u=e)?"":r}d("next"),(e=new e.Collection(e,function(){return Nt(a[0],l[h-1]+r)}))._ondirectionchange=function(e){d(e)};var p=0;return e._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var d=o(i);if(t(d,l,p))return!0;for(var f=null,m=p;m<h;++m){var g=function(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,l=0;l<s;++l){var u=t[l];if(u!==r[l])return i(e[l],n[l])<0?e.substr(0,l)+n[l]+n.substr(l+1):i(e[l],r[l])<0?e.substr(0,l)+r[l]+n.substr(l+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[l],u)<0&&(a=l)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}(i,d,a[m],l[m],s,u);null===g&&null===f?p=m+1:(null===f||0<s(f,g))&&(f=g)}return n(null!==f?function(){e.continue(f+c)}:r),!1}),e}function Nt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Pt(e){return{type:1,lower:e,upper:e}}var Dt=(Object.defineProperty(Lt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Lt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Mt(this):new this.Collection(this,function(){return Nt(e,t,!n,!r)})}catch(e){return At(this,Qe)}},Lt.prototype.equals=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Pt(e)})},Lt.prototype.above=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(e,void 0,!0)})},Lt.prototype.aboveOrEqual=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(e,void 0,!1)})},Lt.prototype.below=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(void 0,e,!1,!0)})},Lt.prototype.belowOrEqual=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(void 0,e)})},Lt.prototype.startsWith=function(e){return"string"!=typeof e?At(this,et):this.between(e,e+$e,!0,!0)},Lt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Tt(this,function(e,t){return 0===e.indexOf(t[0])},[e],$e)},Lt.prototype.equalsIgnoreCase=function(e){return Tt(this,function(e,t){return e===t[0]},[e],"")},Lt.prototype.anyOfIgnoreCase=function(){var e=L.apply(D,arguments);return 0===e.length?Mt(this):Tt(this,function(e,t){return-1!==t.indexOf(e)},e,"")},Lt.prototype.startsWithAnyOfIgnoreCase=function(){var e=L.apply(D,arguments);return 0===e.length?Mt(this):Tt(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,$e)},Lt.prototype.anyOf=function(){var e=this,t=L.apply(D,arguments),n=this._cmp;try{t.sort(n)}catch(r){return At(this,Qe)}if(0===t.length)return Mt(this);var r=new this.Collection(this,function(){return Nt(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var s=e.key;0<n(s,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(s,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},Lt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Lt.prototype.noneOf=function(){var e=L.apply(D,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return At(this,Qe)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Lt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,s=this._min,a=this._max;if(0===e.length)return Mt(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0}))return At(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",G.InvalidArgument);var l,u=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,h=i;function d(e,t){return h(e[0],t[0])}try{(l=e.reduce(function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=s(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return At(this,Qe)}var p=0,f=c?function(e){return 0<i(e,l[p][1])}:function(e){return 0<=i(e,l[p][1])},m=u?function(e){return 0<o(e,l[p][0])}:function(e){return 0<=o(e,l[p][0])},g=f;return(e=new this.Collection(this,function(){return Nt(l[0][0],l[l.length-1][1],!u,!c)}))._ondirectionchange=function(e){h="next"===e?(g=f,i):(g=m,o),l.sort(d)},e._addAlgorithm(function(e,t,r){for(var o,s=e.key;g(s);)if(++p===l.length)return t(r),!1;return!f(o=s)&&!m(o)||(0===n._cmp(s,l[p][1])||0===n._cmp(s,l[p][0])||t(function(){h===i?e.continue(l[p][0]):e.continue(l[p][1])}),!1)}),e},Lt.prototype.startsWithAnyOf=function(){var e=L.apply(D,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?Mt(this):this.inAnyRange(e.map(function(e){return[e,e+$e]})):At(this,"startsWithAnyOf() only works with strings")},Lt);function Lt(){}function Bt(e){return Pe(function(t){return Ft(t),e(t.target.error),!1})}function Ft(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var jt="storagemutated",Kt="x-storagemutated-1",zt=ft(null,jt),Ut=(qt.prototype._lock=function(){return b(!ve.global),++this._reculock,1!==this._reculock||ve.global||(ve.lockOwnerFor=this),this},qt.prototype._unlock=function(){if(b(!ve.global),0==--this._reculock)for(ve.global||(ve.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ye(e[1],e[0])}catch(e){}}return this},qt.prototype._locked=function(){return this._reculock&&ve.lockOwnerFor!==this},qt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new G.DatabaseClosed(r);case"MissingAPIError":throw new G.MissingAPI(r.message,r);default:throw new G.OpenFailed(r)}if(!this.active)throw new G.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Pe(function(n){Ft(n),t._reject(e.error)}),e.onabort=Pe(function(n){Ft(n),t.active&&t._reject(new G.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=Pe(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&zt.storagemutated.fire(e.mutatedParts)}),this},qt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Je(new G.ReadOnly("Transaction is readonly"));if(!this.active)return Je(new G.TransactionInactive);if(this._locked())return new Ce(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])});if(n)return ze(function(){var e=new Ce(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new Ce(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},qt.prototype._root=function(){return this.parent?this.parent._root():this},qt.prototype.waitFor=function(e){var t,n=this._root(),r=Ce.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new Ce(function(e,t){r.then(function(t){return n._waitingQueue.push(Pe(e.bind(null,t)))},function(e){return n._waitingQueue.push(Pe(t.bind(null,e)))}).finally(function(){n._waitingFor===i&&(n._waitingFor=null)})})},qt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new G.Abort))},qt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(c(t,e))return t[e];var n=this.schema[e];if(!n)throw new G.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},qt);function qt(){}function Vt(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Wt(t)}}function Wt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Gt(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e},{}))};var r}var Ht=function(e){try{return e.only([[]]),Ht=function(){return[[]]},[[]]}catch(e){return Ht=function(){return $e},$e}};function Yt(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return S(e,t)}:function(t){return S(t,e)};var t}function Zt(e){return[].slice.call(e)}var Xt=0;function Jt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function $t(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,s=e.values,a=e.range;return new Promise(function(e,l){e=Pe(e);var u=t.objectStore(n),c=null==u.keyPath,h="put"===i||"add"===i;if(!h&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var d,p=(o||s||{length:1}).length;if(o&&s&&o.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function f(e){++y,Ft(e)}var m=[],g=[],y=0;if("deleteRange"===i){if(4===a.type)return e({numFailures:y,failures:g,results:[],lastResult:void 0});3===a.type?m.push(d=u.clear()):m.push(d=u.delete(r(a)))}else{var v=(c=h?c?[s,o]:[s,null]:[o,null])[0],b=c[1];if(h)for(var w=0;w<p;++w)m.push(d=b&&void 0!==b[w]?u[i](v[w],b[w]):u[i](v[w])),d.onerror=f;else for(w=0;w<p;++w)m.push(d=u[i](v[w])),d.onerror=f}function S(t){t=t.target.result,m.forEach(function(e,t){return null!=e.error&&(g[t]=e.error)}),e({numFailures:y,failures:g,results:"delete"===i?o:m.map(function(e){return e.result}),lastResult:t})}d.onerror=function(e){f(e),S(e)},d.onsuccess=S})},getMany:function(e){var t=e.trans,r=e.keys;return new Promise(function(e,i){e=Pe(e);for(var o,s=t.objectStore(n),a=r.length,l=new Array(a),u=0,c=0,h=function(t){t=t.target,l[t._pos]=t.result,++c===u&&e(l)},d=Bt(i),p=0;p<a;++p)null!=r[p]&&((o=s.get(r[p]))._pos=p,o.onsuccess=h,o.onerror=d,++u);0===u&&e(l)})},get:function(e){var t=e.trans,r=e.key;return new Promise(function(e,i){e=Pe(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Bt(i)})},query:(t=c,function(e){return new Promise(function(i,o){i=Pe(i);var s,a,l,u=e.trans,c=e.values,h=e.limit,d=e.query,p=h===1/0?void 0:h,f=d.index;if(d=d.range,u=u.objectStore(n),f=f.isPrimaryKey?u:u.index(f.name),d=r(d),0===h)return i({result:[]});t?((p=c?f.getAll(d,p):f.getAllKeys(d,p)).onsuccess=function(e){return i({result:e.target.result})},p.onerror=Bt(o)):(s=0,a=!c&&"openKeyCursor"in f?f.openKeyCursor(d):f.openCursor(d),l=[],a.onsuccess=function(e){var t=a.result;return t?(l.push(c?t.value:t.primaryKey),++s===h?i({result:l}):void t.continue()):i({result:l})},a.onerror=Bt(o))})}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,s=e.reverse,a=e.unique;return new Promise(function(e,l){e=Pe(e);var u=o.index,c=o.range,h=t.objectStore(n),d=(h=u.isPrimaryKey?h:h.index(u.name),u=s?a?"prevunique":"prev":a?"nextunique":"next",!i&&"openKeyCursor"in h?h.openKeyCursor(r(c),u):h.openCursor(r(c),u));d.onerror=Bt(l),d.onsuccess=Pe(function(n){var r,i,o,s,a=d.result;a?(a.___id=++Xt,a.done=!1,r=a.continue.bind(a),i=(i=a.continuePrimaryKey)&&i.bind(a),o=a.advance.bind(a),s=function(){throw new Error("Cursor not stopped")},a.trans=t,a.stop=a.continue=a.continuePrimaryKey=a.advance=function(){throw new Error("Cursor not started")},a.fail=Pe(l),a.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},a.start=function(e){function t(){if(d.result)try{e()}catch(e){a.fail(e)}else a.done=!0,a.start=function(){throw new Error("Cursor behind last entry")},a.stop()}var n=new Promise(function(e,t){e=Pe(e),d.onerror=Bt(t),a.fail=t,a.stop=function(t){a.stop=a.continue=a.continuePrimaryKey=a.advance=s,e(t)}});return d.onsuccess=Pe(function(e){d.onsuccess=t,t()}),a.continue=r,a.continuePrimaryKey=i,a.advance=o,t(),n},e(a)):e(null)},l)})},count:function(e){var t=e.query,i=e.trans,o=t.index,s=t.range;return new Promise(function(e,t){var a=i.objectStore(n),l=o.isPrimaryKey?a:a.index(o.name);(l=(a=r(s))?l.count(a):l.count()).onsuccess=Pe(function(t){return e(t.target.result)}),l.onerror=Bt(t)})}}}var o,a,l,u=(a=n,l=Zt((o=e).objectStoreNames),{schema:{name:o.name,tables:l.map(function(e){return a.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Yt(t)},indexes:Zt(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:Yt(e)},i[Jt(e)]=r}),getIndexByKeyPath:function(e){return i[Jt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Jt(t)]=n.primaryKey),n})},hasGetAll:0<l.length&&"getAll"in a.objectStore(l[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),c=(n=u.schema,u.hasGetAll),h=(u=n.tables.map(i),{});return u.forEach(function(e){return h[e.name]=e}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!h[e])throw new Error("Table '".concat(e,"' not found"));return h[e]},MIN_KEY:-1/0,MAX_KEY:Ht(t),schema:n}}function Qt(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=$t(n,o,i),e.dbcore.reduce(function(e,n){return n=n.create,t(t({},e),n(e))},i))}}function en(e,t){var n=t.db;t=Qt(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function tn(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=function e(t,n){return m(t,n)||(t=l(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){d(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function nn(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function rn(e,t){return e._cfg.version-t._cfg.version}function on(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=Gt("$meta",pn("")[0],[]),e._storeNames.push("$meta"));var s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var a=s._reject.bind(s),l=ve.transless||ve;ze(function(){return ve.trans=s,ve.transless=l,0!==t?(en(e,n),u=t,((r=s).storeNames.includes("$meta")?r.table("$meta").get("version").then(function(e){return null!=e?e:u}):Ce.resolve(u)).then(function(t){return i=t,a=s,l=n,u=[],t=(r=e)._versions,c=r._dbSchema=hn(0,r.idbdb,l),0!==(t=t.filter(function(e){return e._cfg.version>=i})).length?(t.forEach(function(e){u.push(function(){var t=c,n=e._cfg.dbschema;dn(r,t,l),dn(r,n,l),c=r._dbSchema=n;var s=an(t,n);s.add.forEach(function(e){ln(l,e[0],e[1].primKey,e[1].indexes)}),s.change.forEach(function(e){if(e.recreate)throw new G.Upgrade("Not yet support for changing primary key");var t=l.objectStore(e.name);e.add.forEach(function(e){return cn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),cn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var u=e._cfg.contentUpgrade;if(u&&e._cfg.version>i){en(r,l),a._memoizedTables={};var h=k(n);s.del.forEach(function(e){h[e]=t[e]}),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],o(h),h),a.schema=h;var d,p=B(u);return p&&Ue(),s=Ce.follow(function(){var e;(d=u(a))&&p&&(e=qe.bind(null,null),d.then(e,e))}),d&&"function"==typeof d.then?Ce.resolve(d):s.then(function(){return d})}}),u.push(function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach(function(e){return null==n[e]&&i.db.deleteObjectStore(e)}),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),a.schema=r._dbSchema}),u.push(function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter(function(e){return"$meta"!==e})):t.objectStore("$meta").put(e._cfg.version,"version"))})}),function e(){return u.length?Ce.resolve(u.shift()(a.idbtrans)).then(e):Ce.resolve()}().then(function(){un(c,l)})):Ce.resolve();var r,i,a,l,u,c}).catch(a)):(o(i).forEach(function(e){ln(n,e,i[e].primKey,i[e].indexes)}),en(e,n),void Ce.follow(function(){return e.on.populate.fire(s)}).catch(a));var r,u})}function sn(e,t){un(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=hn(0,e.idbdb,t);dn(e,e._dbSchema,t);for(var r=0,i=an(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(e){cn(n,e)})}(i[r]);if("object"==typeof o)return o.value}}function an(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var s={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)s.recreate=!0,r.change.push(s);else{var a=i.idxByName,l=o.idxByName,u=void 0;for(u in a)l[u]||s.del.push(u);for(u in l){var c=a[u],h=l[u];c?c.src!==h.src&&s.change.push(h):s.add.push(h)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,o])}return r}function ln(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return cn(i,e)}),i}function un(e,t){o(e).forEach(function(n){t.db.objectStoreNames.contains(n)||ln(t,n,e[n].primKey,e[n].indexes)})}function cn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function hn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=Vt(Wt(a=t.keyPath),a||"",!0,!1,!!t.autoIncrement,a&&"string"!=typeof a,!0),o=[],s=0;s<t.indexNames.length;++s){var a=(l=t.index(t.indexNames[s])).keyPath,l=Vt(l.name,a,!!l.unique,!!l.multiEntry,!1,a&&"string"!=typeof a,!1);o.push(l)}r[e]=Gt(e,i,o)}),r}function dn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var s=r[o],a=n.objectStore(s);e._hasGetAll="getAll"in a;for(var l=0;l<a.indexNames.length;++l){var u=a.indexNames[l],c=a.index(u).keyPath,h="string"==typeof c?c:"["+y(c).join("+")+"]";!t[s]||(c=t[s].idxByName[h])&&(c.name=u,delete t[s].idxByName[h],t[s].idxByName[u]=c)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function pn(e){return e.split(",").map(function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Vt(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(r),0===t)})}var fn=(mn.prototype._parseStoresSpec=function(e,t){o(e).forEach(function(n){if(null!==e[n]){var r=pn(e[n]),i=r.shift();if(i.unique=!0,i.multi)throw new G.Schema("Primary key cannot be multi-valued");r.forEach(function(e){if(e.auto)throw new G.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new G.Schema("Index must have a name and cannot be an empty string")}),t[n]=Gt(n,i,r)}})},mn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach(function(e){a(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,nn(t,[t._allTables,t,t.Transaction.prototype]),tn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},mn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||Z,e),this},mn);function mn(){}function gn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new tr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function yn(e){return e&&"function"==typeof e.databases}function vn(e){return ze(function(){return ve.letThrough=!0,e()})}function bn(e){return!("from"in e)}var wn=function(e,t){if(!this){var n=new wn;return e&&"d"in e&&a(n,e),n}a(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Sn(e,t,n){var r=ut(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(bn(e))return a(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,ut(n,e.from)<0)return i?Sn(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},In(e);if(0<ut(t,e.to))return r?Sn(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},In(e);ut(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ut(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&Cn(e,i),r&&n&&Cn(e,r)}}function Cn(e,t){bn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,Sn(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function kn(e,t){var n=xn(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=xn(e),s=o.next(i.from),a=s.value;!r.done&&!s.done;){if(ut(a.from,i.to)<=0&&0<=ut(a.to,i.from))return!0;ut(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}function xn(e){var t=bn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ut(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ut(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function In(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=On(r)),e.d=On(e)}function On(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function En(e,t){return o(t).forEach(function(n){e[n]?Cn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)c(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||E.has(r.constructor)?r:e(r));return i}(t[n])}),e}function Rn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&kn(t[n],e[n])})}h(wn.prototype,((F={add:function(e){return Cn(this,e),this},addKey:function(e){return Sn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return Sn(t,e,e)}),this},hasKey:function(e){var t=xn(this).next(e).value;return t&&ut(t.from,e)<=0&&0<=ut(t.to,e)}})[T]=function(){return xn(this)},F));var _n={},An={},Mn=!1;function Tn(e){En(An,e),Mn||(Mn=!0,setTimeout(function(){Mn=!1,Nn(An,!(An={}))},0))}function Nn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(_n);r<i.length;r++)Pn(s=i[r],e,n,t);else for(var o in e){var s,a=/^idb\:\/\/(.*)\/(.*)\//.exec(o);a&&(o=a[1],a=a[2],(s=_n["idb://".concat(o,"/").concat(a)])&&Pn(s,e,n,t))}n.forEach(function(e){return e()})}function Pn(e,t,n,r){for(var i=[],o=0,s=Object.entries(e.queries.query);o<s.length;o++){for(var a=s[o],l=a[0],u=[],c=0,h=a[1];c<h.length;c++){var d=h[c];Rn(t,d.obsSet)?d.subscribers.forEach(function(e){return n.add(e)}):r&&u.push(d)}r&&i.push([l,u])}if(r)for(var p=0,f=i;p<f.length;p++){var m=f[p];l=m[0],u=m[1],e.queries.query[l]=u}}function Dn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?Je(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),s=!1;function a(){if(t.openCanceller!==r)throw new G.DatabaseClosed("db.open() was cancelled")}function l(){return new Ce(function(r,u){if(a(),!n)throw new G.MissingAPI;var c=e.name,p=t.autoSchema||!i?n.open(c):n.open(c,i);if(!p)throw new G.MissingAPI;p.onerror=Bt(u),p.onblocked=Pe(e._fireOnBlocked),p.onupgradeneeded=Pe(function(r){var i;h=p.transaction,t.autoSchema&&!e._options.allowEmptyDB?(p.onerror=Ft,h.abort(),p.result.close(),(i=n.deleteDatabase(c)).onsuccess=i.onerror=Pe(function(){u(new G.NoSuchDatabase("Database ".concat(c," doesnt exist")))})):(h.onerror=Bt(u),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,d=r<1,e.idbdb=p.result,s&&sn(e,h),on(e,r/10,h,u))},u),p.onsuccess=Pe(function(){h=null;var n,a,u,f,m,g=e.idbdb=p.result,v=y(g.objectStoreNames);if(0<v.length)try{var b=g.transaction(1===(f=v).length?f[0]:f,"readonly");if(t.autoSchema)a=g,u=b,(n=e).verno=a.version/10,u=n._dbSchema=hn(0,a,u),n._storeNames=y(a.objectStoreNames,0),tn(n,[n._allTables],o(u),u);else if(dn(e,e._dbSchema,b),((m=an(hn(0,(m=e).idbdb,b),m._dbSchema)).add.length||m.change.some(function(e){return e.add.length||e.change.length}))&&!s)return g.close(),i=g.version+1,s=!0,r(l());en(e,b)}catch(n){}tt.push(e),g.onversionchange=Pe(function(n){t.vcFired=!0,e.on("versionchange").fire(n)}),g.onclose=Pe(function(t){e.on("close").fire(t)}),d&&(m=e._deps,b=c,g=m.indexedDB,m=m.IDBKeyRange,yn(g)||b===nt||gn(g,m).put({name:b}).catch(Z)),r()},u)}).catch(function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,l();break;case"VersionError":if(0<i)return i=0,l()}return Ce.reject(e)})}var u,c=t.dbReadyResolve,h=null,d=!1;return Ce.race([r,("undefined"==typeof navigator?Ce.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}u=setInterval(t,100),t()}).finally(function(){return clearInterval(u)}):Promise.resolve()).then(l)]).then(function(){return a(),t.onReadyBeingFired=[],Ce.resolve(vn(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,Z);return t.onReadyBeingFired=[],Ce.resolve(vn(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{h&&h.abort()}catch(n){}return r===t.openCanceller&&e._close(),Je(n)}).finally(function(){t.openComplete=!0,c()}).then(function(){var t;return d&&(t={},e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new wn(-1/0,[[[]]]))}),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new wn(-1/0,[[[]]])}),zt(jt).fire(t),Nn(t,!0)),e})}function Ln(e){function t(t){return e.next(t)}var n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function Bn(e,t,n){for(var r=s(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Fn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},s=[];function a(e,n,r){var i=Jt(e),l=o[i]=o[i]||[],u=null==e?0:"string"==typeof e?1:e.length,c=0<n;return c=t(t({},r),{name:c?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:c,keyTail:n,keyLength:u,extractKey:Yt(e),unique:!c&&r.unique}),l.push(c),c.isPrimaryKey||s.push(c),1<u&&a(2===u?e[0]:e.slice(0,u-1),n+1,r),l.sort(function(e,t){return e.keyTail-t.keyTail}),c}n=a(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var l=0,u=i.indexes;l<u.length;l++){var c=u[l];a(c.keyPath,0,c)}function h(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:Bn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Bn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=o[Jt(e)])&&e[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,s=n.keyLength;return o?r.openCursor(h(t)).then(function(e){return e&&a(e)}):r.openCursor(t);function a(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(Bn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Bn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}}})}})}};function jn(e,t,n,r){return n=n||{},r=r||"",o(e).forEach(function(i){var o,s,a;c(t,i)?(o=e[i],s=t[i],"object"==typeof o&&"object"==typeof s&&o&&s?(a=M(o))!==M(s)?n[r+i]=t[i]:"Object"===a?jn(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i]):o!==s&&(n[r+i]=t[i])):n[r+i]=void 0}),o(t).forEach(function(i){c(e,i)||(n[r+i]=t[i])}),n}function Kn(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var zn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans,a=s.table(n).hook,l=a.deleting,u=a.creating,h=a.updating;switch(e.type){case"add":if(u.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"put":if(u.fire===Z&&h.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"delete":if(l.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"deleteRange":if(l.fire===Z)break;return s._promise("readwrite",function(){return function e(n,r,s){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:s}).then(function(i){var o=i.result;return d({type:"delete",keys:o,trans:n}).then(function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),s)})})}(e.trans,e.range,1e4)},!0)}return i.mutate(e);function d(e){var n,s,a,d=ve.trans,p=e.keys||Kn(o,e);if(!p)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:p}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),n=i,a=p,("add"===(s=e).type?Promise.resolve([]):n.getMany({trans:s.trans,keys:a,cache:"immutable"})).then(function(t){var n=p.map(function(n,r){var i,s,a,p=t[r],f={onerror:null,onsuccess:null};return"delete"===e.type?l.fire.call(f,n,p,d):"add"===e.type||void 0===p?(i=u.fire.call(f,n,e.values[r],d),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||C(e.values[r],o.keyPath,n))):(i=jn(p,e.values[r]),(s=h.fire.call(f,i,n,p,d))&&(a=e.values[r],Object.keys(s).forEach(function(e){c(a,e)?a[e]=s[e]:C(a,e,s[e])}))),f});return i.mutate(e).then(function(r){for(var i=r.failures,o=r.results,s=r.numFailures,a=(r=r.lastResult,0);a<p.length;++a){var l=(o||p)[a],u=n[a];null==l?u.onerror&&u.onerror(i[a]):u.onsuccess&&u.onsuccess("put"===e.type&&t[a]?e.values[a]:l)}return{failures:i,results:o,numFailures:s,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}}})}})}};function Un(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===ut(t.keys[i],e[o])&&(r.push(n?_(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var qn={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Un(e.keys,e.trans._cache,"clone"===e.cache);return t?Ce.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?_(t):t},t})},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function Vn(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function Wn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Gn={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new wn(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ve.subscr&&"readonly"!==n)throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ve.querier));return e.transaction(t,n,r)},table:function(i){var a=e.table(i),l=a.schema,u=l.primaryKey,c=l.indexes,h=u.extractKey,d=u.outbound,p=u.autoIncrement&&c.filter(function(e){return e.compound&&e.keyPath.includes(u.keyPath)}),f=t(t({},a),{mutate:function(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),m[e]||(m[e]=new wn)}var c,h,d,f=t.trans,m=t.mutatedParts||(t.mutatedParts={}),g=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Kn(u,t).filter(function(e){return e}),t.values]:[],w=b[0],S=b[1];return b=t.trans._cache,s(w)?(g.addKeys(w),(b="delete"===v||w.length===S.length?Un(w,b):null)||y.addKeys(w),(b||S)&&(c=o,h=b,d=S,l.indexes.forEach(function(e){var t=c(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach(function(e){return t.addKey(e)}):t.addKey(n)}(h||d).forEach(function(e,t){var i=h&&n(h[t]);0!==ut(i,t=d&&n(d[t]))&&(null!=i&&r(i),null!=t&&r(t))})}))):w?(S={from:null!==(S=w.lower)&&void 0!==S?S:e.MIN_KEY,to:null!==(S=w.upper)&&void 0!==S?S:e.MAX_KEY},y.add(S),g.add(S)):(g.add(r),y.add(r),l.indexes.forEach(function(e){return o(e.name).add(r)})),a.mutate(t).then(function(e){return!w||"add"!==t.type&&"put"!==t.type||(g.addKeys(e.results),p&&p.forEach(function(n){for(var r=t.values.map(function(e){return n.extractKey(e)}),i=n.keyPath.findIndex(function(e){return e===u.keyPath}),s=0,a=e.results.length;s<a;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)})),f.mutatedParts=En(f.mutatedParts||{},m),e})}}),m=(c=function(t){t=(n=t.query).index;var n=n.range;return[t,new wn(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[u,new wn(e.key)]},getMany:function(e){return[u,(new wn).addKeys(e.keys)]},count:c,query:c,openCursor:c});return o(m).forEach(function(e){f[e]=function(o){var s=!!(f=ve.subscr),l=Vn(ve,a)&&Wn(e,o)?o.obsSet={}:f;if(s){var u=function(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),l[e]||(l[e]=new wn)},c=u(""),p=u(":dels"),f=(s=(f=m[e](o))[0],f[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?p:u(s.name||"")).add(f),!s.isPrimaryKey){if("count"!==e){var g="query"===e&&d&&o.values&&a.query(t(t({},o),{values:!1}));return a[e].apply(this,arguments).then(function(t){if("query"===e){if(d&&o.values)return g.then(function(e){return e=e.result,c.addKeys(e),t});var n=o.values?t.result.map(h):t.result;(o.values?c:p).addKeys(n)}else if("openCursor"===e){var r=t,i=o.values;return r&&Object.create(r,{key:{get:function(){return p.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return p.addKey(e),e}},value:{get:function(){return i&&c.addKey(r.primaryKey),r.value}}})}return t})}p.add(r)}}return a[e].apply(this,arguments)}}),f}})}};function Hn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),s(n.keys)&&(n.keys=n.keys.filter(function(e,t){return!(t in r.failures)})),"values"in n&&s(n.values)&&(n.values=n.values.filter(function(e,t){return!(t in r.failures)})),n)}function Yn(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<ut(n,r.lower):0<=ut(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?ut(e,t.upper)<0:ut(e,t.upper)<=0));var n,r}function Zn(e,t,n,r,i,o){if(!n||0===n.length)return e;var a=t.query.index,l=a.multiEntry,u=t.query.range,c=r.schema.primaryKey.extractKey,h=a.extractKey,d=(a.lowLevelIndex||a).extractKey;return n=n.reduce(function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new wn,a=n.values.length-1;0<=a;--a){var d,p=n.values[a],f=c(p);o.hasKey(f)||(d=h(p),(l&&s(d)?d.some(function(e){return Yn(e,u)}):Yn(d,u))&&(o.addKey(f),i.push(p)))}switch(n.type){case"add":var m=(new wn).addKeys(t.values?e.map(function(e){return c(e)}):e);r=e.concat(t.values?i.filter(function(e){return e=c(e),!m.hasKey(e)&&(m.addKey(e),!0)}):i.map(function(e){return c(e)}).filter(function(e){return!m.hasKey(e)&&(m.addKey(e),!0)}));break;case"put":var g=(new wn).addKeys(n.values.map(function(e){return c(e)}));r=e.filter(function(e){return!g.hasKey(t.values?c(e):e)}).concat(t.values?i:i.map(function(e){return c(e)}));break;case"delete":var y=(new wn).addKeys(n.keys);r=e.filter(function(e){return!y.hasKey(t.values?c(e):e)});break;case"deleteRange":var v=n.range;r=e.filter(function(e){return!Yn(c(e),v)})}return r},e),n===e?e:(n.sort(function(e,t){return ut(d(e),d(t))||ut(c(e),c(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function Xn(e,t){return 0===ut(e.lower,t.lower)&&0===ut(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Jn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=ut(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=ut(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function $n(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout(function(){0===r.subscribers.size&&P(i,r)},3e3))})}var Qn={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,s,a=e.transaction(t,r,i);return"readwrite"===r&&(s=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var s=new Set,l=0,u=t;l<u.length;l++){var c=u[l],h=_n["idb://".concat(n,"/").concat(c)];if(h){var d=e.table(c),p=h.optimisticOps.filter(function(e){return e.trans===a});if(a._explicit&&i&&a.mutatedParts)for(var f=0,m=Object.values(h.queries.query);f<m.length;f++)for(var g=0,y=(w=m[f]).slice();g<y.length;g++)Rn((S=y[g]).obsSet,a.mutatedParts)&&(P(w,S),S.subscribers.forEach(function(e){return s.add(e)}));else if(0<p.length){h.optimisticOps=h.optimisticOps.filter(function(e){return e.trans!==a});for(var v=0,b=Object.values(h.queries.query);v<b.length;v++)for(var w,S,C,k=0,x=(w=b[v]).slice();k<x.length;k++)null!=(S=x[k]).res&&a.mutatedParts&&(i&&!S.dirty?(C=Object.isFrozen(S.res),C=Zn(S.res,S.req,p,d,S,C),S.dirty?(P(w,S),S.subscribers.forEach(function(e){return s.add(e)})):C!==S.res&&(S.res=C,S.promise=Ce.resolve({result:C}))):(S.dirty&&P(w,S),S.subscribers.forEach(function(e){return s.add(e)})))}}}s.forEach(function(e){return e()})}}},a.addEventListener("abort",i(!1),{signal:s}),a.addEventListener("error",i(!1),{signal:s}),a.addEventListener("complete",i(!0),{signal:s})),a},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans;if(o.outbound||"disabled"===s.db._options.cache||s.explicit||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var a=_n["idb://".concat(n,"/").concat(r)];return a?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Kn(o,e).some(function(e){return null==e}))?(a.optimisticOps.push(e),e.mutatedParts&&Tn(e.mutatedParts),s.then(function(t){0<t.numFailures&&(P(a.optimisticOps,e),(t=Hn(0,e,t))&&a.optimisticOps.push(t),e.mutatedParts&&Tn(e.mutatedParts))}),s.catch(function(){P(a.optimisticOps,e),e.mutatedParts&&Tn(e.mutatedParts)})):s.then(function(n){var r=Hn(0,t(t({},e),{values:e.values.map(function(e,r){var i;return n.failures[r]||C(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?_(e):t({},e),o.keyPath,n.results[r]),e})}),n);a.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&Tn(e.mutatedParts)})}),s):i.mutate(e)},query:function(e){if(!Vn(ve,i)||!Wn("query",e))return i.query(e);var t="immutable"===(null===(a=ve.trans)||void 0===a?void 0:a.db._options.cache),o=(u=ve).requery,s=u.signal,a=function(e,t,n,r){var i=_n["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var s=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Xn(e.req.query.range,r.query.range)});return s?[s,!0,i,o]:[o.find(function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Jn(e.req.query.range,r.query.range)}),!1,i,o];case"count":return s=o.find(function(e){return Xn(e.req.query.range,r.query.range)}),[s,!!s,i,o]}}(n,r,"query",e),l=a[0],u=a[1],c=a[2],h=a[3];return l&&u?l.obsSet=e.obsSet:(u=i.query(e).then(function(e){var n=e.result;if(l&&(l.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=_(n);return e}).catch(function(e){return h&&l&&P(h,l),Promise.reject(e)}),l={obsSet:e.obsSet,promise:u,subscribers:new Set,type:"query",req:e,dirty:!1},h?h.push(l):(h=[l],(c=c||(_n["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=h)),$n(l,h,o,s),l.promise.then(function(n){return{result:Zn(n.result,e,null==c?void 0:c.optimisticOps,i,l,t)}})}})}})}};function er(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var tr=(nr.prototype.version=function(e){if(isNaN(e)||e<.1)throw new G.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new G.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(rn),n.stores({}),this._state.autoSchema=!1,n)},nr.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ve.letThrough||this._vip)?e():new Ce(function(e,n){if(t._state.openComplete)return n(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new G.DatabaseClosed);t.open().catch(Z)}t._state.dbReadyPromise.then(e,n)}).then(e)},nr.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort(function(e,t){return e.level-t.level}),this},nr.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},nr.prototype.open=function(){var e=this;return Ye(ye,function(){return Dn(e)})},nr.prototype._close=function(){var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new Ce(function(t){e.dbReadyResolve=t}),e.openCanceller=new Ce(function(t,n){e.cancelOpen=n}))},nr.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new G.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new G.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nr.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new Ce(function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Pe(function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,yn(r)||n===nt||gn(r,e).delete(n).catch(Z),i()}),n.onerror=Bt(o),n.onblocked=t._fireOnBlocked}if(n)throw new G.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()})},nr.prototype.backendDB=function(){return this.idbdb},nr.prototype.isOpen=function(){return null!==this.idbdb},nr.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nr.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nr.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nr.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),nr.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new G.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,I(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},nr.prototype._transaction=function(e,t,n){var r=this,i=ve.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,s,a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map(function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new G.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!a)throw new G.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach(function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new G.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,function(e,t){t(n)}):Je(n)}var l=function e(t,n,r,i,o){return Ce.resolve().then(function(){var s=ve.transless||ve,a=t._createTransaction(n,r,t._dbSchema,i);if(a.explicit=!0,s={trans:a,transless:s},i)a.idbtrans=i.idbtrans;else try{a.create(),a.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(s){return s.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,o)})):Je(s)}var l,u=B(o);return u&&Ue(),s=Ce.follow(function(){var e;(l=o.call(a,a))&&(u?(e=qe.bind(null,null),l.then(e,e)):"function"==typeof l.next&&"function"==typeof l.throw&&(l=Ln(l)))},s),(l&&"function"==typeof l.then?Ce.resolve(l).then(function(e){return a.active?e:Je(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):s.then(function(){return l})).then(function(e){return i&&a._resolve(),a._completion.then(function(){return e})}).catch(function(e){return a._reject(e),Je(e)})})}.bind(null,this,o,s,i,n);return i?i._promise(o,l,"lock"):ve.trans?Ye(ve.transless,function(){return r._whenReady(l)}):this._whenReady(l)},nr.prototype.table=function(e){if(!c(this._allTables,e))throw new G.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nr);function nr(e,n){var r=this;this._middlewares={},this.verno=0;var i=nr.dependencies;this._options=n=t({addons:nr.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,s,a,l,u,c={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Z,dbReadyPromise:null,cancelOpen:Z,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};c.dbReadyPromise=new Ce(function(e){c.dbReadyResolve=e}),c.openCanceller=new Ce(function(e,t){c.cancelOpen=t}),this._state=c,this.name=e,this.on=ft(this,"populate","blocked","versionchange","close",{ready:[re,Z]}),this.on.ready.subscribe=v(this.on.ready.subscribe,function(e){return function(t,n){nr.vip(function(){var i,o=r._state;o.openComplete?(o.dbOpenError||Ce.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e(function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)}))})}}),this.Collection=(o=this,mt(It.prototype,function(e,t){this.db=o;var n=st,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==X?e:null}})),this.Table=(s=this,mt(dt.prototype,function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:ft(null,{creating:[Q,Z],reading:[J,X],updating:[te,Z],deleting:[ee,Z]})})),this.Transaction=(a=this,mt(Ut.prototype,function(e,t,n,r,i){var o=this;this.db=a,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=ft(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ce(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Je(e)})})),this.Version=(l=this,mt(fn.prototype,function(e){this.db=l,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(u=this,mt(Dt.prototype,function(e,t,n){if(this.db=u,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=ut,this._descending=function(e,t){return ut(t,e)},this._max=function(e,t){return 0<ut(e,t)?e:t},this._min=function(e,t){return ut(e,t)<0?e:t},this._IDBKeyRange=u._deps.IDBKeyRange,!this._IDBKeyRange)throw new G.MissingAPI})),this.on("versionchange",function(e){e.newVersion,r.close({disableAutoOpen:!1})}),this.on("blocked",function(e){!e.newVersion||(e.newVersion,e.oldVersion)}),this._maxKey=Ht(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter(function(e){return e.name===r.name&&e!==r&&!e._state.vcFired}).map(function(t){return t.on("versionchange").fire(e)})},this.use(qn),this.use(Qn),this.use(Gn),this.use(Fn),this.use(zn);var h=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return er(r.table(e),h)};var i=Reflect.get(e,t,n);return i instanceof dt?er(i,h):"tables"===t?i.map(function(e){return er(e,h)}):"_createTransaction"===t?function(){return er(i.apply(this,arguments),h)}:i}});this.vip=h,i.forEach(function(e){return e(r)})}F="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var rr,ir=(or.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},or.prototype[F]=function(){return this},or);function or(e){this._subscribe=e}try{rr={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(O){rr={indexedDB:null,IDBKeyRange:null}}function sr(e){var t,n=!1,r=new ir(function(r){var i,o=B(e),s=!1,a={},l={},u={get closed(){return s},unsubscribe:function(){s||(s=!0,i&&i.abort(),h&&zt.storagemutated.unsubscribe(p))}};r.start&&r.start(u);var h=!1,d=function(){return Xe(f)},p=function(e){En(a,e),Rn(l,a)&&d()},f=function(){var u,f,m;!s&&rr.indexedDB&&(a={},u={},i&&i.abort(),i=new AbortController,m=function(t){var n=Ae();try{o&&Ue();var r=ze(e,t);return r=o?r.finally(qe):r}finally{n&&Me()}}(f={subscr:u,signal:i.signal,requery:d,querier:e,trans:null}),Promise.resolve(m).then(function(e){n=!0,t=e,s||f.signal.aborted||(a={},function(e){for(var t in e)if(c(e,t))return;return 1}(l=u)||h||(zt(jt,p),h=!0),Xe(function(){return!s&&r.next&&r.next(e)}))},function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Xe(function(){s||r.error&&r.error(e)})}))};return setTimeout(d,0),u});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var ar=tr;function lr(e){var t=cr;try{cr=!0,zt.storagemutated.fire(e),Nn(e,!0)}finally{cr=t}}h(ar,t(t({},Y),{delete:function(e){return new ar(e,{addons:[]}).delete()},exists:function(e){return new ar(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return n=(t=ar.dependencies).indexedDB,t=t.IDBKeyRange,(yn(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==nt})}):gn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Je(new G.MissingAPI)}var t,n},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return ve.trans?Ye(ve.transless,e):e()},vip:vn,async:function(e){return function(){try{var t=Ln(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ce.resolve(t)}catch(t){return Je(t)}}},spawn:function(e,t,n){try{var r=Ln(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Ce.resolve(r)}catch(e){return Je(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=Ce.resolve("function"==typeof e?ar.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:Ce,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:f,extend:a,props:h,override:v,Events:ft,on:zt,liveQuery:sr,extendObservabilitySet:En,getByKeyPath:S,setByKeyPath:C,delByKeyPath:function(e,t){"string"==typeof t?C(e,t,void 0):"length"in t&&[].map.call(t,function(t){C(e,t,void 0)})},shallowClone:k,deepClone:_,getObjectDiff:jn,cmp:ut,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:V,dependencies:rr,cache:_n,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),ar.maxKey=Ht(ar.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(zt(jt,function(e){cr||(e=new CustomEvent(Kt,{detail:e}),cr=!0,dispatchEvent(e),cr=!1)}),addEventListener(Kt,function(e){e=e.detail,cr||lr(e)}));var ur,cr=!1,hr=function(){};return"undefined"!=typeof BroadcastChannel&&((hr=function(){(ur=new BroadcastChannel(Kt)).onmessage=function(e){return e.data&&lr(e.data)}})(),"function"==typeof ur.unref&&ur.unref(),zt(jt,function(e){cr||ur.postMessage(e)})),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",function(e){if(!tr.disableBfCache&&e.persisted){null!=ur&&ur.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!tr.disableBfCache&&e.persisted&&(hr(),lr({all:new wn(-1/0,[[]])}))})),Ce.rejectionMapper=function(e,t){return!e||e instanceof K||e instanceof TypeError||e instanceof SyntaxError||!e.name||!H[e.name]?e:(t=new H[e.name](t||e.message,e),"stack"in e&&p(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),t(tr,Object.freeze({__proto__:null,Dexie:tr,liveQuery:sr,Entity:lt,cmp:ut,PropModification:kt,replacePrefix:function(e,t){return new kt({replacePrefix:[e,t]})},add:function(e){return new kt({add:e})},remove:function(e){return new kt({remove:e})},default:tr,RangeSet:wn,mergeRanges:Cn,rangesOverlap:kn}),{default:tr}),tr}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return function(){"use strict";const e="betterbugs-sdk-main",t="STEPS_FEATURE_CLICK_EVENT",r="STEPS_FEATURE_NAVIGATE_EVENT",i="STEPS_FEATURE_TYPED_EVENT",o="STEPS_FEATURE_PRESSED_EVENT",s="STEPS_FEATURE_SCROLL_EVENT";let a=!1;function l(e){a=e}function u(){return a}try{window.setBetterBugsLogging=l}catch(e){globalThis.setBetterBugsLogging=l}try{window.getBetterBugsLogging=u}catch(e){globalThis.getBetterBugsLogging=u}const c={sample(e,t,...n){if(h(n)){}},log:(...e)=>{h(e)},warn:(...e)=>{if(h(e)){}},error:(...e)=>{if(h(e)){}},info:(...e)=>{if(h(e)){}},debug:(...e)=>{h(e)},group:(...e)=>{h(e)},groupCollapsed:(...e)=>{h(e)},groupEnd:(...e)=>{h(e)}};function h(e){return a&&function(e){try{if(!("localStorage"in globalThis)||!globalThis.localStorage.debug)return!0}catch(e){return!0}if("string"!=typeof e[0]||"string"!=typeof globalThis.localStorage.debug)return!0;const t=e[0],n=globalThis.localStorage.debug.replace("*",".*");return new RegExp("^"+n).test(t)}(e)}var d,p="user-agent",f="",m="function",g="undefined",y="object",v="string",b="browser",w="cpu",S="device",C="engine",k="os",x="result",I="name",O="type",E="vendor",R="version",_="architecture",A="major",M="model",T="console",N="mobile",P="tablet",D="smarttv",L="wearable",B="xr",F="embedded",j="inapp",K="brands",z="formFactors",U="fullVersionList",q="platform",V="platformVersion",W="bitness",G="sec-ch-ua",H=G+"-full-version-list",Y=G+"-arch",Z=G+"-"+W,X=G+"-form-factors",J=G+"-"+N,$=G+"-"+M,Q=G+"-"+q,ee=Q+"-version",te=[K,U,N,M,q,V,_,z,W],ne="Amazon",re="Apple",ie="ASUS",oe="BlackBerry",se="Google",ae="Huawei",le="Lenovo",ue="Honor",ce="LG",he="Microsoft",de="Motorola",pe="Nvidia",fe="OnePlus",me="OPPO",ge="Samsung",ye="Sharp",ve="Sony",be="Xiaomi",we="Zebra",Se="Chrome",Ce="Chromium",ke="Chromecast",xe="Firefox",Ie="Opera",Oe="Facebook",Ee="Sogou",Re="Mobile ",_e=" Browser",Ae="Windows",Me=typeof window!==g&&window.navigator?window.navigator:void 0,Te=Me&&Me.userAgentData?Me.userAgentData:void 0,Ne=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Pe=function(e,t){if(typeof e===y&&e.length>0){for(var n in e)if(Fe(e[n])==Fe(t))return!0;return!1}return!!Le(e)&&-1!==Fe(t).indexOf(Fe(e))},De=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||!!t&&De(e[n])},Le=function(e){return typeof e===v},Be=function(e){if(e){for(var t=[],n=ze(/\\?\"/g,e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var i=qe(n[r]).split(";v=");t[r]={brand:i[0],version:i[1]}}else t[r]=qe(n[r]);return t}},Fe=function(e){return Le(e)?e.toLowerCase():e},je=function(e){return Le(e)?ze(/[^\d\.]/g,e).split(".")[0]:void 0},Ke=function(e){for(var t in e){var n=e[t];typeof n==y&&2==n.length?this[n[0]]=n[1]:this[n]=void 0}return this},ze=function(e,t){return Le(t)?t.replace(e,f):t},Ue=function(e){return ze(/\\?\"/g,e)},qe=function(e,t){if(Le(e))return e=ze(/^\s\s*/,e),typeof t===g?e:e.substring(0,500)},Ve=function(e,t){if(e&&t)for(var n,r,i,o,s,a,l=0;l<t.length&&!s;){var u=t[l],c=t[l+1];for(n=r=0;n<u.length&&!s&&u[n];)if(s=u[n++].exec(e))for(i=0;i<c.length;i++)a=s[++r],typeof(o=c[i])===y&&o.length>0?2===o.length?typeof o[1]==m?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:3===o.length?typeof o[1]!==m||o[1].exec&&o[1].test?this[o[0]]=a?a.replace(o[1],o[2]):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0:4===o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;l+=2}},We=function(e,t){for(var n in t)if(typeof t[n]===y&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Pe(t[n][r],e))return"?"===n?void 0:n}else if(Pe(t[n],e))return"?"===n?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},Ge={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},He={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ye={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[R,[I,Re+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[R,[I,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[I,R],[/opios[\/ ]+([\w\.]+)/i],[R,[I,Ie+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[R,[I,Ie+" GX"]],[/\bopr\/([\w\.]+)/i],[R,[I,Ie]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[R,[I,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[R,[I,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[I,R],[/quark(?:pc)?\/([-\w\.]+)/i],[R,[I,"Quark"]],[/\bddg\/([\w\.]+)/i],[R,[I,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[R,[I,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[R,[I,"WeChat"]],[/konqueror\/([\w\.]+)/i],[R,[I,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[R,[I,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[R,[I,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[R,[I,"Smart "+le+_e]],[/(avast|avg)\/([\w\.]+)/i],[[I,/(.+)/,"$1 Secure"+_e],R],[/\bfocus\/([\w\.]+)/i],[R,[I,xe+" Focus"]],[/\bopt\/([\w\.]+)/i],[R,[I,Ie+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[R,[I,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[R,[I,"Dolphin"]],[/coast\/([\w\.]+)/i],[R,[I,Ie+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[R,[I,"MIUI"+_e]],[/fxios\/([\w\.-]+)/i],[R,[I,Re+xe]],[/\bqihoobrowser\/?([\w\.]*)/i],[R,[I,"360"]],[/\b(qq)\/([\w\.]+)/i],[[I,/(.+)/,"$1Browser"],R],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[I,/(.+)/,"$1"+_e],R],[/samsungbrowser\/([\w\.]+)/i],[R,[I,ge+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[R,[I,Ee+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[I,Ee+" Mobile"],R],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[I,R],[/(lbbrowser|rekonq)/i],[I],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[R,I],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[I,Oe],R,[O,j]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[I,R,[O,j]],[/\bgsa\/([\w\.]+) .*safari\//i],[R,[I,"GSA"],[O,j]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[R,[I,"TikTok"],[O,j]],[/\[(linkedin)app\]/i],[I,[O,j]],[/(chromium)[\/ ]([-\w\.]+)/i],[I,R],[/headlesschrome(?:\/([\w\.]+)| )/i],[R,[I,Se+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[I,Se+" WebView"],R],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[R,[I,"Android"+_e]],[/chrome\/([\w\.]+) mobile/i],[R,[I,Re+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[I,R],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[R,[I,Re+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[I,Re+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[R,I],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[I,[R,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[I,R],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[I,Re+xe],R],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[I,"Netscape"],R],[/(wolvic|librewolf)\/([\w\.]+)/i],[I,R],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[R,[I,xe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[I,[R,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[I,[R,/[^\d\.]+./,f]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,f,Fe]],[/ sun4\w[;\)]/i],[[_,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,Fe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[M,[E,ge],[O,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[M,[E,ge],[O,N]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[M,[E,re],[O,N]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[M,[E,re],[O,P]],[/(macintosh);/i],[M,[E,re]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[M,[E,ye],[O,N]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[M,[E,ue],[O,P]],[/honor([-\w ]+)[;\)]/i],[M,[E,ue],[O,N]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[M,[E,ae],[O,P]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[M,[E,ae],[O,N]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[M,/_/g," "],[E,be],[O,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[M,/_/g," "],[E,be],[O,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[M,[E,me],[O,N]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[M,[E,We,{OnePlus:["304","403","203"],"*":me}],[O,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[M,[E,"BLU"],[O,N]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[M,[E,"Vivo"],[O,N]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[M,[E,"Realme"],[O,N]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[M,[E,de],[O,N]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[M,[E,de],[O,P]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[M,[E,ce],[O,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[M,[E,ce],[O,N]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[M,[E,le],[O,P]],[/(nokia) (t[12][01])/i],[E,M,[O,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[M,/_/g," "],[O,N],[E,"Nokia"]],[/(pixel (c|tablet))\b/i],[M,[E,se],[O,P]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[M,[E,se],[O,N]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[M,[E,ve],[O,N]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[M,"Xperia Tablet"],[E,ve],[O,P]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[M,[E,fe],[O,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[M,[E,ne],[O,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[M,/(.+)/g,"Fire Phone $1"],[E,ne],[O,N]],[/(playbook);[-\w\),; ]+(rim)/i],[M,E,[O,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[M,[E,oe],[O,N]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[M,[E,ie],[O,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[M,[E,ie],[O,N]],[/(nexus 9)/i],[M,[E,"HTC"],[O,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[M,/_/g," "],[O,N]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[M,[E,"TCL"],[O,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[M,[E,"TCL"],[O,N]],[/(itel) ((\w+))/i],[[E,Fe],M,[O,We,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[M,[E,"Acer"],[O,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[M,[E,"Meizu"],[O,N]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[M,[E,"Ulefone"],[O,N]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[M,[E,"Energizer"],[O,N]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[M,[E,"Cat"],[O,N]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[M,[E,"Smartfren"],[O,N]],[/droid.+; (a(?:015|06[35]|142p?))/i],[M,[E,"Nothing"],[O,N]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[M,[E,"Archos"],[O,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[M,[E,"Archos"],[O,N]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[E,M,[O,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[E,M,[O,N]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[E,M,[O,P]],[/(surface duo)/i],[M,[E,he],[O,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[M,[E,"Fairphone"],[O,N]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[M,[E,pe],[O,P]],[/(sprint) (\w+)/i],[E,M,[O,N]],[/(kin\.[onetw]{3})/i],[[M,/\./g," "],[E,he],[O,N]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[M,[E,we],[O,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[M,[E,we],[O,N]],[/smart-tv.+(samsung)/i],[E,[O,D]],[/hbbtv.+maple;(\d+)/i],[[M,/^/,"SmartTV"],[E,ge],[O,D]],[/tcast.+(lg)e?. ([-\w]+)/i],[E,M,[O,D]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,ce],[O,D]],[/(apple) ?tv/i],[E,[M,re+" TV"],[O,D]],[/crkey.*devicetype\/chromecast/i],[[M,ke+" Third Generation"],[E,se],[O,D]],[/crkey.*devicetype\/([^/]*)/i],[[M,/^/,"Chromecast "],[E,se],[O,D]],[/fuchsia.*crkey/i],[[M,ke+" Nest Hub"],[E,se],[O,D]],[/crkey/i],[[M,ke],[E,se],[O,D]],[/(portaltv)/i],[M,[E,Oe],[O,D]],[/droid.+aft(\w+)( bui|\))/i],[M,[E,ne],[O,D]],[/(shield \w+ tv)/i],[M,[E,pe],[O,D]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[M,[E,ye],[O,D]],[/(bravia[\w ]+)( bui|\))/i],[M,[E,ve],[O,D]],[/(mi(tv|box)-?\w+) bui/i],[M,[E,be],[O,D]],[/Hbbtv.*(technisat) (.*);/i],[E,M,[O,D]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,qe],[M,qe],[O,D]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[M,[O,D]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[O,D]],[/(ouya)/i,/(nintendo) (\w+)/i],[E,M,[O,T]],[/droid.+; (shield)( bui|\))/i],[M,[E,pe],[O,T]],[/(playstation \w+)/i],[M,[E,ve],[O,T]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[M,[E,he],[O,T]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[M,[E,ge],[O,L]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[E,M,[O,L]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[M,[E,me],[O,L]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[M,[E,re],[O,L]],[/(opwwe\d{3})/i],[M,[E,fe],[O,L]],[/(moto 360)/i],[M,[E,de],[O,L]],[/(smartwatch 3)/i],[M,[E,ve],[O,L]],[/(g watch r)/i],[M,[E,ce],[O,L]],[/droid.+; (wt63?0{2,3})\)/i],[M,[E,we],[O,L]],[/droid.+; (glass) \d/i],[M,[E,se],[O,B]],[/(pico) (4|neo3(?: link|pro)?)/i],[E,M,[O,B]],[/(quest( \d| pro)?s?).+vr/i],[M,[E,Oe],[O,B]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[O,F]],[/(aeobc)\b/i],[M,[E,ne],[O,F]],[/(homepod).+mac os/i],[M,[E,re],[O,F]],[/windows iot/i],[[O,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[M,[O,We,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[O,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[O,N]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[M,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[R,[I,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[I,R],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[R,[I,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[I,R],[/ladybird\//i],[[I,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[R,I]],os:[[/microsoft (windows) (vista|xp)/i],[I,R],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[I,[R,We,Ge]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[R,We,Ge],[I,Ae]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[R,/_/g,"."],[I,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[I,"macOS"],[R,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[R,[I,ke+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[R,[I,ke+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[R,[I,ke+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[R,[I,ke+" Linux"]],[/crkey\/([\d\.]+)/i],[R,[I,ke]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[R,I],[/(ubuntu) ([\w\.]+) like android/i],[[I,/(.+)/,"$1 Touch"],R],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[I,R],[/\(bb(10);/i],[R,[I,oe]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[R,[I,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[R,[I,xe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[R,[I,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[R,[I,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[I,"Chrome OS"],R],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[I,R],[/(sunos) ?([\w\.\d]*)/i],[[I,"Solaris"],R],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[I,R]]},Ze=(Ke.call((d={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}}).init,[[b,[I,R,A,O]],[w,[_]],[S,[O,M,E]],[C,[I,R]],[k,[I,R]]]),Ke.call(d.isIgnore,[[b,[R,A]],[C,[R]],[k,[R]]]),Ke.call(d.isIgnoreRgx,[[b,/ ?browser$/i],[k,/ ?os$/i]]),Ke.call(d.toString,[[b,[I,R]],[w,[_]],[S,[E,M]],[C,[I,R]],[k,[I,R]]]),d),Xe=function(e,t){var n=Ze.init[t],r=Ze.isIgnore[t]||0,i=Ze.isIgnoreRgx[t]||0,o=Ze.toString[t]||0;function s(){Ke.call(this,n)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return Te?Te.getHighEntropyValues(te).then(function(t){return e.setCH(new Je(t,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=x&&(s.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Pe(r,n)&&Fe(i?ze(i,this[n]):this[n])==Fe(i?ze(i,e):e)){if(t=!0,e!=g)break}else if(e==g&&t){t=!t;break}return t},s.prototype.toString=function(){var e=f;for(var t in o)typeof this[o[t]]!==g&&(e+=(e?" ":f)+this[o[t]]);return e||g}),Te||(s.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:s.prototype.is,toString:s.prototype.toString};var r=new n;return e(r),r}),new s};function Je(e,t){if(e=e||{},Ke.call(this,te),t)Ke.call(this,[[K,Be(e[G])],[U,Be(e[H])],[N,/\?1/.test(e[J])],[M,Ue(e[$])],[q,Ue(e[Q])],[V,Ue(e[ee])],[_,Ue(e[Y])],[z,Be(e[X])],[W,Ue(e[Z])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==g&&(this[n]=e[n])}function $e(e,t,n,r){return this.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},this.set=function(e,t){return this.data[e]=t,this},this.setCH=function(e){return this.uaCH=e,this},this.detectFeature=function(){if(Me&&Me.userAgent==this.ua)switch(this.itemType){case b:Me.brave&&typeof Me.brave.isBrave==m&&this.set(I,"Brave");break;case S:!this.get(O)&&Te&&Te[N]&&this.set(O,N),"Macintosh"==this.get(M)&&Me&&typeof Me.standalone!==g&&Me.maxTouchPoints&&Me.maxTouchPoints>2&&this.set(M,"iPad").set(O,P);break;case k:!this.get(I)&&Te&&Te[q]&&this.set(I,Te[q]);break;case x:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(b,t(b)).set(w,t(w)).set(S,t(S)).set(C,t(C)).set(k,t(k))}return this},this.parseUA=function(){return this.itemType!=x&&Ve.call(this.data,this.ua,this.rgxMap),this.itemType==b&&this.set(A,je(this.get(R))),this},this.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case b:case C:var n,r=e[U]||e[K];if(r)for(var i in r){var o=r[i].brand||r[i],s=r[i].version;this.itemType!=b||/not.a.brand/i.test(o)||n&&(!/chrom/i.test(n)||o==Ce)||(o=We(o,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(I,o).set(R,s).set(A,je(s)),n=o),this.itemType==C&&o==Ce&&this.set(R,s)}break;case w:var a=e[_];a&&(a&&"64"==e[W]&&(a+="64"),Ve.call(this.data,a+";",t));break;case S:if(e[N]&&this.set(O,N),e[M]&&(this.set(M,e[M]),!this.get(O)||!this.get(E))){var l={};Ve.call(l,"droid 9; "+e[M]+")",t),!this.get(O)&&l.type&&this.set(O,l.type),!this.get(E)&&l.vendor&&this.set(E,l.vendor)}if(e[z]){var u;if("string"!=typeof e[z])for(var c=0;!u&&c<e[z].length;)u=We(e[z][c++],He);else u=We(e[z],He);this.set(O,u)}break;case k:var h=e[q];if(h){var d=e[V];h==Ae&&(d=parseInt(je(d),10)>=13?"11":"10"),this.set(I,h).set(R,d)}this.get(I)==Ae&&"Xbox"==e[M]&&this.set(I,"Xbox").set(R,void 0);break;case x:var p=this.data,f=function(t){return p[t].getItem().setCH(e).parseCH().get()};this.set(b,f(b)).set(w,f(w)).set(S,f(S)).set(C,f(C)).set(k,f(k))}return this},Ke.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",Xe(this,e)]]),this}function Qe(e,t,n){if(typeof e===y?(De(e,!0)?(typeof t===y&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e!==v||De(t,!0)||(n=t,t=void 0),n&&typeof n.append===m){var r={};n.forEach(function(e,t){r[t]=e}),n=r}if(!(this instanceof Qe))return new Qe(e,t,n).getResult();var i=typeof e===v?e:n&&n[p]?n[p]:Me&&Me.userAgent?Me.userAgent:f,o=new Je(n,!0),s=t?function(e,t){var n={},r=t;if(!De(t))for(var i in r={},t)for(var o in t[i])r[o]=t[i][o].concat(r[o]?r[o]:[]);for(var s in e)n[s]=r[s]&&r[s].length%2==0?r[s].concat(e[s]):e[s];return n}(Ye,t):Ye,a=function(e){return e==x?function(){return new $e(e,i,s,o).set("ua",i).set(b,this.getBrowser()).set(w,this.getCPU()).set(S,this.getDevice()).set(C,this.getEngine()).set(k,this.getOS()).get()}:function(){return new $e(e,i,s[e],o).parseUA().get()}};return Ke.call(this,[["getBrowser",a(b)],["getCPU",a(w)],["getDevice",a(S)],["getEngine",a(C)],["getOS",a(k)],["getResult",a(x)],["getUA",function(){return i}],["setUA",function(e){return Le(e)&&(i=e.length>500?qe(e,500):e),this}]]).setUA(i),this}Qe.VERSION="2.0.3",Qe.BROWSER=Ne([I,R,A,O]),Qe.CPU=Ne([_]),Qe.DEVICE=Ne([M,E,O,T,N,D,P,L,F]),Qe.ENGINE=Qe.OS=Ne([I,R]);const et=e=>{try{return JSON.parse(JSON.stringify(e))}catch(t){return e}},tt=()=>((new Date).getTime()/1e3|0).toString(16)+Math.floor(16777216*Math.random()).toString(16).padStart(6,"0")+Math.floor(65536*Math.random()).toString(16).padStart(4,"0")+Math.floor(16777216*Math.random()).toString(16).padStart(6,"0"),nt=(e,t=60)=>e&&e.length>t?`${e.substring(0,t-1)}...`:e,rt=(e,t)=>{let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}};const it=()=>(sessionStorage.getItem("tabId")||sessionStorage.setItem("tabId",tt()),sessionStorage.getItem("tabId")||"");var ot,st=Object.defineProperty,at=(e,t,n)=>((e,t,n)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),lt=Object.defineProperty,ut=(e,t,n)=>((e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),ct=(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))(ct||{});const ht={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},pt={};function ft(e){if(pt[e])return pt[e];const t=globalThis[e],n=t.prototype,r=e in ht?ht[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in dt?dt[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return pt[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?pt[e]=o:n}catch{return n}}const mt={};function gt(e,t,n){var r;const i=`${e}.${String(n)}`;if(mt[i])return mt[i].call(t);const o=ft(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(mt[i]=s,s.call(t)):t[n]}const yt={};function vt(e,t,n){const r=`${e}.${String(n)}`;if(yt[r])return yt[r].bind(t);const i=ft(e)[n];return"function"!=typeof i?t[n]:(yt[r]=i,i.bind(t))}const bt={childNodes:function(e){return gt("Node",e,"childNodes")},parentNode:function(e){return gt("Node",e,"parentNode")},parentElement:function(e){return gt("Node",e,"parentElement")},textContent:function(e){return gt("Node",e,"textContent")},contains:function(e,t){return vt("Node",e,"contains")(t)},getRootNode:function(e){return vt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?gt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?gt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return gt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return gt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ft("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}};function wt(e){return e.nodeType===e.ELEMENT_NODE}function St(e){const t=e&&"host"in e&&"mode"in e&&bt.host(e)||null;return Boolean(t&&"shadowRoot"in t&&bt.shadowRoot(t)===e)}function Ct(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function kt(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const i=Array.from(n,e=>xt(e,r)).join("");return(t=i).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}catch(e){return null}var t}function xt(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=kt(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?Lt(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?Lt(n,t):n}}class It{constructor(){ut(this,"idNodeMap",new Map),ut(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ot(){return new It}function Et({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&Rt(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function Rt(e){return e.toLowerCase()}const _t="__rrweb_original__";function At(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Rt(t):null}function Mt(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Tt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nt=/^(?:[a-z+]+:)?\/\//i,Pt=/^www\..*/i,Dt=/^(data:)([^,]*),(.*)/i;function Lt(e,t){return(e||"").replace(Tt,(e,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return e;if(Nt.test(a)||Pt.test(a))return`url(${l}${a}${l})`;if(Dt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`})}function Bt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ft(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),i=[];let o=0;if(r.length>1&&e&&"string"==typeof e){let t=Bt(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const l=Bt(r[a].textContent,n),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let h=l.substring(0,c),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==r[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&c>u){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=Bt(e).length;p=t.indexOf(h,n)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;const l=Bt(e.substring(0,a),n);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}let jt=1;const Kt=new RegExp("[^a-z0-9-_:]");function zt(){return jt++}let Ut,qt;const Vt=/^[^ \t\n\r\u000c]+/,Wt=/^[, \t\n\r\u000c]+/;const Gt=new WeakMap;function Ht(e,t){return t&&""!==t.trim()?Zt(e,t):t}function Yt(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Zt(e,t){let n=Gt.get(e);if(n||(n=e.createElement("a"),Gt.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Xt(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?Ht(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(Wt),!(n>=t.length);){let o=r(Vt);if(","===o.slice(-1))o=Ht(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=Ht(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?Lt(r,Zt(e)):"object"===t&&"data"===n?Ht(e,r):r:r}function Jt(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function $t(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&$t(bt.parentNode(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&$t(bt.parentNode(e),t,n)}function Qt(e,t,n,r){let i;if(wt(e)){if(i=e,!bt.childNodes(i).length)return!1}else{if(null===bt.parentElement(e))return!1;i=bt.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if($t(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function en(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:ct.Document,childNodes:[],compatMode:e.compatMode}:{type:ct.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ct.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Rt(e.tagName);return Kt.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const r=e.attributes[t];Jt(m,r.name,r.value)||(g[r.name]=Xt(n,m,Rt(r.name),r.value))}if("link"===m&&o){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=kt(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=kt(e.sheet);t&&(e.childNodes.length>1&&(t=Ft(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(m)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Et({element:e,type:At(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===m&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&c)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const i=t.getImageData,o=_t in i?i[_t]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&u){Ut||(Ut=n.createElement("canvas"),qt=Ut.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),i=()=>{t.removeEventListener("load",i);try{Ut.width=t.naturalWidth,Ut.height=t.naturalHeight,qt.drawImage(t,0,0),g.rr_dataURL=Ut.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(m)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==m||h(g.src)||(e.test||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(m)&&(v=!0)}catch(e){}return{type:ct.Element,tagName:m,attributes:g,childNodes:[],isSVG:Yt(e)||void 0,needBlock:f,rootId:p,isCustom:v}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=bt.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=bt.textContent(e),u&&l&&(l=Lt(l,Zt(t.doc))));!u&&!c&&l&&n&&(l=r?r(l,bt.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:ct.Text,textContent:l||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:ct.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:ct.Comment,textContent:bt.textContent(e)||"",rootId:y};default:return!1}}function tn(e){return null==e?"":e.toLowerCase()}function nn(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function rn(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:k=!1,cssCaptured:x=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:O=!0}=t;if(!I){I=Qt(e,s,a,void 0===I)}const E=en(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:k,cssCaptured:x});if(!E)return null;let R;R=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===ct.Comment)return!0;if(e.type===ct.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Mt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(tn(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===tn(e.attributes.name)||"icon"===tn(e.attributes.rel)||"apple-touch-icon"===tn(e.attributes.rel)||"shortcut icon"===tn(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&tn(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(tn(e.attributes.property).match(/^(og|twitter|fb):/)||tn(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===tn(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===tn(e.attributes.name)||"googlebot"===tn(e.attributes.name)||"bingbot"===tn(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===tn(e.attributes.name)||"generator"===tn(e.attributes.name)||"framework"===tn(e.attributes.name)||"publisher"===tn(e.attributes.name)||"progid"===tn(e.attributes.name)||tn(e.attributes.property).match(/^article:/)||tn(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===tn(e.attributes.name)||"yandex-verification"===tn(e.attributes.name)||"csrf-token"===tn(e.attributes.name)||"p:domain_verify"===tn(e.attributes.name)||"verify-v1"===tn(e.attributes.name)||"verification"===tn(e.attributes.name)||"shopify-checkout-api-token"===tn(e.attributes.name)))return!0}}return!1}(E,p)||!O&&E.type===ct.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:zt();const _=Object.assign(E,{id:R});if(r.add(e,_),-2===R)return null;y&&y(e);let A=!l;if(_.type===ct.Element){A=A&&!_.needBlock,delete _.needBlock;const t=bt.shadowRoot(e);t&&Ct(t)&&(_.isShadowHost=!0)}if((_.type===ct.Document||_.type===ct.Element)&&A){p.headWhitespace&&_.type===ct.Element&&"head"===_.tagName&&(O=!1);const t={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(_.type===ct.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===ct.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(bt.childNodes(e))){const e=rn(n,t);e&&_.childNodes.push(e)}}let k=null;if(wt(e)&&(k=bt.shadowRoot(e)))for(const e of Array.from(bt.childNodes(k))){const n=rn(e,t);n&&(Ct(k)&&(n.isShadow=!0),_.childNodes.push(n))}}const M=bt.parentNode(e);return M&&St(M)&&Ct(M)&&(_.isShadow=!0),_.type===ct.Element&&"iframe"===_.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"!==i){const r=setTimeout(()=>{o||(t(),o=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.test;if(t&&v){const n=rn(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});n&&v(e,n)}},b),_.type===ct.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===Mt(_.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(w){const t=rn(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&w(e,t)}},S),_}new RegExp(/(max|min)-device-(width|height)/.source,"g");function on(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var an={exports:{}},ln=String,un=function(){return{isColorSupported:!1,reset:ln,bold:ln,dim:ln,italic:ln,underline:ln,inverse:ln,hidden:ln,strikethrough:ln,black:ln,red:ln,green:ln,yellow:ln,blue:ln,magenta:ln,cyan:ln,white:ln,gray:ln,bgBlack:ln,bgRed:ln,bgGreen:ln,bgYellow:ln,bgBlue:ln,bgMagenta:ln,bgCyan:ln,bgWhite:ln}};an.exports=un(),an.exports.createColors=un;var cn=an.exports;const hn=sn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let dn=cn,pn=hn,fn=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=dn.isColorSupported),pn&&e&&(t=pn(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=dn.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var mn=fn;fn.default=fn;var gn={};gn.isClean=Symbol("isClean"),gn.my=Symbol("my");const yn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let vn=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return yn[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=yn[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 bn=vn;vn.default=vn;let wn=bn;function Sn(e,t){new wn(t).stringify(e)}var Cn=Sn;Sn.default=Sn;let{isClean:kn,my:xn}=gn,In=mn,On=bn,En=Cn;function Rn(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>Rn(e,n)):("object"===o&&null!==i&&(i=Rn(i)),n[r]=i)}return n}let _n=class{constructor(e={}){this.raws={},this[kn]=!1,this[xn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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=Rn(this);for(let n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new In(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[kn]){this[kn]=!1;let e=this;for(;e=e.parent;)e[kn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},n=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new On).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=En){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var An=_n;_n.default=_n;let Mn=An,Tn=class extends Mn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Nn=Tn;Tn.default=Tn;var Pn={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:Dn,SourceMapGenerator:Ln}=hn,{existsSync:Bn,readFileSync:Fn}=hn,{dirname:jn,join:Kn}=hn;let zn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=jn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Dn(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=jn(e),Bn(e))return this.mapFile=e,Fn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Dn)return Ln.fromSourceMap(t).toString();if(t instanceof Ln)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Kn(jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Un=zn;zn.default=zn;let{SourceMapConsumer:qn,SourceMapGenerator:Vn}=hn,{fileURLToPath:Wn,pathToFileURL:Gn}=hn,{isAbsolute:Hn,resolve:Yn}=hn,{nanoid:Zn}=Pn,Xn=hn,Jn=mn,$n=Un,Qn=Symbol("fromOffsetCache"),er=Boolean(qn&&Vn),tr=Boolean(Yn&&Hn),nr=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!tr||/^\w+:\/\//.test(t.from)||Hn(t.from)?this.file=t.from:this.file=Yn(t.from)),tr&&er){let e=new $n(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Zn(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new Jn(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Jn(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Gn&&(i.input.url=Gn(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Qn])n=this[Qn];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Qn]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Yn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=Hn(a.source)?Gn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Gn(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Wn)throw new Error("file: protocol is not available in this PostCSS build");l.file=Wn(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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 rr=nr;nr.default=nr,Xn&&Xn.registerInput&&Xn.registerInput(nr);let{SourceMapConsumer:ir,SourceMapGenerator:or}=hn,{dirname:sr,relative:ar,resolve:lr,sep:ur}=hn,{pathToFileURL:cr}=hn,hr=rr,dr=Boolean(ir&&or),pr=Boolean(sr&&lr&&ar&&ur);var fr=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||sr(e.file);!1===this.mapOpts.sourcesContent?(t=new ir(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),pr&&dr&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=or.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new or({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 or({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?sr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=sr(lr(n,this.mapOpts.annotation)));let r=ar(n,e);return this.memoizedPaths.set(e,r),r}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 hr(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,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(cr){let t=cr(e).toString();return this.memoizedFileURLs.set(e,t),t}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;"\\"===ur&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let mr=An,gr=class extends mr{constructor(e){super(e),this.type="comment"}};var yr=gr;gr.default=gr;let vr,br,wr,Sr,{isClean:Cr,my:kr}=gn,xr=Nn,Ir=yr,Or=An;function Er(e){return e.map(e=>(e.nodes&&(e.nodes=Er(e.nodes)),delete e.source,e))}function Rr(e){if(e[Cr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Rr(t)}let _r=class e extends Or{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Er(vr(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new xr(t)]}else if(t.selector)t=[new br(t)];else if(t.name)t=[new wr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ir(t)]}return t.map(t=>(t[kr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Cr]&&Rr(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};_r.registerParse=e=>{vr=e},_r.registerRule=e=>{br=e},_r.registerAtRule=e=>{wr=e},_r.registerRoot=e=>{Sr=e};var Ar=_r;_r.default=_r,_r.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,wr.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,xr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ir.prototype):"root"===e.type&&Object.setPrototypeOf(e,Sr.prototype),e[kr]=!0,e.nodes&&e.nodes.forEach(e=>{_r.rebuild(e)})};let Mr,Tr,Nr=Ar,Pr=class extends Nr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Mr(new Tr,this,e).stringify()}};Pr.registerLazyResult=e=>{Mr=e},Pr.registerProcessor=e=>{Tr=e};var Dr=Pr;Pr.default=Pr;let Lr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}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 Br=Lr;Lr.default=Lr;let Fr=Br,jr=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Fr(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Kr=jr;jr.default=jr;const zr="'".charCodeAt(0),Ur='"'.charCodeAt(0),qr="\\".charCodeAt(0),Vr="/".charCodeAt(0),Wr="\n".charCodeAt(0),Gr=" ".charCodeAt(0),Hr="\f".charCodeAt(0),Yr="\t".charCodeAt(0),Zr="\r".charCodeAt(0),Xr="[".charCodeAt(0),Jr="]".charCodeAt(0),$r="(".charCodeAt(0),Qr=")".charCodeAt(0),ei="{".charCodeAt(0),ti="}".charCodeAt(0),ni=";".charCodeAt(0),ri="*".charCodeAt(0),ii=":".charCodeAt(0),oi="@".charCodeAt(0),si=/[\t\n\f\r "#'()/;[\\\]{}]/g,ai=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,li=/.[\r\n"'(/\\]/,ui=/[\da-f]/i;let ci=Ar,hi=class extends ci{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 di=hi;hi.default=hi,ci.registerAtRule(hi);let pi,fi,mi=Ar,gi=class extends mi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new pi(new fi,this,e).stringify()}};gi.registerLazyResult=e=>{pi=e},gi.registerProcessor=e=>{fi=e};var yi=gi;gi.default=gi,mi.registerRoot(gi);let vi={comma(e){return vi.split(e,[","],!0)},space(e){return vi.split(e,[" ","\n","\t"])},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let n of e)u?u=!1:"\\"===n?u=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var bi=vi;vi.default=vi;let wi=Ar,Si=bi,Ci=class extends wi{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Si.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var ki=Ci;Ci.default=Ci,wi.registerRule(Ci);let xi=Nn,Ii=function(e,t={}){let n,r,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(m),n){case Wr:case Gr:case Yr:case Zr:case Hr:r=m;do{r+=1,n=d.charCodeAt(r)}while(n===Gr||n===Wr||n===Yr||n===Zr||n===Hr);h=["space",d.slice(m,r)],m=r-1;break;case Xr:case Jr:case ei:case ti:case ii:case ni:case Qr:{let e=String.fromCharCode(n);h=[e,e,m];break}case $r:if(u=g.length?g.pop()[1]:"",c=d.charCodeAt(m+1),"url"===u&&c!==zr&&c!==Ur&&c!==Gr&&c!==Wr&&c!==Yr&&c!==Hr&&c!==Zr){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}v("bracket")}for(l=r;d.charCodeAt(l-1)===qr;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||li.test(o)?h=["(","(",m]:(h=["brackets",o,m,r],m=r);break;case zr:case Ur:i=n===zr?"'":'"',r=m;do{if(a=!1,r=d.indexOf(i,r+1),-1===r){if(p||t){r=m+1;break}v("string")}for(l=r;d.charCodeAt(l-1)===qr;)l-=1,a=!a}while(a);h=["string",d.slice(m,r+1),m,r],m=r;break;case oi:si.lastIndex=m+1,si.test(d),r=0===si.lastIndex?d.length-1:si.lastIndex-2,h=["at-word",d.slice(m,r+1),m,r],m=r;break;case qr:for(r=m,s=!0;d.charCodeAt(r+1)===qr;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==Vr&&n!==Gr&&n!==Wr&&n!==Yr&&n!==Zr&&n!==Hr&&(r+=1,ui.test(d.charAt(r)))){for(;ui.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Gr&&(r+=1)}h=["word",d.slice(m,r+1),m,r],m=r;break;default:n===Vr&&d.charCodeAt(m+1)===ri?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(m,r+1),m,r],m=r):(ai.lastIndex=m+1,ai.test(d),r=0===ai.lastIndex?d.length-1:ai.lastIndex-2,h=["word",d.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},Oi=yr,Ei=di,Ri=yi,_i=ki;const Ai={empty:!0,space:!0};let Mi=Ar,Ti=class{constructor(e){this.input=e,this.root=new Ri,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,n,r,i=new Ei;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],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(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Oi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ii(this.input)}decl(e,t){let n=new xi;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.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 _i;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 e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}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,n,r){let i,o,s,a,l=n.length,u="",c=!0;for(let e=0;e<l;e+=1)i=n[e],o=i[0],"space"!==o||e!==l-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",Ai[a]||Ai[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new _i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},Ni=rr;function Pi(e,t){let n=new Ni(e,t),r=new Ti(n);try{r.parse()}catch(e){throw e}return r.root}var Di=Pi;Pi.default=Pi,Mi.registerParse(Pi);let{isClean:Li,my:Bi}=gn,Fi=fr,ji=Cn,Ki=Ar,zi=Dr,Ui=Kr,qi=Di,Vi=yi;const Wi={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Gi={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},Hi={Once:!0,postcssPlugin:!0,prepare:!0};function Yi(e){return"object"==typeof e&&"function"==typeof e.then}function Zi(e){let t=!1,n=Wi[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Xi(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Zi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ji(e){return e[Li]=!1,e.nodes&&e.nodes.forEach(e=>Ji(e)),e}let $i={},Qi=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof Ui)i=Ji(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=qi;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[Bi]&&Ki.rebuild(i)}else i=Ji(n);this.result=new Ui(t,i,r),this.helpers={...$i,postcss:$i,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!Gi[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Hi[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(Yi(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Li];){e[Li]=!0;let t=[Xi(e)];for(;t.length>0;){let e=this.visitTick(t);if(Yi(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Yi(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ji;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Fi(t,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 e of this.plugins){if(Yi(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Li];)e[Li]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Yi(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[Li])return r[Li]=!0,void e.push(Xi(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Li]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Li]=!0;let t=Zi(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Li]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};Qi.registerPostcss=e=>{$i=e};var eo=Qi;Qi.default=Qi,Vi.registerLazyResult(Qi),zi.registerLazyResult(Qi);let to=fr,no=Cn,ro=Di;const io=Kr;let oo=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=no;this.result=new io(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new to(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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=ro;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var so=oo;oo.default=oo;let ao=so,lo=eo,uo=Dr,co=yi,ho=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new lo(this,e,t):new ao(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var po=ho;ho.default=ho,co.registerProcessor(ho),uo.registerProcessor(ho);let fo=Nn,mo=Un,go=yr,yo=di,vo=rr,bo=yi,wo=ki;function So(e,t){if(Array.isArray(e))return e.map(e=>So(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:vo.prototype};n.map&&(n.map={...n.map,__proto__:mo.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>So(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new bo(r);if("decl"===r.type)return new fo(r);if("rule"===r.type)return new wo(r);if("comment"===r.type)return new go(r);if("atrule"===r.type)return new yo(r);throw new Error("Unknown node type: "+e.type)}var Co=So;So.default=So;let ko=mn,xo=Nn,Io=eo,Oo=Ar,Eo=po,Ro=Cn,_o=Co,Ao=Dr,Mo=Br,To=yr,No=di,Po=Kr,Do=rr,Lo=Di,Bo=bi,Fo=ki,jo=yi,Ko=An;function zo(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Eo(e)}zo.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"1",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"9",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS2-F417-M314-9953",TEST_API_KEY:"da0d664f14c5ae55a420ffc96467de86",PACKAGE_VERSION:""}.LANG&&{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"1",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"9",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS2-F417-M314-9953",TEST_API_KEY:"da0d664f14c5ae55a420ffc96467de86",PACKAGE_VERSION:""}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new Eo).version,i}return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(e,t,n){return zo([i(n)]).process(e,t)},i},zo.stringify=Ro,zo.parse=Lo,zo.fromJSON=_o,zo.list=Bo,zo.comment=e=>new To(e),zo.atRule=e=>new No(e),zo.decl=e=>new xo(e),zo.rule=e=>new Fo(e),zo.root=e=>new jo(e),zo.document=e=>new Ao(e),zo.CssSyntaxError=ko,zo.Declaration=xo,zo.Container=Oo,zo.Processor=Eo,zo.Document=Ao,zo.Comment=To,zo.Warning=Mo,zo.AtRule=No,zo.Result=Po,zo.Input=Do,zo.Rule=Fo,zo.Root=jo,zo.Node=Ko,Io.registerPostcss(zo);var Uo=zo;zo.default=zo;const qo=on(Uo);qo.stringify,qo.fromJSON,qo.plugin,qo.parse,qo.list,qo.document,qo.comment,qo.atRule,qo.rule,qo.decl,qo.root,qo.CssSyntaxError,qo.Declaration,qo.Container,qo.Processor,qo.Document,qo.Comment,qo.Warning,qo.AtRule,qo.Result,qo.Input,qo.Rule,qo.Root,qo.Node;var Vo=Object.defineProperty,Wo=(e,t,n)=>((e,t,n)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);Object.defineProperty;function Go(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ho(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Yo={exports:{}},Zo=String,Xo=function(){return{isColorSupported:!1,reset:Zo,bold:Zo,dim:Zo,italic:Zo,underline:Zo,inverse:Zo,hidden:Zo,strikethrough:Zo,black:Zo,red:Zo,green:Zo,yellow:Zo,blue:Zo,magenta:Zo,cyan:Zo,white:Zo,gray:Zo,bgBlack:Zo,bgRed:Zo,bgGreen:Zo,bgYellow:Zo,bgBlue:Zo,bgMagenta:Zo,bgCyan:Zo,bgWhite:Zo}};Yo.exports=Xo(),Yo.exports.createColors=Xo;var Jo=Yo.exports;const $o=Ho(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Qo=Jo,es=$o,ts=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Qo.isColorSupported),es&&e&&(t=es(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Qo.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ns=ts;ts.default=ts;var rs={};rs.isClean=Symbol("isClean"),rs.my=Symbol("my");const is={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let os=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return is[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=is[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 ss=os;os.default=os;let as=ss;function ls(e,t){new as(t).stringify(e)}var us=ls;ls.default=ls;let{isClean:cs,my:hs}=rs,ds=ns,ps=ss,fs=us;function ms(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>ms(e,n)):("object"===o&&null!==i&&(i=ms(i)),n[r]=i)}return n}let gs=class{constructor(e={}){this.raws={},this[cs]=!1,this[hs]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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 n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new ds(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[cs]){this[cs]=!1;let e=this;for(;e=e.parent;)e[cs]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},n=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new ps).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=fs){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var ys=gs;gs.default=gs;let vs=ys,bs=class extends vs{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ws=bs;bs.default=bs;var Ss={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:Cs,SourceMapGenerator:ks}=$o,{existsSync:xs,readFileSync:Is}=$o,{dirname:Os,join:Es}=$o;let Rs=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Os(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Cs(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=Os(e),xs(e))return this.mapFile=e,Is(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Cs)return ks.fromSourceMap(t).toString();if(t instanceof ks)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Es(Os(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var _s=Rs;Rs.default=Rs;let{SourceMapConsumer:As,SourceMapGenerator:Ms}=$o,{fileURLToPath:Ts,pathToFileURL:Ns}=$o,{isAbsolute:Ps,resolve:Ds}=$o,{nanoid:Ls}=Ss,Bs=$o,Fs=ns,js=_s,Ks=Symbol("fromOffsetCache"),zs=Boolean(As&&Ms),Us=Boolean(Ds&&Ps),qs=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Us||/^\w+:\/\//.test(t.from)||Ps(t.from)?this.file=t.from:this.file=Ds(t.from)),Us&&zs){let e=new js(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Ls(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new Fs(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Fs(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Ns&&(i.input.url=Ns(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Ks])n=this[Ks];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Ks]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ds(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=Ps(a.source)?Ns(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ns(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ts)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ts(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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 Vs=qs;qs.default=qs,Bs&&Bs.registerInput&&Bs.registerInput(qs);let{SourceMapConsumer:Ws,SourceMapGenerator:Gs}=$o,{dirname:Hs,relative:Ys,resolve:Zs,sep:Xs}=$o,{pathToFileURL:Js}=$o,$s=Vs,Qs=Boolean(Ws&&Gs),ea=Boolean(Hs&&Zs&&Ys&&Xs);var ta=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||Hs(e.file);!1===this.mapOpts.sourcesContent?(t=new Ws(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ea&&Qs&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Gs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Gs({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 Gs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?Hs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Hs(Zs(n,this.mapOpts.annotation)));let r=Ys(n,e);return this.memoizedPaths.set(e,r),r}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 $s(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,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(Js){let t=Js(e).toString();return this.memoizedFileURLs.set(e,t),t}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;"\\"===Xs&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let na=ys,ra=class extends na{constructor(e){super(e),this.type="comment"}};var ia=ra;ra.default=ra;let oa,sa,aa,la,{isClean:ua,my:ca}=rs,ha=ws,da=ia,pa=ys;function fa(e){return e.map(e=>(e.nodes&&(e.nodes=fa(e.nodes)),delete e.source,e))}function ma(e){if(e[ua]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ma(t)}let ga=class e extends pa{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=fa(oa(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new ha(t)]}else if(t.selector)t=[new sa(t)];else if(t.name)t=[new aa(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new da(t)]}return t.map(t=>(t[ca]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ua]&&ma(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};ga.registerParse=e=>{oa=e},ga.registerRule=e=>{sa=e},ga.registerAtRule=e=>{aa=e},ga.registerRoot=e=>{la=e};var ya=ga;ga.default=ga,ga.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,aa.prototype):"rule"===e.type?Object.setPrototypeOf(e,sa.prototype):"decl"===e.type?Object.setPrototypeOf(e,ha.prototype):"comment"===e.type?Object.setPrototypeOf(e,da.prototype):"root"===e.type&&Object.setPrototypeOf(e,la.prototype),e[ca]=!0,e.nodes&&e.nodes.forEach(e=>{ga.rebuild(e)})};let va,ba,wa=ya,Sa=class extends wa{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new va(new ba,this,e).stringify()}};Sa.registerLazyResult=e=>{va=e},Sa.registerProcessor=e=>{ba=e};var Ca=Sa;Sa.default=Sa;let ka=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}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 xa=ka;ka.default=ka;let Ia=xa,Oa=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Ia(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ea=Oa;Oa.default=Oa;const Ra="'".charCodeAt(0),_a='"'.charCodeAt(0),Aa="\\".charCodeAt(0),Ma="/".charCodeAt(0),Ta="\n".charCodeAt(0),Na=" ".charCodeAt(0),Pa="\f".charCodeAt(0),Da="\t".charCodeAt(0),La="\r".charCodeAt(0),Ba="[".charCodeAt(0),Fa="]".charCodeAt(0),ja="(".charCodeAt(0),Ka=")".charCodeAt(0),za="{".charCodeAt(0),Ua="}".charCodeAt(0),qa=";".charCodeAt(0),Va="*".charCodeAt(0),Wa=":".charCodeAt(0),Ga="@".charCodeAt(0),Ha=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ya=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Za=/.[\r\n"'(/\\]/,Xa=/[\da-f]/i;let Ja=ya,$a=class extends Ja{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 Qa=$a;$a.default=$a,Ja.registerAtRule($a);let el,tl,nl=ya,rl=class extends nl{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new el(new tl,this,e).stringify()}};rl.registerLazyResult=e=>{el=e},rl.registerProcessor=e=>{tl=e};var il=rl;rl.default=rl,nl.registerRoot(rl);let ol={comma(e){return ol.split(e,[","],!0)},space(e){return ol.split(e,[" ","\n","\t"])},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let n of e)u?u=!1:"\\"===n?u=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var sl=ol;ol.default=ol;let al=ya,ll=sl,ul=class extends al{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ll.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var cl=ul;ul.default=ul,al.registerRule(ul);let hl=ws,dl=function(e,t={}){let n,r,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(m),n){case Ta:case Na:case Da:case La:case Pa:r=m;do{r+=1,n=d.charCodeAt(r)}while(n===Na||n===Ta||n===Da||n===La||n===Pa);h=["space",d.slice(m,r)],m=r-1;break;case Ba:case Fa:case za:case Ua:case Wa:case qa:case Ka:{let e=String.fromCharCode(n);h=[e,e,m];break}case ja:if(u=g.length?g.pop()[1]:"",c=d.charCodeAt(m+1),"url"===u&&c!==Ra&&c!==_a&&c!==Na&&c!==Ta&&c!==Da&&c!==Pa&&c!==La){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}v("bracket")}for(l=r;d.charCodeAt(l-1)===Aa;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||Za.test(o)?h=["(","(",m]:(h=["brackets",o,m,r],m=r);break;case Ra:case _a:i=n===Ra?"'":'"',r=m;do{if(a=!1,r=d.indexOf(i,r+1),-1===r){if(p||t){r=m+1;break}v("string")}for(l=r;d.charCodeAt(l-1)===Aa;)l-=1,a=!a}while(a);h=["string",d.slice(m,r+1),m,r],m=r;break;case Ga:Ha.lastIndex=m+1,Ha.test(d),r=0===Ha.lastIndex?d.length-1:Ha.lastIndex-2,h=["at-word",d.slice(m,r+1),m,r],m=r;break;case Aa:for(r=m,s=!0;d.charCodeAt(r+1)===Aa;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==Ma&&n!==Na&&n!==Ta&&n!==Da&&n!==La&&n!==Pa&&(r+=1,Xa.test(d.charAt(r)))){for(;Xa.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Na&&(r+=1)}h=["word",d.slice(m,r+1),m,r],m=r;break;default:n===Ma&&d.charCodeAt(m+1)===Va?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(m,r+1),m,r],m=r):(Ya.lastIndex=m+1,Ya.test(d),r=0===Ya.lastIndex?d.length-1:Ya.lastIndex-2,h=["word",d.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},pl=ia,fl=Qa,ml=il,gl=cl;const yl={empty:!0,space:!0};let vl=ya,bl=class{constructor(e){this.input=e,this.root=new ml,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,n,r,i=new fl;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],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(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new pl;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=dl(this.input)}decl(e,t){let n=new hl;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.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 gl;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 e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}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,n,r){let i,o,s,a,l=n.length,u="",c=!0;for(let e=0;e<l;e+=1)i=n[e],o=i[0],"space"!==o||e!==l-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",yl[a]||yl[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new gl;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},wl=Vs;function Sl(e,t){let n=new wl(e,t),r=new bl(n);try{r.parse()}catch(e){throw e}return r.root}var Cl=Sl;Sl.default=Sl,vl.registerParse(Sl);let{isClean:kl,my:xl}=rs,Il=ta,Ol=us,El=ya,Rl=Ca,_l=Ea,Al=Cl,Ml=il;const Tl={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Nl={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},Pl={Once:!0,postcssPlugin:!0,prepare:!0};function Dl(e){return"object"==typeof e&&"function"==typeof e.then}function Ll(e){let t=!1,n=Tl[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Bl(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ll(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Fl(e){return e[kl]=!1,e.nodes&&e.nodes.forEach(e=>Fl(e)),e}let jl={},Kl=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof _l)i=Fl(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=Al;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[xl]&&El.rebuild(i)}else i=Fl(n);this.result=new _l(t,i,r),this.helpers={...jl,postcss:jl,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!Nl[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Pl[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(Dl(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kl];){e[kl]=!0;let t=[Bl(e)];for(;t.length>0;){let e=this.visitTick(t);if(Dl(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Dl(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ol;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Il(t,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 e of this.plugins){if(Dl(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kl];)e[kl]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Dl(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[kl])return r[kl]=!0,void e.push(Bl(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[kl]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[kl]=!0;let t=Ll(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[kl]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};Kl.registerPostcss=e=>{jl=e};var zl=Kl;Kl.default=Kl,Ml.registerLazyResult(Kl),Rl.registerLazyResult(Kl);let Ul=ta,ql=us,Vl=Cl;const Wl=Ea;let Gl=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=ql;this.result=new Wl(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new Ul(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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=Vl;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Hl=Gl;Gl.default=Gl;let Yl=Hl,Zl=zl,Xl=Ca,Jl=il,$l=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Zl(this,e,t):new Yl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ql=$l;$l.default=$l,Jl.registerProcessor($l),Xl.registerProcessor($l);let eu=ws,tu=_s,nu=ia,ru=Qa,iu=Vs,ou=il,su=cl;function au(e,t){if(Array.isArray(e))return e.map(e=>au(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:iu.prototype};n.map&&(n.map={...n.map,__proto__:tu.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>au(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new ou(r);if("decl"===r.type)return new eu(r);if("rule"===r.type)return new su(r);if("comment"===r.type)return new nu(r);if("atrule"===r.type)return new ru(r);throw new Error("Unknown node type: "+e.type)}var lu=au;au.default=au;let uu=ns,cu=ws,hu=zl,du=ya,pu=Ql,fu=us,mu=lu,gu=Ca,yu=xa,vu=ia,bu=Qa,wu=Ea,Su=Vs,Cu=Cl,ku=sl,xu=cl,Iu=il,Ou=ys;function Eu(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new pu(e)}Eu.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"1",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"9",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS2-F417-M314-9953",TEST_API_KEY:"da0d664f14c5ae55a420ffc96467de86",PACKAGE_VERSION:""}.LANG&&{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"1",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"9",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS2-F417-M314-9953",TEST_API_KEY:"da0d664f14c5ae55a420ffc96467de86",PACKAGE_VERSION:""}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new pu).version,i}return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(e,t,n){return Eu([i(n)]).process(e,t)},i},Eu.stringify=fu,Eu.parse=Cu,Eu.fromJSON=mu,Eu.list=ku,Eu.comment=e=>new vu(e),Eu.atRule=e=>new bu(e),Eu.decl=e=>new cu(e),Eu.rule=e=>new xu(e),Eu.root=e=>new Iu(e),Eu.document=e=>new gu(e),Eu.CssSyntaxError=uu,Eu.Declaration=cu,Eu.Container=du,Eu.Processor=pu,Eu.Document=gu,Eu.Comment=vu,Eu.Warning=yu,Eu.AtRule=bu,Eu.Result=wu,Eu.Input=Su,Eu.Rule=xu,Eu.Root=Iu,Eu.Node=Ou,hu.registerPostcss(Eu);var Ru=Eu;Eu.default=Eu;const _u=Go(Ru);_u.stringify,_u.fromJSON,_u.plugin,_u.parse,_u.list,_u.document,_u.comment,_u.atRule,_u.rule,_u.decl,_u.root,_u.CssSyntaxError,_u.Declaration,_u.Container,_u.Processor,_u.Document,_u.Comment,_u.Warning,_u.AtRule,_u.Result,_u.Input,_u.Rule,_u.Root,_u.Node;class Au{constructor(...e){Wo(this,"parentElement",null),Wo(this,"parentNode",null),Wo(this,"ownerDocument"),Wo(this,"firstChild",null),Wo(this,"lastChild",null),Wo(this,"previousSibling",null),Wo(this,"nextSibling",null),Wo(this,"ELEMENT_NODE",1),Wo(this,"TEXT_NODE",3),Wo(this,"nodeType"),Wo(this,"nodeName"),Wo(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Au))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Mu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Tu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Nu={};function Pu(e){if(Nu[e])return Nu[e];const t=globalThis[e],n=t.prototype,r=e in Mu?Mu[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in Tu?Tu[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return Nu[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?Nu[e]=o:n}catch{return n}}const Du={};function Lu(e,t,n){var r;const i=`${e}.${String(n)}`;if(Du[i])return Du[i].call(t);const o=Pu(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Du[i]=s,s.call(t)):t[n]}const Bu={};function Fu(e,t,n){const r=`${e}.${String(n)}`;if(Bu[r])return Bu[r].bind(t);const i=Pu(e)[n];return"function"!=typeof i?t[n]:(Bu[r]=i,i.bind(t))}function ju(){return Pu("MutationObserver").constructor}function Ku(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}const zu={childNodes:function(e){return Lu("Node",e,"childNodes")},parentNode:function(e){return Lu("Node",e,"parentNode")},parentElement:function(e){return Lu("Node",e,"parentElement")},textContent:function(e){return Lu("Node",e,"textContent")},contains:function(e,t){return Fu("Node",e,"contains")(t)},getRootNode:function(e){return Fu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Lu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Lu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Lu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Lu("Element",e,"querySelectorAll")(t)},mutationObserver:ju,patch:Ku};function Uu(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let qu={map:{},getId(){return-1},getNode(){return null},removeNodeFromMap(){},has(){return!1},reset(){}};function Vu(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function Wu(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Wu(e,t,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(qu=new Proxy(qu,{get(e,t,n){return Reflect.get(e,t,n)}}));let Gu=Date.now;function Hu(e){var t,n,r,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=zu.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=zu.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Yu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xu(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:zu.parentElement(e)}function Ju(e,t,n,r){if(!e)return!1;const i=Xu(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if($t(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function $u(e,t){return-1!==t.getId(e)}function Qu(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function ec(e,t){if(St(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=zu.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||ec(r,t))}function tc(e){return Boolean(e.changedTouches)}function nc(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function rc(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(i,o.parent))}else{const e=r.indexOf(o);r.splice(e,0,n(i,null))}continue}if(o in t){const e=t[o];e.children.push(n(i,e));continue}r.push(n(i,null))}return r}function ic(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)ic(e.children[n],t)}function oc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function sc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ac(e,t){var n,r;const i=null==(null==e.ownerDocument?void 0:n.defaultView)?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),s=ac(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function lc(e){return!!e&&(e instanceof Au&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(zu.shadowRoot(e)))}function uc(e,t){const n=e[t[0]];return 1===t.length?n:uc(n.cssRules[t[1]].cssRules,t.slice(2))}function cc(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function hc(e){const t=new Set,n=[];for(let r=e.length;r--;){const i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}/[1-9][0-9]{12}/.test(Date.now().toString())||(Gu=()=>(new Date).getTime());class dc{constructor(){at(this,"id",1),at(this,"styleIDMap",new WeakMap),at(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function pc(e){var t;let n=null;return"getRootNode"in e&&(null==(t=zu.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&zu.host(zu.getRootNode(e))&&(n=zu.host(zu.getRootNode(e))),n}function fc(e){let t,n=e;for(;t=pc(n);)n=t;return n}function mc(e){const t=e.ownerDocument;if(!t)return!1;const n=fc(e);return zu.contains(t,n)}function gc(e){const t=e.ownerDocument;return!!t&&(zu.contains(t,e)||mc(e))}Symbol.toStringTag;var yc=(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))(yc||{}),vc=(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))(vc||{}),bc=(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))(bc||{}),wc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(wc||{}),Sc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Sc||{}),Cc=(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))(Cc||{}),kc=(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))(kc||{});function xc(e){return"__ln"in e}class Ic{constructor(){at(this,"length",0),at(this,"head",null),at(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xc(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&xc(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Oc=(e,t)=>`${e}@${t}`;class Ec{constructor(){at(this,"frozen",!1),at(this,"locked",!1),at(this,"texts",[]),at(this,"attributes",[]),at(this,"attributeMap",new WeakMap),at(this,"removes",[]),at(this,"mapRemoves",[]),at(this,"movedMap",{}),at(this,"addedSet",new Set),at(this,"movedSet",new Set),at(this,"droppedSet",new Set),at(this,"removesSubTreeCache",new Set),at(this,"mutationCb"),at(this,"blockClass"),at(this,"blockSelector"),at(this,"maskTextClass"),at(this,"maskTextSelector"),at(this,"inlineStylesheet"),at(this,"maskInputOptions"),at(this,"maskTextFn"),at(this,"maskInputFn"),at(this,"keepIframeSrcFn"),at(this,"recordCanvas"),at(this,"inlineImages"),at(this,"slimDOMOptions"),at(this,"dataURLOptions"),at(this,"doc"),at(this,"mirror"),at(this,"iframeManager"),at(this,"stylesheetManager"),at(this,"shadowDomManager"),at(this,"canvasManager"),at(this,"processedNodeManager"),at(this,"unattachedDoc"),at(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),at(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Ic,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{const o=zu.parentNode(i);if(!o||!gc(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=St(o)?this.mirror.getId(pc(i)):this.mirror.getId(o),l=r(i);if(-1===a||-1===l)return n.addNode(i);const u=rn(i,{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:e=>{oc(e,this.mirror)&&this.iframeManager.addIframe(e),sc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),lc(i)&&this.shadowDomManager.addShadowRoot(zu.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)_c(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(zu.parentNode(e))||i(e);for(const e of this.addedSet)Ac(this.droppedSet,e)||_c(this.removesSubTreeCache,e,this.mirror)?Ac(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(zu.parentNode(o.value)),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(zu.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=zu.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=zu.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=zu.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))}),at(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(zu.childNodes(e),e=>zu.textContent(e)||"").join("");t.attributes.value=Et({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:At(e),value:n,maskInputFn:this.maskInputFn})}),at(this,"processMutation",e=>{if(!Qu(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=zu.textContent(e.target);Ju(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Qt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xu(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=At(t);r=Et({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Ju(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.test)return;n="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Jt(t.tagName,n))if(i.attributes[n]=Xt(this.doc,Rt(t.tagName),Rt(n),r),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||o!==n.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?r:[r,o]:i._unchangedStyles[e]=[r,o]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Ju(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=St(e.target)?this.mirror.getId(zu.host(e.target)):this.mirror.getId(e.target);Ju(e.target,this.blockClass,this.blockSelector,!1)||Qu(t,this.mirror,this.slimDOMOptions)||!$u(t,this.mirror)||(this.addedSet.has(t)?(Rc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ec(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Oc(n,r)]?Rc(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!St(e.target)||!Ct(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),zu.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),at(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Qu(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Oc(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ju(e,this.blockClass,this.blockSelector,!1)||(zu.childNodes(e).forEach(e=>this.genAdds(e)),lc(e)&&zu.childNodes(zu.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}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 Rc(e,t){e.delete(t),zu.childNodes(t).forEach(t=>Rc(e,t))}function _c(e,t,n){return 0!==e.size&&function(e,t){const n=zu.parentNode(t);return!!n&&e.has(n)}(e,t)}function Ac(e,t){return 0!==e.size&&Mc(e,t)}function Mc(e,t){const n=zu.parentNode(t);return!!n&&(!!e.has(n)||Mc(e,n))}let Tc;const Nc=e=>{if(!Tc)return e;return(...t)=>{try{return e(...t)}catch(e){if(Tc&&!0===Tc(e))return;throw e}}},Pc=[];function Dc(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 Lc(e,t){const n=new Ec;Pc.push(n),n.init(e);const r=new(ju())(Nc(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Bc({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(bc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=Rt(o);const u=(t=>o=>{const s=Dc(o);if(Ju(s,r,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=wc.Mouse;break;case"touch":a=wc.Touch;break;case"pen":a=wc.Pen}a===wc.Touch?bc[t]===bc.MouseDown?u="TouchStart":bc[t]===bc.MouseUp&&(u="TouchEnd"):wc.Pen}else tc(o)&&(a=wc.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===wc.Touch||u.startsWith("Mouse")&&a===wc.Mouse)&&(a=null)):bc[t]===bc.Click&&(a=l,l=null);const c=tc(o)?o.changedTouches[0]:o;if(!c)return;const h=n.getId(s),{clientX:d,clientY:p}=c;Nc(e)({type:bc[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(bc[o]){case bc.MouseDown:case bc.MouseUp:s=s.replace("mouse","pointer");break;case bc.TouchStart:case bc.TouchEnd:return}a.push(Uu(s,u,t))}),Nc(()=>{a.forEach(e=>e())})}function Fc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return Uu("scroll",Nc(Vu(Nc(o=>{const s=Dc(o);if(!s||Ju(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Hu(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}const jc=["INPUT","TEXTAREA","SELECT"],Kc=new WeakMap;function zc(e){return function(e,t){if(Wc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Wc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Wc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Wc("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Uc(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function qc({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(zu.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(o=null==(i=n.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),Nc(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Vc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(r=Lc(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=Vu(Nc(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),u=Nc(Vu(Nc(e=>{const t=Dc(e),{clientX:n,clientY:i}=tc(e)?e.changedTouches[0]:e;s||(s=Gu()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Gu()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?vc.Drag:e instanceof MouseEvent?vc.MouseMove:vc.TouchMove)}),i,{trailing:!1})),c=[Uu("mousemove",u,n),Uu("touchmove",u,n),Uu("drag",u,n)];return Nc(()=>{c.forEach(e=>e())})}(e),o=Bc(e),s=Fc(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return Uu("resize",Nc(Vu(Nc(()=>{const t=Yu(),i=Zu();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let n=Dc(e);const u=e.isTrusted,h=n&&n.tagName;if(n&&"OPTION"===h&&(n=zu.parentElement(n)),!n||!h||jc.indexOf(h)<0||Ju(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let p=n.value,f=!1;const m=At(n)||"";"radio"===m||"checkbox"===m?f=n.checked:(a[h.toLowerCase()]||a[m])&&(p=Et({element:n,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(n,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const g=n.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;d(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,r){const i=Kc.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Kc.set(t,r);const i=n.getId(t);Nc(e)({...r,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>Uu(e,Nc(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>Wu(e[0],e[1],{set(){Nc(h)({target:this,isTrusted:!1})}},!1,f))),Nc(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Nc(o=>Vu(Nc(i=>{const s=Dc(i);if(!s||Ju(s,t,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:o,id:r.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),i.media||500)),a=[Uu("play",s(Cc.Play),o),Uu("pause",s(Cc.Pause),o),Uu("seeked",s(Cc.Seeked),o),Uu("volumechange",s(Cc.VolumeChange),o),Uu("ratechange",s(Cc.RateChange),o)];return Nc(()=>{a.forEach(e=>e())})}(e);let c=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Nc((r,i,o)=>{const[s,a]=o,{id:l,styleId:u}=Uc(i,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=Uc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=Uc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=Uc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),r.apply(i,o)})}));const l={};Gc("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Gc("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Gc("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Gc("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([r,i])=>{u[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[r].insertRule,{apply:Nc((r,i,o)=>{const[s,a]=o,{id:l,styleId:u}=Uc(i.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...zc(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[r].deleteRule,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=Uc(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...zc(i),s]}]}),r.apply(i,o)})})}),Nc(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:n}),h=qc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Nc((i,s,a)=>{var l;const[u,c,h]=a;if(n.has(u))return o.apply(s,[u,c,h]);const{id:d,styleId:p}=Uc(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:u,value:c,priority:h},index:zc(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Nc((i,o,a)=>{var l;const[u]=a;if(n.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=Uc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:zc(o.parentRule)}),i.apply(o,a)})}),Nc(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=Ku(t.fonts,"add",function(t){return function(n){return setTimeout(Nc(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),Nc(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Nc(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;Ju(s,r,i,!0)||Ju(u,r,i,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(u),endOffset:c})}o({ranges:a})});return a(),Uu("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Ku(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,i])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Nc(()=>{Pc.forEach(e=>e.reset()),null==r||r.disconnect(),i(),o(),s(),a(),l(),u(),c(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function Wc(e){return void 0!==window[e]}function Gc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Hc{constructor(e){at(this,"iframeIdToRemoteIdMap",new WeakMap),at(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Yc{constructor(e){at(this,"iframes",new WeakMap),at(this,"crossOriginIframeMap",new WeakMap),at(this,"crossOriginIframeMirror",new Hc(zt)),at(this,"crossOriginIframeStyleMirror"),at(this,"crossOriginIframeRootIdMap",new WeakMap),at(this,"mirror"),at(this,"mutationCb"),at(this,"wrappedEmit"),at(this,"loadListener"),at(this,"stylesheetManager"),at(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Hc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.test&&e.test.adoptedStyleSheets&&e.test.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.test.adoptedStyleSheets,this.mirror.getId(e.test))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case yc.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:yc.IncrementalSnapshot,data:{source:vc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case yc.Meta:case yc.Load:case yc.DomContentLoaded:return!1;case yc.Plugin:return t;case yc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case yc.IncrementalSnapshot:switch(t.data.source){case vc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vc.Drag:case vc.TouchMove:case vc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vc.ViewportResize:return!1;case vc.MediaInteraction:case vc.MouseInteraction:case vc.Scroll:case vc.CanvasMutation:case vc.Input:return this.replaceIds(t.data,e,["id"]),t;case vc.StyleSheetRule:case vc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case vc.Font:return t;case vc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case vc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===kc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Zc{constructor(e){at(this,"shadowDoms",new WeakSet),at(this,"mutationCb"),at(this,"scrollCb"),at(this,"bypassOptions"),at(this,"mirror"),at(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ct(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Lc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Fc({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(zu.host(e))),this.restoreHandlers.push(qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.test&&this.patchAttachShadow(e.contentWindow.Element,e.test)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ku(e.prototype,"attachShadow",function(e){return function(r){const i=e.call(this,r),o=zu.shadowRoot(this);return o&&gc(this)&&n.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$c=0;$c<64;$c++)Jc[Xc.charCodeAt($c)]=$c;const Qc=new Map;const eh=(e,t,n)=>{if(!e||!rh(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Qc.get(e);return n||(n=new Map,Qc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function th(e,t,n){if(e instanceof Array)return e.map(e=>th(e,t,n));if(null===e)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(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Xc[n[t]>>2],i+=Xc[(3&n[t])<<4|n[t+1]>>4],i+=Xc[(15&n[t+1])<<2|n[t+2]>>6],i+=Xc[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[th(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[th(e.data,t,n),e.width,e.height]}}if(rh(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:eh(e,t,n)}}return e}const nh=(e,t,n)=>e.map(e=>th(e,t,n)),rh=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function ih(e,t,n,r){const i=[];try{const o=Ku(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!Ju(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch{}return()=>{i.forEach(e=>e())}}function oh(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Ku(e,l,function(e){return function(...s){const a=e.apply(this,s);if(eh(a,o,this),"tagName"in this.canvas&&!Ju(this.canvas,r,i,!0)){const e=nh(s,o,this),r={type:t,property:l,args:e};n(this.canvas,r)}return a}});s.push(a)}catch{const r=Wu(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}const sh="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ah="undefined"!=typeof window&&window.Blob&&new Blob([(lh=sh,Uint8Array.from(atob(lh),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var lh;function uh(e){let t;try{if(t=ah&&(window.URL||window.webkitURL).createObjectURL(ah),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker("data:text/javascript;base64,"+sh,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class ch{constructor(e){at(this,"pendingCanvasMutations",new Map),at(this,"rafStamps",{latestId:0,invokeId:null}),at(this,"mirror"),at(this,"mutationCb"),at(this,"resetObservers"),at(this,"frozen",!1),at(this,"locked",!1),at(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}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(e,t,n,r,i){const o=ih(t,n,r,!0),s=new Map,a=new uh;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:Sc["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let u,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ju(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=ih(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Ku(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return Ju(this.canvas,n,r,!0)||setTimeout(()=>{const n=nh(o,t,this);e(this.canvas,{type:Sc["2D"],property:s,args:n})},0),i.apply(this,o)}});i.push(o)}catch{const n=Wu(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Sc["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const i=[];return i.push(...oh(t.WebGLRenderingContext.prototype,Sc.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...oh(t.WebGL2RenderingContext.prototype,Sc.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}class hh{constructor(e){at(this,"trackedLinkElements",new WeakSet),at(this,"mutationCb"),at(this,"adoptedStyleSheetCb"),at(this,"styleMirror",new dc),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:xt(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class dh{constructor(){at(this,"nodeMap",new WeakMap),at(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let ph,fh,mh,gh=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ot=e.contentWindow)?void 0:ot.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){}const yh=Ot();function vh(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:v={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:k=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:_=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Tc=M;const T=!k||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==w&&void 0===v.mousemove&&(v.mousemove=w),yh.reset();const P=!0===h?{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}:void 0!==d?d:{password:!0},D=nn(p);let L;nc();let B=0;const F=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};ph=(e,i)=>{var o;const s=e;if(s.timestamp=Gu(),!(null==(o=Pc[0])?void 0:o.isFrozen())||s.type===yc.FullSnapshot||s.type===yc.IncrementalSnapshot&&s.data.source===vc.Mutation||Pc.forEach(e=>e.unfreeze()),T)null==t||t(F(s),i);else if(N){const e={type:"rrweb",event:F(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===yc.FullSnapshot)L=s,B=0;else if(s.type===yc.IncrementalSnapshot){if(s.data.source===vc.Mutation&&s.data.isAttachIframe)return;B++;const e=r&&B>=r,t=n&&s.timestamp-L.timestamp>n;(e||t)&&fh(!0)}};const j=e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.Mutation,...e}})},K=e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Scroll,...e}}),z=e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.CanvasMutation,...e}}),U=new hh({mutationCb:j,adoptedStyleSheetCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.AdoptedStyleSheet,...e}})}),q=new Yc({mirror:yh,mutationCb:j,stylesheetManager:U,recordCrossOriginIframes:k,wrappedEmit:ph});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:yh,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const V=new dh;mh=new ch({recordCanvas:C,mutationCb:z,win:window,blockClass:i,blockSelector:o,mirror:yh,sampling:v.canvas,dataURLOptions:b});const W=new Zc({mutationCb:j,scrollCb:K,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:P,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:D,iframeManager:q,stylesheetManager:U,canvasManager:mh,keepIframeSrcFn:_,processedNodeManager:V},mirror:yh});fh=(e=!1)=>{if(!S)return;ph({type:yc.Meta,data:{href:window.location.href,width:Zu(),height:Yu()}},e),U.reset(),W.init(),Pc.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new It,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S=()=>!1}=t||{};return rn(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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}:!1===c?{password:!0}:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:nn(p),dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:yh,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:P,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:C,inlineImages:E,onSerialize:e=>{oc(e,yh)&&q.addIframe(e),sc(e,yh)&&U.trackLinkElement(e),lc(e)&&W.addShadowRoot(zu.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),W.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{U.attachLinkElement(e,t)},keepIframeSrcFn:_});t&&(ph({type:yc.FullSnapshot,data:{node:t,initialOffset:Hu(window)}},e),Pc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&U.adoptStyleSheets(document.adoptedStyleSheets,yh.getId(document)))};try{const e=[],t=e=>{var t;return Nc(Vc)({mutationCb:j,mousemoveCb:(e,t)=>ph({type:yc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.MouseInteraction,...e}}),scrollCb:K,viewportResizeCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.ViewportResize,...e}}),inputCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Input,...e}}),mediaInteractionCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.MediaInteraction,...e}}),styleSheetRuleCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.StyleSheetRule,...e}}),styleDeclarationCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Font,...e}}),selectionCb:e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.Selection,...e}})},customElementCb:e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:P,inlineStylesheet:c,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:I,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:_,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:yh,iframeManager:q,stylesheetManager:U,shadowDomManager:W,processedNodeManager:V,canvasManager:mh,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>ph({type:yc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};q.addLoadListener(n=>{try{e.push(t(n.test))}catch(e){}});const n=()=>{fh(),e.push(t(document)),gh=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(Uu("DOMContentLoaded",()=>{ph({type:yc.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&n()})),e.push(Uu("load",()=>{ph({type:yc.Load,data:{}}),"load"===x&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")}}),V.destroy(),gh=!1,Tc=void 0}}catch(e){}}function bh(e){return{all:e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),e.get("*")&&r.slice().map(function(e){e(t,n)})}}}vh.addCustomEvent=(e,t)=>{if(!gh)throw new Error("please add custom event after start recording");ph({type:yc.Custom,data:{tag:e,payload:t}})},vh.freezePage=()=>{Pc.forEach(e=>e.freeze())},vh.takeFullSnapshot=e=>{if(!gh)throw new Error("please take full snapshot after start recording");fh(e)},vh.mirror=yh;Symbol.toStringTag;var wh,Sh;(Sh=wh||(wh={}))[Sh.NotStarted=0]="NotStarted",Sh[Sh.Running=1]="Running",Sh[Sh.Stopped=2]="Stopped";const{addCustomEvent:Ch}=vh,{freezePage:kh}=vh,{takeFullSnapshot:xh}=vh;var Ih=n(7753);const Oh=Symbol.for("Dexie"),Eh=globalThis[Oh]||(globalThis[Oh]=Ih);if(Ih.semVer!==Eh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ih.semVer} and ${Eh.semVer}`);const{liveQuery:Rh,mergeRanges:_h,rangesOverlap:Ah,RangeSet:Mh,cmp:Th,Entity:Nh,PropModification:Ph,replacePrefix:Dh,add:Lh,remove:Bh}=Eh;var Fh=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};class jh{constructor(e){this.batchQueue=[],this.rewindBatchQueue=[],this.processingBatch=!1,this.processingRewindBatch=!1,this.BATCH_SIZE=15,this.BATCH_INTERVAL=2e3,this.lastBatch=0,this.requests=new Map,this.CLEAN_UP_INTERVAL=3e4,this.lastCleanup=0,this.isDestroyed=!1,this.minutesToKeepData=15,this.dbInitialized=!1,this.dbInitPromise=null,this.isInitializedForRecordingLink=!1,this.__init(e)}__init(e){if(jh._instance)return jh._instance;jh._instance=this,this.isDestroyed=!1,this.initDB().catch(e=>{}),this.isInitializedForRecordingLink=e.isInitializedForRecordingLink||!1,this.batchQueue=[],this.rewindBatchQueue=[],this.processingBatch=!1,this.processingRewindBatch=!1,this.BATCH_SIZE=15,this.BATCH_INTERVAL=2e3,this.CLEAN_UP_INTERVAL=3e4,this.startPeriodicBatchProcess(),this.minutesToKeepData=e.maxRecordingMinutes||15}setMaxRecordingMinutes(e){e>0&&(this.minutesToKeepData=e)}cleanUpdata(){return Fh(this,void 0,void 0,function*(){const e=Date.now();if(e-parseInt(localStorage.getItem("lastCleanup")||"0")>=this.CLEAN_UP_INTERVAL){const t=60*this.minutesToKeepData*1e3;this.deleteRewindDataOnTabReload(t),yield this.db.logs.where("timestamp").between(0,Date.now()-t,!0,!0).delete(),localStorage.setItem("lastCleanup",e.toString())}})}deleteRewindDataOnTabReload(e){return Fh(this,void 0,void 0,function*(){try{return yield this.db.rewind.where("timestamp").between(0,Date.now()-e,!0,!0).delete(),!0}catch(e){return c.log("🚀 ~ deleteRewindDataOnTabReload ~ error:",e),!1}})}startPeriodicBatchProcess(){this.interval=setInterval(()=>{var e;this.batchQueue.length>0&&this.processBatch(),(null===(e=this.rewindBatchQueue)||void 0===e?void 0:e.length)>0&&this.processRewindBatch(),this.cleanUpdata()},this.BATCH_INTERVAL)}initDB(){return Fh(this,void 0,void 0,function*(){return this.dbInitPromise||(this.dbInitPromise=new Promise((e,t)=>{try{const n=parseInt("1");this.db=new Eh("logger-DB"),this.db.version(n).stores({logs:"++id,tabId,timestamp,type,recordingIds,[tabId+timestamp]",rewind:"++id,tabId,timestamp,[tabId+timestamp]"}),this.db.open().then(()=>{this.dbInitialized=!0,c.log("Database initialized successfully"),e()}).catch(e=>{t(e)})}catch(e){t(e)}})),this.dbInitPromise})}addToBatch(e){return Fh(this,void 0,void 0,function*(){try{this.batchQueue.push(Object.assign({},e)),this.batchQueue.length>=this.BATCH_SIZE&&(yield this.processBatch())}catch(e){c.error("Error in addToBatch:",e)}})}addRewindDataToBatch(e){return Fh(this,void 0,void 0,function*(){this.rewindBatchQueue.push(e),this.rewindBatchQueue.length>=this.BATCH_SIZE&&(yield this.processRewindBatch())})}processRewindBatch(){var e,t,n,r,i,o;return Fh(this,void 0,void 0,function*(){if(this.processingRewindBatch||0===this.rewindBatchQueue.length)return;let s=[];try{this.processingRewindBatch=!0,s=this.rewindBatchQueue.splice(0,this.BATCH_SIZE);const n=s.filter(e=>!!e).map(e=>Object.assign(Object.assign({},e),{event:this.sanitizeForIndexedDB(e.event),events:Array.isArray(e.events)?e.events.map(e=>this.sanitizeForIndexedDB(e)):e.events}));yield null===(t=null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.rewind)||void 0===t?void 0:t.bulkAdd(n)}catch(e){c.error("Error processing rewind batch:",e);for(const e of s)try{const t=Object.assign(Object.assign({},e),{event:this.sanitizeForIndexedDB(e.event),events:Array.isArray(e.events)?e.events.map(e=>this.sanitizeForIndexedDB(e)):e.events});yield null===(r=null===(n=null==this?void 0:this.db)||void 0===n?void 0:n.rewind)||void 0===r?void 0:r.put(t)}catch(t){c.error("Failed to save individual rewind log:",t,e);const n=t;if("DataCloneError"===n.name||"ConstraintError"===n.name)try{const t={id:e.id||Date.now().toString(),type:"rewind",timestamp:e.timestamp||Date.now(),tabId:e.tabId||it(),createdAt:e.createdAt||(new Date).toISOString(),event:{error:"Original rewind data could not be stored",errorType:n.name,originalEventType:typeof e.event}};yield null===(o=null===(i=null==this?void 0:this.db)||void 0===i?void 0:i.rewind)||void 0===o?void 0:o.put(t)}catch(e){c.error("Failed to save even minimal rewind log version:",e)}}}finally{this.processingRewindBatch=!1}})}sanitizeForIndexedDB(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return c.error("Failed to sanitize data for IndexedDB:",t),{error:"Data sanitization failed",originalType:typeof e,timestamp:Date.now()}}}processBatch(){var e,t,n,r,i,o;return Fh(this,void 0,void 0,function*(){if(this.processingBatch||0===this.batchQueue.length)return;let s=[];try{this.processingBatch=!0,s=this.batchQueue.splice(0,this.BATCH_SIZE);const n=s.filter(e=>!!e).map(e=>Object.assign(Object.assign({},e),{data:this.sanitizeForIndexedDB(e.data)}));yield null===(t=null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.logs)||void 0===t?void 0:t.bulkAdd(n)}catch(e){c.error("Error processing batch:",e);for(const e of s)try{const t=Object.assign(Object.assign({},e),{data:this.sanitizeForIndexedDB(e.data)});yield null===(r=null===(n=null==this?void 0:this.db)||void 0===n?void 0:n.logs)||void 0===r?void 0:r.put(t)}catch(t){c.error("Failed to save individual log:",t,e);const n=t;if("DataCloneError"===n.name||"ConstraintError"===n.name)try{const t={type:e.type||"unknown",timestamp:e.timestamp||0,tabId:e.tabId||it(),data:{error:"Original data could not be stored",errorType:n.name,originalDataType:typeof e.data}};yield null===(o=null===(i=null==this?void 0:this.db)||void 0===i?void 0:i.logs)||void 0===o?void 0:o.put(t)}catch(e){c.error("Failed to save even minimal log version:",e)}}}finally{this.processingBatch=!1}})}saveNetworkRequest(e){var t;return Fh(this,void 0,void 0,function*(){if(!e)return;const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(!this.isInitializedForRecordingLink||(null==r?void 0:r.length))try{yield this.addToBatch({type:"network",timestamp:e.timestamp||Date.now(),data:e,recordingIds:r,tabId:it()})}catch(e){c.error("Error handling network response:",e)}})}saveConsoleLog(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"console",timestamp:e.timestamp||0,data:e,recordingIds:r,tabId:it()})}catch(e){c.error("Error handling console logs",e)}})}saveSteps(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"step",timestamp:e.timestamp?Number(e.timestamp):0,data:e,tabId:it(),recordingIds:r})}catch(e){c.error("Error handling steps data",e)}})}saveApplicationData(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"application",timestamp:e.timestamp||Date.now(),data:e.data,tabId:it(),recordingIds:r})}catch(e){c.error("Error handling steps data",e)}})}saveRewindData(e){return Fh(this,void 0,void 0,function*(){if(e)try{yield this.addRewindDataToBatch(Object.assign(Object.assign({},e),{type:"rewind",tabId:it()}))}catch(e){c.error("Error handling rewind data",e)}})}handleSuspend(){return Fh(this,void 0,void 0,function*(){c.log("Extension suspending, performing cleanup..."),yield this.destroy()})}destroy(){var e;return Fh(this,void 0,void 0,function*(){this.isDestroyed||(this.isDestroyed=!0,clearInterval(this.interval),yield this.processBatch(),yield this.processRewindBatch(),yield null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.close())})}getLogsByStackTrace(e,t=!1,n=!1){return Fh(this,void 0,void 0,function*(){const r=this.batchQueue,i=yield this.queryLogs(e,!1,t,n);c.log("logs",i);const o=e.reduce((e,t)=>({startTime:Math.min(e.startTime,t.startTime||0),endTime:Math.max(e.endTime,t.endTime||Date.now())}),{startTime:1/0,endTime:-1/0});return[...i,...(null==r?void 0:r.filter(e=>e.timestamp>o.startTime&&e.timestamp<o.endTime))||[]]})}queryLogs(e,t=!1,n=!1,r=!1){var i,o,s,a,l,u,h,d,p;return Fh(this,void 0,void 0,function*(){if(this.dbInitialized||(yield this.initDB()),!e||0===e.length)return[];c.log("Database state:",{dbExists:!!this.db,isDestroyed:this.isDestroyed,dbVersion:null===(i=this.db)||void 0===i?void 0:i.verno,hasLogsTable:!!(null===(o=this.db)||void 0===o?void 0:o.logs),isInitialized:this.dbInitialized}),c.log("stackTrace",e,t,n);const f=e.reduce((e,t)=>({startTime:Math.min(e.startTime,t.startTime||0),endTime:Math.max(e.endTime,t.endTime||Date.now())}),{startTime:1/0,endTime:-1/0});c.log("timeRange",f,r,t),n&&(f.startTime-=12e4);try{if(t)return yield null===(s=null==this?void 0:this.db)||void 0===s?void 0:s.rewind.where(["tabId","timestamp"]).between([it(),f.startTime],[it(),f.endTime],!0,!0).toArray();if(r){c.log("isFromRecordingLink",r),c.log("this?.db?.logs",null===(a=null==this?void 0:this.db)||void 0===a?void 0:a.logs,this.db);let t=null===(l=null==this?void 0:this.db)||void 0===l?void 0:l.logs.where("timestamp").between(f.startTime,f.endTime,!0,!0);c.log("isFromRecordingLink2",r),(null===(u=e[0])||void 0===u?void 0:u.type)&&(t=t.filter(t=>t.type===e[0].type)),c.log("isFromRecordingLink3",r),(null===(h=e[0])||void 0===h?void 0:h.recordingId)&&(t=t.filter(t=>{var n;return!!(null===(n=t.recordingIds)||void 0===n?void 0:n.length)&&t.recordingIds.includes(e[0].recordingId||"")})),c.log("isFromRecordingLink4",r),c.log("datdshgdjh dayusgd uasygada");const n=yield t.reverse().toArray();return c.log("datdshgdjhada",n),n}{const t=(null===(d=e[0])||void 0===d?void 0:d.type)?t=>t.type===e[0].type:()=>!0;return yield null===(p=null==this?void 0:this.db)||void 0===p?void 0:p.logs.where(["tabId","timestamp"]).between([it(),f.startTime],[it(),f.endTime],!0,!0).filter(t).reverse().toArray()}}catch(e){return c.log(e),c.error("Error querying logs:",e),[]}})}}jh._instance=null;var Kh=jh,zh=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};const Uh=[8,9,13,16,17,18,19,20,27,33,32,34,35,36,37,38,39,40,45,46],qh=/(^|@)\S+:\d+/,Vh=/^\s*at .*(\S+:\d+|\(native\))/m,Wh=/^(eval@)?(\[native code])?$/;class Gh{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}const Hh={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Vh))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e,void 0,void 0];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]?parseInt(t[2]):void 0,t[3]?parseInt(t[3]):void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Vh)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Gh({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Wh)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Gh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Gh({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,i=n.length;e<i;e+=2){const i=t.exec(n[e]);i&&r.push(new Gh({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,i=n.length;e<i;e+=2){const i=t.exec(n[e]);i&&r.push(new Gh({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(qh)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Gh({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};class Yh{constructor(t){this.handleKeyUpEvent=t=>{var n,r;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(n=null===document||void 0===document?void 0:document.getElementById(e))||void 0===n?void 0:n.contains(document.activeElement))||(null==Uh?void 0:Uh.includes(t.keyCode))&&this.onSteps({id:tt(),eventType:o,eventData:32!==t.keyCode?t.key:t.keyCode.toString(),count:0,eventElement:nt((null===(r=document.activeElement)||void 0===r?void 0:r.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})},this.lastScrollY=0,window.stopRRweb=void 0,this.dbLogger=new Kh({maxRecordingMinutes:t.maxRecordingMinutes,isInitializedForRecordingLink:t.isInitializedForRecordingLink}),this.isInitializedForRecordingLink=t.isInitializedForRecordingLink,this.maxRecordingMinutes=t.maxRecordingMinutes,window.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateRecordingStatuses()}),this.updateRecordingStatuses()}setMaxRecordingMinutes(e){var t;e>0&&(this.maxRecordingMinutes=e,null===(t=this.dbLogger)||void 0===t||t.setMaxRecordingMinutes(e))}localStorageListener(){window.addEventListener("storage",e=>{"recordingStatuses"===e.key&&this.updateRecordingStatuses()})}updateRecordingStatuses(){var e;return zh(this,void 0,void 0,function*(){if(window.isRecordingTab)return;let t=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[];t=et(t);const n=t.map(e=>((e=et(e)).currentlyRecording&&(e.domain=window.location.hostname,e.pageTitle=document.title,e.url=window.location.href),e));localStorage.setItem("recordingStatuses",JSON.stringify(n));const r=yield this.getApplicationData();null===(e=this.dbLogger)||void 0===e||e.saveApplicationData({type:"application",data:r,timestamp:Date.now()})})}static getInstance(e){return Yh.instance?Yh.instance.setMaxRecordingMinutes(e.maxRecordingMinutes):Yh.instance=new Yh({maxRecordingMinutes:e.maxRecordingMinutes,isInitializedForRecordingLink:e.isInitializedForRecordingLink}),Yh.instance}listenConsoleEvents(){if(window.location.href.includes("https://challenges.cloudflare.com"))return;let e;const t={},n=[],r=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];e=[];const o={};let s;const a=new Set,l=function(){let t,i;try{i=function(){return r},window.console?(window.console.isToastLogConsole?(s=Object.assign({},window.console.toastLogOldConsole),delete window.console.toastLogOldConsole,delete window.console.isToastLogConsole,window.console=s):s=Object.assign({},window.console),t=function(t){let s;return t in console&&(s=console[t])&&(console[t]=function(...i){var l,u,c,h;let d,p,f;const m=null===(l=null==n?void 0:n.slice)||void 0===l?void 0:l.call(i,0);for(p=0,f=Math.min(o[t].handlers.length,10);p<f;p++)a.has(o[t].handlers[p])&&(null===(u=null==r?void 0:r.apply)||void 0===u||u.call(o[t].handlers[p],console,m));for(p=0,f=Math.min(e.length,10);p<f;p++)a.has(e[p])&&(d=[t],n.push.apply(d,m),null===(c=null==r?void 0:r.apply)||void 0===c||c.call(e[p],console,d));null===(h=null==r?void 0:r.apply)||void 0===h||h.call(s,console,m)}),console[t]||i}):t=i}catch(e){c.error(e)}return t}();!function(){let e,t,n;for(e=0,t=i.length;e<t;e++)n=i[e],o[n]={handlers:[]},"function"==typeof l&&l(n)}();const u=function(){e=[];for(const e in o)o[e].handlers=[];a.clear(),window.console=s};window.realConsoleListener=window.console,window.ConsoleListener={on:function(n,r){var i;try{let s,l;if("[object Object]"===(null===(i=t.toString)||void 0===i?void 0:i.call(n)))for(s in n)l=n[s],"all"===s?e.length<10&&(e.push(l),a.add(l)):s in o&&o[s].handlers.length<10&&(o[s].handlers.push(l),a.add(l));else"function"==typeof n?e.length<10&&(e.push(n),a.add(n)):n in o&&o[n].handlers.length<10&&(o[n].handlers.push(r),a.add(r))}catch(e){c.error(e)}},close:u};const h={};i.forEach(e=>{h[e]=(t,...n)=>{const r=Hh.parse(new Error(void 0));this.onConsoleEvent("custom",{type:e,extra:void 0,fileUrl:r,e:t,more:n})}}),window.ConsoleListener.on(h),window.addEventListener("unload",u),window.onerror=(e,t="",n,r,i)=>{const o={msg:e,url:t,lineNo:n,columnNo:r,error:i},s=new Gh({columnNumber:r,fileName:t,lineNumber:n});this.onConsoleEvent("custom",{type:"error",extra:o,e:o.msg,fileUrl:s})};const d=e=>{const t=Hh.parse(new Error("0"));let n,r;try{n=null==e?void 0:e.reason}catch(e){n=void 0}try{r=null==e?void 0:e.detail,!n&&r&&(n=null==r?void 0:r.reason)}catch(e){}n||(n="[unhandledrejection] error getting `reason` from event"),this.onConsoleEvent("custom",{type:"error",e:`Uncaught (in promise) ${n}`,fileUrl:t,extra:void 0})};window.addEventListener("unhandledrejection",d),window.addEventListener("unload",()=>{window.removeEventListener("unhandledrejection",d)})}ListenNetworkEvents(){const e=window.fetch,t=this,n=e=>{if(!e)return!1;const t=e.toLowerCase();return t.includes("application/json")||t.includes("text/")||t.includes("application/xml")||t.includes("application/x-www-form-urlencoded")};window.fetch=function(...r){var i;return zh(this,void 0,void 0,function*(){const o=Date.now(),s=r[0]instanceof Request?r[0]:new Request(r[0].toString(),r[1]),a=s.url;let l;try{if(!(null===(i=s.signal)||void 0===i?void 0:i.aborted)){const e=s.headers.get("content-type");n(e)&&(l=yield s.clone().text())}}catch(e){c.error("Error reading request body:",e)}return new Promise((i,u)=>{e.apply(window,r).then(e=>zh(this,void 0,void 0,function*(){var r,u;try{if(e&&!(null===(r=s.signal)||void 0===r?void 0:r.aborted)){const r=e.clone(),i=e.headers.get("content-type"),h=s.method,d=Object.fromEntries(s.headers),p=Object.fromEntries(e.headers),f=Date.now();let m;try{n(i)&&(m=(null==i?void 0:i.toLowerCase().includes("json"))?JSON.stringify(yield r.json()):yield r.text())}catch(e){if(c.error("Error parsing response:",e),n(i))try{m=yield r.text()}catch(e){c.error("Error parsing response as text:",e)}}"BetterBugsSDK"===d["X-App-Client"]||window.isRecordingTab||null===(u=t.dbLogger)||void 0===u||u.saveNetworkRequest({id:tt(),method:h,response:m,requestBody:l,requestHeaders:Object.entries(d).map(([e,t])=>({name:e,value:t})),responseHeaders:Object.entries(p).map(([e,t])=>({name:e,value:t})),url:a||e.url,statusCode:e.status,isError:e.status>=400,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:o,endTime:f,initiator:window.location.origin})}}catch(e){c.error("Error processing fetch response:",e)}i(e)})).catch(e=>{var n;try{const r=Object.fromEntries(s.headers);"BetterBugsSDK"===r["X-App-Client"]||window.isRecordingTab||null===(n=t.dbLogger)||void 0===n||n.saveNetworkRequest({id:tt(),method:s.method,requestBody:l,requestHeaders:Object.entries(r).map(([e,t])=>({name:e,value:t})),responseHeaders:[],url:a,statusCode:0,isError:!0,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:o,endTime:Date.now(),initiator:window.location.origin,response:(null==e?void 0:e.message)||"Network request failed"})}catch(e){c.error("Error saving failed fetch request:",e)}u(e)})})})},function(){const e=XMLHttpRequest.prototype,r=e.open,i=e.send,o=e.setRequestHeader;e.open=function(e,t){try{this._startTime=Date.now(),this._method=e,this._url=(e=>{try{return new URL(e,window.location.origin).toString()}catch(t){return c.error("Error getting absolute URL:",t),e}})(t),this._requestHeaders={}}catch(e){c.error("Error in XHR open:",e)}return r.apply(this,[e,t,!0,null,null])},e.setRequestHeader=function(e,t){try{this._requestHeaders&&(this._requestHeaders[e]=t)}catch(e){c.error("Error in XHR setRequestHeader:",e)}return o.apply(this,[e,t])},e.send=function(e){var r,o;try{const i=(null===(r=this._requestHeaders)||void 0===r?void 0:r["content-type"])||(null===(o=this._requestHeaders)||void 0===o?void 0:o["Content-Type"]);n(i||null)&&(this._requestBody=e),this.addEventListener("load",function(){var e;try{const r=this._method||"GET",i=this._requestHeaders||{},o=this._url||this.responseURL,s=this.status,a=this._startTime||Date.now(),l=this.getAllResponseHeaders().split("\r\n").reduce((e,t)=>{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{}),u=Date.now(),c=this.getResponseHeader("content-type");let h;n(c)&&(h=this.response),"BetterBugsSDK"===i["X-App-Client"]||window.isRecordingTab||null===(e=t.dbLogger)||void 0===e||e.saveNetworkRequest({id:tt(),method:r,response:h,requestBody:this._requestBody,requestHeaders:Object.entries(i).map(([e,t])=>({name:e,value:t})),responseHeaders:Object.entries(l).map(([e,t])=>({name:e,value:t})),url:o,isError:s>=400,statusCode:s,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:a,endTime:u,initiator:window.location.origin})}catch(e){c.error("Error processing XHR response:",e)}});const s=(e,n)=>{var r;try{const i=e._requestHeaders||{};"BetterBugsSDK"===i["X-App-Client"]||window.isRecordingTab||null===(r=t.dbLogger)||void 0===r||r.saveNetworkRequest({id:tt(),method:e._method||"GET",response:n,requestBody:e._requestBody,requestHeaders:Object.entries(i).map(([e,t])=>({name:e,value:t})),responseHeaders:[],url:e._url||"",isError:!0,statusCode:0,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:e._startTime||Date.now(),endTime:Date.now(),initiator:window.location.origin})}catch(e){c.error("Error saving failed XHR request:",e)}};this.addEventListener("error",function(){s(this,"Network request failed")}),this.addEventListener("timeout",function(){s(this,"Request timed out")}),this.addEventListener("abort",function(){s(this,"Request aborted")})}catch(e){c.error("Error in XHR send:",e)}return i.apply(this,[e])}}()}ListenNavigationEvents(){let e=window.location.href;const t=(t,n,i)=>{if(i&&n!==i){e=i;try{this.onSteps({id:tt(),eventType:r,eventData:i,eventElement:`via ${t} from ${n}`,url:i,createdAt:(new Date).toISOString(),timestamp:Date.now()})}catch(e){c.error("Error saving navigation log:",e)}}},n=history.pushState.bind(history),i=history.replaceState.bind(history);history.pushState=function(r,i,o){const s=e;n(r,i,o);const a=o?new URL(o.toString(),window.location.origin).href:window.location.href;t("pushState",s,a)},history.replaceState=function(n,r,o){const s=e;i(n,r,o);const a=o?new URL(o.toString(),window.location.origin).href:window.location.href;t("replaceState",s,a)},window.addEventListener("popstate",()=>{const n=window.location.href,r=new URL(e),i=new URL(n);r.origin===i.origin&&r.pathname===i.pathname&&r.search===i.search||t("popstate",e,n)}),window.addEventListener("hashchange",()=>{const n=window.location.href;t("hashchange",e,n)})}initializeRecording(t){try{window.stopRRweb&&window.stopRRweb(),window.stopRRweb=vh({emit:(e,n)=>{const r=et(e);switch(r.isCheckout=n,t&&this.onRRwebEvent(r),r.type){case yc.IncrementalSnapshot:r.data.source===vc.MouseInteraction&&r.data.type===bc.Click?rt(e=>this.handleClickEvent(e),100)(r):r.data.source===vc.Scroll?rt(e=>this.handleScrollEvent(e),500)(r):r.data.source===vc.Input&&this.handleInputEvent(r);break;case yc.Meta&&!n:this.handleNavigationEvent(r)}},checkoutEveryNms:1e3,inlineStylesheet:!0,slimDOMOptions:{comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},maskInputOptions:{email:!0,password:!0,number:!0,tel:!0},blockSelector:`#${e}`,maskTextSelector:'[data-betterbugs="ignore"]'})}catch(e){c.log("error: ",e)}window.addEventListener("keyup",this.handleKeyUpEvent)}handleNavigationEvent(e){this.onSteps({id:tt(),eventType:r,eventData:e.data.href,eventElement:null,url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleInputEvent(t){var n,r,o;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(n=null===document||void 0===document?void 0:document.getElementById(e))||void 0===n?void 0:n.contains(document.activeElement))||"BODY"===(null===(r=document.activeElement)||void 0===r?void 0:r.tagName)||this.onSteps({id:tt(),eventType:i,eventData:t.data.text,eventElement:nt((null===(o=null===document||void 0===document?void 0:document.activeElement)||void 0===o?void 0:o.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleClickEvent(n){var r,i,o,s,a,l;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(r=null===document||void 0===document?void 0:document.getElementById(e))||void 0===r?void 0:r.contains(document.elementFromPoint(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.x,null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.y)))||this.onSteps({id:tt(),eventType:t,eventData:(null===(s=document.elementFromPoint(n.data.x,n.data.y))||void 0===s?void 0:s.innerText)?null===(a=document.elementFromPoint(n.data.x,n.data.y))||void 0===a?void 0:a.innerText:"",eventElement:nt((null===(l=null===document||void 0===document?void 0:document.elementFromPoint(n.data.x,n.data.y))||void 0===l?void 0:l.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleScrollEvent(e){const t=e.data.y-this.lastScrollY;if(this.lastScrollY=e.data.y,0===t)return;const n=t>0?"down":"up";this.onSteps({id:tt(),eventType:s,eventData:n,scrollDelta:t,scrollY:e.data.y,eventElement:null,url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}onConsoleEvent(e,t){var n,r,i;window.isRecordingTab||("rrweb"===e&&"data"in t?null===(n=this.dbLogger)||void 0===n||n.saveConsoleLog({id:tt(),args:null===(r=t.data.payload.payload)||void 0===r?void 0:r.map(e=>{try{return JSON.parse(e)}catch(t){return e}}),file:t.data.payload.trace,timestamp:Date.now(),url:window.location.href,type:t.data.payload.level,createdAt:(new Date).toDateString()}):"type"in t&&(null===(i=this.dbLogger)||void 0===i||i.saveConsoleLog({type:t.type,args:[t.e,...(null==t?void 0:t.more)||[]],timestamp:Date.now(),url:window.location.href,file:t.fileUrl,id:tt(),createdAt:(new Date).toDateString()})))}onRRwebEvent(e){var t;return zh(this,void 0,void 0,function*(){window.isRecordingTab||null===(t=this.dbLogger)||void 0===t||t.saveRewindData({id:tt(),event:e,createdAt:(new Date).toDateString(),timestamp:Date.now(),url:window.location.href})})}onSteps(e){var t;return zh(this,void 0,void 0,function*(){window.isRecordingTab||null===(t=this.dbLogger)||void 0===t||t.saveSteps(e)})}getApplicationData(){var e,t;return zh(this,void 0,void 0,function*(){if(window.isRecordingTab)return[];const n=[],r=null===window||void 0===window?void 0:window.localStorage,i=null===window||void 0===window?void 0:window.sessionStorage,o=document.cookie.split(";").map(e=>{const[t,n]=e.trim().split("=");return{args:{name:t,value:decodeURIComponent(n),domain:window.location.hostname,path:"/",secure:"https:"===window.location.protocol,httpOnly:!1,sameSite:"lax",hostOnly:!1,session:!0,storeId:"0",expirationDate:null},type:"cookie",url:window.location.href,timestamp:Date.now()}});if(n.push(...o),r)for(const t in r)if(null===(e=Object.prototype.hasOwnProperty)||void 0===e?void 0:e.call(r,t)){const e=r[t];if("function"==typeof e)continue;const i={args:{key:t,value:e},type:"local",url:window.location.href,timestamp:Date.now()};n.push(i)}for(const e in i)if(null===(t=Object.prototype.hasOwnProperty)||void 0===t?void 0:t.call(i,e)){const t=i[e];if("function"==typeof t)continue;const r={args:{key:e,value:t},type:"session",url:window.location.href,timestamp:Date.now()};n.push(r)}return n})}startRecording({captureRewindEvents:e=!0}){return zh(this,void 0,void 0,function*(){Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).ListenNetworkEvents(),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).listenConsoleEvents(),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).initializeRecording(e),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).ListenNavigationEvents(),window.isBetterbugsLogsCaptureInitialized=!0})}getAllData(e,t=!1){var n,r;return zh(this,void 0,void 0,function*(){const[i,o]=yield Promise.all([t?null===(n=this.dbLogger)||void 0===n?void 0:n.queryLogs(e,!0):Promise.resolve([]),null===(r=this.dbLogger)||void 0===r?void 0:r.queryLogs(e,!1,!0)]);return{rewindData:i,logsData:o}})}captureScreenshot(){return zh(this,void 0,void 0,function*(){const e=new CustomEvent("betterbugs:captureScreenshot");document.dispatchEvent(e)})}submitBug(e){return zh(this,void 0,void 0,function*(){const t=new CustomEvent("betterbugs:submitBug",{detail:e});document.dispatchEvent(t)})}stopRecording(){var e;return zh(this,void 0,void 0,function*(){window.stopRRweb&&window.stopRRweb(),this.dbLogger&&(null===(e=this.dbLogger)||void 0===e||e.destroy(),this.dbLogger=void 0),Yh.instance=void 0})}}window.isBetterbugsLogsCaptureInitialized||Yh.getInstance({maxRecordingMinutes:15,isInitializedForRecordingLink:!0}).startRecording({captureRewindEvents:!1})}(),r=r.default}()});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Betterbugs=t():e.Betterbugs=t()}(this,function(){return function(){var e={7753:function(e,t,n){e.exports=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,o=Object.keys,s=Array.isArray;function a(e,t){return"object"!=typeof t||o(t).forEach(function(n){e[n]=t[n]}),e}"undefined"==typeof Promise||i.Promise||(i.Promise=Promise);var l=Object.getPrototypeOf,u={}.hasOwnProperty;function c(e,t){return u.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(l(e))),("undefined"==typeof Reflect?o:Reflect.ownKeys)(t).forEach(function(n){p(e,n,t[n])})}var d=Object.defineProperty;function p(e,t,n,r){d(e,t,a(n&&c(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function f(e){return{from:function(t){return e.prototype=Object.create(t.prototype),p(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}var m=Object.getOwnPropertyDescriptor,g=[].slice;function y(e,t,n){return g.call(e,t,n)}function v(e,t){return t(e)}function b(e){if(!e)throw new Error("Assertion Failed")}function w(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function S(e,t){if("string"==typeof t&&c(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=S(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return null==a?void 0:S(a,t.substr(s+1))}}function C(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){b("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)C(e,t[r],n[r])}else{var o,a,l=t.indexOf(".");-1!==l?(o=t.substr(0,l),""===(a=t.substr(l+1))?void 0===n?s(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n:C(l=(l=e[o])&&c(e,o)?l:e[o]={},a,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function k(e){var t,n={};for(t in e)c(e,t)&&(n[t]=e[t]);return n}var x=[].concat;function I(e){return x.apply([],e)}var O="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(I([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return i[e]}),E=new Set(O.map(function(e){return i[e]})),R=null;function _(e){return R=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=R.get(t);if(n)return n;if(s(t)){n=[],R.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(E.has(t.constructor))n=t;else{var o,a=l(t);for(o in n=a===Object.prototype?{}:Object.create(a),R.set(t,n),t)c(t,o)&&(n[o]=e(t[o]))}return n}(e),R=null,e}var A={}.toString;function M(e){return A.call(e).slice(8,-1)}var T="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",N="symbol"==typeof T?function(e){var t;return null!=e&&(t=e[T])&&t.apply(e)}:function(){return null};function P(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var D={};function L(e){var t,n,r,i;if(1===arguments.length){if(s(e))return e.slice();if(this===D&&"string"==typeof e)return[e];if(i=N(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"!=typeof(t=e.length))return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var B="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},F=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(le=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"]),j={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function K(e,t){this.name=e,this.message=t}function U(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function z(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=U(e,t)}function q(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=U(e,this.failures)}f(K).from(Error).extend({toString:function(){return this.name+": "+this.message}}),f(z).from(K),f(q).from(K);var V=F.reduce(function(e,t){return e[t]=t+"Error",e},{}),W=K,G=F.reduce(function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=j[t]||n,this.inner=null)}return f(r).from(W),e[t]=r,e},{});G.Syntax=SyntaxError,G.Type=TypeError,G.Range=RangeError;var H=le.reduce(function(e,t){return e[t+"Error"]=G[t],e},{}),Y=F.reduce(function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=G[t]),e},{});function Z(){}function X(e){return e}function J(e,t){return null==e||e===X?t:function(n){return t(e(n))}}function $(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Q(e,t){return e===Z?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?$(r,this.onsuccess):r),i&&(this.onerror=this.onerror?$(i,this.onerror):i),void 0!==o?o:n}}function ee(e,t){return e===Z?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?$(n,this.onsuccess):n),r&&(this.onerror=this.onerror?$(r,this.onerror):r)}}function te(e,t){return e===Z?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,o=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),i&&(this.onsuccess=this.onsuccess?$(i,this.onsuccess):i),o&&(this.onerror=this.onerror?$(o,this.onerror):o),void 0===r?void 0===n?void 0:n:a(r,n)}}function ne(e,t){return e===Z?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function re(e,t){return e===Z?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}Y.ModifyError=z,Y.DexieError=K,Y.BulkError=q;var ie="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function oe(e){ie=e}var se={},ae=100,le=(O="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,l(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,l(t),e]}(),O[0]),ue=(F=O[1],O=O[2],F=F&&F.then,le&&le.constructor),ce=!!O,he=function(e,t){be.push([e,t]),pe&&(queueMicrotask(_e),pe=!1)},de=!0,pe=!0,fe=[],me=[],ge=X,ye={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Z,pgp:!1,env:{},finalize:Z},ve=ye,be=[],we=0,Se=[];function Ce(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=ve;if("function"!=typeof e){if(e!==se)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Ie(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Ae();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof Ce?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,Oe(t)),r&&Me()}},Ie.bind(null,t))}catch(n){Ie(t,n)}}(this,e)}var ke={get:function(){var e=ve,t=je;function n(n,r){var i=this,o=!e.global&&(e!==ve||t!==je),s=o&&!qe(),a=new Ce(function(t,a){Ee(i,new xe(Ze(n,e,o,s),Ze(r,e,o,s),t,a,e))});return this._consoleTask&&(a._consoleTask=this._consoleTask),a}return n.prototype=se,n},set:function(e){p(this,"then",e&&e.prototype===se?ke:{get:function(){return e},set:ke.set})}};function xe(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function Ie(e,t){var n,r;me.push(t),null===e._state&&(n=e._lib&&Ae(),t=ge(t),e._state=!1,e._value=t,r=e,fe.some(function(e){return e._value===r._value})||fe.push(r),Oe(e),n&&Me())}function Oe(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ee(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===we&&(++we,he(function(){0==--we&&Te()},[]))}function Ee(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++we,he(Re,[n,e,t])}else e._listeners.push(t)}function Re(e,t,n){try{var r,i=t._value;!t._state&&me.length&&(me=[]),r=ie&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),t._state||-1!==me.indexOf(i)||function(e){for(var t=fe.length;t;)if(fe[--t]._value===e._value)return fe.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--we&&Te(),--n.psd.ref||n.psd.finalize()}}function _e(){Ye(ye,function(){Ae()&&Me()})}function Ae(){var e=de;return pe=de=!1,e}function Me(){var e,t,n;do{for(;0<be.length;)for(e=be,be=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(0<be.length);pe=de=!0}function Te(){var e=fe;fe=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=Se.slice(0),n=t.length;n;)t[--n]()}function Ne(e){return new Ce(se,!1,e)}function Pe(e,t){var n=ve;return function(){var r=Ae(),i=ve;try{return Ge(n,!0),e.apply(this,arguments)}catch(r){t&&t(r)}finally{Ge(i,!1),r&&Me()}}}h(Ce.prototype,{then:ke,_then:function(e,t){Ee(this,new xe(null,null,e,t,ve))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=e,n=arguments[1];return"function"==typeof t?this.then(null,function(e){return(e instanceof t?n:Ne)(e)}):this.then(null,function(e){return(e&&e.name===t?n:Ne)(e)})},finally:function(e){return this.then(function(t){return Ce.resolve(e()).then(function(){return t})},function(t){return Ce.resolve(e()).then(function(){return Ne(t)})})},timeout:function(e,t){var n=this;return e<1/0?new Ce(function(r,i){var o=setTimeout(function(){return i(new G.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&p(Ce.prototype,Symbol.toStringTag,"Dexie.Promise"),ye.env=He(),h(Ce,{all:function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return Ce.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof Ce?e:e&&"function"==typeof e.then?new Ce(function(t,n){e.then(t,n)}):new Ce(se,!0,e)},reject:Ne,race:function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){e.map(function(e){return Ce.resolve(e).then(t,n)})})},PSD:{get:function(){return ve},set:function(e){return ve=e}},totalEchoes:{get:function(){return je}},newPSD:Ue,usePSD:Ye,scheduler:{get:function(){return he},set:function(e){he=e}},rejectionMapper:{get:function(){return ge},set:function(e){ge=e}},follow:function(e,t){return new Ce(function(n,r){return Ue(function(t,n){var r=ve;r.unhandleds=[],r.onunhandled=n,r.finalize=$(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},Se.push(function t(){e(),Se.splice(Se.indexOf(t),1)}),++we,he(function(){0==--we&&Te()},[])},r.finalize),e()},t,n,r)})}}),ue&&(ue.allSettled&&p(Ce,"allSettled",function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach(function(e,i){return Ce.resolve(e).then(function(e){return r[i]={status:"fulfilled",value:e}},function(e){return r[i]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),ue.any&&"undefined"!=typeof AggregateError&&p(Ce,"any",function(){var e=L.apply(null,arguments).map(Ve);return new Ce(function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach(function(e,o){return Ce.resolve(e).then(function(e){return t(e)},function(e){i[o]=e,--r||n(new AggregateError(i))})})})}),ue.withResolvers&&(Ce.withResolvers=ue.withResolvers));var De={awaits:0,echoes:0,id:0},Le=0,Be=[],Fe=0,je=0,Ke=0;function Ue(e,t,n,r){var i=ve,o=Object.create(i);return o.parent=i,o.ref=0,o.global=!1,o.id=++Ke,ye.env,o.env=ce?{Promise:Ce,PromiseProp:{value:Ce,configurable:!0,writable:!0},all:Ce.all,race:Ce.race,allSettled:Ce.allSettled,any:Ce.any,resolve:Ce.resolve,reject:Ce.reject}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()},r=Ye(o,e,n,r),0===o.ref&&o.finalize(),r}function ze(){return De.id||(De.id=++Le),++De.awaits,De.echoes+=ae,De.id}function qe(){return!!De.awaits&&(0==--De.awaits&&(De.id=0),De.echoes=De.awaits*ae,!0)}function Ve(e){return De.echoes&&e&&e.constructor===ue?(ze(),e.then(function(e){return qe(),e},function(e){return qe(),Je(e)})):e}function We(){var e=Be[Be.length-1];Be.pop(),Ge(e,!1)}function Ge(e,t){var n,r=ve;(t?!De.echoes||Fe++&&e===ve:!Fe||--Fe&&e===ve)||queueMicrotask(t?function(e){++je,De.echoes&&0!=--De.echoes||(De.echoes=De.awaits=De.id=0),Be.push(ve),Ge(e,!0)}.bind(null,e):We),e!==ve&&(ve=e,r===ye&&(ye.env=He()),ce&&(n=ye.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(i,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function He(){var e=i.Promise;return ce?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ye(e,t,n,r,i){var o=ve;try{return Ge(e,!0),t(n,r,i)}finally{Ge(o,!1)}}function Ze(e,t,n,r){return"function"!=typeof e?e:function(){var i=ve;n&&ze(),Ge(t,!0);try{return e.apply(this,arguments)}finally{Ge(i,!1),r&&queueMicrotask(qe)}}}function Xe(e){Promise===ue&&0===De.echoes?0===Fe?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+F).indexOf("[native code]")&&(ze=qe=Z);var Je=Ce.reject,$e=String.fromCharCode(65535),Qe="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",et="String expected.",tt=[],nt="__dbnames",rt="readonly",it="readwrite";function ot(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var st={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function at(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=_(t))[e],t}}function lt(){throw G.Type()}function ut(e,t){try{var n=ct(e),r=ct(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}(ht(e),ht(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var s=ut(e[o],t[o]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function ct(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)||"ArrayBuffer"===(e=M(e))?"binary":e}function ht(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var dt=(pt.prototype._trans=function(e,t,n){var r=this._tx||ve.trans,i=this.name,o=ie&&"undefined"!=typeof console&&console.createTask&&void 0;function s(e,n,r){if(!r.schema[i])throw new G.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var a=Ae();try{var l=r&&r.db._novip===this.db._novip?r===ve.trans?r._promise(e,s,n):Ue(function(){return r._promise(e,s,n)},{trans:r,transless:ve.transless||ve}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||ve.letThrough||t._vip)){var o=t._createTransaction(n,r,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,i)})):Je(o)}return o._promise(n,function(e,t){return Ue(function(){return ve.trans=o,i(e,t,o)})}).then(function(e){if("readwrite"===n)try{o.idbtrans.commit()}catch(e){}return"readonly"===n?e:o._completion.then(function(){return e})})}if(t._state.openComplete)return Je(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return Je(new G.DatabaseClosed);t.open().catch(Z)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],s);return o&&(l._consoleTask=o,l=l.catch(function(e){return Je(e)})),l}finally{a&&Me()}},pt.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?Je(new G.Type("Invalid argument to Table.get()")):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},pt.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=o(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==$e){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}var i=this.schema.idxByName;function a(e,t){return 0===ut(e,t)}var l=t.reduce(function(t,n){var r=t[0],o=t[1],l=(t=i[n],e[n]);return[r||t,r||!t?ot(o,t&&t.multi?function(e){return e=S(e,n),s(e)&&e.some(function(e){return a(l,e)})}:function(e){return a(l,S(e,n))}):o]},[null,null]);return r=l[0],l=l[1],r?this.where(r.name).equals(e[r.keyPath]).filter(l):n?this.filter(l):this.where(t).equals("")},pt.prototype.filter=function(e){return this.toCollection().and(e)},pt.prototype.count=function(e){return this.toCollection().count(e)},pt.prototype.offset=function(e){return this.toCollection().offset(e)},pt.prototype.limit=function(e){return this.toCollection().limit(e)},pt.prototype.each=function(e){return this.toCollection().each(e)},pt.prototype.toArray=function(e){return this.toCollection().toArray(e)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(t){var n,r=this.db,i=this.name;function o(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof lt&&(function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(o,n=t),Object.defineProperty(o.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),o.prototype.table=function(){return i},t=o);for(var s=new Set,a=t.prototype;a;a=l(a))Object.getOwnPropertyNames(a).forEach(function(e){return s.add(e)});function u(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=u,this.hook("reading",u),t},pt.prototype.defineClass=function(){return this.mapToClass(function(e){a(this,e)})},pt.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=at(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{C(e,o,t)}catch(t){}return t})},pt.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=S(e,this.schema.primKey.keyPath))?Je(new G.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},pt.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,o=r.keyPath,s=e;return o&&i&&(s=at(o)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):e.lastResult}).then(function(t){if(o)try{C(e,o,t)}catch(t){}return t})},pt.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):void 0})},pt.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:st})}).then(function(e){return e.numFailures?Ce.reject(e.failures[0]):void 0})},pt.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},pt.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=(a=r.schema.primKey).auto;if((a=a.keyPath)&&i)throw new G.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,a=a&&n?e.map(at(a)):e;return r.core.mutate({trans:t,type:"add",keys:i,values:a,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new q("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),e)})})},pt.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,o=(n=n||(i?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=(a=r.schema.primKey).auto;if((a=a.keyPath)&&i)throw new G.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new G.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,a=a&&n?e.map(at(a)):e;return r.core.mutate({trans:t,type:"put",keys:i,values:a,wantResults:o}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult;if(e=e.failures,0===t)return o?n:i;throw new q("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),e)})})},pt.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),i=e.map(function(e){return e.changes}),o=[];return this._trans("readwrite",function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then(function(a){var l=[],u=[];e.forEach(function(e,n){var r=e.key,i=e.changes,s=a[n];if(s){for(var c=0,h=Object.keys(i);c<h.length;c++){var d=h[c],p=i[d];if(d===t.schema.primKey.keyPath){if(0!==ut(p,r))throw new G.Constraint("Cannot update primary key in bulkUpdate()")}else C(s,d,p)}o.push(n),l.push(r),u.push(s)}});var c=l.length;return n.mutate({trans:s,type:"put",keys:l,values:u,updates:{keys:r,changeSpecs:i}}).then(function(e){var n=e.numFailures,r=e.failures;if(0===n)return c;for(var i=0,s=Object.keys(r);i<s.length;i++){var a,l=s[i],u=o[Number(l)];null!=u&&(a=r[l],delete r[l],r[u]=a)}throw new q("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(c," operations failed"),r)})})})},pt.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,i=e.lastResult;if(e=e.failures,0===r)return i;throw new q("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)})},pt);function pt(){}function ft(e){function t(t,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return n[t].subscribe.apply(null,o),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=a;for(var r=1,i=arguments.length;r<i;++r)a(arguments[r]);return t;function a(e,r,i){if("object"!=typeof e){var l;r=r||ne;var u={subscribers:[],fire:i=i||Z,subscribe:function(e){-1===u.subscribers.indexOf(e)&&(u.subscribers.push(e),u.fire=r(u.fire,e))},unsubscribe:function(e){u.subscribers=u.subscribers.filter(function(t){return t!==e}),u.fire=u.subscribers.reduce(r,i)}};return n[e]=t[e]=u}o(l=e).forEach(function(e){var t=l[e];if(s(t))a(e,l[e][0],l[e][1]);else{if("asap"!==t)throw new G.InvalidArgument("Invalid event config");var n=a(e,X,function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){w(function(){e.apply(null,t)})})})}})}}function mt(e,t){return f(t).from({prototype:e}),t}function gt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function yt(e,t){e.filter=ot(e.filter,t)}function vt(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return ot(r(),t())}:t,e.justLimit=n&&!r}function bt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new G.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function wt(e,t,n){var r=bt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function St(e,t,n,r){var i=e.replayFilter?ot(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},s=function(e,n,r){var s,a;i&&!i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||("[object ArrayBuffer]"==(a=""+(s=n.primaryKey))&&(a=""+new Uint8Array(s)),c(o,a)||(o[a]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),Ct(wt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return Ct(wt(e,r,n),ot(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function Ct(e,t,n,r){var i=Pe(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=Z},function(t){e.fail(t),n=Z})||i(e.value,e,function(e){return n=e}),n()})})}var kt=(xt.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var i=t.remove;if(s(i))return s(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if("number"==typeof i)return Number(e)-i;if("bigint"==typeof i)try{return BigInt(e)-i}catch(e){return BigInt(0)-i}throw new TypeError("Invalid subtrahend ".concat(i))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},xt);function xt(e){this["@@propmod"]=e}var It=(Ot.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Je.bind(null,n.error)):n.table._trans("readonly",e).then(t)},Ot.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Je.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Ot.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=ot(t.algorithm,e)},Ot.prototype._iterate=function(e,t){return St(this._ctx,e,t,this._ctx.table.core)},Ot.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&a(n,e),t._ctx=n,t},Ot.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ot.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return St(t,e,n,t.table.core)})},Ot.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(gt(n,!0))return r.count({trans:e,query:{index:bt(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return St(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},Ot.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){return ut(o(e,i),o(t,i))*s}return this.toArray(function(e){return e.sort(a)}).then(t)},Ot.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&>(n,!0)&&0<n.limit){var r=n.valueMapper,i=bt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){return e=e.result,r?e.map(r):e})}var o=[];return St(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},Ot.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,gt(t)?vt(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):vt(t,function(){var t=e;return function(){return--t<0}})),this},Ot.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),vt(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},Ot.prototype.until=function(e,t){return yt(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},Ot.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},Ot.prototype.last=function(e){return this.reverse().first(e)},Ot.prototype.filter=function(e){var t;return yt(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=ot(t.isMatch,e),this},Ot.prototype.and=function(e){return this.filter(e)},Ot.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Ot.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ot.prototype.desc=function(){return this.reverse()},Ot.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},Ot.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Ot.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},Ot.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},Ot.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&>(t,!0)&&0<t.limit)return this._read(function(e){var n=bt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},Ot.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Ot.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},Ot.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Ot.prototype.distinct=function(){var e;if(!(e=(e=this._ctx).index&&e.table.schema.idxByName[e.index])||!e.multi)return this;var t={};return yt(this._ctx,function(e){var n=e.primaryKey.toString();return e=c(t,n),t[n]=!0,!e}),this},Ot.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var i,s,a;a="function"==typeof e?e:(i=o(e),s=i.length,function(t){for(var n=!1,r=0;r<s;++r){var o=i[r],a=e[o],l=S(t,o);a instanceof kt?(C(t,o,a.execute(l)),n=!0):l!==a&&(C(t,o,a),n=!0)}return n});var l,u=n.table.core,c=(l=u.schema.primaryKey).outbound,h=l.extractKey,d=200;function p(e,t){var n=t.failures;t=t.numFailures,m+=e-t;for(var r=0,i=o(n);r<i.length;r++){var s=i[r];f.push(n[s])}}(l=t.db._options.modifyChunkSize)&&(d="object"==typeof l?l[u.name]||l["*"]||200:l);var f=[],m=0,g=[];return t.clone().primaryKeys().then(function(t){function i(n){var s=Math.min(d,t.length-n);return u.getMany({trans:r,keys:t.slice(n,n+s),cache:"immutable"}).then(function(l){for(var f=[],m=[],g=c?[]:null,y=[],v=0;v<s;++v){var b=l[v],w={value:_(b),primKey:t[n+v]};!1!==a.call(w,w.value,w)&&(null==w.value?y.push(t[n+v]):c||0===ut(h(b),h(w.value))?(m.push(w.value),c&&g.push(t[n+v])):(y.push(t[n+v]),f.push(w.value)))}return Promise.resolve(0<f.length&&u.mutate({trans:r,type:"add",values:f}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);p(f.length,e)})).then(function(){return(0<m.length||o&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:g,values:m,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<n}).then(function(e){return p(m.length,e)})}).then(function(){return(0<y.length||o&&e===Et)&&u.mutate({trans:r,type:"delete",keys:y,criteria:o,isAdditionalChunk:0<n}).then(function(e){return p(y.length,e)})}).then(function(){return t.length>n+s&&i(n+d)})})}var o=gt(n)&&n.limit===1/0&&("function"!=typeof e||e===Et)&&{index:n.index,range:n.range};return i(0).then(function(){if(0<f.length)throw new z("Error modifying one or more objects",f,m,g);return t.length})})})},Ot.prototype.delete=function(){var e=this._ctx,t=e.range;return gt(e)&&(e.isPrimKey||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then(function(e){var n=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new z("Could not delete some values",Object.keys(n).map(function(e){return n[e]}),t-e);return t-e})})}):this.modify(Et)},Ot);function Ot(){}var Et=function(e,t){return t.value=null};function Rt(e,t){return e<t?-1:e===t?0:1}function _t(e,t){return t<e?-1:e===t?0:1}function At(e,t,n){return(e=e instanceof Dt?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function Mt(e){return new e.Collection(e,function(){return Pt("")}).limit(0)}function Tt(e,t,n,r){var i,o,s,a,l,u,c,h=n.length;if(!n.every(function(e){return"string"==typeof e}))return At(e,et);function d(e){i="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},o="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?Rt:_t;var t=n.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return s(e.lower,t.lower)});a=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),c="next"===(u=e)?"":r}d("next"),(e=new e.Collection(e,function(){return Nt(a[0],l[h-1]+r)}))._ondirectionchange=function(e){d(e)};var p=0;return e._addAlgorithm(function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var d=o(i);if(t(d,l,p))return!0;for(var f=null,m=p;m<h;++m){var g=function(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,l=0;l<s;++l){var u=t[l];if(u!==r[l])return i(e[l],n[l])<0?e.substr(0,l)+n[l]+n.substr(l+1):i(e[l],r[l])<0?e.substr(0,l)+r[l]+n.substr(l+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[l],u)<0&&(a=l)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}(i,d,a[m],l[m],s,u);null===g&&null===f?p=m+1:(null===f||0<s(f,g))&&(f=g)}return n(null!==f?function(){e.continue(f+c)}:r),!1}),e}function Nt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Pt(e){return{type:1,lower:e,upper:e}}var Dt=(Object.defineProperty(Lt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Lt.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Mt(this):new this.Collection(this,function(){return Nt(e,t,!n,!r)})}catch(e){return At(this,Qe)}},Lt.prototype.equals=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Pt(e)})},Lt.prototype.above=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(e,void 0,!0)})},Lt.prototype.aboveOrEqual=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(e,void 0,!1)})},Lt.prototype.below=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(void 0,e,!1,!0)})},Lt.prototype.belowOrEqual=function(e){return null==e?At(this,Qe):new this.Collection(this,function(){return Nt(void 0,e)})},Lt.prototype.startsWith=function(e){return"string"!=typeof e?At(this,et):this.between(e,e+$e,!0,!0)},Lt.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Tt(this,function(e,t){return 0===e.indexOf(t[0])},[e],$e)},Lt.prototype.equalsIgnoreCase=function(e){return Tt(this,function(e,t){return e===t[0]},[e],"")},Lt.prototype.anyOfIgnoreCase=function(){var e=L.apply(D,arguments);return 0===e.length?Mt(this):Tt(this,function(e,t){return-1!==t.indexOf(e)},e,"")},Lt.prototype.startsWithAnyOfIgnoreCase=function(){var e=L.apply(D,arguments);return 0===e.length?Mt(this):Tt(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,$e)},Lt.prototype.anyOf=function(){var e=this,t=L.apply(D,arguments),n=this._cmp;try{t.sort(n)}catch(r){return At(this,Qe)}if(0===t.length)return Mt(this);var r=new this.Collection(this,function(){return Nt(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var s=e.key;0<n(s,t[i]);)if(++i===t.length)return r(o),!1;return 0===n(s,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},Lt.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Lt.prototype.noneOf=function(){var e=L.apply(D,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return At(this,Qe)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Lt.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,s=this._min,a=this._max;if(0===e.length)return Mt(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0}))return At(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",G.InvalidArgument);var l,u=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers,h=i;function d(e,t){return h(e[0],t[0])}try{(l=e.reduce(function(e,t){for(var n=0,i=e.length;n<i;++n){var o=e[n];if(r(t[0],o[1])<0&&0<r(t[1],o[0])){o[0]=s(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return At(this,Qe)}var p=0,f=c?function(e){return 0<i(e,l[p][1])}:function(e){return 0<=i(e,l[p][1])},m=u?function(e){return 0<o(e,l[p][0])}:function(e){return 0<=o(e,l[p][0])},g=f;return(e=new this.Collection(this,function(){return Nt(l[0][0],l[l.length-1][1],!u,!c)}))._ondirectionchange=function(e){h="next"===e?(g=f,i):(g=m,o),l.sort(d)},e._addAlgorithm(function(e,t,r){for(var o,s=e.key;g(s);)if(++p===l.length)return t(r),!1;return!f(o=s)&&!m(o)||(0===n._cmp(s,l[p][1])||0===n._cmp(s,l[p][0])||t(function(){h===i?e.continue(l[p][0]):e.continue(l[p][1])}),!1)}),e},Lt.prototype.startsWithAnyOf=function(){var e=L.apply(D,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?Mt(this):this.inAnyRange(e.map(function(e){return[e,e+$e]})):At(this,"startsWithAnyOf() only works with strings")},Lt);function Lt(){}function Bt(e){return Pe(function(t){return Ft(t),e(t.target.error),!1})}function Ft(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var jt="storagemutated",Kt="x-storagemutated-1",Ut=ft(null,jt),zt=(qt.prototype._lock=function(){return b(!ve.global),++this._reculock,1!==this._reculock||ve.global||(ve.lockOwnerFor=this),this},qt.prototype._unlock=function(){if(b(!ve.global),0==--this._reculock)for(ve.global||(ve.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{Ye(e[1],e[0])}catch(e){}}return this},qt.prototype._locked=function(){return this._reculock&&ve.lockOwnerFor!==this},qt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new G.DatabaseClosed(r);case"MissingAPIError":throw new G.MissingAPI(r.message,r);default:throw new G.OpenFailed(r)}if(!this.active)throw new G.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Pe(function(n){Ft(n),t._reject(e.error)}),e.onabort=Pe(function(n){Ft(n),t.active&&t._reject(new G.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=Pe(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Ut.storagemutated.fire(e.mutatedParts)}),this},qt.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Je(new G.ReadOnly("Transaction is readonly"));if(!this.active)return Je(new G.TransactionInactive);if(this._locked())return new Ce(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},ve])});if(n)return Ue(function(){var e=new Ce(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new Ce(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},qt.prototype._root=function(){return this.parent?this.parent._root():this},qt.prototype.waitFor=function(e){var t,n=this._root(),r=Ce.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}());var i=n._waitingFor;return new Ce(function(e,t){r.then(function(t){return n._waitingQueue.push(Pe(e.bind(null,t)))},function(e){return n._waitingQueue.push(Pe(t.bind(null,e)))}).finally(function(){n._waitingFor===i&&(n._waitingFor=null)})})},qt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new G.Abort))},qt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(c(t,e))return t[e];var n=this.schema[e];if(!n)throw new G.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},qt);function qt(){}function Vt(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Wt(t)}}function Wt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Gt(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e},{}))};var r}var Ht=function(e){try{return e.only([[]]),Ht=function(){return[[]]},[[]]}catch(e){return Ht=function(){return $e},$e}};function Yt(e){return null==e?function(){}:"string"==typeof e?1===(t=e).split(".").length?function(e){return e[t]}:function(e){return S(e,t)}:function(t){return S(t,e)};var t}function Zt(e){return[].slice.call(e)}var Xt=0;function Jt(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function $t(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,i=e.lowerOpen;return e=e.upperOpen,void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n=e.name;return{name:n,schema:e,mutate:function(e){var t=e.trans,i=e.type,o=e.keys,s=e.values,a=e.range;return new Promise(function(e,l){e=Pe(e);var u=t.objectStore(n),c=null==u.keyPath,h="put"===i||"add"===i;if(!h&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var d,p=(o||s||{length:1}).length;if(o&&s&&o.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function f(e){++y,Ft(e)}var m=[],g=[],y=0;if("deleteRange"===i){if(4===a.type)return e({numFailures:y,failures:g,results:[],lastResult:void 0});3===a.type?m.push(d=u.clear()):m.push(d=u.delete(r(a)))}else{var v=(c=h?c?[s,o]:[s,null]:[o,null])[0],b=c[1];if(h)for(var w=0;w<p;++w)m.push(d=b&&void 0!==b[w]?u[i](v[w],b[w]):u[i](v[w])),d.onerror=f;else for(w=0;w<p;++w)m.push(d=u[i](v[w])),d.onerror=f}function S(t){t=t.target.result,m.forEach(function(e,t){return null!=e.error&&(g[t]=e.error)}),e({numFailures:y,failures:g,results:"delete"===i?o:m.map(function(e){return e.result}),lastResult:t})}d.onerror=function(e){f(e),S(e)},d.onsuccess=S})},getMany:function(e){var t=e.trans,r=e.keys;return new Promise(function(e,i){e=Pe(e);for(var o,s=t.objectStore(n),a=r.length,l=new Array(a),u=0,c=0,h=function(t){t=t.target,l[t._pos]=t.result,++c===u&&e(l)},d=Bt(i),p=0;p<a;++p)null!=r[p]&&((o=s.get(r[p]))._pos=p,o.onsuccess=h,o.onerror=d,++u);0===u&&e(l)})},get:function(e){var t=e.trans,r=e.key;return new Promise(function(e,i){e=Pe(e);var o=t.objectStore(n).get(r);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Bt(i)})},query:(t=c,function(e){return new Promise(function(i,o){i=Pe(i);var s,a,l,u=e.trans,c=e.values,h=e.limit,d=e.query,p=h===1/0?void 0:h,f=d.index;if(d=d.range,u=u.objectStore(n),f=f.isPrimaryKey?u:u.index(f.name),d=r(d),0===h)return i({result:[]});t?((p=c?f.getAll(d,p):f.getAllKeys(d,p)).onsuccess=function(e){return i({result:e.target.result})},p.onerror=Bt(o)):(s=0,a=!c&&"openKeyCursor"in f?f.openKeyCursor(d):f.openCursor(d),l=[],a.onsuccess=function(e){var t=a.result;return t?(l.push(c?t.value:t.primaryKey),++s===h?i({result:l}):void t.continue()):i({result:l})},a.onerror=Bt(o))})}),openCursor:function(e){var t=e.trans,i=e.values,o=e.query,s=e.reverse,a=e.unique;return new Promise(function(e,l){e=Pe(e);var u=o.index,c=o.range,h=t.objectStore(n),d=(h=u.isPrimaryKey?h:h.index(u.name),u=s?a?"prevunique":"prev":a?"nextunique":"next",!i&&"openKeyCursor"in h?h.openKeyCursor(r(c),u):h.openCursor(r(c),u));d.onerror=Bt(l),d.onsuccess=Pe(function(n){var r,i,o,s,a=d.result;a?(a.___id=++Xt,a.done=!1,r=a.continue.bind(a),i=(i=a.continuePrimaryKey)&&i.bind(a),o=a.advance.bind(a),s=function(){throw new Error("Cursor not stopped")},a.trans=t,a.stop=a.continue=a.continuePrimaryKey=a.advance=function(){throw new Error("Cursor not started")},a.fail=Pe(l),a.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},a.start=function(e){function t(){if(d.result)try{e()}catch(e){a.fail(e)}else a.done=!0,a.start=function(){throw new Error("Cursor behind last entry")},a.stop()}var n=new Promise(function(e,t){e=Pe(e),d.onerror=Bt(t),a.fail=t,a.stop=function(t){a.stop=a.continue=a.continuePrimaryKey=a.advance=s,e(t)}});return d.onsuccess=Pe(function(e){d.onsuccess=t,t()}),a.continue=r,a.continuePrimaryKey=i,a.advance=o,t(),n},e(a)):e(null)},l)})},count:function(e){var t=e.query,i=e.trans,o=t.index,s=t.range;return new Promise(function(e,t){var a=i.objectStore(n),l=o.isPrimaryKey?a:a.index(o.name);(l=(a=r(s))?l.count(a):l.count()).onsuccess=Pe(function(t){return e(t.target.result)}),l.onerror=Bt(t)})}}}var o,a,l,u=(a=n,l=Zt((o=e).objectStoreNames),{schema:{name:o.name,tables:l.map(function(e){return a.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),i={};return n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Yt(t)},indexes:Zt(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry;return e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:Yt(e)},i[Jt(e)]=r}),getIndexByKeyPath:function(e){return i[Jt(e)]}},i[":id"]=n.primaryKey,null!=t&&(i[Jt(t)]=n.primaryKey),n})},hasGetAll:0<l.length&&"getAll"in a.objectStore(l[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),c=(n=u.schema,u.hasGetAll),h=(u=n.tables.map(i),{});return u.forEach(function(e){return h[e.name]=e}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!h[e])throw new Error("Table '".concat(e,"' not found"));return h[e]},MIN_KEY:-1/0,MAX_KEY:Ht(t),schema:n}}function Qt(e,n,r,i){var o=r.IDBKeyRange;return r.indexedDB,{dbcore:(i=$t(n,o,i),e.dbcore.reduce(function(e,n){return n=n.create,t(t({},e),n(e))},i))}}function en(e,t){var n=t.db;t=Qt(e._middlewares,n,e._deps,t),e.core=t.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function tn(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=function e(t,n){return m(t,n)||(t=l(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){d(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function nn(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function rn(e,t){return e._cfg.version-t._cfg.version}function on(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains("$meta")&&!i.$meta&&(i.$meta=Gt("$meta",pn("")[0],[]),e._storeNames.push("$meta"));var s=e._createTransaction("readwrite",e._storeNames,i);s.create(n),s._completion.catch(r);var a=s._reject.bind(s),l=ve.transless||ve;Ue(function(){return ve.trans=s,ve.transless=l,0!==t?(en(e,n),u=t,((r=s).storeNames.includes("$meta")?r.table("$meta").get("version").then(function(e){return null!=e?e:u}):Ce.resolve(u)).then(function(t){return i=t,a=s,l=n,u=[],t=(r=e)._versions,c=r._dbSchema=hn(0,r.idbdb,l),0!==(t=t.filter(function(e){return e._cfg.version>=i})).length?(t.forEach(function(e){u.push(function(){var t=c,n=e._cfg.dbschema;dn(r,t,l),dn(r,n,l),c=r._dbSchema=n;var s=an(t,n);s.add.forEach(function(e){ln(l,e[0],e[1].primKey,e[1].indexes)}),s.change.forEach(function(e){if(e.recreate)throw new G.Upgrade("Not yet support for changing primary key");var t=l.objectStore(e.name);e.add.forEach(function(e){return cn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),cn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var u=e._cfg.contentUpgrade;if(u&&e._cfg.version>i){en(r,l),a._memoizedTables={};var h=k(n);s.del.forEach(function(e){h[e]=t[e]}),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],o(h),h),a.schema=h;var d,p=B(u);return p&&ze(),s=Ce.follow(function(){var e;(d=u(a))&&p&&(e=qe.bind(null,null),d.then(e,e))}),d&&"function"==typeof d.then?Ce.resolve(d):s.then(function(){return d})}}),u.push(function(t){var n,i,o=e._cfg.dbschema;n=o,i=t,[].slice.call(i.db.objectStoreNames).forEach(function(e){return null==n[e]&&i.db.deleteObjectStore(e)}),nn(r,[r.Transaction.prototype]),tn(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),a.schema=r._dbSchema}),u.push(function(t){r.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore("$meta"),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter(function(e){return"$meta"!==e})):t.objectStore("$meta").put(e._cfg.version,"version"))})}),function e(){return u.length?Ce.resolve(u.shift()(a.idbtrans)).then(e):Ce.resolve()}().then(function(){un(c,l)})):Ce.resolve();var r,i,a,l,u,c}).catch(a)):(o(i).forEach(function(e){ln(n,e,i[e].primKey,i[e].indexes)}),en(e,n),void Ce.follow(function(){return e.on.populate.fire(s)}).catch(a));var r,u})}function sn(e,t){un(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=hn(0,e.idbdb,t);dn(e,e._dbSchema,t);for(var r=0,i=an(n,e._dbSchema).change;r<i.length;r++){var o=function(e){if(e.change.length||e.recreate)return{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(e){cn(n,e)})}(i[r]);if("object"==typeof o)return o.value}}function an(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var s={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto)s.recreate=!0,r.change.push(s);else{var a=i.idxByName,l=o.idxByName,u=void 0;for(u in a)l[u]||s.del.push(u);for(u in l){var c=a[u],h=l[u];c?c.src!==h.src&&s.change.push(h):s.add.push(h)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,o])}return r}function ln(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return cn(i,e)}),i}function un(e,t){o(e).forEach(function(n){t.db.objectStoreNames.contains(n)||ln(t,n,e[n].primKey,e[n].indexes)})}function cn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function hn(e,t,n){var r={};return y(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=Vt(Wt(a=t.keyPath),a||"",!0,!1,!!t.autoIncrement,a&&"string"!=typeof a,!0),o=[],s=0;s<t.indexNames.length;++s){var a=(l=t.index(t.indexNames[s])).keyPath,l=Vt(l.name,a,!!l.unique,!!l.multiEntry,!1,a&&"string"!=typeof a,!1);o.push(l)}r[e]=Gt(e,i,o)}),r}function dn(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var s=r[o],a=n.objectStore(s);e._hasGetAll="getAll"in a;for(var l=0;l<a.indexNames.length;++l){var u=a.indexNames[l],c=a.index(u).keyPath,h="string"==typeof c?c:"["+y(c).join("+")+"]";!t[s]||(c=t[s].idxByName[h])&&(c.name=u,delete t[s].idxByName[h],t[s].idxByName[u]=c)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function pn(e){return e.split(",").map(function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Vt(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(r),0===t)})}var fn=(mn.prototype._parseStoresSpec=function(e,t){o(e).forEach(function(n){if(null!==e[n]){var r=pn(e[n]),i=r.shift();if(i.unique=!0,i.multi)throw new G.Schema("Primary key cannot be multi-valued");r.forEach(function(e){if(e.auto)throw new G.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new G.Schema("Index must have a name and cannot be an empty string")}),t[n]=Gt(n,i,r)}})},mn.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?a(this._cfg.storesSource,e):e,e=t._versions;var n={},r={};return e.forEach(function(e){a(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,nn(t,[t._allTables,t,t.Transaction.prototype]),tn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],o(r),r),t._storeNames=o(r),this},mn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=re(this._cfg.contentUpgrade||Z,e),this},mn);function mn(){}function gn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new tr(nt,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function yn(e){return e&&"function"==typeof e.databases}function vn(e){return Ue(function(){return ve.letThrough=!0,e()})}function bn(e){return!("from"in e)}var wn=function(e,t){if(!this){var n=new wn;return e&&"d"in e&&a(n,e),n}a(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function Sn(e,t,n){var r=ut(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(bn(e))return a(e,{from:t,to:n,d:1});var i=e.l;if(r=e.r,ut(n,e.from)<0)return i?Sn(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},In(e);if(0<ut(t,e.to))return r?Sn(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},In(e);ut(t,e.from)<0&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<ut(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,i&&!e.l&&Cn(e,i),r&&n&&Cn(e,r)}}function Cn(e,t){bn(t)||function e(t,n){var r=n.from,i=n.to,o=n.l;n=n.r,Sn(t,r,i),o&&e(t,o),n&&e(t,n)}(e,t)}function kn(e,t){var n=xn(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=xn(e),s=o.next(i.from),a=s.value;!r.done&&!s.done;){if(ut(a.from,i.to)<=0&&0<=ut(a.to,i.from))return!0;ut(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}function xn(e){var t=bn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ut(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ut(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function In(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1<i?"r":i<-1?"l":"";o&&(n="r"==o?"l":"r",r=t({},e),i=e[o],e.from=i.from,e.to=i.to,e[o]=i[o],r[o]=i[n],(e[n]=r).d=On(r)),e.d=On(e)}function On(e){var t=e.r;return e=e.l,(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function En(e,t){return o(t).forEach(function(n){e[n]?Cn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)c(t,n)&&(r=t[n],i[n]=!r||"object"!=typeof r||E.has(r.constructor)?r:e(r));return i}(t[n])}),e}function Rn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&kn(t[n],e[n])})}h(wn.prototype,((F={add:function(e){return Cn(this,e),this},addKey:function(e){return Sn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return Sn(t,e,e)}),this},hasKey:function(e){var t=xn(this).next(e).value;return t&&ut(t.from,e)<=0&&0<=ut(t.to,e)}})[T]=function(){return xn(this)},F));var _n={},An={},Mn=!1;function Tn(e){En(An,e),Mn||(Mn=!0,setTimeout(function(){Mn=!1,Nn(An,!(An={}))},0))}function Nn(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(_n);r<i.length;r++)Pn(s=i[r],e,n,t);else for(var o in e){var s,a=/^idb\:\/\/(.*)\/(.*)\//.exec(o);a&&(o=a[1],a=a[2],(s=_n["idb://".concat(o,"/").concat(a)])&&Pn(s,e,n,t))}n.forEach(function(e){return e()})}function Pn(e,t,n,r){for(var i=[],o=0,s=Object.entries(e.queries.query);o<s.length;o++){for(var a=s[o],l=a[0],u=[],c=0,h=a[1];c<h.length;c++){var d=h[c];Rn(t,d.obsSet)?d.subscribers.forEach(function(e){return n.add(e)}):r&&u.push(d)}r&&i.push([l,u])}if(r)for(var p=0,f=i;p<f.length;p++){var m=f[p];l=m[0],u=m[1],e.queries.query[l]=u}}function Dn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?Je(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,i=Math.round(10*e.verno),s=!1;function a(){if(t.openCanceller!==r)throw new G.DatabaseClosed("db.open() was cancelled")}function l(){return new Ce(function(r,u){if(a(),!n)throw new G.MissingAPI;var c=e.name,p=t.autoSchema||!i?n.open(c):n.open(c,i);if(!p)throw new G.MissingAPI;p.onerror=Bt(u),p.onblocked=Pe(e._fireOnBlocked),p.onupgradeneeded=Pe(function(r){var i;h=p.transaction,t.autoSchema&&!e._options.allowEmptyDB?(p.onerror=Ft,h.abort(),p.result.close(),(i=n.deleteDatabase(c)).onsuccess=i.onerror=Pe(function(){u(new G.NoSuchDatabase("Database ".concat(c," doesnt exist")))})):(h.onerror=Bt(u),r=r.oldVersion>Math.pow(2,62)?0:r.oldVersion,d=r<1,e.idbdb=p.result,s&&sn(e,h),on(e,r/10,h,u))},u),p.onsuccess=Pe(function(){h=null;var n,a,u,f,m,g=e.idbdb=p.result,v=y(g.objectStoreNames);if(0<v.length)try{var b=g.transaction(1===(f=v).length?f[0]:f,"readonly");if(t.autoSchema)a=g,u=b,(n=e).verno=a.version/10,u=n._dbSchema=hn(0,a,u),n._storeNames=y(a.objectStoreNames,0),tn(n,[n._allTables],o(u),u);else if(dn(e,e._dbSchema,b),((m=an(hn(0,(m=e).idbdb,b),m._dbSchema)).add.length||m.change.some(function(e){return e.add.length||e.change.length}))&&!s)return g.close(),i=g.version+1,s=!0,r(l());en(e,b)}catch(n){}tt.push(e),g.onversionchange=Pe(function(n){t.vcFired=!0,e.on("versionchange").fire(n)}),g.onclose=Pe(function(t){e.on("close").fire(t)}),d&&(m=e._deps,b=c,g=m.indexedDB,m=m.IDBKeyRange,yn(g)||b===nt||gn(g,m).put({name:b}).catch(Z)),r()},u)}).catch(function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,l();break;case"VersionError":if(0<i)return i=0,l()}return Ce.reject(e)})}var u,c=t.dbReadyResolve,h=null,d=!1;return Ce.race([r,("undefined"==typeof navigator?Ce.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}u=setInterval(t,100),t()}).finally(function(){return clearInterval(u)}):Promise.resolve()).then(l)]).then(function(){return a(),t.onReadyBeingFired=[],Ce.resolve(vn(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(re,Z);return t.onReadyBeingFired=[],Ce.resolve(vn(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{h&&h.abort()}catch(n){}return r===t.openCanceller&&e._close(),Je(n)}).finally(function(){t.openComplete=!0,c()}).then(function(){var t;return d&&(t={},e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new wn(-1/0,[[[]]]))}),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new wn(-1/0,[[[]]])}),Ut(jt).fire(t),Nn(t,!0)),e})}function Ln(e){function t(t){return e.next(t)}var n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var i=e(t);return t=i.value,i.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return i(t)()}function Bn(e,t,n){for(var r=s(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Fn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),i=r.schema,o={},s=[];function a(e,n,r){var i=Jt(e),l=o[i]=o[i]||[],u=null==e?0:"string"==typeof e?1:e.length,c=0<n;return c=t(t({},r),{name:c?"".concat(i,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:c,keyTail:n,keyLength:u,extractKey:Yt(e),unique:!c&&r.unique}),l.push(c),c.isPrimaryKey||s.push(c),1<u&&a(2===u?e[0]:e.slice(0,u-1),n+1,r),l.sort(function(e,t){return e.keyTail-t.keyTail}),c}n=a(i.primaryKey.keyPath,0,i.primaryKey),o[":id"]=[n];for(var l=0,u=i.indexes;l<u.length;l++){var c=u[l];a(c.keyPath,0,c)}function h(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:1===r.type?2:r.type,lower:Bn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Bn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},i),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=o[Jt(e)])&&e[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,s=n.keyLength;return o?r.openCursor(h(t)).then(function(e){return e&&a(e)}):r.openCursor(t);function a(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(Bn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Bn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}}})}})}};function jn(e,t,n,r){return n=n||{},r=r||"",o(e).forEach(function(i){var o,s,a;c(t,i)?(o=e[i],s=t[i],"object"==typeof o&&"object"==typeof s&&o&&s?(a=M(o))!==M(s)?n[r+i]=t[i]:"Object"===a?jn(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i]):o!==s&&(n[r+i]=t[i])):n[r+i]=void 0}),o(t).forEach(function(i){c(e,i)||(n[r+i]=t[i])}),n}function Kn(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var Un={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var i=e.table(n),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans,a=s.table(n).hook,l=a.deleting,u=a.creating,h=a.updating;switch(e.type){case"add":if(u.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"put":if(u.fire===Z&&h.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"delete":if(l.fire===Z)break;return s._promise("readwrite",function(){return d(e)},!0);case"deleteRange":if(l.fire===Z)break;return s._promise("readwrite",function(){return function e(n,r,s){return i.query({trans:n,values:!1,query:{index:o,range:r},limit:s}).then(function(i){var o=i.result;return d({type:"delete",keys:o,trans:n}).then(function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):o.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:o[o.length-1],lowerOpen:!0}),s)})})}(e.trans,e.range,1e4)},!0)}return i.mutate(e);function d(e){var n,s,a,d=ve.trans,p=e.keys||Kn(o,e);if(!p)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:p}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),n=i,a=p,("add"===(s=e).type?Promise.resolve([]):n.getMany({trans:s.trans,keys:a,cache:"immutable"})).then(function(t){var n=p.map(function(n,r){var i,s,a,p=t[r],f={onerror:null,onsuccess:null};return"delete"===e.type?l.fire.call(f,n,p,d):"add"===e.type||void 0===p?(i=u.fire.call(f,n,e.values[r],d),null==n&&null!=i&&(e.keys[r]=n=i,o.outbound||C(e.values[r],o.keyPath,n))):(i=jn(p,e.values[r]),(s=h.fire.call(f,i,n,p,d))&&(a=e.values[r],Object.keys(s).forEach(function(e){c(a,e)?a[e]=s[e]:C(a,e,s[e])}))),f});return i.mutate(e).then(function(r){for(var i=r.failures,o=r.results,s=r.numFailures,a=(r=r.lastResult,0);a<p.length;++a){var l=(o||p)[a],u=n[a];null==l?u.onerror&&u.onerror(i[a]):u.onsuccess&&u.onsuccess("put"===e.type&&t[a]?e.values[a]:l)}return{failures:i,results:o,numFailures:s,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}}})}})}};function zn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)0===ut(t.keys[i],e[o])&&(r.push(n?_(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}var qn={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=zn(e.keys,e.trans._cache,"clone"===e.cache);return t?Ce.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?_(t):t},t})},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function Vn(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function Wn(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Gn={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new wn(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(ve.subscr&&"readonly"!==n)throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ve.querier));return e.transaction(t,n,r)},table:function(i){var a=e.table(i),l=a.schema,u=l.primaryKey,c=l.indexes,h=u.extractKey,d=u.outbound,p=u.autoIncrement&&c.filter(function(e){return e.compound&&e.keyPath.includes(u.keyPath)}),f=t(t({},a),{mutate:function(t){function o(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),m[e]||(m[e]=new wn)}var c,h,d,f=t.trans,m=t.mutatedParts||(t.mutatedParts={}),g=o(""),y=o(":dels"),v=t.type,b="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[Kn(u,t).filter(function(e){return e}),t.values]:[],w=b[0],S=b[1];return b=t.trans._cache,s(w)?(g.addKeys(w),(b="delete"===v||w.length===S.length?zn(w,b):null)||y.addKeys(w),(b||S)&&(c=o,h=b,d=S,l.indexes.forEach(function(e){var t=c(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach(function(e){return t.addKey(e)}):t.addKey(n)}(h||d).forEach(function(e,t){var i=h&&n(h[t]);0!==ut(i,t=d&&n(d[t]))&&(null!=i&&r(i),null!=t&&r(t))})}))):w?(S={from:null!==(S=w.lower)&&void 0!==S?S:e.MIN_KEY,to:null!==(S=w.upper)&&void 0!==S?S:e.MAX_KEY},y.add(S),g.add(S)):(g.add(r),y.add(r),l.indexes.forEach(function(e){return o(e.name).add(r)})),a.mutate(t).then(function(e){return!w||"add"!==t.type&&"put"!==t.type||(g.addKeys(e.results),p&&p.forEach(function(n){for(var r=t.values.map(function(e){return n.extractKey(e)}),i=n.keyPath.findIndex(function(e){return e===u.keyPath}),s=0,a=e.results.length;s<a;++s)r[s][i]=e.results[s];o(n.name).addKeys(r)})),f.mutatedParts=En(f.mutatedParts||{},m),e})}}),m=(c=function(t){t=(n=t.query).index;var n=n.range;return[t,new wn(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},{get:function(e){return[u,new wn(e.key)]},getMany:function(e){return[u,(new wn).addKeys(e.keys)]},count:c,query:c,openCursor:c});return o(m).forEach(function(e){f[e]=function(o){var s=!!(f=ve.subscr),l=Vn(ve,a)&&Wn(e,o)?o.obsSet={}:f;if(s){var u=function(e){return e="idb://".concat(n,"/").concat(i,"/").concat(e),l[e]||(l[e]=new wn)},c=u(""),p=u(":dels"),f=(s=(f=m[e](o))[0],f[1]);if(("query"===e&&s.isPrimaryKey&&!o.values?p:u(s.name||"")).add(f),!s.isPrimaryKey){if("count"!==e){var g="query"===e&&d&&o.values&&a.query(t(t({},o),{values:!1}));return a[e].apply(this,arguments).then(function(t){if("query"===e){if(d&&o.values)return g.then(function(e){return e=e.result,c.addKeys(e),t});var n=o.values?t.result.map(h):t.result;(o.values?c:p).addKeys(n)}else if("openCursor"===e){var r=t,i=o.values;return r&&Object.create(r,{key:{get:function(){return p.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return p.addKey(e),e}},value:{get:function(){return i&&c.addKey(r.primaryKey),r.value}}})}return t})}p.add(r)}}return a[e].apply(this,arguments)}}),f}})}};function Hn(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var i=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===i?null:(n=t({},n),s(n.keys)&&(n.keys=n.keys.filter(function(e,t){return!(t in r.failures)})),"values"in n&&s(n.values)&&(n.values=n.values.filter(function(e,t){return!(t in r.failures)})),n)}function Yn(e,t){return n=e,(void 0===(r=t).lower||(r.lowerOpen?0<ut(n,r.lower):0<=ut(n,r.lower)))&&(void 0===t.upper||(t.upperOpen?ut(e,t.upper)<0:ut(e,t.upper)<=0));var n,r}function Zn(e,t,n,r,i,o){if(!n||0===n.length)return e;var a=t.query.index,l=a.multiEntry,u=t.query.range,c=r.schema.primaryKey.extractKey,h=a.extractKey,d=(a.lowLevelIndex||a).extractKey;return n=n.reduce(function(e,n){var r=e,i=[];if("add"===n.type||"put"===n.type)for(var o=new wn,a=n.values.length-1;0<=a;--a){var d,p=n.values[a],f=c(p);o.hasKey(f)||(d=h(p),(l&&s(d)?d.some(function(e){return Yn(e,u)}):Yn(d,u))&&(o.addKey(f),i.push(p)))}switch(n.type){case"add":var m=(new wn).addKeys(t.values?e.map(function(e){return c(e)}):e);r=e.concat(t.values?i.filter(function(e){return e=c(e),!m.hasKey(e)&&(m.addKey(e),!0)}):i.map(function(e){return c(e)}).filter(function(e){return!m.hasKey(e)&&(m.addKey(e),!0)}));break;case"put":var g=(new wn).addKeys(n.values.map(function(e){return c(e)}));r=e.filter(function(e){return!g.hasKey(t.values?c(e):e)}).concat(t.values?i:i.map(function(e){return c(e)}));break;case"delete":var y=(new wn).addKeys(n.keys);r=e.filter(function(e){return!y.hasKey(t.values?c(e):e)});break;case"deleteRange":var v=n.range;r=e.filter(function(e){return!Yn(c(e),v)})}return r},e),n===e?e:(n.sort(function(e,t){return ut(d(e),d(t))||ut(c(e),c(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(i.dirty=!0)),o?Object.freeze(n):n)}function Xn(e,t){return 0===ut(e.lower,t.lower)&&0===ut(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function Jn(e,t){return function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=ut(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return-1}return t}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return-1;if(0===(t=ut(e,t))){if(n&&r)return 0;if(n)return-1;if(r)return 1}return t}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function $n(e,t,n,r){e.subscribers.add(n),r.addEventListener("abort",function(){var r,i;e.subscribers.delete(n),0===e.subscribers.size&&(r=e,i=t,setTimeout(function(){0===r.subscribers.size&&P(i,r)},3e3))})}var Qn={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var o,s,a=e.transaction(t,r,i);return"readwrite"===r&&(s=(o=new AbortController).signal,i=function(i){return function(){if(o.abort(),"readwrite"===r){for(var s=new Set,l=0,u=t;l<u.length;l++){var c=u[l],h=_n["idb://".concat(n,"/").concat(c)];if(h){var d=e.table(c),p=h.optimisticOps.filter(function(e){return e.trans===a});if(a._explicit&&i&&a.mutatedParts)for(var f=0,m=Object.values(h.queries.query);f<m.length;f++)for(var g=0,y=(w=m[f]).slice();g<y.length;g++)Rn((S=y[g]).obsSet,a.mutatedParts)&&(P(w,S),S.subscribers.forEach(function(e){return s.add(e)}));else if(0<p.length){h.optimisticOps=h.optimisticOps.filter(function(e){return e.trans!==a});for(var v=0,b=Object.values(h.queries.query);v<b.length;v++)for(var w,S,C,k=0,x=(w=b[v]).slice();k<x.length;k++)null!=(S=x[k]).res&&a.mutatedParts&&(i&&!S.dirty?(C=Object.isFrozen(S.res),C=Zn(S.res,S.req,p,d,S,C),S.dirty?(P(w,S),S.subscribers.forEach(function(e){return s.add(e)})):C!==S.res&&(S.res=C,S.promise=Ce.resolve({result:C}))):(S.dirty&&P(w,S),S.subscribers.forEach(function(e){return s.add(e)})))}}}s.forEach(function(e){return e()})}}},a.addEventListener("abort",i(!1),{signal:s}),a.addEventListener("error",i(!1),{signal:s}),a.addEventListener("complete",i(!0),{signal:s})),a},table:function(r){var i=e.table(r),o=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var s=ve.trans;if(o.outbound||"disabled"===s.db._options.cache||s.explicit||"readwrite"!==s.idbtrans.mode)return i.mutate(e);var a=_n["idb://".concat(n,"/").concat(r)];return a?(s=i.mutate(e),"add"!==e.type&&"put"!==e.type||!(50<=e.values.length||Kn(o,e).some(function(e){return null==e}))?(a.optimisticOps.push(e),e.mutatedParts&&Tn(e.mutatedParts),s.then(function(t){0<t.numFailures&&(P(a.optimisticOps,e),(t=Hn(0,e,t))&&a.optimisticOps.push(t),e.mutatedParts&&Tn(e.mutatedParts))}),s.catch(function(){P(a.optimisticOps,e),e.mutatedParts&&Tn(e.mutatedParts)})):s.then(function(n){var r=Hn(0,t(t({},e),{values:e.values.map(function(e,r){var i;return n.failures[r]||C(e=null!==(i=o.keyPath)&&void 0!==i&&i.includes(".")?_(e):t({},e),o.keyPath,n.results[r]),e})}),n);a.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&Tn(e.mutatedParts)})}),s):i.mutate(e)},query:function(e){if(!Vn(ve,i)||!Wn("query",e))return i.query(e);var t="immutable"===(null===(a=ve.trans)||void 0===a?void 0:a.db._options.cache),o=(u=ve).requery,s=u.signal,a=function(e,t,n,r){var i=_n["idb://".concat(e,"/").concat(t)];if(!i)return[];if(!(t=i.queries[n]))return[null,!1,i,null];var o=t[(r.query?r.query.index.name:null)||""];if(!o)return[null,!1,i,null];switch(n){case"query":var s=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&Xn(e.req.query.range,r.query.range)});return s?[s,!0,i,o]:[o.find(function(e){return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&Jn(e.req.query.range,r.query.range)}),!1,i,o];case"count":return s=o.find(function(e){return Xn(e.req.query.range,r.query.range)}),[s,!!s,i,o]}}(n,r,"query",e),l=a[0],u=a[1],c=a[2],h=a[3];return l&&u?l.obsSet=e.obsSet:(u=i.query(e).then(function(e){var n=e.result;if(l&&(l.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}else e.result=_(n);return e}).catch(function(e){return h&&l&&P(h,l),Promise.reject(e)}),l={obsSet:e.obsSet,promise:u,subscribers:new Set,type:"query",req:e,dirty:!1},h?h.push(l):(h=[l],(c=c||(_n["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=h)),$n(l,h,o,s),l.promise.then(function(n){return{result:Zn(n.result,e,null==c?void 0:c.optimisticOps,i,l,t)}})}})}})}};function er(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var tr=(nr.prototype.version=function(e){if(isNaN(e)||e<.1)throw new G.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new G.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(rn),n.stores({}),this._state.autoSchema=!1,n)},nr.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||ve.letThrough||this._vip)?e():new Ce(function(e,n){if(t._state.openComplete)return n(new G.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new G.DatabaseClosed);t.open().catch(Z)}t._state.dbReadyPromise.then(e,n)}).then(e)},nr.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;return i&&this.unuse({stack:t,name:i}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:i}),e.sort(function(e,t){return e.level-t.level}),this},nr.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},nr.prototype.open=function(){var e=this;return Ye(ye,function(){return Dn(e)})},nr.prototype._close=function(){var e=this._state,t=tt.indexOf(this);if(0<=t&&tt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new Ce(function(t){e.dbReadyResolve=t}),e.openCanceller=new Ce(function(t,n){e.cancelOpen=n}))},nr.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen;e=this._state,t?(e.isBeingOpened&&e.cancelOpen(new G.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new G.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nr.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new Ce(function(i,o){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=Pe(function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,yn(r)||n===nt||gn(r,e).delete(n).catch(Z),i()}),n.onerror=Bt(o),n.onblocked=t._fireOnBlocked}if(n)throw new G.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()})},nr.prototype.backendDB=function(){return this.idbdb},nr.prototype.isOpen=function(){return null!==this.idbdb},nr.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nr.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nr.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nr.prototype,"tables",{get:function(){var e=this;return o(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),nr.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new G.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,I(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},nr.prototype._transaction=function(e,t,n){var r=this,i=ve.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,s,a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map(function(e){if("string"!=typeof(e=e instanceof r.Table?e.name:e))throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==e||e===rt)o=rt;else{if("rw"!=e&&e!=it)throw new G.InvalidArgument("Invalid transaction mode: "+e);o=it}if(i){if(i.mode===rt&&o===it){if(!a)throw new G.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach(function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new G.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(n){return i?i._promise(null,function(e,t){t(n)}):Je(n)}var l=function e(t,n,r,i,o){return Ce.resolve().then(function(){var s=ve.transless||ve,a=t._createTransaction(n,r,t._dbSchema,i);if(a.explicit=!0,s={trans:a,transless:s},i)a.idbtrans=i.idbtrans;else try{a.create(),a.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(s){return s.name===V.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,o)})):Je(s)}var l,u=B(o);return u&&ze(),s=Ce.follow(function(){var e;(l=o.call(a,a))&&(u?(e=qe.bind(null,null),l.then(e,e)):"function"==typeof l.next&&"function"==typeof l.throw&&(l=Ln(l)))},s),(l&&"function"==typeof l.then?Ce.resolve(l).then(function(e){return a.active?e:Je(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):s.then(function(){return l})).then(function(e){return i&&a._resolve(),a._completion.then(function(){return e})}).catch(function(e){return a._reject(e),Je(e)})})}.bind(null,this,o,s,i,n);return i?i._promise(o,l,"lock"):ve.trans?Ye(ve.transless,function(){return r._whenReady(l)}):this._whenReady(l)},nr.prototype.table=function(e){if(!c(this._allTables,e))throw new G.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nr);function nr(e,n){var r=this;this._middlewares={},this.verno=0;var i=nr.dependencies;this._options=n=t({addons:nr.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},i=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var o,s,a,l,u,c={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Z,dbReadyPromise:null,cancelOpen:Z,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};c.dbReadyPromise=new Ce(function(e){c.dbReadyResolve=e}),c.openCanceller=new Ce(function(e,t){c.cancelOpen=t}),this._state=c,this.name=e,this.on=ft(this,"populate","blocked","versionchange","close",{ready:[re,Z]}),this.on.ready.subscribe=v(this.on.ready.subscribe,function(e){return function(t,n){nr.vip(function(){var i,o=r._state;o.openComplete?(o.dbOpenError||Ce.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),i=r,n||e(function e(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(e)}))})}}),this.Collection=(o=this,mt(It.prototype,function(e,t){this.db=o;var n=st,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx;e=(t=i.table).hook.reading.fire,this._ctx={table:t,index:i.index,isPrimKey:!i.index||t.schema.primKey.keyPath&&i.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:e!==X?e:null}})),this.Table=(s=this,mt(dt.prototype,function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:ft(null,{creating:[Q,Z],reading:[J,X],updating:[te,Z],deleting:[ee,Z]})})),this.Transaction=(a=this,mt(zt.prototype,function(e,t,n,r,i){var o=this;this.db=a,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=ft(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ce(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),Je(e)})})),this.Version=(l=this,mt(fn.prototype,function(e){this.db=l,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(u=this,mt(Dt.prototype,function(e,t,n){if(this.db=u,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=ut,this._descending=function(e,t){return ut(t,e)},this._max=function(e,t){return 0<ut(e,t)?e:t},this._min=function(e,t){return ut(e,t)<0?e:t},this._IDBKeyRange=u._deps.IDBKeyRange,!this._IDBKeyRange)throw new G.MissingAPI})),this.on("versionchange",function(e){e.newVersion,r.close({disableAutoOpen:!1})}),this.on("blocked",function(e){!e.newVersion||(e.newVersion,e.oldVersion)}),this._maxKey=Ht(n.IDBKeyRange),this._createTransaction=function(e,t,n,i){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,i)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),tt.filter(function(e){return e.name===r.name&&e!==r&&!e._state.vcFired}).map(function(t){return t.on("versionchange").fire(e)})},this.use(qn),this.use(Qn),this.use(Gn),this.use(Fn),this.use(Un);var h=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return er(r.table(e),h)};var i=Reflect.get(e,t,n);return i instanceof dt?er(i,h):"tables"===t?i.map(function(e){return er(e,h)}):"_createTransaction"===t?function(){return er(i.apply(this,arguments),h)}:i}});this.vip=h,i.forEach(function(e){return e(r)})}F="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";var rr,ir=(or.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},or.prototype[F]=function(){return this},or);function or(e){this._subscribe=e}try{rr={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch(O){rr={indexedDB:null,IDBKeyRange:null}}function sr(e){var t,n=!1,r=new ir(function(r){var i,o=B(e),s=!1,a={},l={},u={get closed(){return s},unsubscribe:function(){s||(s=!0,i&&i.abort(),h&&Ut.storagemutated.unsubscribe(p))}};r.start&&r.start(u);var h=!1,d=function(){return Xe(f)},p=function(e){En(a,e),Rn(l,a)&&d()},f=function(){var u,f,m;!s&&rr.indexedDB&&(a={},u={},i&&i.abort(),i=new AbortController,m=function(t){var n=Ae();try{o&&ze();var r=Ue(e,t);return r=o?r.finally(qe):r}finally{n&&Me()}}(f={subscr:u,signal:i.signal,requery:d,querier:e,trans:null}),Promise.resolve(m).then(function(e){n=!0,t=e,s||f.signal.aborted||(a={},function(e){for(var t in e)if(c(e,t))return;return 1}(l=u)||h||(Ut(jt,p),h=!0),Xe(function(){return!s&&r.next&&r.next(e)}))},function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||Xe(function(){s||r.error&&r.error(e)})}))};return setTimeout(d,0),u});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var ar=tr;function lr(e){var t=cr;try{cr=!0,Ut.storagemutated.fire(e),Nn(e,!0)}finally{cr=t}}h(ar,t(t({},Y),{delete:function(e){return new ar(e,{addons:[]}).delete()},exists:function(e){return new ar(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return n=(t=ar.dependencies).indexedDB,t=t.IDBKeyRange,(yn(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==nt})}):gn(n,t).toCollection().primaryKeys()).then(e)}catch(e){return Je(new G.MissingAPI)}var t,n},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return ve.trans?Ye(ve.transless,e):e()},vip:vn,async:function(e){return function(){try{var t=Ln(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Ce.resolve(t)}catch(t){return Je(t)}}},spawn:function(e,t,n){try{var r=Ln(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Ce.resolve(r)}catch(e){return Je(e)}},currentTransaction:{get:function(){return ve.trans||null}},waitFor:function(e,t){return t=Ce.resolve("function"==typeof e?ar.ignoreTransaction(e):e).timeout(t||6e4),ve.trans?ve.trans.waitFor(t):t},Promise:Ce,debug:{get:function(){return ie},set:function(e){oe(e)}},derive:f,extend:a,props:h,override:v,Events:ft,on:Ut,liveQuery:sr,extendObservabilitySet:En,getByKeyPath:S,setByKeyPath:C,delByKeyPath:function(e,t){"string"==typeof t?C(e,t,void 0):"length"in t&&[].map.call(t,function(t){C(e,t,void 0)})},shallowClone:k,deepClone:_,getObjectDiff:jn,cmp:ut,asap:w,minKey:-1/0,addons:[],connections:tt,errnames:V,dependencies:rr,cache:_n,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),ar.maxKey=Ht(ar.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Ut(jt,function(e){cr||(e=new CustomEvent(Kt,{detail:e}),cr=!0,dispatchEvent(e),cr=!1)}),addEventListener(Kt,function(e){e=e.detail,cr||lr(e)}));var ur,cr=!1,hr=function(){};return"undefined"!=typeof BroadcastChannel&&((hr=function(){(ur=new BroadcastChannel(Kt)).onmessage=function(e){return e.data&&lr(e.data)}})(),"function"==typeof ur.unref&&ur.unref(),Ut(jt,function(e){cr||ur.postMessage(e)})),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",function(e){if(!tr.disableBfCache&&e.persisted){null!=ur&&ur.close();for(var t=0,n=tt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!tr.disableBfCache&&e.persisted&&(hr(),lr({all:new wn(-1/0,[[]])}))})),Ce.rejectionMapper=function(e,t){return!e||e instanceof K||e instanceof TypeError||e instanceof SyntaxError||!e.name||!H[e.name]?e:(t=new H[e.name](t||e.message,e),"stack"in e&&p(t,"stack",{get:function(){return this.inner.stack}}),t)},oe(ie),t(tr,Object.freeze({__proto__:null,Dexie:tr,liveQuery:sr,Entity:lt,cmp:ut,PropModification:kt,replacePrefix:function(e,t){return new kt({replacePrefix:[e,t]})},add:function(e){return new kt({add:e})},remove:function(e){return new kt({remove:e})},default:tr,RangeSet:wn,mergeRanges:Cn,rangesOverlap:kn}),{default:tr}),tr}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return function(){"use strict";const e="betterbugs-sdk-main",t="STEPS_FEATURE_CLICK_EVENT",r="STEPS_FEATURE_NAVIGATE_EVENT",i="STEPS_FEATURE_TYPED_EVENT",o="STEPS_FEATURE_PRESSED_EVENT",s="STEPS_FEATURE_SCROLL_EVENT";let a=!1;function l(e){a=e}function u(){return a}try{window.setBetterBugsLogging=l}catch(e){globalThis.setBetterBugsLogging=l}try{window.getBetterBugsLogging=u}catch(e){globalThis.getBetterBugsLogging=u}const c={sample(e,t,...n){if(h(n)){}},log:(...e)=>{h(e)},warn:(...e)=>{if(h(e)){}},error:(...e)=>{if(h(e)){}},info:(...e)=>{if(h(e)){}},debug:(...e)=>{h(e)},group:(...e)=>{h(e)},groupCollapsed:(...e)=>{h(e)},groupEnd:(...e)=>{h(e)}};function h(e){return a&&function(e){try{if(!("localStorage"in globalThis)||!globalThis.localStorage.debug)return!0}catch(e){return!0}if("string"!=typeof e[0]||"string"!=typeof globalThis.localStorage.debug)return!0;const t=e[0],n=globalThis.localStorage.debug.replace("*",".*");return new RegExp("^"+n).test(t)}(e)}var d,p="user-agent",f="",m="function",g="undefined",y="object",v="string",b="browser",w="cpu",S="device",C="engine",k="os",x="result",I="name",O="type",E="vendor",R="version",_="architecture",A="major",M="model",T="console",N="mobile",P="tablet",D="smarttv",L="wearable",B="xr",F="embedded",j="inapp",K="brands",U="formFactors",z="fullVersionList",q="platform",V="platformVersion",W="bitness",G="sec-ch-ua",H=G+"-full-version-list",Y=G+"-arch",Z=G+"-"+W,X=G+"-form-factors",J=G+"-"+N,$=G+"-"+M,Q=G+"-"+q,ee=Q+"-version",te=[K,z,N,M,q,V,_,U,W],ne="Amazon",re="Apple",ie="ASUS",oe="BlackBerry",se="Google",ae="Huawei",le="Lenovo",ue="Honor",ce="LG",he="Microsoft",de="Motorola",pe="Nvidia",fe="OnePlus",me="OPPO",ge="Samsung",ye="Sharp",ve="Sony",be="Xiaomi",we="Zebra",Se="Chrome",Ce="Chromium",ke="Chromecast",xe="Firefox",Ie="Opera",Oe="Facebook",Ee="Sogou",Re="Mobile ",_e=" Browser",Ae="Windows",Me=typeof window!==g&&window.navigator?window.navigator:void 0,Te=Me&&Me.userAgentData?Me.userAgentData:void 0,Ne=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Pe=function(e,t){if(typeof e===y&&e.length>0){for(var n in e)if(Fe(e[n])==Fe(t))return!0;return!1}return!!Le(e)&&-1!==Fe(t).indexOf(Fe(e))},De=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||!!t&&De(e[n])},Le=function(e){return typeof e===v},Be=function(e){if(e){for(var t=[],n=Ue(/\\?\"/g,e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var i=qe(n[r]).split(";v=");t[r]={brand:i[0],version:i[1]}}else t[r]=qe(n[r]);return t}},Fe=function(e){return Le(e)?e.toLowerCase():e},je=function(e){return Le(e)?Ue(/[^\d\.]/g,e).split(".")[0]:void 0},Ke=function(e){for(var t in e){var n=e[t];typeof n==y&&2==n.length?this[n[0]]=n[1]:this[n]=void 0}return this},Ue=function(e,t){return Le(t)?t.replace(e,f):t},ze=function(e){return Ue(/\\?\"/g,e)},qe=function(e,t){if(Le(e))return e=Ue(/^\s\s*/,e),typeof t===g?e:e.substring(0,500)},Ve=function(e,t){if(e&&t)for(var n,r,i,o,s,a,l=0;l<t.length&&!s;){var u=t[l],c=t[l+1];for(n=r=0;n<u.length&&!s&&u[n];)if(s=u[n++].exec(e))for(i=0;i<c.length;i++)a=s[++r],typeof(o=c[i])===y&&o.length>0?2===o.length?typeof o[1]==m?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:3===o.length?typeof o[1]!==m||o[1].exec&&o[1].test?this[o[0]]=a?a.replace(o[1],o[2]):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0:4===o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;l+=2}},We=function(e,t){for(var n in t)if(typeof t[n]===y&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Pe(t[n][r],e))return"?"===n?void 0:n}else if(Pe(t[n],e))return"?"===n?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},Ge={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},He={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ye={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[R,[I,Re+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[R,[I,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[I,R],[/opios[\/ ]+([\w\.]+)/i],[R,[I,Ie+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[R,[I,Ie+" GX"]],[/\bopr\/([\w\.]+)/i],[R,[I,Ie]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[R,[I,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[R,[I,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[I,R],[/quark(?:pc)?\/([-\w\.]+)/i],[R,[I,"Quark"]],[/\bddg\/([\w\.]+)/i],[R,[I,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[R,[I,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[R,[I,"WeChat"]],[/konqueror\/([\w\.]+)/i],[R,[I,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[R,[I,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[R,[I,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[R,[I,"Smart "+le+_e]],[/(avast|avg)\/([\w\.]+)/i],[[I,/(.+)/,"$1 Secure"+_e],R],[/\bfocus\/([\w\.]+)/i],[R,[I,xe+" Focus"]],[/\bopt\/([\w\.]+)/i],[R,[I,Ie+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[R,[I,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[R,[I,"Dolphin"]],[/coast\/([\w\.]+)/i],[R,[I,Ie+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[R,[I,"MIUI"+_e]],[/fxios\/([\w\.-]+)/i],[R,[I,Re+xe]],[/\bqihoobrowser\/?([\w\.]*)/i],[R,[I,"360"]],[/\b(qq)\/([\w\.]+)/i],[[I,/(.+)/,"$1Browser"],R],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[I,/(.+)/,"$1"+_e],R],[/samsungbrowser\/([\w\.]+)/i],[R,[I,ge+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[R,[I,Ee+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[I,Ee+" Mobile"],R],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[I,R],[/(lbbrowser|rekonq)/i],[I],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[R,I],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[I,Oe],R,[O,j]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[I,R,[O,j]],[/\bgsa\/([\w\.]+) .*safari\//i],[R,[I,"GSA"],[O,j]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[R,[I,"TikTok"],[O,j]],[/\[(linkedin)app\]/i],[I,[O,j]],[/(chromium)[\/ ]([-\w\.]+)/i],[I,R],[/headlesschrome(?:\/([\w\.]+)| )/i],[R,[I,Se+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[I,Se+" WebView"],R],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[R,[I,"Android"+_e]],[/chrome\/([\w\.]+) mobile/i],[R,[I,Re+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[I,R],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[R,[I,Re+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[I,Re+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[R,I],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[I,[R,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[I,R],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[I,Re+xe],R],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[I,"Netscape"],R],[/(wolvic|librewolf)\/([\w\.]+)/i],[I,R],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[R,[I,xe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[I,[R,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[I,[R,/[^\d\.]+./,f]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,f,Fe]],[/ sun4\w[;\)]/i],[[_,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,Fe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[M,[E,ge],[O,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[M,[E,ge],[O,N]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[M,[E,re],[O,N]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[M,[E,re],[O,P]],[/(macintosh);/i],[M,[E,re]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[M,[E,ye],[O,N]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[M,[E,ue],[O,P]],[/honor([-\w ]+)[;\)]/i],[M,[E,ue],[O,N]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[M,[E,ae],[O,P]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[M,[E,ae],[O,N]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[M,/_/g," "],[E,be],[O,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[M,/_/g," "],[E,be],[O,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[M,[E,me],[O,N]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[M,[E,We,{OnePlus:["304","403","203"],"*":me}],[O,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[M,[E,"BLU"],[O,N]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[M,[E,"Vivo"],[O,N]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[M,[E,"Realme"],[O,N]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[M,[E,de],[O,N]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[M,[E,de],[O,P]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[M,[E,ce],[O,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[M,[E,ce],[O,N]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[M,[E,le],[O,P]],[/(nokia) (t[12][01])/i],[E,M,[O,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[M,/_/g," "],[O,N],[E,"Nokia"]],[/(pixel (c|tablet))\b/i],[M,[E,se],[O,P]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[M,[E,se],[O,N]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[M,[E,ve],[O,N]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[M,"Xperia Tablet"],[E,ve],[O,P]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[M,[E,fe],[O,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[M,[E,ne],[O,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[M,/(.+)/g,"Fire Phone $1"],[E,ne],[O,N]],[/(playbook);[-\w\),; ]+(rim)/i],[M,E,[O,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[M,[E,oe],[O,N]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[M,[E,ie],[O,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[M,[E,ie],[O,N]],[/(nexus 9)/i],[M,[E,"HTC"],[O,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[M,/_/g," "],[O,N]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[M,[E,"TCL"],[O,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[M,[E,"TCL"],[O,N]],[/(itel) ((\w+))/i],[[E,Fe],M,[O,We,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[M,[E,"Acer"],[O,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[M,[E,"Meizu"],[O,N]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[M,[E,"Ulefone"],[O,N]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[M,[E,"Energizer"],[O,N]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[M,[E,"Cat"],[O,N]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[M,[E,"Smartfren"],[O,N]],[/droid.+; (a(?:015|06[35]|142p?))/i],[M,[E,"Nothing"],[O,N]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[M,[E,"Archos"],[O,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[M,[E,"Archos"],[O,N]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[E,M,[O,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[E,M,[O,N]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[E,M,[O,P]],[/(surface duo)/i],[M,[E,he],[O,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[M,[E,"Fairphone"],[O,N]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[M,[E,pe],[O,P]],[/(sprint) (\w+)/i],[E,M,[O,N]],[/(kin\.[onetw]{3})/i],[[M,/\./g," "],[E,he],[O,N]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[M,[E,we],[O,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[M,[E,we],[O,N]],[/smart-tv.+(samsung)/i],[E,[O,D]],[/hbbtv.+maple;(\d+)/i],[[M,/^/,"SmartTV"],[E,ge],[O,D]],[/tcast.+(lg)e?. ([-\w]+)/i],[E,M,[O,D]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,ce],[O,D]],[/(apple) ?tv/i],[E,[M,re+" TV"],[O,D]],[/crkey.*devicetype\/chromecast/i],[[M,ke+" Third Generation"],[E,se],[O,D]],[/crkey.*devicetype\/([^/]*)/i],[[M,/^/,"Chromecast "],[E,se],[O,D]],[/fuchsia.*crkey/i],[[M,ke+" Nest Hub"],[E,se],[O,D]],[/crkey/i],[[M,ke],[E,se],[O,D]],[/(portaltv)/i],[M,[E,Oe],[O,D]],[/droid.+aft(\w+)( bui|\))/i],[M,[E,ne],[O,D]],[/(shield \w+ tv)/i],[M,[E,pe],[O,D]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[M,[E,ye],[O,D]],[/(bravia[\w ]+)( bui|\))/i],[M,[E,ve],[O,D]],[/(mi(tv|box)-?\w+) bui/i],[M,[E,be],[O,D]],[/Hbbtv.*(technisat) (.*);/i],[E,M,[O,D]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,qe],[M,qe],[O,D]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[M,[O,D]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[O,D]],[/(ouya)/i,/(nintendo) (\w+)/i],[E,M,[O,T]],[/droid.+; (shield)( bui|\))/i],[M,[E,pe],[O,T]],[/(playstation \w+)/i],[M,[E,ve],[O,T]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[M,[E,he],[O,T]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[M,[E,ge],[O,L]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[E,M,[O,L]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[M,[E,me],[O,L]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[M,[E,re],[O,L]],[/(opwwe\d{3})/i],[M,[E,fe],[O,L]],[/(moto 360)/i],[M,[E,de],[O,L]],[/(smartwatch 3)/i],[M,[E,ve],[O,L]],[/(g watch r)/i],[M,[E,ce],[O,L]],[/droid.+; (wt63?0{2,3})\)/i],[M,[E,we],[O,L]],[/droid.+; (glass) \d/i],[M,[E,se],[O,B]],[/(pico) (4|neo3(?: link|pro)?)/i],[E,M,[O,B]],[/(quest( \d| pro)?s?).+vr/i],[M,[E,Oe],[O,B]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[O,F]],[/(aeobc)\b/i],[M,[E,ne],[O,F]],[/(homepod).+mac os/i],[M,[E,re],[O,F]],[/windows iot/i],[[O,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[M,[O,We,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[O,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[O,N]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[M,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[R,[I,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[I,R],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[R,[I,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[I,R],[/ladybird\//i],[[I,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[R,I]],os:[[/microsoft (windows) (vista|xp)/i],[I,R],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[I,[R,We,Ge]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[R,We,Ge],[I,Ae]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[R,/_/g,"."],[I,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[I,"macOS"],[R,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[R,[I,ke+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[R,[I,ke+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[R,[I,ke+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[R,[I,ke+" Linux"]],[/crkey\/([\d\.]+)/i],[R,[I,ke]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[R,I],[/(ubuntu) ([\w\.]+) like android/i],[[I,/(.+)/,"$1 Touch"],R],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[I,R],[/\(bb(10);/i],[R,[I,oe]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[R,[I,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[R,[I,xe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[R,[I,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[R,[I,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[I,"Chrome OS"],R],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[I,R],[/(sunos) ?([\w\.\d]*)/i],[[I,"Solaris"],R],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[I,R]]},Ze=(Ke.call((d={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}}).init,[[b,[I,R,A,O]],[w,[_]],[S,[O,M,E]],[C,[I,R]],[k,[I,R]]]),Ke.call(d.isIgnore,[[b,[R,A]],[C,[R]],[k,[R]]]),Ke.call(d.isIgnoreRgx,[[b,/ ?browser$/i],[k,/ ?os$/i]]),Ke.call(d.toString,[[b,[I,R]],[w,[_]],[S,[E,M]],[C,[I,R]],[k,[I,R]]]),d),Xe=function(e,t){var n=Ze.init[t],r=Ze.isIgnore[t]||0,i=Ze.isIgnoreRgx[t]||0,o=Ze.toString[t]||0;function s(){Ke.call(this,n)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return Te?Te.getHighEntropyValues(te).then(function(t){return e.setCH(new Je(t,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=x&&(s.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Pe(r,n)&&Fe(i?Ue(i,this[n]):this[n])==Fe(i?Ue(i,e):e)){if(t=!0,e!=g)break}else if(e==g&&t){t=!t;break}return t},s.prototype.toString=function(){var e=f;for(var t in o)typeof this[o[t]]!==g&&(e+=(e?" ":f)+this[o[t]]);return e||g}),Te||(s.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:s.prototype.is,toString:s.prototype.toString};var r=new n;return e(r),r}),new s};function Je(e,t){if(e=e||{},Ke.call(this,te),t)Ke.call(this,[[K,Be(e[G])],[z,Be(e[H])],[N,/\?1/.test(e[J])],[M,ze(e[$])],[q,ze(e[Q])],[V,ze(e[ee])],[_,ze(e[Y])],[U,Be(e[X])],[W,ze(e[Z])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==g&&(this[n]=e[n])}function $e(e,t,n,r){return this.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},this.set=function(e,t){return this.data[e]=t,this},this.setCH=function(e){return this.uaCH=e,this},this.detectFeature=function(){if(Me&&Me.userAgent==this.ua)switch(this.itemType){case b:Me.brave&&typeof Me.brave.isBrave==m&&this.set(I,"Brave");break;case S:!this.get(O)&&Te&&Te[N]&&this.set(O,N),"Macintosh"==this.get(M)&&Me&&typeof Me.standalone!==g&&Me.maxTouchPoints&&Me.maxTouchPoints>2&&this.set(M,"iPad").set(O,P);break;case k:!this.get(I)&&Te&&Te[q]&&this.set(I,Te[q]);break;case x:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(b,t(b)).set(w,t(w)).set(S,t(S)).set(C,t(C)).set(k,t(k))}return this},this.parseUA=function(){return this.itemType!=x&&Ve.call(this.data,this.ua,this.rgxMap),this.itemType==b&&this.set(A,je(this.get(R))),this},this.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case b:case C:var n,r=e[z]||e[K];if(r)for(var i in r){var o=r[i].brand||r[i],s=r[i].version;this.itemType!=b||/not.a.brand/i.test(o)||n&&(!/chrom/i.test(n)||o==Ce)||(o=We(o,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(I,o).set(R,s).set(A,je(s)),n=o),this.itemType==C&&o==Ce&&this.set(R,s)}break;case w:var a=e[_];a&&(a&&"64"==e[W]&&(a+="64"),Ve.call(this.data,a+";",t));break;case S:if(e[N]&&this.set(O,N),e[M]&&(this.set(M,e[M]),!this.get(O)||!this.get(E))){var l={};Ve.call(l,"droid 9; "+e[M]+")",t),!this.get(O)&&l.type&&this.set(O,l.type),!this.get(E)&&l.vendor&&this.set(E,l.vendor)}if(e[U]){var u;if("string"!=typeof e[U])for(var c=0;!u&&c<e[U].length;)u=We(e[U][c++],He);else u=We(e[U],He);this.set(O,u)}break;case k:var h=e[q];if(h){var d=e[V];h==Ae&&(d=parseInt(je(d),10)>=13?"11":"10"),this.set(I,h).set(R,d)}this.get(I)==Ae&&"Xbox"==e[M]&&this.set(I,"Xbox").set(R,void 0);break;case x:var p=this.data,f=function(t){return p[t].getItem().setCH(e).parseCH().get()};this.set(b,f(b)).set(w,f(w)).set(S,f(S)).set(C,f(C)).set(k,f(k))}return this},Ke.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",Xe(this,e)]]),this}function Qe(e,t,n){if(typeof e===y?(De(e,!0)?(typeof t===y&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e!==v||De(t,!0)||(n=t,t=void 0),n&&typeof n.append===m){var r={};n.forEach(function(e,t){r[t]=e}),n=r}if(!(this instanceof Qe))return new Qe(e,t,n).getResult();var i=typeof e===v?e:n&&n[p]?n[p]:Me&&Me.userAgent?Me.userAgent:f,o=new Je(n,!0),s=t?function(e,t){var n={},r=t;if(!De(t))for(var i in r={},t)for(var o in t[i])r[o]=t[i][o].concat(r[o]?r[o]:[]);for(var s in e)n[s]=r[s]&&r[s].length%2==0?r[s].concat(e[s]):e[s];return n}(Ye,t):Ye,a=function(e){return e==x?function(){return new $e(e,i,s,o).set("ua",i).set(b,this.getBrowser()).set(w,this.getCPU()).set(S,this.getDevice()).set(C,this.getEngine()).set(k,this.getOS()).get()}:function(){return new $e(e,i,s[e],o).parseUA().get()}};return Ke.call(this,[["getBrowser",a(b)],["getCPU",a(w)],["getDevice",a(S)],["getEngine",a(C)],["getOS",a(k)],["getResult",a(x)],["getUA",function(){return i}],["setUA",function(e){return Le(e)&&(i=e.length>500?qe(e,500):e),this}]]).setUA(i),this}Qe.VERSION="2.0.3",Qe.BROWSER=Ne([I,R,A,O]),Qe.CPU=Ne([_]),Qe.DEVICE=Ne([M,E,O,T,N,D,P,L,F]),Qe.ENGINE=Qe.OS=Ne([I,R]);const et=e=>{try{return JSON.parse(JSON.stringify(e))}catch(t){return e}},tt=()=>((new Date).getTime()/1e3|0).toString(16)+Math.floor(16777216*Math.random()).toString(16).padStart(6,"0")+Math.floor(65536*Math.random()).toString(16).padStart(4,"0")+Math.floor(16777216*Math.random()).toString(16).padStart(6,"0"),nt=(e,t=60)=>e&&e.length>t?`${e.substring(0,t-1)}...`:e,rt=(e,t)=>{let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}};const it=()=>(sessionStorage.getItem("tabId")||sessionStorage.setItem("tabId",tt()),sessionStorage.getItem("tabId")||"");var ot,st=Object.defineProperty,at=(e,t,n)=>((e,t,n)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),lt=Object.defineProperty,ut=(e,t,n)=>((e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),ct=(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))(ct||{});const ht={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},pt={};function ft(e){if(pt[e])return pt[e];const t=globalThis[e],n=t.prototype,r=e in ht?ht[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in dt?dt[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return pt[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?pt[e]=o:n}catch{return n}}const mt={};function gt(e,t,n){var r;const i=`${e}.${String(n)}`;if(mt[i])return mt[i].call(t);const o=ft(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(mt[i]=s,s.call(t)):t[n]}const yt={};function vt(e,t,n){const r=`${e}.${String(n)}`;if(yt[r])return yt[r].bind(t);const i=ft(e)[n];return"function"!=typeof i?t[n]:(yt[r]=i,i.bind(t))}const bt={childNodes:function(e){return gt("Node",e,"childNodes")},parentNode:function(e){return gt("Node",e,"parentNode")},parentElement:function(e){return gt("Node",e,"parentElement")},textContent:function(e){return gt("Node",e,"textContent")},contains:function(e,t){return vt("Node",e,"contains")(t)},getRootNode:function(e){return vt("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?gt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?gt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return gt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return gt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ft("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}};function wt(e){return e.nodeType===e.ELEMENT_NODE}function St(e){const t=e&&"host"in e&&"mode"in e&&bt.host(e)||null;return Boolean(t&&"shadowRoot"in t&&bt.shadowRoot(t)===e)}function Ct(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function kt(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const i=Array.from(n,e=>xt(e,r)).join("");return(t=i).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}catch(e){return null}var t}function xt(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=kt(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?Lt(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?Lt(n,t):n}}class It{constructor(){ut(this,"idNodeMap",new Map),ut(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ot(){return new It}function Et({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:o}){let s=i||"";const a=r&&Rt(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function Rt(e){return e.toLowerCase()}const _t="__rrweb_original__";function At(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Rt(t):null}function Mt(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Tt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nt=/^(?:[a-z+]+:)?\/\//i,Pt=/^www\..*/i,Dt=/^(data:)([^,]*),(.*)/i;function Lt(e,t){return(e||"").replace(Tt,(e,n,r,i,o,s)=>{const a=r||o||s,l=n||i||"";if(!a)return e;if(Nt.test(a)||Pt.test(a))return`url(${l}${a}${l})`;if(Dt.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`})}function Bt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ft(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),i=[];let o=0;if(r.length>1&&e&&"string"==typeof e){let t=Bt(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const l=Bt(r[a].textContent,n),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let h=l.substring(0,c),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==r[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&c>u){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=Bt(e).length;p=t.indexOf(h,n)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*r.length)return i.push(e),i;const l=Bt(e.substring(0,a),n);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}let jt=1;const Kt=new RegExp("[^a-z0-9-_:]");function Ut(){return jt++}let zt,qt;const Vt=/^[^ \t\n\r\u000c]+/,Wt=/^[, \t\n\r\u000c]+/;const Gt=new WeakMap;function Ht(e,t){return t&&""!==t.trim()?Zt(e,t):t}function Yt(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Zt(e,t){let n=Gt.get(e);if(n||(n=e.createElement("a"),Gt.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Xt(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?Ht(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(Wt),!(n>=t.length);){let o=r(Vt);if(","===o.slice(-1))o=Ht(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=Ht(e,o);let s=!1;for(;;){const e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?Lt(r,Zt(e)):"object"===t&&"data"===n?Ht(e,r):r:r}function Jt(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function $t(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&$t(bt.parentNode(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&$t(bt.parentNode(e),t,n)}function Qt(e,t,n,r){let i;if(wt(e)){if(i=e,!bt.childNodes(i).length)return!1}else{if(null===bt.parentElement(e))return!1;i=bt.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if($t(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function en(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:ct.Document,childNodes:[],compatMode:e.compatMode}:{type:ct.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ct.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Rt(e.tagName);return Kt.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const r=e.attributes[t];Jt(m,r.name,r.value)||(g[r.name]=Xt(n,m,Rt(r.name),r.value))}if("link"===m&&o){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=kt(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=kt(e.sheet);t&&(e.childNodes.length>1&&(t=Ft(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(m)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Et({element:e,type:At(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===m&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&c)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const i=t.getImageData,o=_t in i?i[_t]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&u){zt||(zt=n.createElement("canvas"),qt=zt.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),i=()=>{t.removeEventListener("load",i);try{zt.width=t.naturalWidth,zt.height=t.naturalHeight,qt.drawImage(t,0,0),g.rr_dataURL=zt.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(m)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==m||h(g.src)||(e.test||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(m)&&(v=!0)}catch(e){}return{type:ct.Element,tagName:m,attributes:g,childNodes:[],isSVG:Yt(e)||void 0,needBlock:f,rootId:p,isCustom:v}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:o}=t,s=bt.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=bt.textContent(e),u&&l&&(l=Lt(l,Zt(t.doc))));!u&&!c&&l&&n&&(l=r?r(l,bt.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:ct.Text,textContent:l||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:ct.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:ct.Comment,textContent:bt.textContent(e)||"",rootId:y};default:return!1}}function tn(e){return null==e?"":e.toLowerCase()}function nn(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function rn(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:k=!1,cssCaptured:x=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:O=!0}=t;if(!I){I=Qt(e,s,a,void 0===I)}const E=en(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:k,cssCaptured:x});if(!E)return null;let R;R=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===ct.Comment)return!0;if(e.type===ct.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Mt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(tn(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===tn(e.attributes.name)||"icon"===tn(e.attributes.rel)||"apple-touch-icon"===tn(e.attributes.rel)||"shortcut icon"===tn(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&tn(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(tn(e.attributes.property).match(/^(og|twitter|fb):/)||tn(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===tn(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===tn(e.attributes.name)||"googlebot"===tn(e.attributes.name)||"bingbot"===tn(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===tn(e.attributes.name)||"generator"===tn(e.attributes.name)||"framework"===tn(e.attributes.name)||"publisher"===tn(e.attributes.name)||"progid"===tn(e.attributes.name)||tn(e.attributes.property).match(/^article:/)||tn(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===tn(e.attributes.name)||"yandex-verification"===tn(e.attributes.name)||"csrf-token"===tn(e.attributes.name)||"p:domain_verify"===tn(e.attributes.name)||"verify-v1"===tn(e.attributes.name)||"verification"===tn(e.attributes.name)||"shopify-checkout-api-token"===tn(e.attributes.name)))return!0}}return!1}(E,p)||!O&&E.type===ct.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ut();const _=Object.assign(E,{id:R});if(r.add(e,_),-2===R)return null;y&&y(e);let A=!l;if(_.type===ct.Element){A=A&&!_.needBlock,delete _.needBlock;const t=bt.shadowRoot(e);t&&Ct(t)&&(_.isShadowHost=!0)}if((_.type===ct.Document||_.type===ct.Element)&&A){p.headWhitespace&&_.type===ct.Element&&"head"===_.tagName&&(O=!1);const t={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(_.type===ct.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===ct.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(bt.childNodes(e))){const e=rn(n,t);e&&_.childNodes.push(e)}}let k=null;if(wt(e)&&(k=bt.shadowRoot(e)))for(const e of Array.from(bt.childNodes(k))){const n=rn(e,t);n&&(Ct(k)&&(n.isShadow=!0),_.childNodes.push(n))}}const M=bt.parentNode(e);return M&&St(M)&&Ct(M)&&(_.isShadow=!0),_.type===ct.Element&&"iframe"===_.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"!==i){const r=setTimeout(()=>{o||(t(),o=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.test;if(t&&v){const n=rn(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});n&&v(e,n)}},b),_.type===ct.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===Mt(_.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(w){const t=rn(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&w(e,t)}},S),_}new RegExp(/(max|min)-device-(width|height)/.source,"g");function on(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var an={exports:{}},ln=String,un=function(){return{isColorSupported:!1,reset:ln,bold:ln,dim:ln,italic:ln,underline:ln,inverse:ln,hidden:ln,strikethrough:ln,black:ln,red:ln,green:ln,yellow:ln,blue:ln,magenta:ln,cyan:ln,white:ln,gray:ln,bgBlack:ln,bgRed:ln,bgGreen:ln,bgYellow:ln,bgBlue:ln,bgMagenta:ln,bgCyan:ln,bgWhite:ln}};an.exports=un(),an.exports.createColors=un;var cn=an.exports;const hn=sn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let dn=cn,pn=hn,fn=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=dn.isColorSupported),pn&&e&&(t=pn(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=dn.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var mn=fn;fn.default=fn;var gn={};gn.isClean=Symbol("isClean"),gn.my=Symbol("my");const yn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let vn=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return yn[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=yn[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 bn=vn;vn.default=vn;let wn=bn;function Sn(e,t){new wn(t).stringify(e)}var Cn=Sn;Sn.default=Sn;let{isClean:kn,my:xn}=gn,In=mn,On=bn,En=Cn;function Rn(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>Rn(e,n)):("object"===o&&null!==i&&(i=Rn(i)),n[r]=i)}return n}let _n=class{constructor(e={}){this.raws={},this[kn]=!1,this[xn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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=Rn(this);for(let n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new In(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[kn]){this[kn]=!1;let e=this;for(;e=e.parent;)e[kn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},n=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new On).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=En){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var An=_n;_n.default=_n;let Mn=An,Tn=class extends Mn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Nn=Tn;Tn.default=Tn;var Pn={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:Dn,SourceMapGenerator:Ln}=hn,{existsSync:Bn,readFileSync:Fn}=hn,{dirname:jn,join:Kn}=hn;let Un=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=jn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Dn(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=jn(e),Bn(e))return this.mapFile=e,Fn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Dn)return Ln.fromSourceMap(t).toString();if(t instanceof Ln)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Kn(jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var zn=Un;Un.default=Un;let{SourceMapConsumer:qn,SourceMapGenerator:Vn}=hn,{fileURLToPath:Wn,pathToFileURL:Gn}=hn,{isAbsolute:Hn,resolve:Yn}=hn,{nanoid:Zn}=Pn,Xn=hn,Jn=mn,$n=zn,Qn=Symbol("fromOffsetCache"),er=Boolean(qn&&Vn),tr=Boolean(Yn&&Hn),nr=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!tr||/^\w+:\/\//.test(t.from)||Hn(t.from)?this.file=t.from:this.file=Yn(t.from)),tr&&er){let e=new $n(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Zn(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new Jn(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Jn(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Gn&&(i.input.url=Gn(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Qn])n=this[Qn];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Qn]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Yn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=Hn(a.source)?Gn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Gn(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Wn)throw new Error("file: protocol is not available in this PostCSS build");l.file=Wn(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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 rr=nr;nr.default=nr,Xn&&Xn.registerInput&&Xn.registerInput(nr);let{SourceMapConsumer:ir,SourceMapGenerator:or}=hn,{dirname:sr,relative:ar,resolve:lr,sep:ur}=hn,{pathToFileURL:cr}=hn,hr=rr,dr=Boolean(ir&&or),pr=Boolean(sr&&lr&&ar&&ur);var fr=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||sr(e.file);!1===this.mapOpts.sourcesContent?(t=new ir(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),pr&&dr&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=or.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new or({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 or({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?sr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=sr(lr(n,this.mapOpts.annotation)));let r=ar(n,e);return this.memoizedPaths.set(e,r),r}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 hr(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,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(cr){let t=cr(e).toString();return this.memoizedFileURLs.set(e,t),t}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;"\\"===ur&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let mr=An,gr=class extends mr{constructor(e){super(e),this.type="comment"}};var yr=gr;gr.default=gr;let vr,br,wr,Sr,{isClean:Cr,my:kr}=gn,xr=Nn,Ir=yr,Or=An;function Er(e){return e.map(e=>(e.nodes&&(e.nodes=Er(e.nodes)),delete e.source,e))}function Rr(e){if(e[Cr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Rr(t)}let _r=class e extends Or{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Er(vr(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new xr(t)]}else if(t.selector)t=[new br(t)];else if(t.name)t=[new wr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ir(t)]}return t.map(t=>(t[kr]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Cr]&&Rr(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};_r.registerParse=e=>{vr=e},_r.registerRule=e=>{br=e},_r.registerAtRule=e=>{wr=e},_r.registerRoot=e=>{Sr=e};var Ar=_r;_r.default=_r,_r.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,wr.prototype):"rule"===e.type?Object.setPrototypeOf(e,br.prototype):"decl"===e.type?Object.setPrototypeOf(e,xr.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ir.prototype):"root"===e.type&&Object.setPrototypeOf(e,Sr.prototype),e[kr]=!0,e.nodes&&e.nodes.forEach(e=>{_r.rebuild(e)})};let Mr,Tr,Nr=Ar,Pr=class extends Nr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Mr(new Tr,this,e).stringify()}};Pr.registerLazyResult=e=>{Mr=e},Pr.registerProcessor=e=>{Tr=e};var Dr=Pr;Pr.default=Pr;let Lr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}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 Br=Lr;Lr.default=Lr;let Fr=Br,jr=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Fr(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Kr=jr;jr.default=jr;const Ur="'".charCodeAt(0),zr='"'.charCodeAt(0),qr="\\".charCodeAt(0),Vr="/".charCodeAt(0),Wr="\n".charCodeAt(0),Gr=" ".charCodeAt(0),Hr="\f".charCodeAt(0),Yr="\t".charCodeAt(0),Zr="\r".charCodeAt(0),Xr="[".charCodeAt(0),Jr="]".charCodeAt(0),$r="(".charCodeAt(0),Qr=")".charCodeAt(0),ei="{".charCodeAt(0),ti="}".charCodeAt(0),ni=";".charCodeAt(0),ri="*".charCodeAt(0),ii=":".charCodeAt(0),oi="@".charCodeAt(0),si=/[\t\n\f\r "#'()/;[\\\]{}]/g,ai=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,li=/.[\r\n"'(/\\]/,ui=/[\da-f]/i;let ci=Ar,hi=class extends ci{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 di=hi;hi.default=hi,ci.registerAtRule(hi);let pi,fi,mi=Ar,gi=class extends mi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new pi(new fi,this,e).stringify()}};gi.registerLazyResult=e=>{pi=e},gi.registerProcessor=e=>{fi=e};var yi=gi;gi.default=gi,mi.registerRoot(gi);let vi={comma(e){return vi.split(e,[","],!0)},space(e){return vi.split(e,[" ","\n","\t"])},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let n of e)u?u=!1:"\\"===n?u=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var bi=vi;vi.default=vi;let wi=Ar,Si=bi,Ci=class extends wi{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Si.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var ki=Ci;Ci.default=Ci,wi.registerRule(Ci);let xi=Nn,Ii=function(e,t={}){let n,r,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(m),n){case Wr:case Gr:case Yr:case Zr:case Hr:r=m;do{r+=1,n=d.charCodeAt(r)}while(n===Gr||n===Wr||n===Yr||n===Zr||n===Hr);h=["space",d.slice(m,r)],m=r-1;break;case Xr:case Jr:case ei:case ti:case ii:case ni:case Qr:{let e=String.fromCharCode(n);h=[e,e,m];break}case $r:if(u=g.length?g.pop()[1]:"",c=d.charCodeAt(m+1),"url"===u&&c!==Ur&&c!==zr&&c!==Gr&&c!==Wr&&c!==Yr&&c!==Hr&&c!==Zr){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}v("bracket")}for(l=r;d.charCodeAt(l-1)===qr;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||li.test(o)?h=["(","(",m]:(h=["brackets",o,m,r],m=r);break;case Ur:case zr:i=n===Ur?"'":'"',r=m;do{if(a=!1,r=d.indexOf(i,r+1),-1===r){if(p||t){r=m+1;break}v("string")}for(l=r;d.charCodeAt(l-1)===qr;)l-=1,a=!a}while(a);h=["string",d.slice(m,r+1),m,r],m=r;break;case oi:si.lastIndex=m+1,si.test(d),r=0===si.lastIndex?d.length-1:si.lastIndex-2,h=["at-word",d.slice(m,r+1),m,r],m=r;break;case qr:for(r=m,s=!0;d.charCodeAt(r+1)===qr;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==Vr&&n!==Gr&&n!==Wr&&n!==Yr&&n!==Zr&&n!==Hr&&(r+=1,ui.test(d.charAt(r)))){for(;ui.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Gr&&(r+=1)}h=["word",d.slice(m,r+1),m,r],m=r;break;default:n===Vr&&d.charCodeAt(m+1)===ri?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(m,r+1),m,r],m=r):(ai.lastIndex=m+1,ai.test(d),r=0===ai.lastIndex?d.length-1:ai.lastIndex-2,h=["word",d.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},Oi=yr,Ei=di,Ri=yi,_i=ki;const Ai={empty:!0,space:!0};let Mi=Ar,Ti=class{constructor(e){this.input=e,this.root=new Ri,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,n,r,i=new Ei;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],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(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Oi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ii(this.input)}decl(e,t){let n=new xi;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.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 _i;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 e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}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,n,r){let i,o,s,a,l=n.length,u="",c=!0;for(let e=0;e<l;e+=1)i=n[e],o=i[0],"space"!==o||e!==l-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",Ai[a]||Ai[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new _i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},Ni=rr;function Pi(e,t){let n=new Ni(e,t),r=new Ti(n);try{r.parse()}catch(e){throw e}return r.root}var Di=Pi;Pi.default=Pi,Mi.registerParse(Pi);let{isClean:Li,my:Bi}=gn,Fi=fr,ji=Cn,Ki=Ar,Ui=Dr,zi=Kr,qi=Di,Vi=yi;const Wi={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Gi={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},Hi={Once:!0,postcssPlugin:!0,prepare:!0};function Yi(e){return"object"==typeof e&&"function"==typeof e.then}function Zi(e){let t=!1,n=Wi[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Xi(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Zi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ji(e){return e[Li]=!1,e.nodes&&e.nodes.forEach(e=>Ji(e)),e}let $i={},Qi=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof zi)i=Ji(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=qi;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[Bi]&&Ki.rebuild(i)}else i=Ji(n);this.result=new zi(t,i,r),this.helpers={...$i,postcss:$i,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!Gi[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Hi[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(Yi(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Li];){e[Li]=!0;let t=[Xi(e)];for(;t.length>0;){let e=this.visitTick(t);if(Yi(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Yi(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ji;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Fi(t,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 e of this.plugins){if(Yi(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Li];)e[Li]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Yi(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[Li])return r[Li]=!0,void e.push(Xi(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Li]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Li]=!0;let t=Zi(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Li]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};Qi.registerPostcss=e=>{$i=e};var eo=Qi;Qi.default=Qi,Vi.registerLazyResult(Qi),Ui.registerLazyResult(Qi);let to=fr,no=Cn,ro=Di;const io=Kr;let oo=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=no;this.result=new io(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new to(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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=ro;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var so=oo;oo.default=oo;let ao=so,lo=eo,uo=Dr,co=yi,ho=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new lo(this,e,t):new ao(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var po=ho;ho.default=ho,co.registerProcessor(ho),uo.registerProcessor(ho);let fo=Nn,mo=zn,go=yr,yo=di,vo=rr,bo=yi,wo=ki;function So(e,t){if(Array.isArray(e))return e.map(e=>So(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:vo.prototype};n.map&&(n.map={...n.map,__proto__:mo.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>So(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new bo(r);if("decl"===r.type)return new fo(r);if("rule"===r.type)return new wo(r);if("comment"===r.type)return new go(r);if("atrule"===r.type)return new yo(r);throw new Error("Unknown node type: "+e.type)}var Co=So;So.default=So;let ko=mn,xo=Nn,Io=eo,Oo=Ar,Eo=po,Ro=Cn,_o=Co,Ao=Dr,Mo=Br,To=yr,No=di,Po=Kr,Do=rr,Lo=Di,Bo=bi,Fo=ki,jo=yi,Ko=An;function Uo(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Eo(e)}Uo.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"2",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"13",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS3-U657-S937-1145",TEST_API_KEY:"0c6955cccf0992c6791f7ea58f220251",PACKAGE_VERSION:""}.LANG&&{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"2",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"13",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS3-U657-S937-1145",TEST_API_KEY:"0c6955cccf0992c6791f7ea58f220251",PACKAGE_VERSION:""}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new Eo).version,i}return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(e,t,n){return Uo([i(n)]).process(e,t)},i},Uo.stringify=Ro,Uo.parse=Lo,Uo.fromJSON=_o,Uo.list=Bo,Uo.comment=e=>new To(e),Uo.atRule=e=>new No(e),Uo.decl=e=>new xo(e),Uo.rule=e=>new Fo(e),Uo.root=e=>new jo(e),Uo.document=e=>new Ao(e),Uo.CssSyntaxError=ko,Uo.Declaration=xo,Uo.Container=Oo,Uo.Processor=Eo,Uo.Document=Ao,Uo.Comment=To,Uo.Warning=Mo,Uo.AtRule=No,Uo.Result=Po,Uo.Input=Do,Uo.Rule=Fo,Uo.Root=jo,Uo.Node=Ko,Io.registerPostcss(Uo);var zo=Uo;Uo.default=Uo;const qo=on(zo);qo.stringify,qo.fromJSON,qo.plugin,qo.parse,qo.list,qo.document,qo.comment,qo.atRule,qo.rule,qo.decl,qo.root,qo.CssSyntaxError,qo.Declaration,qo.Container,qo.Processor,qo.Document,qo.Comment,qo.Warning,qo.AtRule,qo.Result,qo.Input,qo.Rule,qo.Root,qo.Node;var Vo=Object.defineProperty,Wo=(e,t,n)=>((e,t,n)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);Object.defineProperty;function Go(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ho(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Yo={exports:{}},Zo=String,Xo=function(){return{isColorSupported:!1,reset:Zo,bold:Zo,dim:Zo,italic:Zo,underline:Zo,inverse:Zo,hidden:Zo,strikethrough:Zo,black:Zo,red:Zo,green:Zo,yellow:Zo,blue:Zo,magenta:Zo,cyan:Zo,white:Zo,gray:Zo,bgBlack:Zo,bgRed:Zo,bgGreen:Zo,bgYellow:Zo,bgBlue:Zo,bgMagenta:Zo,bgCyan:Zo,bgWhite:Zo}};Yo.exports=Xo(),Yo.exports.createColors=Xo;var Jo=Yo.exports;const $o=Ho(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Qo=Jo,es=$o,ts=class e extends Error{constructor(t,n,r,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Qo.isColorSupported),es&&e&&(t=es(t));let n,r,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Qo.createColors(!0);n=t=>e(i(t)),r=e=>t(e)}else n=r=e=>e;return i.slice(o,s).map((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ns=ts;ts.default=ts;var rs={};rs.isClean=Symbol("isClean"),rs.my=Symbol("my");const is={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let os=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return is[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let i="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[i]?r=this[i](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=is[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 ss=os;os.default=os;let as=ss;function ls(e,t){new as(t).stringify(e)}var us=ls;ls.default=ls;let{isClean:cs,my:hs}=rs,ds=ns,ps=ss,fs=us;function ms(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>ms(e,n)):("object"===o&&null!==i&&(i=ms(i)),n[r]=i)}return n}let gs=class{constructor(e={}){this.raws={},this[cs]=!1,this[hs]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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 n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new ds(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}}markDirty(){if(this[cs]){this[cs]=!1;let e=this;for(;e=e.parent;)e[cs]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},n=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new ps).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=fs){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var ys=gs;gs.default=gs;let vs=ys,bs=class extends vs{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ws=bs;bs.default=bs;var Ss={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}};let{SourceMapConsumer:Cs,SourceMapGenerator:ks}=$o,{existsSync:xs,readFileSync:Is}=$o,{dirname:Os,join:Es}=$o;let Rs=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Os(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Cs(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=Os(e),xs(e))return this.mapFile=e,Is(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Cs)return ks.fromSourceMap(t).toString();if(t instanceof ks)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Es(Os(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var _s=Rs;Rs.default=Rs;let{SourceMapConsumer:As,SourceMapGenerator:Ms}=$o,{fileURLToPath:Ts,pathToFileURL:Ns}=$o,{isAbsolute:Ps,resolve:Ds}=$o,{nanoid:Ls}=Ss,Bs=$o,Fs=ns,js=_s,Ks=Symbol("fromOffsetCache"),Us=Boolean(As&&Ms),zs=Boolean(Ds&&Ps),qs=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!zs||/^\w+:\/\//.test(t.from)||Ps(t.from)?this.file=t.from:this.file=Ds(t.from)),zs&&Us){let e=new js(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Ls(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,s);return i=a?new Fs(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Fs(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Ns&&(i.input.url=Ns(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[Ks])n=this[Ks];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[Ks]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ds(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=Ps(a.source)?Ns(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ns(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ts)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ts(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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 Vs=qs;qs.default=qs,Bs&&Bs.registerInput&&Bs.registerInput(qs);let{SourceMapConsumer:Ws,SourceMapGenerator:Gs}=$o,{dirname:Hs,relative:Ys,resolve:Zs,sep:Xs}=$o,{pathToFileURL:Js}=$o,$s=Vs,Qs=Boolean(Ws&&Gs),ea=Boolean(Hs&&Zs&&Ys&&Xs);var ta=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||Hs(e.file);!1===this.mapOpts.sourcesContent?(t=new Ws(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ea&&Qs&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Gs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Gs({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 Gs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?Hs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Hs(Zs(n,this.mapOpts.annotation)));let r=Ys(n,e);return this.memoizedPaths.set(e,r),r}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 $s(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,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(Js){let t=Js(e).toString();return this.memoizedFileURLs.set(e,t),t}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;"\\"===Xs&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let na=ys,ra=class extends na{constructor(e){super(e),this.type="comment"}};var ia=ra;ra.default=ra;let oa,sa,aa,la,{isClean:ua,my:ca}=rs,ha=ws,da=ia,pa=ys;function fa(e){return e.map(e=>(e.nodes&&(e.nodes=fa(e.nodes)),delete e.source,e))}function ma(e){if(e[ua]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ma(t)}let ga=class e extends pa{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=fa(oa(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new ha(t)]}else if(t.selector)t=[new sa(t)];else if(t.name)t=[new aa(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new da(t)]}return t.map(t=>(t[ca]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ua]&&ma(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};ga.registerParse=e=>{oa=e},ga.registerRule=e=>{sa=e},ga.registerAtRule=e=>{aa=e},ga.registerRoot=e=>{la=e};var ya=ga;ga.default=ga,ga.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,aa.prototype):"rule"===e.type?Object.setPrototypeOf(e,sa.prototype):"decl"===e.type?Object.setPrototypeOf(e,ha.prototype):"comment"===e.type?Object.setPrototypeOf(e,da.prototype):"root"===e.type&&Object.setPrototypeOf(e,la.prototype),e[ca]=!0,e.nodes&&e.nodes.forEach(e=>{ga.rebuild(e)})};let va,ba,wa=ya,Sa=class extends wa{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new va(new ba,this,e).stringify()}};Sa.registerLazyResult=e=>{va=e},Sa.registerProcessor=e=>{ba=e};var Ca=Sa;Sa.default=Sa;let ka=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}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 xa=ka;ka.default=ka;let Ia=xa,Oa=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Ia(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ea=Oa;Oa.default=Oa;const Ra="'".charCodeAt(0),_a='"'.charCodeAt(0),Aa="\\".charCodeAt(0),Ma="/".charCodeAt(0),Ta="\n".charCodeAt(0),Na=" ".charCodeAt(0),Pa="\f".charCodeAt(0),Da="\t".charCodeAt(0),La="\r".charCodeAt(0),Ba="[".charCodeAt(0),Fa="]".charCodeAt(0),ja="(".charCodeAt(0),Ka=")".charCodeAt(0),Ua="{".charCodeAt(0),za="}".charCodeAt(0),qa=";".charCodeAt(0),Va="*".charCodeAt(0),Wa=":".charCodeAt(0),Ga="@".charCodeAt(0),Ha=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ya=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Za=/.[\r\n"'(/\\]/,Xa=/[\da-f]/i;let Ja=ya,$a=class extends Ja{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 Qa=$a;$a.default=$a,Ja.registerAtRule($a);let el,tl,nl=ya,rl=class extends nl{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new el(new tl,this,e).stringify()}};rl.registerLazyResult=e=>{el=e},rl.registerProcessor=e=>{tl=e};var il=rl;rl.default=rl,nl.registerRoot(rl);let ol={comma(e){return ol.split(e,[","],!0)},space(e){return ol.split(e,[" ","\n","\t"])},split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let n of e)u?u=!1:"\\"===n?u=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=n;return(n||""!==i)&&r.push(i.trim()),r}};var sl=ol;ol.default=ol;let al=ya,ll=sl,ul=class extends al{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ll.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var cl=ul;ul.default=ul,al.registerRule(ul);let hl=ws,dl=function(e,t={}){let n,r,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(m),n){case Ta:case Na:case Da:case La:case Pa:r=m;do{r+=1,n=d.charCodeAt(r)}while(n===Na||n===Ta||n===Da||n===La||n===Pa);h=["space",d.slice(m,r)],m=r-1;break;case Ba:case Fa:case Ua:case za:case Wa:case qa:case Ka:{let e=String.fromCharCode(n);h=[e,e,m];break}case ja:if(u=g.length?g.pop()[1]:"",c=d.charCodeAt(m+1),"url"===u&&c!==Ra&&c!==_a&&c!==Na&&c!==Ta&&c!==Da&&c!==Pa&&c!==La){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}v("bracket")}for(l=r;d.charCodeAt(l-1)===Aa;)l-=1,a=!a}while(a);h=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||Za.test(o)?h=["(","(",m]:(h=["brackets",o,m,r],m=r);break;case Ra:case _a:i=n===Ra?"'":'"',r=m;do{if(a=!1,r=d.indexOf(i,r+1),-1===r){if(p||t){r=m+1;break}v("string")}for(l=r;d.charCodeAt(l-1)===Aa;)l-=1,a=!a}while(a);h=["string",d.slice(m,r+1),m,r],m=r;break;case Ga:Ha.lastIndex=m+1,Ha.test(d),r=0===Ha.lastIndex?d.length-1:Ha.lastIndex-2,h=["at-word",d.slice(m,r+1),m,r],m=r;break;case Aa:for(r=m,s=!0;d.charCodeAt(r+1)===Aa;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==Ma&&n!==Na&&n!==Ta&&n!==Da&&n!==La&&n!==Pa&&(r+=1,Xa.test(d.charAt(r)))){for(;Xa.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Na&&(r+=1)}h=["word",d.slice(m,r+1),m,r],m=r;break;default:n===Ma&&d.charCodeAt(m+1)===Va?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(m,r+1),m,r],m=r):(Ya.lastIndex=m+1,Ya.test(d),r=0===Ya.lastIndex?d.length-1:Ya.lastIndex-2,h=["word",d.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},pl=ia,fl=Qa,ml=il,gl=cl;const yl={empty:!0,space:!0};let vl=ya,bl=class{constructor(e){this.input=e,this.root=new ml,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,n,r,i=new fl;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],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(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new pl;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=dl(this.input)}decl(e,t){let n=new hl;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),i="";for(let e=t;e>0;e--){let t=r[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.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 gl;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 e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}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,n,r){let i,o,s,a,l=n.length,u="",c=!0;for(let e=0;e<l;e+=1)i=n[e],o=i[0],"space"!==o||e!==l-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",yl[a]||yl[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new gl;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},wl=Vs;function Sl(e,t){let n=new wl(e,t),r=new bl(n);try{r.parse()}catch(e){throw e}return r.root}var Cl=Sl;Sl.default=Sl,vl.registerParse(Sl);let{isClean:kl,my:xl}=rs,Il=ta,Ol=us,El=ya,Rl=Ca,_l=Ea,Al=Cl,Ml=il;const Tl={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Nl={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},Pl={Once:!0,postcssPlugin:!0,prepare:!0};function Dl(e){return"object"==typeof e&&"function"==typeof e.then}function Ll(e){let t=!1,n=Tl[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Bl(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ll(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Fl(e){return e[kl]=!1,e.nodes&&e.nodes.forEach(e=>Fl(e)),e}let jl={},Kl=class e{constructor(t,n,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof _l)i=Fl(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=Al;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[xl]&&El.rebuild(i)}else i=Fl(n);this.result=new _l(t,i,r),this.helpers={...jl,postcss:jl,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!Nl[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Pl[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(Dl(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kl];){e[kl]=!0;let t=[Bl(e)];for(;t.length>0;){let e=this.visitTick(t);if(Dl(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Dl(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ol;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Il(t,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 e of this.plugins){if(Dl(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kl];)e[kl]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Dl(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[kl])return r[kl]=!0,void e.push(Bl(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[kl]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[kl]=!0;let t=Ll(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[kl]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};Kl.registerPostcss=e=>{jl=e};var Ul=Kl;Kl.default=Kl,Ml.registerLazyResult(Kl),Rl.registerLazyResult(Kl);let zl=ta,ql=us,Vl=Cl;const Wl=Ea;let Gl=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let i=ql;this.result=new Wl(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new zl(i,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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=Vl;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Hl=Gl;Gl.default=Gl;let Yl=Hl,Zl=Ul,Xl=Ca,Jl=il,$l=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Zl(this,e,t):new Yl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ql=$l;$l.default=$l,Jl.registerProcessor($l),Xl.registerProcessor($l);let eu=ws,tu=_s,nu=ia,ru=Qa,iu=Vs,ou=il,su=cl;function au(e,t){if(Array.isArray(e))return e.map(e=>au(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:iu.prototype};n.map&&(n.map={...n.map,__proto__:tu.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>au(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new ou(r);if("decl"===r.type)return new eu(r);if("rule"===r.type)return new su(r);if("comment"===r.type)return new nu(r);if("atrule"===r.type)return new ru(r);throw new Error("Unknown node type: "+e.type)}var lu=au;au.default=au;let uu=ns,cu=ws,hu=Ul,du=ya,pu=Ql,fu=us,mu=lu,gu=Ca,yu=xa,vu=ia,bu=Qa,wu=Ea,Su=Vs,Cu=Cl,ku=sl,xu=cl,Iu=il,Ou=ys;function Eu(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new pu(e)}Eu.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"2",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"13",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS3-U657-S937-1145",TEST_API_KEY:"0c6955cccf0992c6791f7ea58f220251",PACKAGE_VERSION:""}.LANG&&{NODE_ENV:"production",ENV:"butterfly",HOST:"https://app.betterbugs.io",DASH_URL:"https://app.betterbugs.io",PORT:"9001",API_URL:"https://butterfly-api.betterbugs.io",INDEX_DB_VERSION:"2",LOGGER_DB_VERSION:"1",LOGS_VERSION:"2",BB_VERSION:"13",S3_IMAGE_PATH:"https://betterbug-storage.s3.amazonaws.com",NEW_S3_IMAGE_PATH:"https://betterbug-storage-prod.s3.amazonaws.com",MARKERJS_LICENCE_KEY:"MJS3-U657-S937-1145",TEST_API_KEY:"0c6955cccf0992c6791f7ea58f220251",PACKAGE_VERSION:""}.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new pu).version,i}return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(e,t,n){return Eu([i(n)]).process(e,t)},i},Eu.stringify=fu,Eu.parse=Cu,Eu.fromJSON=mu,Eu.list=ku,Eu.comment=e=>new vu(e),Eu.atRule=e=>new bu(e),Eu.decl=e=>new cu(e),Eu.rule=e=>new xu(e),Eu.root=e=>new Iu(e),Eu.document=e=>new gu(e),Eu.CssSyntaxError=uu,Eu.Declaration=cu,Eu.Container=du,Eu.Processor=pu,Eu.Document=gu,Eu.Comment=vu,Eu.Warning=yu,Eu.AtRule=bu,Eu.Result=wu,Eu.Input=Su,Eu.Rule=xu,Eu.Root=Iu,Eu.Node=Ou,hu.registerPostcss(Eu);var Ru=Eu;Eu.default=Eu;const _u=Go(Ru);_u.stringify,_u.fromJSON,_u.plugin,_u.parse,_u.list,_u.document,_u.comment,_u.atRule,_u.rule,_u.decl,_u.root,_u.CssSyntaxError,_u.Declaration,_u.Container,_u.Processor,_u.Document,_u.Comment,_u.Warning,_u.AtRule,_u.Result,_u.Input,_u.Rule,_u.Root,_u.Node;class Au{constructor(...e){Wo(this,"parentElement",null),Wo(this,"parentNode",null),Wo(this,"ownerDocument"),Wo(this,"firstChild",null),Wo(this,"lastChild",null),Wo(this,"previousSibling",null),Wo(this,"nextSibling",null),Wo(this,"ELEMENT_NODE",1),Wo(this,"TEXT_NODE",3),Wo(this,"nodeType"),Wo(this,"nodeName"),Wo(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Au))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Mu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Tu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Nu={};function Pu(e){if(Nu[e])return Nu[e];const t=globalThis[e],n=t.prototype,r=e in Mu?Mu[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in Tu?Tu[e]:void 0,s=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return Nu[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(r),o?Nu[e]=o:n}catch{return n}}const Du={};function Lu(e,t,n){var r;const i=`${e}.${String(n)}`;if(Du[i])return Du[i].call(t);const o=Pu(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(Du[i]=s,s.call(t)):t[n]}const Bu={};function Fu(e,t,n){const r=`${e}.${String(n)}`;if(Bu[r])return Bu[r].bind(t);const i=Pu(e)[n];return"function"!=typeof i?t[n]:(Bu[r]=i,i.bind(t))}function ju(){return Pu("MutationObserver").constructor}function Ku(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}const Uu={childNodes:function(e){return Lu("Node",e,"childNodes")},parentNode:function(e){return Lu("Node",e,"parentNode")},parentElement:function(e){return Lu("Node",e,"parentElement")},textContent:function(e){return Lu("Node",e,"textContent")},contains:function(e,t){return Fu("Node",e,"contains")(t)},getRootNode:function(e){return Fu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Lu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Lu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Lu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Lu("Element",e,"querySelectorAll")(t)},mutationObserver:ju,patch:Ku};function zu(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let qu={map:{},getId(){return-1},getNode(){return null},removeNodeFromMap(){},has(){return!1},reset(){}};function Vu(e,t,n={}){let r=null,i=0;return function(...o){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=s,e.apply(l,o)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function Wu(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Wu(e,t,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(qu=new Proxy(qu,{get(e,t,n){return Reflect.get(e,t,n)}}));let Gu=Date.now;function Hu(e){var t,n,r,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Uu.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=Uu.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Yu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xu(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Uu.parentElement(e)}function Ju(e,t,n,r){if(!e)return!1;const i=Xu(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if($t(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function $u(e,t){return-1!==t.getId(e)}function Qu(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function ec(e,t){if(St(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Uu.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||ec(r,t))}function tc(e){return Boolean(e.changedTouches)}function nc(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function rc(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(i,o.parent))}else{const e=r.indexOf(o);r.splice(e,0,n(i,null))}continue}if(o in t){const e=t[o];e.children.push(n(i,e));continue}r.push(n(i,null))}return r}function ic(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)ic(e.children[n],t)}function oc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function sc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ac(e,t){var n,r;const i=null==(null==e.ownerDocument?void 0:n.defaultView)?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),s=ac(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function lc(e){return!!e&&(e instanceof Au&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Uu.shadowRoot(e)))}function uc(e,t){const n=e[t[0]];return 1===t.length?n:uc(n.cssRules[t[1]].cssRules,t.slice(2))}function cc(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function hc(e){const t=new Set,n=[];for(let r=e.length;r--;){const i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}/[1-9][0-9]{12}/.test(Date.now().toString())||(Gu=()=>(new Date).getTime());class dc{constructor(){at(this,"id",1),at(this,"styleIDMap",new WeakMap),at(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function pc(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Uu.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Uu.host(Uu.getRootNode(e))&&(n=Uu.host(Uu.getRootNode(e))),n}function fc(e){let t,n=e;for(;t=pc(n);)n=t;return n}function mc(e){const t=e.ownerDocument;if(!t)return!1;const n=fc(e);return Uu.contains(t,n)}function gc(e){const t=e.ownerDocument;return!!t&&(Uu.contains(t,e)||mc(e))}Symbol.toStringTag;var yc=(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))(yc||{}),vc=(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))(vc||{}),bc=(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))(bc||{}),wc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(wc||{}),Sc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Sc||{}),Cc=(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))(Cc||{}),kc=(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))(kc||{});function xc(e){return"__ln"in e}class Ic{constructor(){at(this,"length",0),at(this,"head",null),at(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&xc(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&xc(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Oc=(e,t)=>`${e}@${t}`;class Ec{constructor(){at(this,"frozen",!1),at(this,"locked",!1),at(this,"texts",[]),at(this,"attributes",[]),at(this,"attributeMap",new WeakMap),at(this,"removes",[]),at(this,"mapRemoves",[]),at(this,"movedMap",{}),at(this,"addedSet",new Set),at(this,"movedSet",new Set),at(this,"droppedSet",new Set),at(this,"removesSubTreeCache",new Set),at(this,"mutationCb"),at(this,"blockClass"),at(this,"blockSelector"),at(this,"maskTextClass"),at(this,"maskTextSelector"),at(this,"inlineStylesheet"),at(this,"maskInputOptions"),at(this,"maskTextFn"),at(this,"maskInputFn"),at(this,"keepIframeSrcFn"),at(this,"recordCanvas"),at(this,"inlineImages"),at(this,"slimDOMOptions"),at(this,"dataURLOptions"),at(this,"doc"),at(this,"mirror"),at(this,"iframeManager"),at(this,"stylesheetManager"),at(this,"shadowDomManager"),at(this,"canvasManager"),at(this,"processedNodeManager"),at(this,"unattachedDoc"),at(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),at(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Ic,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{const o=Uu.parentNode(i);if(!o||!gc(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=St(o)?this.mirror.getId(pc(i)):this.mirror.getId(o),l=r(i);if(-1===a||-1===l)return n.addNode(i);const u=rn(i,{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:e=>{oc(e,this.mirror)&&this.iframeManager.addIframe(e),sc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),lc(i)&&this.shadowDomManager.addShadowRoot(Uu.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)_c(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Uu.parentNode(e))||i(e);for(const e of this.addedSet)Ac(this.droppedSet,e)||_c(this.removesSubTreeCache,e,this.mirror)?Ac(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;n.length;){let e=null;if(o){const t=this.mirror.getId(Uu.parentNode(o.value)),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(Uu.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Uu.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Uu.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=Uu.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))}),at(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(Uu.childNodes(e),e=>Uu.textContent(e)||"").join("");t.attributes.value=Et({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:At(e),value:n,maskInputFn:this.maskInputFn})}),at(this,"processMutation",e=>{if(!Qu(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Uu.textContent(e.target);Ju(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Qt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xu(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=At(t);r=Et({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Ju(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.test)return;n="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Jt(t.tagName,n))if(i.attributes[n]=Xt(this.doc,Rt(t.tagName),Rt(n),r),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||o!==n.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?r:[r,o]:i._unchangedStyles[e]=[r,o]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Ju(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=St(e.target)?this.mirror.getId(Uu.host(e.target)):this.mirror.getId(e.target);Ju(e.target,this.blockClass,this.blockSelector,!1)||Qu(t,this.mirror,this.slimDOMOptions)||!$u(t,this.mirror)||(this.addedSet.has(t)?(Rc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ec(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Oc(n,r)]?Rc(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!St(e.target)||!Ct(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Uu.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),at(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Qu(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Oc(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ju(e,this.blockClass,this.blockSelector,!1)||(Uu.childNodes(e).forEach(e=>this.genAdds(e)),lc(e)&&Uu.childNodes(Uu.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}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 Rc(e,t){e.delete(t),Uu.childNodes(t).forEach(t=>Rc(e,t))}function _c(e,t,n){return 0!==e.size&&function(e,t){const n=Uu.parentNode(t);return!!n&&e.has(n)}(e,t)}function Ac(e,t){return 0!==e.size&&Mc(e,t)}function Mc(e,t){const n=Uu.parentNode(t);return!!n&&(!!e.has(n)||Mc(e,n))}let Tc;const Nc=e=>{if(!Tc)return e;return(...t)=>{try{return e(...t)}catch(e){if(Tc&&!0===Tc(e))return;throw e}}},Pc=[];function Dc(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 Lc(e,t){const n=new Ec;Pc.push(n),n.init(e);const r=new(ju())(Nc(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Bc({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(bc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=Rt(o);const u=(t=>o=>{const s=Dc(o);if(Ju(s,r,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=wc.Mouse;break;case"touch":a=wc.Touch;break;case"pen":a=wc.Pen}a===wc.Touch?bc[t]===bc.MouseDown?u="TouchStart":bc[t]===bc.MouseUp&&(u="TouchEnd"):wc.Pen}else tc(o)&&(a=wc.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===wc.Touch||u.startsWith("Mouse")&&a===wc.Mouse)&&(a=null)):bc[t]===bc.Click&&(a=l,l=null);const c=tc(o)?o.changedTouches[0]:o;if(!c)return;const h=n.getId(s),{clientX:d,clientY:p}=c;Nc(e)({type:bc[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(bc[o]){case bc.MouseDown:case bc.MouseUp:s=s.replace("mouse","pointer");break;case bc.TouchStart:case bc.TouchEnd:return}a.push(zu(s,u,t))}),Nc(()=>{a.forEach(e=>e())})}function Fc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){return zu("scroll",Nc(Vu(Nc(o=>{const s=Dc(o);if(!s||Ju(s,r,i,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Hu(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}const jc=["INPUT","TEXTAREA","SELECT"],Kc=new WeakMap;function Uc(e){return function(e,t){if(Wc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Wc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Wc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Wc("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function zc(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function qc({mirror:e,stylesheetManager:t},n){var r,i,o;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(Uu.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(o=null==(i=n.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),Nc(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Vc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(r=Lc(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=Vu(Nc(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),o),u=Nc(Vu(Nc(e=>{const t=Dc(e),{clientX:n,clientY:i}=tc(e)?e.changedTouches[0]:e;s||(s=Gu()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Gu()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?vc.Drag:e instanceof MouseEvent?vc.MouseMove:vc.TouchMove)}),i,{trailing:!1})),c=[zu("mousemove",u,n),zu("touchmove",u,n),zu("drag",u,n)];return Nc(()=>{c.forEach(e=>e())})}(e),o=Bc(e),s=Fc(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return zu("resize",Nc(Vu(Nc(()=>{const t=Yu(),i=Zu();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let n=Dc(e);const u=e.isTrusted,h=n&&n.tagName;if(n&&"OPTION"===h&&(n=Uu.parentElement(n)),!n||!h||jc.indexOf(h)<0||Ju(n,r,i,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let p=n.value,f=!1;const m=At(n)||"";"radio"===m||"checkbox"===m?f=n.checked:(a[h.toLowerCase()]||a[m])&&(p=Et({element:n,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(n,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const g=n.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;d(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,r){const i=Kc.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Kc.set(t,r);const i=n.getId(t);Nc(e)({...r,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>zu(e,Nc(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>Wu(e[0],e[1],{set(){Nc(h)({target:this,isTrusted:!1})}},!1,f))),Nc(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const s=Nc(o=>Vu(Nc(i=>{const s=Dc(i);if(!s||Ju(s,t,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:o,id:r.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),i.media||500)),a=[zu("play",s(Cc.Play),o),zu("pause",s(Cc.Pause),o),zu("seeked",s(Cc.Seeked),o),zu("volumechange",s(Cc.VolumeChange),o),zu("ratechange",s(Cc.RateChange),o)];return Nc(()=>{a.forEach(e=>e())})}(e);let c=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Nc((r,i,o)=>{const[s,a]=o,{id:l,styleId:u}=zc(i,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};const o=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=zc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=zc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=zc(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),r.apply(i,o)})}));const l={};Gc("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Gc("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Gc("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Gc("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([r,i])=>{u[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[r].insertRule,{apply:Nc((r,i,o)=>{const[s,a]=o,{id:l,styleId:u}=zc(i.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...Uc(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[r].deleteRule,{apply:Nc((r,i,o)=>{const[s]=o,{id:a,styleId:l}=zc(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Uc(i),s]}]}),r.apply(i,o)})})}),Nc(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:n}),h=qc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Nc((i,s,a)=>{var l;const[u,c,h]=a;if(n.has(u))return o.apply(s,[u,c,h]);const{id:d,styleId:p}=zc(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:u,value:c,priority:h},index:Uc(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Nc((i,o,a)=>{var l;const[u]=a;if(n.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=zc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:Uc(o.parentRule)}),i.apply(o,a)})}),Nc(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=Ku(t.fonts,"add",function(t){return function(n){return setTimeout(Nc(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),Nc(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let s=!0;const a=Nc(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;Ju(s,r,i,!0)||Ju(u,r,i,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(u),endOffset:c})}o({ranges:a})});return a(),zu("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Ku(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,i])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Nc(()=>{Pc.forEach(e=>e.reset()),null==r||r.disconnect(),i(),o(),s(),a(),l(),u(),c(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function Wc(e){return void 0!==window[e]}function Gc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Hc{constructor(e){at(this,"iframeIdToRemoteIdMap",new WeakMap),at(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Yc{constructor(e){at(this,"iframes",new WeakMap),at(this,"crossOriginIframeMap",new WeakMap),at(this,"crossOriginIframeMirror",new Hc(Ut)),at(this,"crossOriginIframeStyleMirror"),at(this,"crossOriginIframeRootIdMap",new WeakMap),at(this,"mirror"),at(this,"mutationCb"),at(this,"wrappedEmit"),at(this,"loadListener"),at(this,"stylesheetManager"),at(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Hc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.test&&e.test.adoptedStyleSheets&&e.test.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.test.adoptedStyleSheets,this.mirror.getId(e.test))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case yc.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:yc.IncrementalSnapshot,data:{source:vc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case yc.Meta:case yc.Load:case yc.DomContentLoaded:return!1;case yc.Plugin:return t;case yc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case yc.IncrementalSnapshot:switch(t.data.source){case vc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vc.Drag:case vc.TouchMove:case vc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vc.ViewportResize:return!1;case vc.MediaInteraction:case vc.MouseInteraction:case vc.Scroll:case vc.CanvasMutation:case vc.Input:return this.replaceIds(t.data,e,["id"]),t;case vc.StyleSheetRule:case vc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case vc.Font:return t;case vc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case vc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===kc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Zc{constructor(e){at(this,"shadowDoms",new WeakSet),at(this,"mutationCb"),at(this,"scrollCb"),at(this,"bypassOptions"),at(this,"mirror"),at(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ct(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=Lc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Fc({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Uu.host(e))),this.restoreHandlers.push(qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.test&&this.patchAttachShadow(e.contentWindow.Element,e.test)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ku(e.prototype,"attachShadow",function(e){return function(r){const i=e.call(this,r),o=Uu.shadowRoot(this);return o&&gc(this)&&n.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$c=0;$c<64;$c++)Jc[Xc.charCodeAt($c)]=$c;const Qc=new Map;const eh=(e,t,n)=>{if(!e||!rh(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Qc.get(e);return n||(n=new Map,Qc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function th(e,t,n){if(e instanceof Array)return e.map(e=>th(e,t,n));if(null===e)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(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Xc[n[t]>>2],i+=Xc[(3&n[t])<<4|n[t+1]>>4],i+=Xc[(15&n[t+1])<<2|n[t+2]>>6],i+=Xc[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[th(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[th(e.data,t,n),e.width,e.height]}}if(rh(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:eh(e,t,n)}}return e}const nh=(e,t,n)=>e.map(e=>th(e,t,n)),rh=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function ih(e,t,n,r){const i=[];try{const o=Ku(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!Ju(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch{}return()=>{i.forEach(e=>e())}}function oh(e,t,n,r,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Ku(e,l,function(e){return function(...s){const a=e.apply(this,s);if(eh(a,o,this),"tagName"in this.canvas&&!Ju(this.canvas,r,i,!0)){const e=nh(s,o,this),r={type:t,property:l,args:e};n(this.canvas,r)}return a}});s.push(a)}catch{const r=Wu(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(r)}return s}const sh="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ah="undefined"!=typeof window&&window.Blob&&new Blob([(lh=sh,Uint8Array.from(atob(lh),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var lh;function uh(e){let t;try{if(t=ah&&(window.URL||window.webkitURL).createObjectURL(ah),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker("data:text/javascript;base64,"+sh,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class ch{constructor(e){at(this,"pendingCanvasMutations",new Map),at(this,"rafStamps",{latestId:0,invokeId:null}),at(this,"mirror"),at(this,"mutationCb"),at(this,"resetObservers"),at(this,"frozen",!1),at(this,"locked",!1),at(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:s})}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(e,t,n,r,i){const o=ih(t,n,r,!0),s=new Map,a=new uh;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:o}=e.data;this.mutationCb({id:t,type:Sc["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let u,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ju(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=ih(e,t,n,!1),i=function(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=Ku(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return Ju(this.canvas,n,r,!0)||setTimeout(()=>{const n=nh(o,t,this);e(this.canvas,{type:Sc["2D"],property:s,args:n})},0),i.apply(this,o)}});i.push(o)}catch{const n=Wu(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Sc["2D"],property:s,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const i=[];return i.push(...oh(t.WebGLRenderingContext.prototype,Sc.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&i.push(...oh(t.WebGL2RenderingContext.prototype,Sc.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}class hh{constructor(e){at(this,"trackedLinkElements",new WeakSet),at(this,"mutationCb"),at(this,"adoptedStyleSheetCb"),at(this,"styleMirror",new dc),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:xt(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class dh{constructor(){at(this,"nodeMap",new WeakMap),at(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let ph,fh,mh,gh=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ot=e.contentWindow)?void 0:ot.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){}const yh=Ot();function vh(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:v={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:k=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:_=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Tc=M;const T=!k||window.parent===window;let N=!1;if(!T)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(T&&!t)throw new Error("emit function is required");if(!T&&!N)return()=>{};void 0!==w&&void 0===v.mousemove&&(v.mousemove=w),yh.reset();const P=!0===h?{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}:void 0!==d?d:{password:!0},D=nn(p);let L;nc();let B=0;const F=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};ph=(e,i)=>{var o;const s=e;if(s.timestamp=Gu(),!(null==(o=Pc[0])?void 0:o.isFrozen())||s.type===yc.FullSnapshot||s.type===yc.IncrementalSnapshot&&s.data.source===vc.Mutation||Pc.forEach(e=>e.unfreeze()),T)null==t||t(F(s),i);else if(N){const e={type:"rrweb",event:F(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===yc.FullSnapshot)L=s,B=0;else if(s.type===yc.IncrementalSnapshot){if(s.data.source===vc.Mutation&&s.data.isAttachIframe)return;B++;const e=r&&B>=r,t=n&&s.timestamp-L.timestamp>n;(e||t)&&fh(!0)}};const j=e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.Mutation,...e}})},K=e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Scroll,...e}}),U=e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.CanvasMutation,...e}}),z=new hh({mutationCb:j,adoptedStyleSheetCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.AdoptedStyleSheet,...e}})}),q=new Yc({mirror:yh,mutationCb:j,stylesheetManager:z,recordCrossOriginIframes:k,wrappedEmit:ph});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:yh,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const V=new dh;mh=new ch({recordCanvas:C,mutationCb:U,win:window,blockClass:i,blockSelector:o,mirror:yh,sampling:v.canvas,dataURLOptions:b});const W=new Zc({mutationCb:j,scrollCb:K,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:P,dataURLOptions:b,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:D,iframeManager:q,stylesheetManager:z,canvasManager:mh,keepIframeSrcFn:_,processedNodeManager:V},mirror:yh});fh=(e=!1)=>{if(!S)return;ph({type:yc.Meta,data:{href:window.location.href,width:Zu(),height:Yu()}},e),z.reset(),W.init(),Pc.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new It,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S=()=>!1}=t||{};return rn(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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}:!1===c?{password:!0}:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:nn(p),dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:yh,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:P,maskTextFn:m,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:C,inlineImages:E,onSerialize:e=>{oc(e,yh)&&q.addIframe(e),sc(e,yh)&&z.trackLinkElement(e),lc(e)&&W.addShadowRoot(Uu.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),W.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:_});t&&(ph({type:yc.FullSnapshot,data:{node:t,initialOffset:Hu(window)}},e),Pc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,yh.getId(document)))};try{const e=[],t=e=>{var t;return Nc(Vc)({mutationCb:j,mousemoveCb:(e,t)=>ph({type:yc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.MouseInteraction,...e}}),scrollCb:K,viewportResizeCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.ViewportResize,...e}}),inputCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Input,...e}}),mediaInteractionCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.MediaInteraction,...e}}),styleSheetRuleCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.StyleSheetRule,...e}}),styleDeclarationCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>ph({type:yc.IncrementalSnapshot,data:{source:vc.Font,...e}}),selectionCb:e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.Selection,...e}})},customElementCb:e=>{ph({type:yc.IncrementalSnapshot,data:{source:vc.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:P,inlineStylesheet:c,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:I,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:_,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:yh,iframeManager:q,stylesheetManager:z,shadowDomManager:W,processedNodeManager:V,canvasManager:mh,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>ph({type:yc.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};q.addLoadListener(n=>{try{e.push(t(n.test))}catch(e){}});const n=()=>{fh(),e.push(t(document)),gh=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(zu("DOMContentLoaded",()=>{ph({type:yc.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&n()})),e.push(zu("load",()=>{ph({type:yc.Load,data:{}}),"load"===x&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")}}),V.destroy(),gh=!1,Tc=void 0}}catch(e){}}function bh(e){return{all:e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),e.get("*")&&r.slice().map(function(e){e(t,n)})}}}vh.addCustomEvent=(e,t)=>{if(!gh)throw new Error("please add custom event after start recording");ph({type:yc.Custom,data:{tag:e,payload:t}})},vh.freezePage=()=>{Pc.forEach(e=>e.freeze())},vh.takeFullSnapshot=e=>{if(!gh)throw new Error("please take full snapshot after start recording");fh(e)},vh.mirror=yh;Symbol.toStringTag;var wh,Sh;(Sh=wh||(wh={}))[Sh.NotStarted=0]="NotStarted",Sh[Sh.Running=1]="Running",Sh[Sh.Stopped=2]="Stopped";const{addCustomEvent:Ch}=vh,{freezePage:kh}=vh,{takeFullSnapshot:xh}=vh;var Ih=n(7753);const Oh=Symbol.for("Dexie"),Eh=globalThis[Oh]||(globalThis[Oh]=Ih);if(Ih.semVer!==Eh.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ih.semVer} and ${Eh.semVer}`);const{liveQuery:Rh,mergeRanges:_h,rangesOverlap:Ah,RangeSet:Mh,cmp:Th,Entity:Nh,PropModification:Ph,replacePrefix:Dh,add:Lh,remove:Bh}=Eh;var Fh=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};class jh{constructor(e){this.batchQueue=[],this.rewindBatchQueue=[],this.processingBatch=!1,this.processingRewindBatch=!1,this.BATCH_SIZE=15,this.BATCH_INTERVAL=2e3,this.lastBatch=0,this.requests=new Map,this.CLEAN_UP_INTERVAL=3e4,this.lastCleanup=0,this.isDestroyed=!1,this.minutesToKeepData=15,this.dbInitialized=!1,this.dbInitPromise=null,this.isInitializedForRecordingLink=!1,this.__init(e)}__init(e){if(jh._instance)return jh._instance;jh._instance=this,this.isDestroyed=!1,this.initDB().catch(e=>{}),this.isInitializedForRecordingLink=e.isInitializedForRecordingLink||!1,this.batchQueue=[],this.rewindBatchQueue=[],this.processingBatch=!1,this.processingRewindBatch=!1,this.BATCH_SIZE=15,this.BATCH_INTERVAL=2e3,this.CLEAN_UP_INTERVAL=3e4,this.startPeriodicBatchProcess(),this.minutesToKeepData=e.maxRecordingMinutes||15}setMaxRecordingMinutes(e){e>0&&(this.minutesToKeepData=e)}cleanUpdata(){return Fh(this,void 0,void 0,function*(){const e=Date.now();if(e-parseInt(localStorage.getItem("lastCleanup")||"0")>=this.CLEAN_UP_INTERVAL){const t=60*this.minutesToKeepData*1e3;this.deleteRewindDataOnTabReload(t),yield this.db.logs.where("timestamp").between(0,Date.now()-t,!0,!0).delete(),localStorage.setItem("lastCleanup",e.toString())}})}deleteRewindDataOnTabReload(e){return Fh(this,void 0,void 0,function*(){try{return yield this.db.rewind.where("timestamp").between(0,Date.now()-e,!0,!0).delete(),!0}catch(e){return c.log("🚀 ~ deleteRewindDataOnTabReload ~ error:",e),!1}})}startPeriodicBatchProcess(){this.interval=setInterval(()=>{var e;this.batchQueue.length>0&&this.processBatch(),(null===(e=this.rewindBatchQueue)||void 0===e?void 0:e.length)>0&&this.processRewindBatch(),this.cleanUpdata()},this.BATCH_INTERVAL)}initDB(){return Fh(this,void 0,void 0,function*(){return this.dbInitPromise||(this.dbInitPromise=new Promise((e,t)=>{try{const n=parseInt("1");this.db=new Eh("logger-DB"),this.db.version(n).stores({logs:"++id,tabId,timestamp,type,recordingIds,[tabId+timestamp]",rewind:"++id,tabId,timestamp,[tabId+timestamp]"}),this.db.open().then(()=>{this.dbInitialized=!0,c.log("Database initialized successfully"),e()}).catch(e=>{t(e)})}catch(e){t(e)}})),this.dbInitPromise})}addToBatch(e){return Fh(this,void 0,void 0,function*(){try{this.batchQueue.push(Object.assign({},e)),this.batchQueue.length>=this.BATCH_SIZE&&(yield this.processBatch())}catch(e){c.error("Error in addToBatch:",e)}})}addRewindDataToBatch(e){return Fh(this,void 0,void 0,function*(){this.rewindBatchQueue.push(e),this.rewindBatchQueue.length>=this.BATCH_SIZE&&(yield this.processRewindBatch())})}processRewindBatch(){var e,t,n,r,i,o;return Fh(this,void 0,void 0,function*(){if(this.processingRewindBatch||0===this.rewindBatchQueue.length)return;let s=[];try{this.processingRewindBatch=!0,s=this.rewindBatchQueue.splice(0,this.BATCH_SIZE);const n=s.filter(e=>!!e).map(e=>Object.assign(Object.assign({},e),{event:this.sanitizeForIndexedDB(e.event),events:Array.isArray(e.events)?e.events.map(e=>this.sanitizeForIndexedDB(e)):e.events}));yield null===(t=null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.rewind)||void 0===t?void 0:t.bulkAdd(n)}catch(e){c.error("Error processing rewind batch:",e);for(const e of s)try{const t=Object.assign(Object.assign({},e),{event:this.sanitizeForIndexedDB(e.event),events:Array.isArray(e.events)?e.events.map(e=>this.sanitizeForIndexedDB(e)):e.events});yield null===(r=null===(n=null==this?void 0:this.db)||void 0===n?void 0:n.rewind)||void 0===r?void 0:r.put(t)}catch(t){c.error("Failed to save individual rewind log:",t,e);const n=t;if("DataCloneError"===n.name||"ConstraintError"===n.name)try{const t={id:e.id||Date.now().toString(),type:"rewind",timestamp:e.timestamp||Date.now(),tabId:e.tabId||it(),createdAt:e.createdAt||(new Date).toISOString(),event:{error:"Original rewind data could not be stored",errorType:n.name,originalEventType:typeof e.event}};yield null===(o=null===(i=null==this?void 0:this.db)||void 0===i?void 0:i.rewind)||void 0===o?void 0:o.put(t)}catch(e){c.error("Failed to save even minimal rewind log version:",e)}}}finally{this.processingRewindBatch=!1}})}sanitizeForIndexedDB(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return c.error("Failed to sanitize data for IndexedDB:",t),{error:"Data sanitization failed",originalType:typeof e,timestamp:Date.now()}}}processBatch(){var e,t,n,r,i,o;return Fh(this,void 0,void 0,function*(){if(this.processingBatch||0===this.batchQueue.length)return;let s=[];try{this.processingBatch=!0,s=this.batchQueue.splice(0,this.BATCH_SIZE);const n=s.filter(e=>!!e).map(e=>Object.assign(Object.assign({},e),{data:this.sanitizeForIndexedDB(e.data)}));yield null===(t=null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.logs)||void 0===t?void 0:t.bulkAdd(n)}catch(e){c.error("Error processing batch:",e);for(const e of s)try{const t=Object.assign(Object.assign({},e),{data:this.sanitizeForIndexedDB(e.data)});yield null===(r=null===(n=null==this?void 0:this.db)||void 0===n?void 0:n.logs)||void 0===r?void 0:r.put(t)}catch(t){c.error("Failed to save individual log:",t,e);const n=t;if("DataCloneError"===n.name||"ConstraintError"===n.name)try{const t={type:e.type||"unknown",timestamp:e.timestamp||0,tabId:e.tabId||it(),data:{error:"Original data could not be stored",errorType:n.name,originalDataType:typeof e.data}};yield null===(o=null===(i=null==this?void 0:this.db)||void 0===i?void 0:i.logs)||void 0===o?void 0:o.put(t)}catch(e){c.error("Failed to save even minimal log version:",e)}}}finally{this.processingBatch=!1}})}saveNetworkRequest(e){var t;return Fh(this,void 0,void 0,function*(){if(!e)return;const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(!this.isInitializedForRecordingLink||(null==r?void 0:r.length))try{yield this.addToBatch({type:"network",timestamp:e.timestamp||Date.now(),data:e,recordingIds:r,tabId:it()})}catch(e){c.error("Error handling network response:",e)}})}saveConsoleLog(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"console",timestamp:e.timestamp||0,data:e,recordingIds:r,tabId:it()})}catch(e){c.error("Error handling console logs",e)}})}saveSteps(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"step",timestamp:e.timestamp?Number(e.timestamp):0,data:e,tabId:it(),recordingIds:r})}catch(e){c.error("Error handling steps data",e)}})}saveApplicationData(e){var t;return Fh(this,void 0,void 0,function*(){if(e)try{const n=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[],r=null===(t=null==n?void 0:n.filter(e=>e.currentlyRecording))||void 0===t?void 0:t.map(e=>e.id);if(this.isInitializedForRecordingLink&&!(null==r?void 0:r.length))return;yield this.addToBatch({type:"application",timestamp:e.timestamp||Date.now(),data:e.data,tabId:it(),recordingIds:r})}catch(e){c.error("Error handling steps data",e)}})}saveRewindData(e){return Fh(this,void 0,void 0,function*(){if(e)try{yield this.addRewindDataToBatch(Object.assign(Object.assign({},e),{type:"rewind",tabId:it()}))}catch(e){c.error("Error handling rewind data",e)}})}handleSuspend(){return Fh(this,void 0,void 0,function*(){c.log("Extension suspending, performing cleanup..."),yield this.destroy()})}destroy(){var e;return Fh(this,void 0,void 0,function*(){this.isDestroyed||(this.isDestroyed=!0,clearInterval(this.interval),yield this.processBatch(),yield this.processRewindBatch(),yield null===(e=null==this?void 0:this.db)||void 0===e?void 0:e.close())})}getLogsByStackTrace(e,t=!1,n=!1){return Fh(this,void 0,void 0,function*(){const r=this.batchQueue,i=yield this.queryLogs(e,!1,t,n);c.log("logs",i);const o=e.reduce((e,t)=>({startTime:Math.min(e.startTime,t.startTime||0),endTime:Math.max(e.endTime,t.endTime||Date.now())}),{startTime:1/0,endTime:-1/0});return[...i,...(null==r?void 0:r.filter(e=>e.timestamp>o.startTime&&e.timestamp<o.endTime))||[]]})}queryLogs(e,t=!1,n=!1,r=!1){var i,o,s,a,l,u,h,d,p;return Fh(this,void 0,void 0,function*(){if(this.dbInitialized||(yield this.initDB()),!e||0===e.length)return[];c.log("Database state:",{dbExists:!!this.db,isDestroyed:this.isDestroyed,dbVersion:null===(i=this.db)||void 0===i?void 0:i.verno,hasLogsTable:!!(null===(o=this.db)||void 0===o?void 0:o.logs),isInitialized:this.dbInitialized}),c.log("stackTrace",e,t,n);const f=e.reduce((e,t)=>({startTime:Math.min(e.startTime,t.startTime||0),endTime:Math.max(e.endTime,t.endTime||Date.now())}),{startTime:1/0,endTime:-1/0});c.log("timeRange",f,r,t),n&&(f.startTime-=12e4);try{if(t)return yield null===(s=null==this?void 0:this.db)||void 0===s?void 0:s.rewind.where(["tabId","timestamp"]).between([it(),f.startTime],[it(),f.endTime],!0,!0).toArray();if(r){c.log("isFromRecordingLink",r),c.log("this?.db?.logs",null===(a=null==this?void 0:this.db)||void 0===a?void 0:a.logs,this.db);let t=null===(l=null==this?void 0:this.db)||void 0===l?void 0:l.logs.where("timestamp").between(f.startTime,f.endTime,!0,!0);c.log("isFromRecordingLink2",r),(null===(u=e[0])||void 0===u?void 0:u.type)&&(t=t.filter(t=>t.type===e[0].type)),c.log("isFromRecordingLink3",r),(null===(h=e[0])||void 0===h?void 0:h.recordingId)&&(t=t.filter(t=>{var n;return!!(null===(n=t.recordingIds)||void 0===n?void 0:n.length)&&t.recordingIds.includes(e[0].recordingId||"")})),c.log("isFromRecordingLink4",r),c.log("datdshgdjh dayusgd uasygada");const n=yield t.reverse().toArray();return c.log("datdshgdjhada",n),n}{const t=(null===(d=e[0])||void 0===d?void 0:d.type)?t=>t.type===e[0].type:()=>!0;return yield null===(p=null==this?void 0:this.db)||void 0===p?void 0:p.logs.where(["tabId","timestamp"]).between([it(),f.startTime],[it(),f.endTime],!0,!0).filter(t).reverse().toArray()}}catch(e){return c.log(e),c.error("Error querying logs:",e),[]}})}}jh._instance=null;var Kh=jh,Uh=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})};const zh=[8,9,13,16,17,18,19,20,27,33,32,34,35,36,37,38,39,40,45,46],qh=/(^|@)\S+:\d+/,Vh=/^\s*at .*(\S+:\d+|\(native\))/m,Wh=/^(eval@)?(\[native code])?$/;class Gh{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}const Hh={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Vh))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e,void 0,void 0];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]?parseInt(t[2]):void 0,t[3]?parseInt(t[3]):void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Vh)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Gh({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Wh)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Gh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Gh({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,i=n.length;e<i;e+=2){const i=t.exec(n[e]);i&&r.push(new Gh({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,i=n.length;e<i;e+=2){const i=t.exec(n[e]);i&&r.push(new Gh({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(qh)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Gh({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};class Yh{constructor(t){this.handleKeyUpEvent=t=>{var n,r;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(n=null===document||void 0===document?void 0:document.getElementById(e))||void 0===n?void 0:n.contains(document.activeElement))||(null==zh?void 0:zh.includes(t.keyCode))&&this.onSteps({id:tt(),eventType:o,eventData:32!==t.keyCode?t.key:t.keyCode.toString(),count:0,eventElement:nt((null===(r=document.activeElement)||void 0===r?void 0:r.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})},this.lastScrollY=0,window.stopRRweb=void 0,this.dbLogger=new Kh({maxRecordingMinutes:t.maxRecordingMinutes,isInitializedForRecordingLink:t.isInitializedForRecordingLink}),this.isInitializedForRecordingLink=t.isInitializedForRecordingLink,this.maxRecordingMinutes=t.maxRecordingMinutes,window.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateRecordingStatuses()}),this.updateRecordingStatuses()}setMaxRecordingMinutes(e){var t;e>0&&(this.maxRecordingMinutes=e,null===(t=this.dbLogger)||void 0===t||t.setMaxRecordingMinutes(e))}localStorageListener(){window.addEventListener("storage",e=>{"recordingStatuses"===e.key&&this.updateRecordingStatuses()})}updateRecordingStatuses(){var e;return Uh(this,void 0,void 0,function*(){if(window.isRecordingTab)return;let t=JSON.parse(localStorage.getItem("recordingStatuses")||"[]")||[];t=et(t);const n=t.map(e=>((e=et(e)).currentlyRecording&&(e.domain=window.location.hostname,e.pageTitle=document.title,e.url=window.location.href),e));localStorage.setItem("recordingStatuses",JSON.stringify(n));const r=yield this.getApplicationData();null===(e=this.dbLogger)||void 0===e||e.saveApplicationData({type:"application",data:r,timestamp:Date.now()})})}static getInstance(e){return Yh.instance?Yh.instance.setMaxRecordingMinutes(e.maxRecordingMinutes):Yh.instance=new Yh({maxRecordingMinutes:e.maxRecordingMinutes,isInitializedForRecordingLink:e.isInitializedForRecordingLink}),Yh.instance}listenConsoleEvents(){if(window.location.href.includes("https://challenges.cloudflare.com"))return;let e;const t={},n=[],r=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];e=[];const o={};let s;const a=new Set,l=function(){let t,i;try{i=function(){return r},window.console?(window.console.isToastLogConsole?(s=Object.assign({},window.console.toastLogOldConsole),delete window.console.toastLogOldConsole,delete window.console.isToastLogConsole,window.console=s):s=Object.assign({},window.console),t=function(t){let s;return t in console&&(s=console[t])&&(console[t]=function(...i){var l,u,c,h;let d,p,f;const m=null===(l=null==n?void 0:n.slice)||void 0===l?void 0:l.call(i,0);for(p=0,f=Math.min(o[t].handlers.length,10);p<f;p++)a.has(o[t].handlers[p])&&(null===(u=null==r?void 0:r.apply)||void 0===u||u.call(o[t].handlers[p],console,m));for(p=0,f=Math.min(e.length,10);p<f;p++)a.has(e[p])&&(d=[t],n.push.apply(d,m),null===(c=null==r?void 0:r.apply)||void 0===c||c.call(e[p],console,d));null===(h=null==r?void 0:r.apply)||void 0===h||h.call(s,console,m)}),console[t]||i}):t=i}catch(e){c.error(e)}return t}();!function(){let e,t,n;for(e=0,t=i.length;e<t;e++)n=i[e],o[n]={handlers:[]},"function"==typeof l&&l(n)}();const u=function(){e=[];for(const e in o)o[e].handlers=[];a.clear(),window.console=s};window.realConsoleListener=window.console,window.ConsoleListener={on:function(n,r){var i;try{let s,l;if("[object Object]"===(null===(i=t.toString)||void 0===i?void 0:i.call(n)))for(s in n)l=n[s],"all"===s?e.length<10&&(e.push(l),a.add(l)):s in o&&o[s].handlers.length<10&&(o[s].handlers.push(l),a.add(l));else"function"==typeof n?e.length<10&&(e.push(n),a.add(n)):n in o&&o[n].handlers.length<10&&(o[n].handlers.push(r),a.add(r))}catch(e){c.error(e)}},close:u};const h={};i.forEach(e=>{h[e]=(t,...n)=>{const r=Hh.parse(new Error(void 0));this.onConsoleEvent("custom",{type:e,extra:void 0,fileUrl:r,e:t,more:n})}}),window.ConsoleListener.on(h),window.addEventListener("unload",u),window.onerror=(e,t="",n,r,i)=>{const o={msg:e,url:t,lineNo:n,columnNo:r,error:i},s=new Gh({columnNumber:r,fileName:t,lineNumber:n});this.onConsoleEvent("custom",{type:"error",extra:o,e:o.msg,fileUrl:s})};const d=e=>{const t=Hh.parse(new Error("0"));let n,r;try{n=null==e?void 0:e.reason}catch(e){n=void 0}try{r=null==e?void 0:e.detail,!n&&r&&(n=null==r?void 0:r.reason)}catch(e){}n||(n="[unhandledrejection] error getting `reason` from event"),this.onConsoleEvent("custom",{type:"error",e:`Uncaught (in promise) ${n}`,fileUrl:t,extra:void 0})};window.addEventListener("unhandledrejection",d),window.addEventListener("unload",()=>{window.removeEventListener("unhandledrejection",d)})}ListenNetworkEvents(){const e=window.fetch,t=this,n=e=>{if(!e)return!1;const t=e.toLowerCase();return t.includes("application/json")||t.includes("text/")||t.includes("application/xml")||t.includes("application/x-www-form-urlencoded")};window.fetch=function(...r){var i;return Uh(this,void 0,void 0,function*(){const o=Date.now(),s=r[0]instanceof Request?r[0]:new Request(r[0].toString(),r[1]),a=s.url;let l;try{if(!(null===(i=s.signal)||void 0===i?void 0:i.aborted)){const e=s.headers.get("content-type");n(e)&&(l=yield s.clone().text())}}catch(e){c.error("Error reading request body:",e)}return new Promise((i,u)=>{e.apply(window,r).then(e=>Uh(this,void 0,void 0,function*(){var r,u;try{if(e&&!(null===(r=s.signal)||void 0===r?void 0:r.aborted)){const r=e.clone(),i=e.headers.get("content-type"),h=s.method,d=Object.fromEntries(s.headers),p=Object.fromEntries(e.headers),f=Date.now();let m;try{n(i)&&(m=(null==i?void 0:i.toLowerCase().includes("json"))?JSON.stringify(yield r.json()):yield r.text())}catch(e){if(c.error("Error parsing response:",e),n(i))try{m=yield r.text()}catch(e){c.error("Error parsing response as text:",e)}}"BetterBugsSDK"===d["X-App-Client"]||window.isRecordingTab||null===(u=t.dbLogger)||void 0===u||u.saveNetworkRequest({id:tt(),method:h,response:m,requestBody:l,requestHeaders:Object.entries(d).map(([e,t])=>({name:e,value:t})),responseHeaders:Object.entries(p).map(([e,t])=>({name:e,value:t})),url:a||e.url,statusCode:e.status,isError:e.status>=400,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:o,endTime:f,initiator:window.location.origin})}}catch(e){c.error("Error processing fetch response:",e)}i(e)})).catch(e=>{var n;try{const r=Object.fromEntries(s.headers);"BetterBugsSDK"===r["X-App-Client"]||window.isRecordingTab||null===(n=t.dbLogger)||void 0===n||n.saveNetworkRequest({id:tt(),method:s.method,requestBody:l,requestHeaders:Object.entries(r).map(([e,t])=>({name:e,value:t})),responseHeaders:[],url:a,statusCode:0,isError:!0,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:o,endTime:Date.now(),initiator:window.location.origin,response:(null==e?void 0:e.message)||"Network request failed"})}catch(e){c.error("Error saving failed fetch request:",e)}u(e)})})})},function(){const e=XMLHttpRequest.prototype,r=e.open,i=e.send,o=e.setRequestHeader;e.open=function(e,t){try{this._startTime=Date.now(),this._method=e,this._url=(e=>{try{return new URL(e,window.location.origin).toString()}catch(t){return c.error("Error getting absolute URL:",t),e}})(t),this._requestHeaders={}}catch(e){c.error("Error in XHR open:",e)}return r.apply(this,[e,t,!0,null,null])},e.setRequestHeader=function(e,t){try{this._requestHeaders&&(this._requestHeaders[e]=t)}catch(e){c.error("Error in XHR setRequestHeader:",e)}return o.apply(this,[e,t])},e.send=function(e){var r,o;try{const i=(null===(r=this._requestHeaders)||void 0===r?void 0:r["content-type"])||(null===(o=this._requestHeaders)||void 0===o?void 0:o["Content-Type"]);n(i||null)&&(this._requestBody=e),this.addEventListener("load",function(){var e;try{const r=this._method||"GET",i=this._requestHeaders||{},o=this._url||this.responseURL,s=this.status,a=this._startTime||Date.now(),l=this.getAllResponseHeaders().split("\r\n").reduce((e,t)=>{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{}),u=Date.now(),c=this.getResponseHeader("content-type");let h;n(c)&&(h=this.response),"BetterBugsSDK"===i["X-App-Client"]||window.isRecordingTab||null===(e=t.dbLogger)||void 0===e||e.saveNetworkRequest({id:tt(),method:r,response:h,requestBody:this._requestBody,requestHeaders:Object.entries(i).map(([e,t])=>({name:e,value:t})),responseHeaders:Object.entries(l).map(([e,t])=>({name:e,value:t})),url:o,isError:s>=400,statusCode:s,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:a,endTime:u,initiator:window.location.origin})}catch(e){c.error("Error processing XHR response:",e)}});const s=(e,n)=>{var r;try{const i=e._requestHeaders||{};"BetterBugsSDK"===i["X-App-Client"]||window.isRecordingTab||null===(r=t.dbLogger)||void 0===r||r.saveNetworkRequest({id:tt(),method:e._method||"GET",response:n,requestBody:e._requestBody,requestHeaders:Object.entries(i).map(([e,t])=>({name:e,value:t})),responseHeaders:[],url:e._url||"",isError:!0,statusCode:0,type:"xmlhttprequest",createdAt:(new Date).toDateString(),timestamp:Date.now(),startTime:e._startTime||Date.now(),endTime:Date.now(),initiator:window.location.origin})}catch(e){c.error("Error saving failed XHR request:",e)}};this.addEventListener("error",function(){s(this,"Network request failed")}),this.addEventListener("timeout",function(){s(this,"Request timed out")}),this.addEventListener("abort",function(){s(this,"Request aborted")})}catch(e){c.error("Error in XHR send:",e)}return i.apply(this,[e])}}()}ListenNavigationEvents(){let e=window.location.href;const t=(t,n,i)=>{if(i&&n!==i){e=i;try{this.onSteps({id:tt(),eventType:r,eventData:i,eventElement:`via ${t} from ${n}`,url:i,createdAt:(new Date).toISOString(),timestamp:Date.now()})}catch(e){c.error("Error saving navigation log:",e)}}},n=history.pushState.bind(history),i=history.replaceState.bind(history);history.pushState=function(r,i,o){const s=e;n(r,i,o);const a=o?new URL(o.toString(),window.location.origin).href:window.location.href;t("pushState",s,a)},history.replaceState=function(n,r,o){const s=e;i(n,r,o);const a=o?new URL(o.toString(),window.location.origin).href:window.location.href;t("replaceState",s,a)},window.addEventListener("popstate",()=>{const n=window.location.href,r=new URL(e),i=new URL(n);r.origin===i.origin&&r.pathname===i.pathname&&r.search===i.search||t("popstate",e,n)}),window.addEventListener("hashchange",()=>{const n=window.location.href;t("hashchange",e,n)})}initializeRecording(t){try{window.stopRRweb&&window.stopRRweb(),window.stopRRweb=vh({emit:(e,n)=>{const r=et(e);switch(r.isCheckout=n,t&&this.onRRwebEvent(r),r.type){case yc.IncrementalSnapshot:r.data.source===vc.MouseInteraction&&r.data.type===bc.Click?rt(e=>this.handleClickEvent(e),100)(r):r.data.source===vc.Scroll?rt(e=>this.handleScrollEvent(e),500)(r):r.data.source===vc.Input&&this.handleInputEvent(r);break;case yc.Meta&&!n:this.handleNavigationEvent(r)}},checkoutEveryNms:1e3,inlineStylesheet:!0,slimDOMOptions:{comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},maskInputOptions:{email:!0,password:!0,number:!0,tel:!0},blockSelector:`#${e}`,maskTextSelector:'[data-betterbugs="ignore"]'})}catch(e){c.log("error: ",e)}window.addEventListener("keyup",this.handleKeyUpEvent)}handleNavigationEvent(e){this.onSteps({id:tt(),eventType:r,eventData:e.data.href,eventElement:null,url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleInputEvent(t){var n,r,o;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(n=null===document||void 0===document?void 0:document.getElementById(e))||void 0===n?void 0:n.contains(document.activeElement))||"BODY"===(null===(r=document.activeElement)||void 0===r?void 0:r.tagName)||this.onSteps({id:tt(),eventType:i,eventData:t.data.text,eventElement:nt((null===(o=null===document||void 0===document?void 0:document.activeElement)||void 0===o?void 0:o.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleClickEvent(n){var r,i,o,s,a,l;(null===document||void 0===document?void 0:document.getElementById(e))&&(null===(r=null===document||void 0===document?void 0:document.getElementById(e))||void 0===r?void 0:r.contains(document.elementFromPoint(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.x,null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.y)))||this.onSteps({id:tt(),eventType:t,eventData:(null===(s=document.elementFromPoint(n.data.x,n.data.y))||void 0===s?void 0:s.innerText)?null===(a=document.elementFromPoint(n.data.x,n.data.y))||void 0===a?void 0:a.innerText:"",eventElement:nt((null===(l=null===document||void 0===document?void 0:document.elementFromPoint(n.data.x,n.data.y))||void 0===l?void 0:l.outerHTML)||"",200),url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}handleScrollEvent(e){const t=e.data.y-this.lastScrollY;if(this.lastScrollY=e.data.y,0===t)return;const n=t>0?"down":"up";this.onSteps({id:tt(),eventType:s,eventData:n,scrollDelta:t,scrollY:e.data.y,eventElement:null,url:window.location.href,timestamp:Date.now(),createdAt:(new Date).toDateString()})}onConsoleEvent(e,t){var n,r,i;window.isRecordingTab||("rrweb"===e&&"data"in t?null===(n=this.dbLogger)||void 0===n||n.saveConsoleLog({id:tt(),args:null===(r=t.data.payload.payload)||void 0===r?void 0:r.map(e=>{try{return JSON.parse(e)}catch(t){return e}}),file:t.data.payload.trace,timestamp:Date.now(),url:window.location.href,type:t.data.payload.level,createdAt:(new Date).toDateString()}):"type"in t&&(null===(i=this.dbLogger)||void 0===i||i.saveConsoleLog({type:t.type,args:[t.e,...(null==t?void 0:t.more)||[]],timestamp:Date.now(),url:window.location.href,file:t.fileUrl,id:tt(),createdAt:(new Date).toDateString()})))}onRRwebEvent(e){var t;return Uh(this,void 0,void 0,function*(){window.isRecordingTab||null===(t=this.dbLogger)||void 0===t||t.saveRewindData({id:tt(),event:e,createdAt:(new Date).toDateString(),timestamp:Date.now(),url:window.location.href})})}onSteps(e){var t;return Uh(this,void 0,void 0,function*(){window.isRecordingTab||null===(t=this.dbLogger)||void 0===t||t.saveSteps(e)})}getApplicationData(){var e,t;return Uh(this,void 0,void 0,function*(){if(window.isRecordingTab)return[];const n=[],r=null===window||void 0===window?void 0:window.localStorage,i=null===window||void 0===window?void 0:window.sessionStorage,o=document.cookie.split(";").map(e=>{const[t,n]=e.trim().split("=");return{args:{name:t,value:decodeURIComponent(n),domain:window.location.hostname,path:"/",secure:"https:"===window.location.protocol,httpOnly:!1,sameSite:"lax",hostOnly:!1,session:!0,storeId:"0",expirationDate:null},type:"cookie",url:window.location.href,timestamp:Date.now()}});if(n.push(...o),r)for(const t in r)if(null===(e=Object.prototype.hasOwnProperty)||void 0===e?void 0:e.call(r,t)){const e=r[t];if("function"==typeof e)continue;const i={args:{key:t,value:e},type:"local",url:window.location.href,timestamp:Date.now()};n.push(i)}for(const e in i)if(null===(t=Object.prototype.hasOwnProperty)||void 0===t?void 0:t.call(i,e)){const t=i[e];if("function"==typeof t)continue;const r={args:{key:e,value:t},type:"session",url:window.location.href,timestamp:Date.now()};n.push(r)}return n})}startRecording({captureRewindEvents:e=!0}){return Uh(this,void 0,void 0,function*(){Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).ListenNetworkEvents(),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).listenConsoleEvents(),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).initializeRecording(e),Yh.getInstance({maxRecordingMinutes:this.maxRecordingMinutes,isInitializedForRecordingLink:this.isInitializedForRecordingLink}).ListenNavigationEvents(),window.isBetterbugsLogsCaptureInitialized=!0})}getAllData(e,t=!1){var n,r;return Uh(this,void 0,void 0,function*(){const[i,o]=yield Promise.all([t?null===(n=this.dbLogger)||void 0===n?void 0:n.queryLogs(e,!0):Promise.resolve([]),null===(r=this.dbLogger)||void 0===r?void 0:r.queryLogs(e,!1,!0)]);return{rewindData:i,logsData:o}})}captureScreenshot(){return Uh(this,void 0,void 0,function*(){const e=new CustomEvent("betterbugs:captureScreenshot");document.dispatchEvent(e)})}submitBug(e){return Uh(this,void 0,void 0,function*(){const t=new CustomEvent("betterbugs:submitBug",{detail:e});document.dispatchEvent(t)})}stopRecording(){var e;return Uh(this,void 0,void 0,function*(){window.stopRRweb&&window.stopRRweb(),this.dbLogger&&(null===(e=this.dbLogger)||void 0===e||e.destroy(),this.dbLogger=void 0),Yh.instance=void 0})}}window.isBetterbugsLogsCaptureInitialized||Yh.getInstance({maxRecordingMinutes:15,isInitializedForRecordingLink:!0}).startRecording({captureRewindEvents:!1})}(),r=r.default}()});
|