1(function(ue,le){typeof exports=="object"&&typeof module<"u"?le(exports):typeof define=="function"&&define.amd?define(["exports"],le):(ue=typeof globalThis<"u"?globalThis:ue||self,le(ue.raisso={}))})(this,function(ue){"use strict";var Eh=Object.defineProperty;var xh=(ue,le,qe)=>le in ue?Eh(ue,le,{enumerable:!0,configurable:!0,writable:!0,value:qe}):ue[le]=qe;var g=(ue,le,qe)=>xh(ue,typeof le!="symbol"?le+"":le,qe);function le(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qe=function(){this.tests={},this.cache={}};qe.prototype={constructor:qe,define:function(n,e){if(typeof n!="string"||!(e instanceof Function))throw new Error("Invalid capability definition.");if(this.tests[n])throw new Error('Duplicated capability definition by "'+n+'".');this.tests[n]=e},check:function(n){if(!this.test(n))throw new Error('The current environment does not support "'+n+'", therefore we cannot continue.')},test:function(n){if(this.cache[n]!==void 0)return this.cache[n];if(!this.tests[n])throw new Error('Unknown capability with name "'+n+'".');var e=this.tests[n];return this.cache[n]=!!e(),this.cache[n]}};var xc=qe,Ic=xc,vn=new Ic,Bt=function(n){return vn.test(n)};Bt.define=function(n,e){vn.define(n,e)},Bt.check=function(n){vn.check(n)},Bt.test=Bt;var ta=Bt,ra=ta,we=ra.define,ct=ra.test;we("strict mode",function(){return this===void 0}),we("arguments.callee.caller",function(){try{return function(){return arguments.callee.caller}()===arguments.callee}catch{return!1}}),we("es5",function(){return ct("Array.prototype.forEach")&&ct("Array.prototype.map")&&ct("Function.prototype.bind")&&ct("Object.create")&&ct("Object.defineProperties")&&ct("Object.defineProperty")&&ct("Object.prototype.hasOwnProperty")}),we("Array.prototype.forEach",function(){return Array.prototype.forEach}),we("Array.prototype.map",function(){return Array.prototype.map}),we("Function.prototype.bind",function(){return Function.prototype.bind}),we("Object.create",function(){return Object.create}),we("Object.defineProperties",function(){return Object.defineProperties}),we("Object.defineProperty",function(){return Object.defineProperty}),we("Object.prototype.hasOwnProperty",function(){return Object.prototype.hasOwnProperty}),we("Error.captureStackTrace",function(){return Error.captureStackTrace}),we("Error.prototype.stack",function(){try{throw new Error}catch(n){return n.stack||n.stacktrace}});var wn=ta;wn.check("es5");var _n,na;function bn(){if(na)return _n;na=1;var n=function(e,t,r){var s="";if(s+=e.name||"Error",s+=": "+(e.message||""),r instanceof Array)for(var a in r){var i=r[a];s+=` 2 # `+i}for(var o in t){var c=t[o];s+=` 3 at `+c.toString()}return s};return _n=n,_n}var Sn,sa;function Rc(){if(sa)return Sn;sa=1;var n=bn();return Sn=function(){return Error.getStackTrace=function(e){return e.stack},{prepareStackTrace:n}},Sn}var kn,aa;function Nc(){if(aa)return kn;aa=1;var n=function(){var e=Object.create({Source:Object,config:{},buildArgs:[]});function t(c){var u="config";if(c instanceof Function)u="Source";else if(c instanceof Array)u="buildArgs";else if(c instanceof Object)u="config";else throw new Error("Invalid configuration option.");if(e.hasOwnProperty(u))throw new Error("Duplicated configuration option: "+u+".");e[u]=c}for(var r=0,s=arguments.length;r<s;++r)t(arguments[r]);var a=e.Source,i=e.config,o=e.buildArgs;return(a.extend||n.extend).call(a,i,o)};return n.factory=function(){return function(){var e=this;e.build instanceof Function&&e.build.apply(e,arguments),e.init instanceof Function&&e.init.apply(e,arguments)}},n.extend=function(e,t){var r=this;e||(e={});var s;return e.prototype instanceof Object&&e.prototype.constructor!==Object?s=e.prototype.constructor:e.factory instanceof Function&&(s=e.factory.call(r)),s=(r.clone||n.clone).call(r,s,t),(s.merge||n.merge).call(s,e),s},n.prototype.extend=function(e,t){var r=this,s=(r.clone||n.prototype.clone).apply(r,t);return(s.merge||n.prototype.merge).call(s,e),s},n.clone=function(e,t){var r=this;e instanceof Function||(e=(r.factory||n.factory).call(r)),e.prototype=(r.prototype.clone||n.prototype.clone).apply(r.prototype,t||[]),e.prototype.constructor=e;for(var s in r)s!=="prototype"&&(e[s]=r[s]);return e},n.prototype.clone=function(){var e=this,t=Object.create(e);return t.build instanceof Function&&t.build.apply(t,arguments),t},n.merge=function(e){var t=this;for(var r in e)r!=="prototype"&&(t[r]=e[r]);return e.prototype instanceof Object&&(t.prototype.merge||n.prototype.merge).call(t.prototype,e.prototype),t},n.prototype.merge=function(e){var t=this;for(var r in e)r!=="constructor"&&(t[r]=e[r]);return t},n.absorb=function(e){var t=this;for(var r in e)r!=="prototype"&&(t[r]===void 0||t[r]===Function.prototype[r])&&(t[r]=e[r]);return e.prototype instanceof Object&&(t.prototype.absorb||n.prototype.absorb).call(t.prototype,e.prototype),t},n.prototype.absorb=function(e){var t=this;for(var r in e)r!=="constructor"&&(t[r]===void 0||t[r]===Object.prototype[r])&&(t[r]=e[r]);return t},n.getAncestor=function(){var e=this;if(e!==e.prototype.constructor)return e.prototype.constructor},n.newInstance=function(){var e=this,t=Object.create(this.prototype);return e.apply(t,arguments),t},kn=n,kn}var On,ia;function Ac(){return ia||(ia=1,On=function(){throw new Error("Not implemented.")}),On}var Tn,oa;function Cc(){return oa||(oa=1,Tn={Class:Nc(),abstractMethod:Ac()}),Tn}var En,ca;
3function Kt(){return ca||(ca=1,En=Cc()),En}var xn,ua;function Pc(){if(ua)return xn;ua=1;var n=function(e){var t=!1,r;return e instanceof Function||(t=!0,r=e,e=null),function(){return t||(t=!0,r=e.apply(this,arguments),e=null),r}};return xn=n,xn}var In,la;function Dc(){return la||(la=1,In=function n(e,t,r){if(r||(r=[]),r.length<e.length){var s=e[r.length];for(var a in s)r[r.length]=s[a],n(e,t,r),--r.length}else t.apply(null,r)}),In}var Rn,fa;function Lc(){return fa||(fa=1,Rn={cache:Pc(),eachCombination:Dc()}),Rn}var Nn,da;function Yt(){return da||(da=1,Nn=Lc()),Nn}var An,ha;function Mc(){if(ha)return An;ha=1;var n=Kt().Class,e=Kt().abstractMethod,t=Yt().eachCombination,r=Yt().cache,s=wn,a=n(Object,{prototype:{captureFrameStrings:function(o){var c=this.createError();o.unshift(this.captureFrameStrings),o.unshift(this.createError);var u=this.getFrameStrings(c),f=u.slice(o.length),m=[];if(s("arguments.callee.caller")){var _=[this.createError,this.captureFrameStrings];try{for(var h=arguments.callee;h=h.caller;)_.push(h)}catch{}m=_.slice(o.length)}return{frameStrings:f,functionValues:m}},getFrameStrings:function(o){var c=o.message||"",u=o.name||"",f=this.getStackString(o);if(f!==void 0){var m=f.split(` 4`),_=0,h=m.length;return this.hasHeader&&(_+=u.split(` 5`).length+c.split(` 6`).length-1),this.hasFooter&&(h-=1),m.slice(_,h)}},createError:e,getStackString:e,hasHeader:void 0,hasFooter:void 0}}),i=n(Object,{prototype:{calibrateClass:function(o){return this.calibrateMethods(o)&&this.calibrateEnvelope(o)},calibrateMethods:function(o){try{t([[function(c){return new Error(c)},function(c){try{throw new Error(c)}catch(u){return u}}],[function(c){return c.stack},function(c){return c.stacktrace}]],function(c,u){if(u(c()))throw{getStackString:u,createError:c}})}catch(c){return n.merge.call(o,{prototype:c}),!0}return!1},calibrateEnvelope:function(o){var c=o.prototype.getStackString,u=o.prototype.createError,f=c(u("marker")),m=f.split(` 7`);return n.merge.call(o,{prototype:{hasHeader:/marker/.test(m[0]),hasFooter:m[m.length-1]===""}}),!0}}});return An={getClass:r(function(){var o;if(o)return o;o=n(a,{});var c=new i;if(!c.calibrateClass(o))throw new Error("Cannot read Error.prototype.stack in this environment.");return o}),getInstance:r(function(){var o=this.getClass(),c=new o;return c})},An}var Cn,ma;function $c(){if(ma)return Cn;ma=1;var n=Kt().Class,e=Kt().abstractMethod,t=n(Object,{prototype:{init:n.prototype.merge,frameString:void 0,toString:function(){return this.frameString},functionValue:void 0,getThis:e,getTypeName:e,getFunction:function(){return this.functionValue},getFunctionName:e,getMethodName:e,getFileName:e,getLineNumber:e,getColumnNumber:e,getEvalOrigin:e,isTopLevel:e,isEval:e,isNative:e,isConstructor:e}});return Cn=t,Cn}var Pn,pa;function Fc(){if(pa)return Pn;pa=1;var n=Kt().Class,e=$c(),t=Yt().cache,r=n(Object,{prototype:{stackParser:null,frameParser:null,locationParsers:null,constructor:function(s){n.prototype.merge.call(this,s)},getFrames:function(s,a){for(var i=[],o=0,c=s.length;o<c;++o)i[o]=this.getFrame(s[o],a[o]);return i},getFrame:function(s,a){var i={frameString:s,functionValue:a};return new e(i)}}});return Pn={getClass:t(function(){return r}),getInstance:t(function(){var s=this.getClass(),a=new s;return a})},Pn}var Dn,ya;function Uc(){if(ya)return Dn;ya=1;var n=Mc(),e=Fc(),t=Yt().cache,r=bn();return Dn=function(){return Error.captureStackTrace=function s(a,i){var o,c=[s];i&&c.push(i);var u=n.getInstance().captureFrameStrings(c);Object.defineProperties(a,{stack:{configurable:!0,get:t(function(){var f=e.getInstance().getFrames(u.frameStrings,u.functionValues);return(Error.prepareStackTrace||r)(a,f,o)})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(s){if(s.cachedStack)return s.stack;var a=n.getInstance().getFrameStrings(s),i=[],o;a?i=e.getInstance().getFrames(a,[]):o=["The stack is not readable by unthrown errors in this environment."];var c=(Error.prepareStackTrace||r)(s,i,o);if(a)try{Object.defineProperties(s,{stack:{configurable:!0,writable:!0,enumerable:!1,value:c},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch{}return c},{prepareStackTrace:r}},Dn}var Ln,ga;function Vc(){if(ga)return Ln;ga=1;var n=Yt().cache,e=bn();return Ln=function(){return Error.captureStackTrace=function(t,r){Object.defineProperties(t,{stack:{configurable:!0,get:n(function(){return(Error.prepareStackTrace||e)(t,[])})},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})},Error.getStackTrace=function(t){if(t.cachedStack)return t.stack;var r=(Error.prepareStackTrace||e)(t,[]);try{Object.defineProperties(t,{stack:{configurable:!0,writable:!0,enumerable:!1,value:r},cachedStack:{configurable:!0,writable:!0,enumerable:!1,value:!0}})}catch{}return r},{prepareStackTrace:e}},Ln}var va=wn,Tr;
vendor: 3,939 bytes, line 7
7va("Error.captureStackTrace")?Tr=Rc():va("Error.prototype.stack")?Tr=Uc():Tr=Vc(),Tr();var Mn=function(n,e){return Mn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},Mn(n,e)};function ut(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Mn(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Er=function(){return Er=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Er.apply(this,arguments)};function jc(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}function zc(n,e,t,r){function s(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function o(f){try{u(r.next(f))}catch(m){i(m)}}function c(f){try{u(r.throw(f))}catch(m){i(m)}}function u(f){f.done?a(f.value):s(f.value).then(o,c)}u((r=r.apply(n,e||[])).next())})}function wa(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(u){return function(f){return c([u,f])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(t=0)),t;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _t(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $n(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(i)throw i.error}}return a}function Fn(n,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,a;r<s;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))}function bt(n){return this instanceof bt?(this.v=n,this):new bt(n)}function Zc(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(h){return function(O){return Promise.resolve(O).then(h,m)}}function o(h,O){r[h]&&(s[h]=function(A){return new Promise(function(Z,ee){a.push([h,A,Z,ee])>1||c(h,A)})},O&&(s[h]=O(s[h])))}function c(h,O){try{u(r[h](O))}
vendor: 10,063 bytes, lines 7-9
7catch(A){_(a[0][3],A)}}function u(h){h.value instanceof bt?Promise.resolve(h.value.v).then(f,m):_(a[0][2],h)}function f(h){c("next",h)}function m(h){c("throw",h)}function _(h,O){h(O),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Wc(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof _t=="function"?_t(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=n[a]&&function(i){return new Promise(function(o,c){i=n[a](i),s(o,c,i.done,i.value)})}}function s(a,i,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},i)}}typeof SuppressedError=="function"&&SuppressedError;function X(n){return typeof n=="function"}function Un(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Vn=Un(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription: 8`+t.map(function(r,s){return s+1+") "+r.toString()}).join(` 9 `):"",this.name="UnsubscriptionError",this.errors=t}});function jn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var xr=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,r,s,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var o=_t(i),c=o.next();!c.done;c=o.next()){var u=c.value;u.remove(this)}}catch(A){e={error:A}}finally{try{c&&!c.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else i.remove(this);var f=this.initialTeardown;if(X(f))try{f()}catch(A){a=A instanceof Vn?A.errors:[A]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var _=_t(m),h=_.next();!h.done;h=_.next()){var O=h.value;try{Sa(O)}catch(A){a=a??[],A instanceof Vn?a=Fn(Fn([],$n(a)),$n(A.errors)):a.push(A)}}}catch(A){r={error:A}}finally{try{h&&!h.done&&(s=_.return)&&s.call(_)}finally{if(r)throw r.error}}}if(a)throw new Vn(a)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Sa(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&jn(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&jn(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),_a=xr.EMPTY;function ba(n){return n instanceof xr||n&&"closed"in n&&X(n.remove)&&X(n.add)&&X(n.unsubscribe)}function Sa(n){X(n)?n():n.unsubscribe()}var qc={Promise:void 0},Jc={setTimeout:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setTimeout.apply(void 0,Fn([n,e],$n(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function ka(n){Jc.setTimeout(function(){throw n})}function Oa(){}function Ir(n){n()}var zn=function(n){ut(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,ba(t)&&t.add(r)):r.destination=Bc,r}return e.create=function(t,r,s){return new Rr(t,r,s)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(xr),Gc=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(r){Nr(r)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(r){Nr(r)}else Nr(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Nr(t)}},n}(),Rr=function(n){ut(e,n);function e(t,r,s){var a=n.call(this)||this,i;return X(t)||!t?i={next:t??void 0,error:r??void 0,complete:s??void 0}:i=t,a.destination=new Gc(i),a}return e}(zn);function Nr(n){ka(n)}function Qc(n){throw n}var Bc={closed:!0,next:Oa,error:Qc,complete:Oa},Zn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Kc(n){return n}function Yc(n){return n.length===0?Kc:n.length===1?n[0]:function(t){return n.reduce(function(r,s){return s(r)},t)}}var he=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var s=this,a=Xc(e)?e:new Rr(e,t,r);return Ir(function(){var i=s,o=i.operator,c=i.source;a.add(o?o.call(a,c):c?s._subscribe(a):s._trySubscribe(a))}),a},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=Ta(t),new t(function(s,a){var i=new Rr({next:function(o){try{e(o)}catch(c){a(c),i.unsubscribe()}},error:a,complete:s});r.subscribe(i)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[Zn]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Yc(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=Ta(e),new e(function(r,s){var a;t.subscribe(function(i){return a=i},function(i){return s(i)},function(){return r(a)})})},n.create=function(e){return new n(e)},n}();function Ta(n){var e;return(e=n??qc.Promise)!==null&&e!==void 0?e:Promise}function Hc(n){return n&&X(n.next)&&X(n.error)&&X(n.complete)}function Xc(n){return n&&n instanceof zn||Hc(n)&&ba(n)}function eu(n){return X(n==null?void 0:n.lift)}function lt(n){return function(e){if(eu(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Ue(n,e,t,r,s){return new tu(n,e,t,r,s)}var tu=function(n){ut(e,n);function e(t,r,s,a,i,o){var c=n.call(this,t)||this;return c.onFinalize=i,c.shouldUnsubscribe=o,c._next=r?function(u){try{r(u)}catch(f){t.error(f)}}:n.prototype._next,c._error=a?function(u){try{a(u)}catch(f){t.error(f)}finally{this.unsubscribe()}}:n.prototype._error,c._complete=s?function(){try{s()}catch(u){t.error(u)}finally{this.unsubscribe()}}:n.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;n.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(zn),ru=Un(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Wn=function(n){ut(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new Ea(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new ru},e.prototype.next=function(t){var r=this;Ir(function(){var s,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var i=_t(r.currentObservers),o=i.next();!o.done;o=i.next()){var c=o.value;c.next(t)}}catch(u){s={error:u}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var r=this;Ir(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var s=r.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;Ir(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,s=this,a=s.hasError,i=s.isStopped,o=s.observers;return a||i?_a:(this.currentObservers=null,o.push(t),new xr(function(){r.currentObservers=null,jn(o,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,s=r.hasError,a=r.thrownError,i=r.isStopped;s?t.error(a):i&&t.complete()},e.prototype.asObservable=function(){var t=new he;return t.source=this,t},e.create=function(t,r){return new Ea(t,r)},e}(he),Ea=function(n){ut(e,n);function e(t,r){var s=n.call(this)||this;return s.destination=t,s.source=r,s}return e.prototype.next=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,t)},e.prototype.error=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&s!==void 0?s:_a},e}(Wn),xa=function(n){ut(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()}
9,enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,s=t.thrownError,a=t._value;if(r)throw s;return this._throwIfClosed(),a},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(Wn),Ia={now:function(){return(Ia.delegate||Date).now()},delegate:void 0},nu=function(n){ut(e,n);function e(t,r,s){t===void 0&&(t=1/0),r===void 0&&(r=1/0),s===void 0&&(s=Ia);var a=n.call(this)||this;return a._bufferSize=t,a._windowTime=r,a._timestampProvider=s,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,t),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(t){var r=this,s=r.isStopped,a=r._buffer,i=r._infiniteTimeWindow,o=r._timestampProvider,c=r._windowTime;s||(a.push(t),!i&&a.push(o.now()+c)),this._trimBuffer(),n.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(t),s=this,a=s._infiniteTimeWindow,i=s._buffer,o=i.slice(),c=0;c<o.length&&!t.closed;c+=a?1:2)t.next(o[c]);return this._checkFinalizedStatuses(t),r},e.prototype._trimBuffer=function(){var t=this,r=t._bufferSize,s=t._timestampProvider,a=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*r;if(r<1/0&&o<a.length&&a.splice(0,a.length-o),!i){for(var c=s.now(),u=0,f=1;f<a.length&&a[f]<=c;f+=2)u=f;u&&a.splice(0,u+1)}},e}(Wn),su=new he(function(n){return n.complete()});function au(n){return n&&X(n.schedule)}function iu(n){return n[n.length-1]}function ou(n){return au(iu(n))?n.pop():void 0}var Ra=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function Na(n){return X(n==null?void 0:n.then)}function Aa(n){return X(n[Zn])}function Ca(n){return Symbol.asyncIterator&&X(n==null?void 0:n[Symbol.asyncIterator])}function Pa(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function cu(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Da=cu();function La(n){return X(n==null?void 0:n[Da])}function Ma(n){return Zc(this,arguments,function(){var t,r,s,a;return wa(this,function(i){switch(i.label){case 0:t=n.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,bt(t.read())];case 3:return r=i.sent(),s=r.value,a=r.done,a?[4,bt(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,bt(s)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function $a(n){return X(n==null?void 0:n.getReader)}function Je(n){if(n instanceof he)return n;if(n!=null){if(Aa(n))return uu(n);if(Ra(n))return lu(n);if(Na(n))return fu(n);if(Ca(n))return Fa(n);if(La(n))return du(n);if($a(n))return hu(n)}throw Pa(n)}function uu(n){return new he(function(e){var t=n[Zn]();if(X(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function lu(n){return new he(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function fu(n){return new he(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ka)})}function du(n){return new he(function(e){var t,r;try{for(var s=_t(n),a=s.next();!a.done;a=s.next()){var i=a.value;if(e.next(i),e.closed)return}}catch(o){t={error:o}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}e.complete()})}function Fa(n){return new he(function(e){mu(n,e).catch(function(t){return e.error(t)})})}function hu(n){return Fa(Ma(n))}function mu(n,e){var t,r,s,a;return zc(this,void 0,void 0,function(){var i,o;return wa(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=Wc(n),c.label=1;case 1:return[4,t.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=c.sent(),s={error:o},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=t.return)?[4,a.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];
9case 10:return[7];case 11:return e.complete(),[2]}})})}function ft(n,e,t,r,s){r===void 0&&(r=0),s===void 0&&(s=!1);var a=e.schedule(function(){t(),s?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(a),!s)return a}function Ua(n,e){return e===void 0&&(e=0),lt(function(t,r){t.subscribe(Ue(r,function(s){return ft(r,n,function(){return r.next(s)},e)},function(){return ft(r,n,function(){return r.complete()},e)},function(s){return ft(r,n,function(){return r.error(s)},e)}))})}function Va(n,e){return e===void 0&&(e=0),lt(function(t,r){r.add(n.schedule(function(){return t.subscribe(r)},e))})}function pu(n,e){return Je(n).pipe(Va(e),Ua(e))}function yu(n,e){return Je(n).pipe(Va(e),Ua(e))}function gu(n,e){return new he(function(t){var r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}function vu(n,e){return new he(function(t){var r;return ft(t,e,function(){r=n[Da](),ft(t,e,function(){var s,a,i;try{s=r.next(),a=s.value,i=s.done}catch(o){t.error(o);return}i?t.complete():t.next(a)},0,!0)}),function(){return X(r==null?void 0:r.return)&&r.return()}})}function ja(n,e){if(!n)throw new Error("Iterable cannot be null");return new he(function(t){ft(t,e,function(){var r=n[Symbol.asyncIterator]();ft(t,e,function(){r.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function wu(n,e){return ja(Ma(n),e)}function _u(n,e){if(n!=null){if(Aa(n))return pu(n,e);if(Ra(n))return gu(n,e);if(Na(n))return yu(n,e);if(Ca(n))return ja(n,e);if(La(n))return vu(n,e);if($a(n))return wu(n,e)}throw Pa(n)}function bu(n,e){return e?_u(n,e):Je(n)}function za(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=ou(n);return bu(n,t)}var Su=Un(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function qn(n,e){return new Promise(function(t,r){var s=new Rr({next:function(a){t(a),s.unsubscribe()},error:r,complete:function(){r(new Su)}});n.subscribe(s)})}function Ht(n,e){return lt(function(t,r){var s=0;t.subscribe(Ue(r,function(a){r.next(n.call(e,a,s++))}))})}function ku(n,e,t,r,s,a,i,o){var c=[],u=0,f=0,m=!1,_=function(){m&&!c.length&&!u&&e.complete()},h=function(A){return u<r?O(A):c.push(A)},O=function(A){u++;var Z=!1;Je(t(A,f++)).subscribe(Ue(e,function(ee){e.next(ee)},function(){Z=!0},void 0,function(){if(Z)try{u--;for(var ee=function(){var ge=c.shift();i||O(ge)};c.length&&u<r;)ee();_()}catch(ge){e.error(ge)}}))};return n.subscribe(Ue(e,h,function(){m=!0,_()})),function(){}}function Za(n,e,t){return t===void 0&&(t=1/0),X(e)?Za(function(r,s){return Ht(function(a,i){return e(r,a,s,i)})(Je(n(r,s)))},t):(typeof e=="number"&&(t=e),lt(function(r,s){return ku(r,s,n,t)}))}function Wa(n,e){return lt(function(t,r){var s=0;t.subscribe(Ue(r,function(a){return n.call(e,a,s++)&&r.next(a)}))})}function qa(n){return n<=0?function(){return su}:lt(function(e,t){var r=0;e.subscribe(Ue(t,function(s){++r<=n&&(t.next(s),n<=r&&t.complete())}))})}function Ou(n){return Ht(function(){return n})}function Tu(n,e){return Za(function(t,r){return Je(n(t,r)).pipe(qa(1),Ou(t))})}function Ja(n,e){return lt(function(t,r){var s=null,a=0,i=!1,o=function(){return i&&!s&&r.complete()};t.subscribe(Ue(r,function(c){s==null||s.unsubscribe();var u=0,f=a++;Je(n(c,f)).subscribe(s=Ue(r,function(m){return r.next(e?e(c,m,f,u++):m)},function(){s=null,o()}))},function(){i=!0,o()}))})}function Eu(n,e){e===void 0&&(e={});var t=e.selector,r=jc(e,["selector"]);return new he(function(s){var a=new AbortController,i=a.signal,o=!0,c=r.signal;if(c)if(c.aborted)a.abort();else{var u=function(){i.aborted||a.abort()};c.addEventListener("abort",u),s.add(function(){return c.removeEventListener("abort",u)})}var f=Er(Er({},r),{signal:i}),m=function(_){o=!1,s.error(_)};return fetch(n,f).then(function(_){t?Je(t(_)).subscribe(Ue(s,void 0,function(){o=!1,s.complete()},m)):(o=!1,s.next(_),s.complete())}).catch(m),function(){o&&a.abort()}})}class dt extends Error{}class xu extends dt{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Iu extends dt{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Ru extends dt{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class St extends dt{}class Ga extends dt{constructor(e){super(`Invalid unit ${e}`)}}class se extends dt{}class Ge extends dt{constructor(){super("Zone is an abstract class")}}const v="numeric",Te="short",me="long",Ar={year:v,month:v,day:v},Qa={year:v,month:Te,day:v},Nu={year:v,month:Te,day:v,weekday:Te},Ba={year:v,month:me,day:v},Ka={year:v,month:me,day:v,weekday:me},Ya={hour:v,minute:v},Ha={hour:v,minute:v,second:v},Xa={hour:v,minute:v,second:v,timeZoneName:Te},ei={hour:v,minute:v,second:v,timeZoneName:me},ti={hour:v,minute:v,hourCycle:"h23"},ri={hour:v,minute:v,second:v,hourCycle:"h23"},ni={hour:v,minute:v,second:v,hourCycle:"h23",timeZoneName:Te},si={hour:v,minute:v,second:v,hourCycle:"h23",timeZoneName:me},ai={year:v,month:v,day:v,hour:v,minute:v},ii={year:v,month:v,day:v,hour:v,minute:v,second:v},oi={year:v,month:Te,day:v,hour:v,minute:v},ci={year:v,month:Te,day:v,hour:v,minute:v,second:v},Au={year:v,month:Te,day:v,weekday:Te,hour:v,minute:v},ui={year:v,month:me,day:v,hour:v,minute:v,timeZoneName:Te},li={year:v,month:me,day:v,hour:v,minute:v,second:v,timeZoneName:Te},fi={year:v,month:me,day:v,weekday:me,hour:v,minute:v,timeZoneName:me},di={year:v,month:me,day:v,weekday:me,hour:v,minute:v,second:v,timeZoneName:me};class Xt{get type(){throw new Ge}get name(){throw new Ge}get ianaName(){return this.name}get isUniversal(){throw new Ge}offsetName(e,t){throw new Ge}formatOffset(e,t){throw new Ge}offset(e){throw new Ge}equals(e){throw new Ge}get isValid(){throw new Ge}}let Jn=null;class Cr extends Xt{static get instance(){return Jn===null&&(Jn=new Cr),Jn}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Fi(e,t,r)}formatOffset(e,t){return nr(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Gn=new Map;function Cu(n){let e=Gn.get(n);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Gn.set(n,e)),e}const Pu={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Du(n,e){const t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,a,i,o,c,u,f]=r;return[i,s,a,o,c,u,f]}function Lu(n,e){const t=n.formatToParts(e),r=[];for(let s=0;s<t.length;s++){const{type:a,value:i}=t[s],o=Pu[a];a==="era"?r[o]=i:x(o)||(r[o]=parseInt(i,10))}return r}const Qn=new Map;class Ve extends Xt{static create(e){let t=Qn.get(e);return t===void 0&&Qn.set(e,t=new Ve(e)),t}static resetCache(){Qn.clear(),Gn.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Ve.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Fi(e,t,r,this.name)}formatOffset(e,t){return nr(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=Cu(this.name);let[s,a,i,o,c,u,f]=r.formatToParts?Lu(r,t):Du(r,t);o==="BC"&&(s=-Math.abs(s)+1);const _=$r({year:s,month:a,day:i,hour:c===24?0:c,minute:u,second:f,millisecond:0});let h=+t;const O=h%1e3;return h-=O>=0?O:1e3+O,(_-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let hi={};function Mu(n,e={}){const t=JSON.stringify([n,e]);let r=hi[t];return r||(r=new Intl.ListFormat(n,e),hi[t]=r),r}const Bn=new Map;function Kn(n,e={}){const t=JSON.stringify([n,e]);let r=Bn.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(n,e),Bn.set(t,r)),r}const Yn=new Map;function $u(n,e={}){const t=JSON.stringify([n,e]);let r=Yn.get(t);return r===void 0&&(r=new Intl.NumberFormat(n,e),Yn.set(t,r)),r}const Hn=new Map;function Fu(n,e={}){const{base:t,...r}=e,s=JSON.stringify([n,r]);let a=Hn.get(s);return a===void 0&&(a=new Intl.RelativeTimeFormat(n,e),Hn.set(s,a)),a}let er=null;function Uu(){return er||(er=new Intl.DateTimeFormat().resolvedOptions().locale,er)}const Xn=new Map;function mi(n){let e=Xn.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Xn.set(n,e)),e}const es=new Map;function Vu(n){let e=es.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...pi,...e}),es.set(n,e)}return e}function ju(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let r,s;try{r=Kn(n).resolvedOptions(),s=n}catch{const c=n.substring(0,t);r=Kn(c).resolvedOptions(),s=c}
9const{numberingSystem:a,calendar:i}=r;return[s,a,i]}}function zu(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Zu(n){const e=[];for(let t=1;t<=12;t++){const r=T.utc(2009,t,1);e.push(n(r))}return e}function Wu(n){const e=[];for(let t=1;t<=7;t++){const r=T.utc(2016,11,13+t);e.push(n(r))}return e}function Pr(n,e,t,r){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):r(e)}function qu(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||mi(n.locale).numberingSystem==="latn"}class Ju{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:a,...i}=r;if(!t||Object.keys(i).length>0){const o={useGrouping:!1,...r};r.padTo>0&&(o.minimumIntegerDigits=r.padTo),this.inf=$u(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):us(e,3);return H(t,this.padTo)}}}class Gu{constructor(e,t,r){this.opts=r,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const i=-1*(e.offset/60),o=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;e.offset!==0&&Ve.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||s,this.dtf=Kn(t,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:r}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Qu{constructor(e,t,r){this.opts={style:"long",...r},!t&&Di()&&(this.rtf=Fu(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):yl(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const pi={firstDay:1,minimalDays:4,weekend:[6,7]};class V{static fromOpts(e){return V.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,s,a=!1){const i=e||W.defaultLocale,o=i||(a?"en-US":Uu()),c=t||W.defaultNumberingSystem,u=r||W.defaultOutputCalendar,f=os(s)||W.defaultWeekSettings;return new V(o,c,u,f,i)}static resetCache(){er=null,Bn.clear(),Yn.clear(),Hn.clear(),Xn.clear(),es.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:s}={}){return V.create(e,t,r,s)}constructor(e,t,r,s,a){const[i,o,c]=ju(e);this.locale=i,this.numberingSystem=t||o||null,this.outputCalendar=r||c||null,this.weekSettings=s,this.intl=zu(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=qu(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:V.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,os(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Pr(this,e,ji,()=>{const r=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=Zu(a=>this.extract(a,r,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1){return Pr(this,e,Wi,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=Wu(a=>this.extract(a,r,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Pr(this,void 0,()=>qi,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[T.utc(2016,11,13,9),T.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Pr(this,e,Ji,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[T.utc(-40,1,1),T.utc(2017,1,1)].map(r=>this.extract(r,t,"era"))),this.eraCache[e]}
9)}extract(e,t,r){const s=this.dtFormatter(e,t),a=s.formatToParts(),i=a.find(o=>o.type.toLowerCase()===r);return i?i.value:null}numberFormatter(e={}){return new Ju(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Gu(e,this.intl,t)}relFormatter(e={}){return new Qu(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Mu(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||mi(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Li()?Vu(this.locale):pi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ts=null;class oe extends Xt{static get utcInstance(){return ts===null&&(ts=new oe(0)),ts}static instance(e){return e===0?oe.utcInstance:new oe(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new oe(Fr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${nr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${nr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return nr(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Bu extends Xt{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Qe(n,e){if(x(n)||n===null)return e;if(n instanceof Xt)return n;if(tl(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Cr.instance:t==="utc"||t==="gmt"?oe.utcInstance:oe.parseSpecifier(t)||Ve.create(n)}else return Be(n)?oe.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Bu(n)}const rs={arab:"[Ù -Ù©]",arabext:"[Û°-Û¹]",bali:"[á-á]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[ï¼-ï¼]",gujr:"[૦-૯]",hanidec:"[ã|ä¸|äº|ä¸|å|äº|å
|ä¸|å
«|ä¹]",khmr:"[á -á©]",knda:"[೦-೯]",laoo:"[à»-à»]",limb:"[á¥-á¥]",mlym:"[൦-൯]",mong:"[á -á ]",mymr:"[á-á]",orya:"[à¦-à¯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[à¹-à¹]",tibt:"[༠-༩]",latn:"\\d"},yi={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ku=rs.hanidec.replace(/[\[|\]]/g,"").split("");function Yu(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);if(n[t].search(rs.hanidec)!==-1)e+=Ku.indexOf(n[t]);else for(const s in yi){const[a,i]=yi[s];r>=a&&r<=i&&(e+=r-a)}}return parseInt(e,10)}else return e}const ns=new Map;function Hu(){ns.clear()}function Ee({numberingSystem:n},e=""){const t=n||"latn";let r=ns.get(t);r===void 0&&(r=new Map,ns.set(t,r));let s=r.get(e);return s===void 0&&(s=new RegExp(`${rs[t]}${e}`),r.set(e,s)),s}let gi=()=>Date.now(),vi="system",wi=null,_i=null,bi=null,Si=60,ki,Oi=null;class W{static get now(){return gi}static set now(e){gi=e}static set defaultZone(e){vi=e}static get defaultZone(){return Qe(vi,Cr.instance)}static get defaultLocale(){return wi}static set defaultLocale(e){wi=e}static get defaultNumberingSystem(){return _i}static set defaultNumberingSystem(e){_i=e}
9static get defaultOutputCalendar(){return bi}static set defaultOutputCalendar(e){bi=e}static get defaultWeekSettings(){return Oi}static set defaultWeekSettings(e){Oi=os(e)}static get twoDigitCutoffYear(){return Si}static set twoDigitCutoffYear(e){Si=e%100}static get throwOnInvalid(){return ki}static set throwOnInvalid(e){ki=e}static resetCaches(){V.resetCache(),Ve.resetCache(),T.resetCache(),Hu()}}class xe{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ti=[0,31,59,90,120,151,181,212,243,273,304,334],Ei=[0,31,60,91,121,152,182,213,244,274,305,335];function _e(n,e){return new xe("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ss(n,e,t){const r=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return s===0?7:s}function xi(n,e,t){return t+(tr(n)?Ei:Ti)[e-1]}function Ii(n,e){const t=tr(n)?Ei:Ti,r=t.findIndex(a=>a<e),s=e-t[r];return{month:r+1,day:s}}function as(n,e){return(n-e+7)%7+1}function Dr(n,e=4,t=1){const{year:r,month:s,day:a}=n,i=xi(r,s,a),o=as(ss(r,s,a),t);let c=Math.floor((i-o+14-e)/7),u;return c<1?(u=r-1,c=rr(u,e,t)):c>rr(r,e,t)?(u=r+1,c=1):u=r,{weekYear:u,weekNumber:c,weekday:o,...Vr(n)}}function Ri(n,e=4,t=1){const{weekYear:r,weekNumber:s,weekday:a}=n,i=as(ss(r,1,e),t),o=Ot(r);let c=s*7+a-i-7+e,u;c<1?(u=r-1,c+=Ot(u)):c>o?(u=r+1,c-=Ot(r)):u=r;const{month:f,day:m}=Ii(u,c);return{year:u,month:f,day:m,...Vr(n)}}function is(n){const{year:e,month:t,day:r}=n,s=xi(e,t,r);return{year:e,ordinal:s,...Vr(n)}}function Ni(n){const{year:e,ordinal:t}=n,{month:r,day:s}=Ii(e,t);return{year:e,month:r,day:s,...Vr(n)}}function Ai(n,e){if(!x(n.localWeekday)||!x(n.localWeekNumber)||!x(n.localWeekYear)){if(!x(n.weekday)||!x(n.weekNumber)||!x(n.weekYear))throw new St("Cannot mix locale-based week fields with ISO-based week fields");return x(n.localWeekday)||(n.weekday=n.localWeekday),x(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),x(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Xu(n,e=4,t=1){const r=Lr(n.weekYear),s=be(n.weekNumber,1,rr(n.weekYear,e,t)),a=be(n.weekday,1,7);return r?s?a?!1:_e("weekday",n.weekday):_e("week",n.weekNumber):_e("weekYear",n.weekYear)}function el(n){const e=Lr(n.year),t=be(n.ordinal,1,Ot(n.year));return e?t?!1:_e("ordinal",n.ordinal):_e("year",n.year)}function Ci(n){const e=Lr(n.year),t=be(n.month,1,12),r=be(n.day,1,Mr(n.year,n.month));return e?t?r?!1:_e("day",n.day):_e("month",n.month):_e("year",n.year)}function Pi(n){const{hour:e,minute:t,second:r,millisecond:s}=n,a=be(e,0,23)||e===24&&t===0&&r===0&&s===0,i=be(t,0,59),o=be(r,0,59),c=be(s,0,999);return a?i?o?c?!1:_e("millisecond",s):_e("second",r):_e("minute",t):_e("hour",e)}function x(n){return typeof n>"u"}function Be(n){return typeof n=="number"}function Lr(n){return typeof n=="number"&&n%1===0}function tl(n){return typeof n=="string"}function rl(n){return Object.prototype.toString.call(n)==="[object Date]"}function Di(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Li(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function nl(n){return Array.isArray(n)?n:[n]}function Mi(n,e,t){if(n.length!==0)return n.reduce((r,s)=>{const a=[e(s),s];return r&&t(r[0],a[0])===r[0]?r:a},null)[1]}function sl(n,e){return e.reduce((t,r)=>(t[r]=n[r],t),{})}function kt(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function os(n){if(n==null)return null;if(typeof n!="object")throw new se("Week settings must be an object");if(!be(n.firstDay,1,7)||!be(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!be(e,1,7)))throw new se("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function be(n,e,t){return Lr(n)&&n>=e&&n<=t}function al(n,e){return n-e*Math.floor(n/e)}function H(n,e=2){const t=n<0;let r;return t?r="-"+(""+-n).padStart(e,"0"):r=(""+n).padStart(e,"0"),r}function Ke(n){if(!(x(n)||n===null||n===""))return parseInt(n,10)}function ht(n){if(!(x(n)||n===null||n===""))return parseFloat(n)}function cs(n){if(!(x(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function us(n,e,t=!1){const r=10**e;return(t?Math.trunc:Math.round)(n*r)/r}function tr(n){return n%4===0&&(n%100!==0||n%400===0)}function Ot(n){return tr(n)?366:365}function Mr(n,e){const t=al(e-1,12)+1,r=n+(e-t)/12;return t===2?tr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $r(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function $i(n,e,t){return-as(ss(n,1,e),t)+e-1}function rr(n,e=4,t=1){const r=$i(n,e,t),s=$i(n+1,e,t);return(Ot(n)-r+s)/7}function ls(n){return n>99?n:n>W.twoDigitCutoffYear?1900+n:2e3+n}function Fi(n,e,t,r=null){const s=new Date(n),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const i={timeZoneName:e,...a},o=new Intl.DateTimeFormat(t,i).formatToParts(s).find(c=>c.type.toLowerCase()==="timezonename");return o?o.value:null}function Fr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-r:r;return t*60+s}function Ui(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new se(`Invalid unit value ${n}`);return e}function Ur(n,e){const t={};for(const r in n)if(kt(n,r)){const s=n[r];if(s==null)continue;t[e(r)]=Ui(s)}return t}function nr(n,e){const t=Math.trunc(Math.abs(n/60)),r=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${H(t,2)}:${H(r,2)}`;case"narrow":return`${s}${t}${r>0?`:${r}`:""}`;case"techie":return`${s}${H(t,2)}${H(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vr(n){return sl(n,["hour","minute","second","millisecond"])}const il=["January","February","March","April","May","June","July","August","September","October","November","December"],Vi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ol=["J","F","M","A","M","J","J","A","S","O","N","D"];function ji(n){switch(n){case"narrow":return[...ol];case"short":return[...Vi];case"long":return[...il];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}
9const zi=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Zi=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],cl=["M","T","W","T","F","S","S"];function Wi(n){switch(n){case"narrow":return[...cl];case"short":return[...Zi];case"long":return[...zi];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qi=["AM","PM"],ul=["Before Christ","Anno Domini"],ll=["BC","AD"],fl=["B","A"];function Ji(n){switch(n){case"narrow":return[...fl];case"short":return[...ll];case"long":return[...ul];default:return null}}function dl(n){return qi[n.hour<12?0:1]}function hl(n,e){return Wi(e)[n.weekday-1]}function ml(n,e){return ji(e)[n.month-1]}function pl(n,e){return Ji(e)[n.year<0?0:1]}function yl(n,e,t="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&a){const m=n==="days";switch(e){case 1:return m?"tomorrow":`next ${s[n][0]}`;case-1:return m?"yesterday":`last ${s[n][0]}`;case 0:return m?"today":`this ${s[n][0]}`}}const i=Object.is(e,-0)||e<0,o=Math.abs(e),c=o===1,u=s[n],f=r?c?u[1]:u[2]||u[1]:c?s[n][0]:n;return i?`${o} ${f} ago`:`in ${o} ${f}`}function Gi(n,e){let t="";for(const r of n)r.literal?t+=r.val:t+=e(r.val);return t}const gl={D:Ar,DD:Qa,DDD:Ba,DDDD:Ka,t:Ya,tt:Ha,ttt:Xa,tttt:ei,T:ti,TT:ri,TTT:ni,TTTT:si,f:ai,ff:oi,fff:ui,ffff:fi,F:ii,FF:ci,FFF:li,FFFF:di};class ae{static create(e,t={}){return new ae(e,t)}static parseFormat(e){let t=null,r="",s=!1;const a=[];for(let i=0;i<e.length;i++){const o=e.charAt(i);o==="'"?(r.length>0&&a.push({literal:s||/^\s+$/.test(r),val:r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&a.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&a.push({literal:s||/^\s+$/.test(r),val:r}),a}static macroTokenToFormatOpts(e){return gl[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return H(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(h,O)=>this.loc.extract(e,h,O),i=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",o=()=>r?dl(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(h,O)=>r?ml(e,h):a(O?{month:h}:{month:h,day:"numeric"},"month"),u=(h,O)=>r?hl(e,h):a(O?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const O=ae.macroTokenToFormatOpts(h);return O?this.formatWithSystemDefault(e,O):h},m=h=>r?pl(e,h):a({era:h},"era"),_=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?a({day:"numeric"},"day"):this.num(e.day);case"dd":return s?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return s?a({month:"numeric"},"month"):this.num(e.month);case"MM":return s?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return s?a({year:"numeric"},"year"):this.num(e.year);case"yy":return s?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);
9case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Gi(ae.parseFormat(t),_)}formatDurationFromString(e,t){const r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=c=>u=>{const f=r(u);return f?this.num(c.get(f),u.length):u},a=ae.parseFormat(t),i=a.reduce((c,{literal:u,val:f})=>u?c:c.concat(f),[]),o=e.shiftTo(...i.map(r).filter(c=>c));return Gi(a,s(o))}}const Qi=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Tt(...n){const e=n.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function Et(...n){return e=>n.reduce(([t,r,s],a)=>{const[i,o,c]=a(e,s);return[{...t,...i},o||r,c]},[{},null,1]).slice(0,2)}function xt(n,...e){if(n==null)return[null,null];for(const[t,r]of e){const s=t.exec(n);if(s)return r(s)}return[null,null]}function Bi(...n){return(e,t)=>{const r={};let s;for(s=0;s<n.length;s++)r[n[s]]=Ke(e[t+s]);return[r,null,t+s]}}const Ki=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,vl=`(?:${Ki.source}?(?:\\[(${Qi.source})\\])?)?`,fs=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Yi=RegExp(`${fs.source}${vl}`),ds=RegExp(`(?:T${Yi.source})?`),wl=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,_l=/(\d{4})-?W(\d\d)(?:-?(\d))?/,bl=/(\d{4})-?(\d{3})/,Sl=Bi("weekYear","weekNumber","weekDay"),kl=Bi("year","ordinal"),Ol=/(\d{4})-(\d\d)-(\d\d)/,Hi=RegExp(`${fs.source} ?(?:${Ki.source}|(${Qi.source}))?`),Tl=RegExp(`(?: ${Hi.source})?`);function It(n,e,t){const r=n[e];return x(r)?t:Ke(r)}function El(n,e){return[{year:It(n,e),month:It(n,e+1,1),day:It(n,e+2,1)},null,e+3]}function Rt(n,e){return[{hours:It(n,e,0),minutes:It(n,e+1,0),seconds:It(n,e+2,0),milliseconds:cs(n[e+3])},null,e+4]}function sr(n,e){const t=!n[e]&&!n[e+1],r=Fr(n[e+1],n[e+2]),s=t?null:oe.instance(r);return[{},s,e+3]}function ar(n,e){const t=n[e]?Ve.create(n[e]):null;return[{},t,e+1]}const xl=RegExp(`^T?${fs.source}$`),Il=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Rl(n){const[e,t,r,s,a,i,o,c,u]=n,f=e[0]==="-",m=c&&c[0]==="-",_=(h,O=!1)=>h!==void 0&&(O||h&&f)?-h:h;
9return[{years:_(ht(t)),months:_(ht(r)),weeks:_(ht(s)),days:_(ht(a)),hours:_(ht(i)),minutes:_(ht(o)),seconds:_(ht(c),c==="-0"),milliseconds:_(cs(u),m)}]}const Nl={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hs(n,e,t,r,s,a,i){const o={year:e.length===2?ls(Ke(e)):Ke(e),month:Vi.indexOf(t)+1,day:Ke(r),hour:Ke(s),minute:Ke(a)};return i&&(o.second=Ke(i)),n&&(o.weekday=n.length>3?zi.indexOf(n)+1:Zi.indexOf(n)+1),o}const Al=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Cl(n){const[,e,t,r,s,a,i,o,c,u,f,m]=n,_=hs(e,s,r,t,a,i,o);let h;return c?h=Nl[c]:u?h=0:h=Fr(f,m),[_,new oe(h)]}function Pl(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Dl=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ll=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ml=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Xi(n){const[,e,t,r,s,a,i,o]=n;return[hs(e,s,r,t,a,i,o),oe.utcInstance]}function $l(n){const[,e,t,r,s,a,i,o]=n;return[hs(e,o,t,r,s,a,i),oe.utcInstance]}const Fl=Tt(wl,ds),Ul=Tt(_l,ds),Vl=Tt(bl,ds),jl=Tt(Yi),eo=Et(El,Rt,sr,ar),zl=Et(Sl,Rt,sr,ar),Zl=Et(kl,Rt,sr,ar),Wl=Et(Rt,sr,ar);function ql(n){return xt(n,[Fl,eo],[Ul,zl],[Vl,Zl],[jl,Wl])}function Jl(n){return xt(Pl(n),[Al,Cl])}function Gl(n){return xt(n,[Dl,Xi],[Ll,Xi],[Ml,$l])}function Ql(n){return xt(n,[Il,Rl])}const Bl=Et(Rt);function Kl(n){return xt(n,[xl,Bl])}const Yl=Tt(Ol,Tl),Hl=Tt(Hi),Xl=Et(Rt,sr,ar);function ef(n){return xt(n,[Yl,eo],[Hl,Xl])}const to="Invalid Duration",ro={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},tf={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...ro},Se=146097/400,Nt=146097/4800,rf={years:{quarters:4,months:12,weeks:Se/7,days:Se,hours:Se*24,minutes:Se*24*60,seconds:Se*24*60*60,milliseconds:Se*24*60*60*1e3},quarters:{months:3,weeks:Se/28,days:Se/4,hours:Se*24/4,minutes:Se*24*60/4,seconds:Se*24*60*60/4,milliseconds:Se*24*60*60*1e3/4},months:{weeks:Nt/7,days:Nt,hours:Nt*24,minutes:Nt*24*60,seconds:Nt*24*60*60,milliseconds:Nt*24*60*60*1e3},...ro},mt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],nf=mt.slice(0).reverse();function Ye(n,e,t=!1){const r={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new $(r)}function no(n,e){let t=e.milliseconds??0;for(const r of nf.slice(1))e[r]&&(t+=e[r]*n[r].milliseconds);return t}function so(n,e){const t=no(n,e)<0?-1:1;mt.reduceRight((r,s)=>{if(x(e[s]))return r;if(r){const a=e[r]*t,i=n[s][r],o=Math.floor(a/i);e[s]+=o*t,e[r]-=o*i*t}return s},null),mt.reduce((r,s)=>{if(x(e[s]))return r;if(r){const a=e[r]%1;e[r]-=a,e[s]+=a*n[r][s]}return s},null)}function sf(n){const e={};for(const[t,r]of Object.entries(n))r!==0&&(e[t]=r);return e}class ${constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let r=t?rf:tf;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||V.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return $.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new se(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new $({values:Ur(e,$.normalizeUnit),loc:V.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Be(e))return $.fromMillis(e);if($.isDuration(e))return e;if(typeof e=="object")return $.fromObject(e);throw new se(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=Ql(e);
9return r?$.fromObject(r,t):$.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=Kl(e);return r?$.fromObject(r,t):$.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new se("need to specify a reason the Duration is invalid");const r=e instanceof xe?e:new xe(e,t);if(W.throwOnInvalid)throw new Ru(r);return new $({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Ga(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?ae.create(this.loc,r).formatDurationFromString(this,e):to}toHuman(e={}){if(!this.isValid)return to;const t=mt.map(r=>{const s=this.values[r];return x(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(s)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=us(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},T.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?no(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=$.fromDurationLike(e),r={};for(const s of mt)(kt(t.values,s)||kt(this.values,s))&&(r[s]=t.get(s)+this.get(s));return Ye(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=$.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=Ui(e(this.values[r],r));return Ye(this,{values:t},!0)}get(e){return this[$.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Ur(e,$.normalizeUnit)};return Ye(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:s}={}){const i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:r};return Ye(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return so(this.matrix,e),Ye(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=sf(this.normalize().shiftToAll().toObject());return Ye(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(i=>$.normalizeUnit(i));const t={},r={},s=this.toObject();let a;for(const i of mt)if(e.indexOf(i)>=0){a=i;let o=0;for(const u in r)o+=this.matrix[u][i]*r[u],r[u]=0;Be(s[i])&&(o+=s[i]);const c=Math.trunc(o);t[i]=c,r[i]=(o*1e3-c*1e3)/1e3}else Be(s[i])&&(r[i]=s[i]);for(const i in r)r[i]!==0&&(t[a]+=i===a?r[i]:r[i]/this.matrix[a][i]);return so(this.matrix,t),Ye(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ye(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of mt)if(!t(this.values[r],e.values[r]))return!1;return!0}}const At="Invalid Interval";
9function af(n,e){return!n||!n.isValid?q.invalid("missing or invalid start"):!e||!e.isValid?q.invalid("missing or invalid end"):e<n?q.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class q{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new se("need to specify a reason the Interval is invalid");const r=e instanceof xe?e:new xe(e,t);if(W.throwOnInvalid)throw new Iu(r);return new q({invalid:r})}static fromDateTimes(e,t){const r=cr(e),s=cr(t),a=af(r,s);return a??new q({start:r,end:s})}static after(e,t){const r=$.fromDurationLike(t),s=cr(e);return q.fromDateTimes(s,s.plus(r))}static before(e,t){const r=$.fromDurationLike(t),s=cr(e);return q.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let a,i;try{a=T.fromISO(r,t),i=a.isValid}catch{i=!1}let o,c;try{o=T.fromISO(s,t),c=o.isValid}catch{c=!1}if(i&&c)return q.fromDateTimes(a,o);if(i){const u=$.fromISO(s,t);if(u.isValid)return q.after(a,u)}else if(c){const u=$.fromISO(r,t);if(u.isValid)return q.before(o,u)}}return q.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let s;return t!=null&&t.useLocaleWeeks?s=this.end.reconfigure({locale:r.locale}):s=this.end,s=s.startOf(e,t),Math.floor(s.diff(r,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?q.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(cr).filter(i=>this.contains(i)).sort((i,o)=>i.toMillis()-o.toMillis()),r=[];let{s}=this,a=0;for(;s<this.e;){const i=t[a]||this.e,o=+i>+this.e?this.e:i;r.push(q.fromDateTimes(s,o)),s=o,a+=1}return r}splitBy(e){const t=$.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,s=1,a;const i=[];for(;r<this.e;){const o=this.start.plus(t.mapUnits(c=>c*s));a=+o>+this.e?this.e:o,i.push(q.fromDateTimes(r,a)),r=a,s+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:q.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return q.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((s,a)=>s.s-a.s).reduce(([s,a],i)=>a?a.overlaps(i)||a.abutsStart(i)?[s,a.union(i)]:[s.concat([a]),i]:[s,i],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],a=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),i=Array.prototype.concat(...a),o=i.sort((c,u)=>c.time-u.time);for(const c of o)r+=c.type==="s"?1:-1,r===1?t=c.time:(t&&+t!=+c.time&&s.push(q.fromDateTimes(t,c.time)),t=null);return q.merge(s)}difference(...e){return q.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} â ${this.e.toISO()})`:At}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}
9toLocaleString(e=Ar,t={}){return this.isValid?ae.create(this.s.loc.clone(t),e).formatInterval(this):At}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:At}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:At}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:At}toFormat(e,{separator:t=" â "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:At}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):$.invalid(this.invalidReason)}mapEndpoints(e){return q.fromDateTimes(e(this.s),e(this.e))}}class jr{static hasDST(e=W.defaultZone){const t=T.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ve.isValidZone(e)}static normalizeZone(e){return Qe(e,W.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||V.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||V.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||V.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||V.create(t,r,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:a="gregory"}={}){return(s||V.create(t,r,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||V.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||V.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return V.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return V.create(t,null,"gregory").eras(e)}static features(){return{relative:Di(),localeWeek:Li()}}}function ao(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(n);return Math.floor($.fromMillis(r).as("days"))}function of(n,e,t){const r=[["years",(c,u)=>u.year-c.year],["quarters",(c,u)=>u.quarter-c.quarter+(u.year-c.year)*4],["months",(c,u)=>u.month-c.month+(u.year-c.year)*12],["weeks",(c,u)=>{const f=ao(c,u);return(f-f%7)/7}],["days",ao]],s={},a=n;let i,o;for(const[c,u]of r)t.indexOf(c)>=0&&(i=c,s[c]=u(n,e),o=a.plus(s),o>e?(s[c]--,n=a.plus(s),n>e&&(o=n,s[c]--,n=a.plus(s))):n=o);return[n,s,o,i]}function cf(n,e,t,r){let[s,a,i,o]=of(n,e,t);const c=e-s,u=t.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);u.length===0&&(i<e&&(i=s.plus({[o]:1})),i!==s&&(a[o]=(a[o]||0)+c/(i-s)));const f=$.fromObject(a,r);return u.length>0?$.fromMillis(c,r).shiftTo(...u).plus(f):f}const uf="missing Intl.DateTimeFormat.formatToParts support";function U(n,e=t=>t){return{regex:n,deser:([t])=>e(Yu(t))}}const io="[ Â ]",oo=new RegExp(io,"g");function lf(n){return n.replace(/\./g,"\\.?").replace(oo,io)}function co(n){return n.replace(/\./g,"").replace(oo," ").toLowerCase()}function Ie(n,e){return n===null?null:{regex:RegExp(n.map(lf).join("|")),deser:([t])=>n.findIndex(r=>co(t)===co(r))+e}}function uo(n,e){return{regex:n,deser:([,t,r])=>Fr(t,r),groups:e}}function zr(n){return{regex:n,deser:([e])=>e}}
9function ff(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function df(n,e){const t=Ee(e),r=Ee(e,"{2}"),s=Ee(e,"{3}"),a=Ee(e,"{4}"),i=Ee(e,"{6}"),o=Ee(e,"{1,2}"),c=Ee(e,"{1,3}"),u=Ee(e,"{1,6}"),f=Ee(e,"{1,9}"),m=Ee(e,"{2,4}"),_=Ee(e,"{4,6}"),h=Z=>({regex:RegExp(ff(Z.val)),deser:([ee])=>ee,literal:!0}),A=(Z=>{if(n.literal)return h(Z);switch(Z.val){case"G":return Ie(e.eras("short"),0);case"GG":return Ie(e.eras("long"),0);case"y":return U(u);case"yy":return U(m,ls);case"yyyy":return U(a);case"yyyyy":return U(_);case"yyyyyy":return U(i);case"M":return U(o);case"MM":return U(r);case"MMM":return Ie(e.months("short",!0),1);case"MMMM":return Ie(e.months("long",!0),1);case"L":return U(o);case"LL":return U(r);case"LLL":return Ie(e.months("short",!1),1);case"LLLL":return Ie(e.months("long",!1),1);case"d":return U(o);case"dd":return U(r);case"o":return U(c);case"ooo":return U(s);case"HH":return U(r);case"H":return U(o);case"hh":return U(r);case"h":return U(o);case"mm":return U(r);case"m":return U(o);case"q":return U(o);case"qq":return U(r);case"s":return U(o);case"ss":return U(r);case"S":return U(c);case"SSS":return U(s);case"u":return zr(f);case"uu":return zr(o);case"uuu":return U(t);case"a":return Ie(e.meridiems(),0);case"kkkk":return U(a);case"kk":return U(m,ls);case"W":return U(o);case"WW":return U(r);case"E":case"c":return U(t);case"EEE":return Ie(e.weekdays("short",!1),1);case"EEEE":return Ie(e.weekdays("long",!1),1);case"ccc":return Ie(e.weekdays("short",!0),1);case"cccc":return Ie(e.weekdays("long",!0),1);case"Z":case"ZZ":return uo(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return uo(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return zr(/[a-z_+-/]{1,256}?/i);case" ":return zr(/[^\S\n\r]/);default:return h(Z)}})(n)||{invalidReason:uf};return A.token=n,A}const hf={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function mf(n,e,t){const{type:r,value:s}=n;if(r==="literal"){const c=/^\s+$/.test(s);return{literal:!c,val:c?" ":s}}const a=e[r];let i=r;r==="hour"&&(e.hour12!=null?i=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?i="hour12":i="hour24":i=t.hour12?"hour12":"hour24");let o=hf[i];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function pf(n){return[`^${n.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,n]}function yf(n,e,t){const r=n.match(e);if(r){const s={};let a=1;for(const i in t)if(kt(t,i)){const o=t[i],c=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(a,a+c))),a+=c}return[r,s]}else return[r,{}]}function gf(n){const e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,r;return x(n.z)||(t=Ve.create(n.z)),x(n.Z)||(t||(t=new oe(n.Z)),r=n.Z),x(n.q)||(n.M=(n.q-1)*3+1),x(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),x(n.u)||(n.S=cs(n.u)),[Object.keys(n).reduce((a,i)=>{const o=e(i);return o&&(a[o]=n[i]),a},{}),t,r]}let ms=null;function vf(){return ms||(ms=T.fromMillis(1555555555555)),ms}function wf(n,e){if(n.literal)return n;const t=ae.macroTokenToFormatOpts(n.val),r=mo(t,e);return r==null||r.includes(void 0)?n:r}function lo(n,e){return Array.prototype.concat(...n.map(t=>wf(t,e)))}class fo{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=lo(ae.parseFormat(t),e),this.units=this.tokens.map(r=>df(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,s]=pf(this.units);this.regex=RegExp(r,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,r]=yf(e,this.regex,this.handlers),[s,a,i]=r?gf(r):[null,null,void 0];if(kt(r,"a")&&kt(r,"H"))throw new St("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:s,zone:a,specificOffset:i}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invali
9dReason:null}}function ho(n,e,t){return new fo(n,t).explainFromTokens(e)}function _f(n,e,t){const{result:r,zone:s,specificOffset:a,invalidReason:i}=ho(n,e,t);return[r,s,a,i]}function mo(n,e){if(!n)return null;const r=ae.create(e,n).dtFormatter(vf()),s=r.formatToParts(),a=r.resolvedOptions();return s.map(i=>mf(i,n,a))}const ps="Invalid DateTime",bf=864e13;function ir(n){return new xe("unsupported zone",`the zone "${n.name}" is not supported`)}function ys(n){return n.weekData===null&&(n.weekData=Dr(n.c)),n.weekData}function gs(n){return n.localWeekData===null&&(n.localWeekData=Dr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function pt(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new T({...t,...e,old:t})}function po(n,e,t){let r=n-e*60*1e3;const s=t.offset(r);if(e===s)return[r,e];r-=(s-e)*60*1e3;const a=t.offset(r);return s===a?[r,s]:[n-Math.min(s,a)*60*1e3,Math.max(s,a)]}function Zr(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Wr(n,e,t){return po($r(n),e,t)}function yo(n,e){const t=n.o,r=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...n.c,year:r,month:s,day:Math.min(n.c.day,Mr(r,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},i=$.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=$r(a);let[c,u]=po(o,t,n.zone);return i!==0&&(c+=i,u=n.zone.offset(c)),{ts:c,o:u}}function Ct(n,e,t,r,s,a){const{setZone:i,zone:o}=t;if(n&&Object.keys(n).length!==0||e){const c=e||o,u=T.fromObject(n,{...t,zone:c,specificOffset:a});return i?u:u.setZone(o)}else return T.invalid(new xe("unparsable",`the input "${s}" can't be parsed as ${r}`))}function qr(n,e,t=!0){return n.isValid?ae.create(V.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function vs(n,e){const t=n.c.year>9999||n.c.year<0;let r="";return t&&n.c.year>=0&&(r+="+"),r+=H(n.c.year,t?6:4),e?(r+="-",r+=H(n.c.month),r+="-",r+=H(n.c.day)):(r+=H(n.c.month),r+=H(n.c.day)),r}function go(n,e,t,r,s,a){let i=H(n.c.hour);return e?(i+=":",i+=H(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(i+=":")):i+=H(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(i+=H(n.c.second),(n.c.millisecond!==0||!r)&&(i+=".",i+=H(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!a?i+="Z":n.o<0?(i+="-",i+=H(Math.trunc(-n.o/60)),i+=":",i+=H(Math.trunc(-n.o%60))):(i+="+",i+=H(Math.trunc(n.o/60)),i+=":",i+=H(Math.trunc(n.o%60)))),a&&(i+="["+n.zone.ianaName+"]"),i}const vo={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Sf={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kf={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wo=["year","month","day","hour","minute","second","millisecond"],Of=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Tf=["year","ordinal","hour","minute","second","millisecond"];function Ef(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Ga(n);return e}function _o(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ef(n)}}function xf(n){if(or===void 0&&(or=W.now()),n.type!=="iana")return n.offset(or);const e=n.name;let t=ws.get(e);return t===void 0&&(t=n.offset(or),ws.set(e,t)),t}function bo(n,e){const t=Qe(e.zone,W.defaultZone);
9if(!t.isValid)return T.invalid(ir(t));const r=V.fromObject(e);let s,a;if(x(n.year))s=W.now();else{for(const c of wo)x(n[c])&&(n[c]=vo[c]);const i=Ci(n)||Pi(n);if(i)return T.invalid(i);const o=xf(t);[s,a]=Wr(n,o,t)}return new T({ts:s,zone:t,loc:r,o:a})}function So(n,e,t){const r=x(t.round)?!0:t.round,s=(i,o)=>(i=us(i,r||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(i,o)),a=i=>t.calendary?e.hasSame(n,i)?0:e.startOf(i).diff(n.startOf(i),i).get(i):e.diff(n,i).get(i);if(t.unit)return s(a(t.unit),t.unit);for(const i of t.units){const o=a(i);if(Math.abs(o)>=1)return s(o,i)}return s(n>e?-0:0,t.units[t.units.length-1])}function ko(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let or;const ws=new Map;class T{constructor(e){const t=e.zone||W.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new xe("invalid input"):null)||(t.isValid?null:ir(t));this.ts=x(e.ts)?W.now():e.ts;let s=null,a=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,a]=[e.old.c,e.old.o];else{const o=Be(e.o)&&!e.old?e.o:t.offset(this.ts);s=Zr(this.ts,o),r=Number.isNaN(s.year)?new xe("invalid input"):null,s=r?null:s,a=r?null:o}this._zone=t,this.loc=e.loc||V.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=a,this.isLuxonDateTime=!0}static now(){return new T({})}static local(){const[e,t]=ko(arguments),[r,s,a,i,o,c,u]=t;return bo({year:r,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static utc(){const[e,t]=ko(arguments),[r,s,a,i,o,c,u]=t;return e.zone=oe.utcInstance,bo({year:r,month:s,day:a,hour:i,minute:o,second:c,millisecond:u},e)}static fromJSDate(e,t={}){const r=rl(e)?e.valueOf():NaN;if(Number.isNaN(r))return T.invalid("invalid input");const s=Qe(t.zone,W.defaultZone);return s.isValid?new T({ts:r,zone:s,loc:V.fromObject(t)}):T.invalid(ir(s))}static fromMillis(e,t={}){if(Be(e))return e<-864e13||e>bf?T.invalid("Timestamp out of range"):new T({ts:e,zone:Qe(t.zone,W.defaultZone),loc:V.fromObject(t)});throw new se(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Be(e))return new T({ts:e*1e3,zone:Qe(t.zone,W.defaultZone),loc:V.fromObject(t)});throw new se("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=Qe(t.zone,W.defaultZone);if(!r.isValid)return T.invalid(ir(r));const s=V.fromObject(t),a=Ur(e,_o),{minDaysInFirstWeek:i,startOfWeek:o}=Ai(a,s),c=W.now(),u=x(t.specificOffset)?r.offset(c):t.specificOffset,f=!x(a.ordinal),m=!x(a.year),_=!x(a.month)||!x(a.day),h=m||_,O=a.weekYear||a.weekNumber;if((h||f)&&O)throw new St("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new St("Can't mix ordinal dates with month/day");const A=O||a.weekday&&!h;let Z,ee,ge=Zr(c,u);A?(Z=Of,ee=Sf,ge=Dr(ge,i,o)):f?(Z=Tf,ee=kf,ge=is(ge)):(Z=wo,ee=vo);let Gt=!1;for(const Or of Z){const Th=a[Or];x(Th)?Gt?a[Or]=ee[Or]:a[Or]=ge[Or]:Gt=!0}const br=A?Xu(a,i,o):f?el(a):Ci(a),wt=br||Pi(a);if(wt)return T.invalid(wt);const Sr=A?Ri(a,i,o):f?Ni(a):a,[kr,Qt]=Wr(Sr,u,r),ve=new T({ts:kr,zone:r,o:Qt,loc:s});return a.weekday&&h&&e.weekday!==ve.weekday?T.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${ve.toISO()}`):ve.isValid?ve:T.invalid(ve.invalid)}static fromISO(e,t={}){const[r,s]=ql(e);return Ct(r,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,s]=Jl(e);return Ct(r,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,s]=Gl(e);return Ct(r,s,t,"HTTP",t)}static fromFormat(e,t,r={}){if(x(e)||x(t))throw new se("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:a=null}=r,i=V.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0}),[o,c,u,f]=_f(i,e,t);return f?T.invalid(f):Ct(o,c,r,`format ${t}`,e,u)}static fromString(e,t,r={}){return T.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,s]=ef(e);return Ct(r,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new se("need to specify a reason the DateTime is invalid");const r=e instanceof xe?e:new xe(e,t);
9if(W.throwOnInvalid)throw new xu(r);return new T({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=mo(e,V.fromObject(t));return r?r.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return lo(ae.parseFormat(e),V.fromObject(t)).map(s=>s.val).join("")}static resetCache(){or=void 0,ws.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ys(this).weekYear:NaN}get weekNumber(){return this.isValid?ys(this).weekNumber:NaN}get weekday(){return this.isValid?ys(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?gs(this).weekday:NaN}get localWeekNumber(){return this.isValid?gs(this).weekNumber:NaN}get localWeekYear(){return this.isValid?gs(this).weekYear:NaN}get ordinal(){return this.isValid?is(this.c).ordinal:NaN}get monthShort(){return this.isValid?jr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?jr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?jr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?jr.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=$r(this.c),s=this.zone.offset(r-e),a=this.zone.offset(r+e),i=this.zone.offset(r-s*t),o=this.zone.offset(r-a*t);if(i===o)return[this];const c=r-i*t,u=r-o*t,f=Zr(c,i),m=Zr(u,o);return f.hour===m.hour&&f.minute===m.minute&&f.second===m.second&&f.millisecond===m.millisecond?[pt(this,{ts:c}),pt(this,{ts:u})]:[this]}get isInLeapYear(){return tr(this.year)}get daysInMonth(){return Mr(this.year,this.month)}get daysInYear(){return this.isValid?Ot(this.year):NaN}get weeksInWeekYear(){return this.isValid?rr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?rr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:s}=ae.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(oe.instance(e),t)}toLocal(){return this.setZone(W.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if(e=Qe(e,W.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||r){const a=e.offset(this.ts),i=this.toObject();[s]=Wr(i,a,e)}return pt(this,{ts:s,zone:e})}else return T.invalid(ir(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return pt(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Ur(e,_o),{minDaysInFirstWeek:r,startOfWeek:s}=Ai(t,this.loc),a=!x(t.weekYear)||!x(t.weekNumber)||!x(t.weekday),i=!x(t.ordinal),o=!x(t.year),c=!x(t.month)||!x(t.day),u=o||c,f=t.weekYear||t.weekNumber;if((u||i)&&f)throw new St("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&i)throw new St("Can't mix ordinal dates with month/day");let m;a?m=Ri({...Dr(this.c,r,s),...t},r,s):x(t.ordinal)?(m={...this.toObject(),...t},x(t.day)&&(m.day=Math.min(Mr(m.year,m.month),m.day))):m=Ni({...is(this.c),...t});const[_,h]=Wr(m,this.o,this.zone);return pt(this,{ts:_,o:h})}plus(e){if(!this.isValid)return this;const t=$.fromDurationLike(e);return pt(this,yo(this,t))}minus(e){if(!this.isValid)return this;const t=$.fromDurationLike(e).negate();return pt(this,yo(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},s=$.normalizeUnit(e);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(s==="weeks")if(t){const a=this.loc.getStartOfWeek(),{weekday:i}=this;i<a&&(r.weekNumber=this.weekNumber-1),r.weekday=a}else r.weekday=1;if(s==="quarters"){const a=Math.ceil(this.month/3);r.month=(a-1)*3+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?ae.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ps}
9toLocaleString(e=Ar,t={}){return this.isValid?ae.create(this.loc.clone(t),e).formatDateTime(this):ps}toLocaleParts(e={}){return this.isValid?ae.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:s=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;const i=e==="extended";let o=vs(this,i);return o+="T",o+=go(this,i,t,r,s,a),o}toISODate({format:e="extended"}={}){return this.isValid?vs(this,e==="extended"):null}toISOWeekDate(){return qr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:s=!1,extendedZone:a=!1,format:i="extended"}={}){return this.isValid?(s?"T":"")+go(this,i==="extended",t,e,r,a):null}toRFC2822(){return qr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return qr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?vs(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(r&&(s+=" "),t?s+="z":e&&(s+="ZZ")),qr(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ps}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return $.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...r},a=nl(t).map($.normalizeUnit),i=e.valueOf()>this.valueOf(),o=i?this:e,c=i?e:this,u=cf(o,c,a,s);return i?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(T.now(),e,t)}until(e){return this.isValid?q.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const s=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,r)<=s&&s<=a.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||T.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(s=e.unit,a=void 0),So(t,this.plus(r),{...e,numeric:"always",units:s,unit:a})}toRelativeCalendar(e={}){return this.isValid?So(e.base||T.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(T.isDateTime))throw new se("min requires all arguments be DateTimes");return Mi(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(T.isDateTime))throw new se("max requires all arguments be DateTimes");return Mi(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:s=null,numberingSystem:a=null}=r,i=V.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});return ho(i,e,t)}static fromStringExplain(e,t,r={}){return T.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:s=null}=t,a=V.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});return new fo(a,e)}static fromFormatParser(e,t,r={}){if(x(e)||x(t))throw new se("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:a=null}=r,i=V.fromOpts({locale:s,numberingSystem:a,defaultToEN:!0});if(!i.equals(t.locale))throw new se(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${t.locale}`);const{result:o,zone:c,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);
9return f?T.invalid(f):Ct(o,c,r,`format ${t.format}`,e,u)}static get DATE_SHORT(){return Ar}static get DATE_MED(){return Qa}static get DATE_MED_WITH_WEEKDAY(){return Nu}static get DATE_FULL(){return Ba}static get DATE_HUGE(){return Ka}static get TIME_SIMPLE(){return Ya}static get TIME_WITH_SECONDS(){return Ha}static get TIME_WITH_SHORT_OFFSET(){return Xa}static get TIME_WITH_LONG_OFFSET(){return ei}static get TIME_24_SIMPLE(){return ti}static get TIME_24_WITH_SECONDS(){return ri}static get TIME_24_WITH_SHORT_OFFSET(){return ni}static get TIME_24_WITH_LONG_OFFSET(){return si}static get DATETIME_SHORT(){return ai}static get DATETIME_SHORT_WITH_SECONDS(){return ii}static get DATETIME_MED(){return oi}static get DATETIME_MED_WITH_SECONDS(){return ci}static get DATETIME_MED_WITH_WEEKDAY(){return Au}static get DATETIME_FULL(){return ui}static get DATETIME_FULL_WITH_SECONDS(){return li}static get DATETIME_HUGE(){return fi}static get DATETIME_HUGE_WITH_SECONDS(){return di}}function cr(n){if(T.isDateTime(n))return n;if(n&&n.valueOf&&Be(n.valueOf()))return T.fromJSDate(n);if(n&&typeof n=="object")return T.fromObject(n);throw new se(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const _s=1e8*24*60*6e4;class pe{constructor(){g(this,"_firstName");g(this,"_lastName");g(this,"_gender");g(this,"_birthDate");g(this,"_age");g(this,"_email");g(this,"_lid");g(this,"_photoURL");g(this,"_personalizzazione");g(this,"_privacyPolicyIsAccepted");g(this,"_need_password_change");g(this,"_pubblicitaProfilata");g(this,"_pubblicitaProfilataIsAccepted");g(this,"_ua");g(this,"_uid");g(this,"_user_type","persona");g(this,"_userDomain");g(this,"_user_update");g(this,"_user_data_update");g(this,"_lastToken");g(this,"_parentalControl");g(this,"_social");g(this,"_expiration",_s);this._firstName="",this._lastName="",this._gender="A",this._birthDate=new Date(-1*_s),this._age=0,this._email="",this._lid="",this._ua="",this._uid=0,this._userDomain={refreshToken:""},this._expiration=Date.now()+24*60*60*1e3}get firstName(){return this._firstName}get lastName(){return this._lastName}get nickname(){return`${this.firstName} ${this.lastName}`}get gender(){return this._gender}get birthDate(){return this._birthDate}get birthDateTime(){return T.fromJSDate(this.birthDate)}get birthDay(){return this.birthDate&&this.birthDateTime.isValid?this.birthDateTime.day:NaN}get birthMonth(){return this.birthDate&&this.birthDateTime.isValid?this.birthDateTime.month:NaN}get birthYear(){return this.birthDate&&this.birthDateTime.isValid?this.birthDateTime.year:NaN}get age(){return this._age}get email(){return this._email}get lid(){return this._lid}get photoURL(){return this._photoURL}get personalizzazione(){return this._personalizzazione}get privacyPolicyIsAccepted(){return this._privacyPolicyIsAccepted}get pubblicitaProfilata(){return this._pubblicitaProfilata}get pubblicitaProfilataIsAccepted(){return this._pubblicitaProfilataIsAccepted}get need_password_change(){return this._need_password_change}get social(){return this._social}get ua(){return this._ua}get uid(){return this._uid}get user_type(){return this._user_type}get userDomain(){return this._userDomain}get user_update(){return this._user_update}get user_data_update(){return this._user_data_update}get lastToken(){return this._lastToken}get parental_control(){return this._parentalControl}get isSocial(){var e;return((e=this._social)==null?void 0:e.loginProvider)!=null}get expirationDate(){return new Date(this._expiration)}static fromLogin(e){const t=new pe,{raisso:r,ente_accreditato:s,social:a,user_update:i,user_data_update:o}=e;return r&&(t._age=r.age,t._birthDate=T.fromISO(r.birthDate).toJSDate(),t._email=r.email,t._lid=r.lid,t._firstName=r.firstName,t._gender=r.gender,t._lastName=r.lastName,t._personalizzazione=r.personalizzazione,t._photoURL=r.photoURL??(a==null?void 0:a.photoURL)??(a==null?void 0:a.thumbnailURL),t._privacyPolicyIsAccepted=r.privacy_Policy_isAccepted,t._pubblicitaProfilata=r.pubblicitaProfilata,t._pubblicitaProfilataIsAccepted=r.privacy_Pubblicita_isAccepted,t._need_password_change=r.need_password_change,a&&(t._social=a),t._ua=r.ua,t._uid=r.uid,t._userDomain=r.userDomain,t._user_data_update=o??r.user_data_update,t._user_update=i??r.user_update,t._user_type=s?"ente":"persona",t._lastToken=r.lastToken?T.fromISO(r.lastToken).toJSDate():void 0,t._parentalControl=r.parental_control),t}renewExpiration(e){e>=-864e13&&e<=_s?this._expiration=e:this._expiration=Date.now()+24*60*60*1e3}setPrivacyData(e){this._personalizzazione=e.personalizzazione,this._privacyPolicyIsAccepted=e.privacy_Policy_isAccepted,this._pubblicitaProfilata=e.pubblicitaProfilata,this._pubblicitaProfilataIsAccepted=e.privacy_Pubblicita_isAccepted}toJSON(){const{age:e,birthDate:t,email:r,lid:s,_expiration:a,firstName:i,gender:
9o,lastName:c,personalizzazione:u,photoURL:f,privacyPolicyIsAccepted:m,pubblicitaProfilata:_,pubblicitaProfilataIsAccepted:h,ua:O,uid:A,userDomain:Z,user_data_update:ee,user_update:ge,user_type:Gt,_social:br,lastToken:wt,parental_control:Sr,need_password_change:kr}=this,Qt=T.fromJSDate(t),ve=wt?T.fromJSDate(wt):void 0;return{age:e,birthDate:Qt.isValid?Qt.toFormat("yyyy-MM-dd"):null,email:r,lid:s,expiration:a,firstName:i,gender:o,lastName:c,personalizzazione:u,photoURL:f,privacyPolicyIsAccepted:m,pubblicitaProfilata:_,pubblicitaProfilataIsAccepted:h,ua:O,uid:A,userDomain:Z,user_data_update:ee,user_type:Gt,user_update:ge,social:br,lastToken:ve!=null&&ve.isValid?ve.toFormat("yyyy-MM-dd"):void 0,parental_control:Sr,need_password_change:kr}}static fromJSON(e){const{age:t,birthDate:r,email:s,lid:a,expiration:i,firstName:o,gender:c,lastName:u,personalizzazione:f,photoURL:m,privacyPolicyIsAccepted:_,pubblicitaProfilataIsAccepted:h,pubblicitaProfilata:O,ua:A,user_update:Z,uid:ee,user_type:ge,social:Gt,userDomain:br,user_data_update:wt,lastToken:Sr,parental_control:kr,need_password_change:Qt}=e,ve=this.fromLogin({ente_accreditato:ge==="ente",social:Gt,raisso:{age:t,birthDate:r??"",email:s,lid:a,firstName:o,gender:c,lastName:u,ua:A,uid:ee,userDomain:br,personalizzazione:f,photoURL:m,privacy_Policy_isAccepted:_,privacy_Pubblicita_isAccepted:h,pubblicitaProfilata:O,user_data_update:wt,user_update:Z,lastToken:Sr,parental_control:kr,need_password_change:Qt}});return ve.renewExpiration(i),ve}}const ur="rai:access_token",lr="rai:refresh_token",Oo="rai:access_token_last_date",bs="rai:raiSso",Ss="rai:raiSsoChildrenProfiles",To="rai:device_app_id",If="rai:recommendation-sections",Rf="rai:recommendationCardClicks",un=class un{static getService(){return this.instance||(this.instance=new un),this.instance}setToken(e){const{authToken:t,refreshToken:r}=e;localStorage.setItem(ur,t),localStorage.setItem(lr,r);const s=location.protocol==="https:"?"secure;":"";document.cookie=`${ur}=${encodeURIComponent(t)}; expires=Fri, 31 Dec 2199 23:59:59 GMT; path=/; ${s} SameSite=Strict`,document.cookie=`${lr}=${encodeURIComponent(r)}; expires=Fri, 31 Dec 2199 23:59:59 GMT; path=/; ${s} SameSite=Strict`}getAccessToken(){try{return localStorage.getItem(ur)}catch{return}}getRefreshToken(){try{return localStorage.getItem(lr)}catch{return}}clearToken(){localStorage.removeItem(ur),localStorage.removeItem(lr),this.deleteCookie(ur),this.deleteCookie(lr)}deleteCookie(e){document.cookie=`${e}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Strict`}setProfile(e,t){if(e){const r=JSON.stringify(e);localStorage.setItem(bs,r)}t&&localStorage.setItem(Ss,JSON.stringify(t))}getProfile(){try{const e=localStorage.getItem(bs);if(e){const t=JSON.parse(e);return pe.fromJSON(t)}}catch{}}getChildrenProfile(){const e=localStorage.getItem(Ss);return e&&JSON.parse(e)||void 0}clearProfile(){localStorage.removeItem(bs),localStorage.removeItem(Ss),sessionStorage.removeItem(If),sessionStorage.removeItem(Rf)}setTokenLastDate(){localStorage.setItem(Oo,String(Date.now()))}getTokenLastDate(){try{const e=localStorage.getItem(Oo);return Number(e)}catch{return}}setDeviceAppId(e){localStorage.setItem(To,`${e}`)}getDeviceAppId(){const e=localStorage.getItem(To);return Number(e)}};g(un,"instance");let Jr=un;const Pt={yoyo:"WMXcFqe65MXcK4vpfcF",raiplay:"arSgRtwasD324SaA",sondaggi:"das554fds34safd2As",raiplay2020:"arSgRtwasD324SaA",sound:"newApiKeyRaiRadio",lavoraConNoi:"lcnApiKey"},ks={default:"/",test:"//sttest.rai.it/"},Dt={raiPlay:"3_I55u9iiGSTrsMk0Tr9SlgcL37clRoL_wyiCxSRPWD_6tBccbLbPGAyOmekkrpoEn",radio:"3_qkVbqpKn13tlaYY1tlYE6wer43ZRo1XmYZBOhvWwIpVQLsdeOTQZF-sK1M85Catz",raiSport:"3_dUbVa2fC1BkaWR_Suy7Jhw4S_CmYNUU4ViCnO2tmiAEpIjKGgcoNkAPMSbr5XrJC",stTest:"3_i_Ms574WFExW0zCNlQEAVxX7brDQQ7OTgsR8WDOdtNKVxNZRPiNsVQi57ZoPq0qb",raiTv:"3_H6AyGSYZJkl6L9-AVpZS3UHc2twYG3rxy_5IHTpEVGIIopQd3lQzbenhWgyRl3Ap",rai:"3_xVTjKOtf9coz04AzqDj05XeSgBqH9zVQxmQtWJOC_y_fcdC0idy7H5ECPwjD6VYW"},fe=((n,e)=>{if(!("raiSsoDomainApiKey"in e)||!e.raiSsoDomainApiKey){const t=n.getElementById("ssoDomainApiKey");let r;if(t!=null&&t.innerText)r=t.innerText;else{r=Pt.raiplay;const s=n.location.hostname,a=n.location.pathname;/^(?:www\.)?raiplaysound/.test(s)?r=Pt.sound:s==="www.raiplayyoyo.it"?r=Pt.yoyo:/raiplay-(?:demo|dev|int)\.rai\.it/.test(s)?r=Pt.raiplay2020:/^(rai-(dev|pre|int)\.rai\.it|www\.rai\.it|localhost)(:\d+)?$/.test(s)&&a.startsWith("/lavoraconnoi")?r=Pt.lavoraConNoi:/^(rai-(dev|pre|int)\.rai\.it|www\.rai\.it|localhost)(:\d+)?$/.test(s)&&a.startsWith("/borgodeiborghi")&&(r=Pt.sondaggi)}e.raiSsoDomainApiKey=r}return e.raiSsoDomainApiKey})(document,window),Ce=(n=>{let e=ks.default;return["10.99.40.16","127.0.0.1"].includes(n)?e=ks.default:/^sstest\.rai/.exec(n)&&(e=ks.test),`${e}atomatic/raisso-service`})(document.location.hostname);
9class Nf extends Error{constructor(t,r={}){const{cause:s,context:a}=r;super(t,{cause:s});g(this,"context");Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),this.context=a}}class l extends Nf{constructor(t,r){super(typeof t=="string"?t:t.message??"Errore",r);g(this,"title");g(this,"code");g(this,"detail");Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor),typeof t!="string"&&(this.title=t.title,this.code=t.detail,this.detail=t.detail)}}function d(n,...e){return new n(...e)}class de extends Error{constructor(t){super(t.message,{cause:t.cause});g(this,"code","EREQUEST_NOT_ALLOWED");this.error=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor)}static fromRaisso(t){return new de(t)}}class I extends Error{constructor(t){var r,s;super(t.message,{cause:t.cause});g(this,"response");g(this,"code","EINVALID_OPERATION");g(this,"forceLogout");g(this,"title");g(this,"detail");this.error=t,Object.defineProperty(this,"name",{value:new.target.name,configurable:!0,enumerable:!1}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor),this.response=(r=t.context)==null?void 0:r.response,this.forceLogout=((s=t.context)==null?void 0:s.needLogin)??!1,this.title=t.title,this.detail=t.detail}static fromRaisso(t){return new I(t)}}class Os extends Error{constructor(t){var r;super(t.message,{cause:t.cause});g(this,"code","ACTIVATION_REQUIRED");g(this,"forceLogout",!0);g(this,"data");g(this,"title");g(this,"detail");this.error=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor),this.data=(r=t.context)==null?void 0:r.data,this.title=t.title,this.detail=t.detail}static fromRaisso(t){return new Os(t)}}class Re extends Error{constructor(t){super(t.message,{cause:t.cause});g(this,"code","ENEED_LOGIN");g(this,"forceLogout",!0);this.error=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor)}static fromRaisso(t){return new Re(t)}}class C extends Error{constructor(t){var r,s;super(t.message,{cause:t.cause});g(this,"code","EINVALID_RESPONSE");g(this,"forceLogout");g(this,"data");g(this,"title");g(this,"detail");this.error=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor),this.forceLogout=((r=t.context)==null?void 0:r.needLogin)??!1,this.data=(s=t.context)==null?void 0:s.data,this.title=t.title,this.detail=t.detail}static fromRaisso(t){return new C(t)}}class Ts extends Error{constructor(t){super(t.message,{cause:t.cause});g(this,"code","ENEED_LOGOUT");g(this,"forceLogout",!0);this.error=t,Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor)}static fromRaisso(t){return new Ts(t)}}
9class Es extends Error{constructor(t){super(t.message,{cause:t.cause});g(this,"code","ENEED_REGISTRATION");g(this,"forceLogout",!0);Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace(this,this.constructor)}static fromRaisso(t){return new Es(t)}}const Lt="raissoUserLogin",Eo="raissoUserLogout",xs="raissoUserRefresh",Af="rai:privacy-required",Cf="rai:privacy-pubblicita-required",Pe="rai:wizard-user-update",He="rai:wizard-user-data-update",ye=new nu;function xo(){return ye.pipe(Wa(n=>n.type===Lt),qa(1))}const Pf=Object.freeze(Object.defineProperty({__proto__:null,event$:ye,getLoginEvent$:xo,login:Lt,logout:Eo,privacyPubblicitaRequired:Cf,privacyRequired:Af,refresh:xs,userDataUpdate:He,userUpdate:Pe},Symbol.toStringTag,{value:"Module"})),Df=/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)[^\s]{8,}$/;function Lf(n){let e=!!n&&n.length>0;return e&&(e=Df.test(n)),e}const Mf=/^[\w-.]+@(?:[\w-]+\.)+[a-zA-Z0-9]{2,4}/;function Io(n){return!!n&&Mf.test(n)}function $f(n){let e={};const t=n?n.split("; "):[];for(let r of t){const s=r.split("=");let a=s.slice(1).join("=");a[0]==='"'&&(a=a.slice(1,-1));try{const i=decodeURIComponent(s[0]);e[i]=a.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}catch{}}return e}function Ff(){return $f(document.cookie)}function Uf(n){return Ff()[n]}function Vf(n,e){return n.TAG===0?{TAG:0,_0:e(n._0)}:{TAG:1,_0:n._0}}function jf(n){return n.TAG!==0}function Gr(n){var e=n.then(function(t){return Promise.resolve({TAG:0,_0:t})});return e.catch(function(t){return Promise.resolve({TAG:1,_0:t})})}var Ro=Vf;function j(){if(arguments.length===1){const n=arguments;return function(t){return Ro(t,n[0])}}return Ro(arguments[0],arguments[1])}function No(n,e,t){return n.TAG===0?e(n._0):t(n._0)}function zf(){if(arguments.length===2){const n=arguments;return function(t){return No(t,n[0],n[1])}}return No(arguments[0],arguments[1],arguments[2])}var fr=jf;function Ao(n,e){return n.TAG!==0||e(n._0),n}function Co(){if(arguments.length===1){const n=arguments;return function(t){return Ao(t,n[0])}}return Ao(arguments[0],arguments[1])}function Po(n,e){return n.TAG===0||e(n._0),n}function Zf(){if(arguments.length===1){const n=arguments;return function(t){return Po(t,n[0])}}return Po(arguments[0],arguments[1])}function Do(n,e){return n.TAG===0?n:{TAG:0,_0:e(n._0)}}function Wf(){if(arguments.length===1){const n=arguments;return function(t){return Do(t,n[0])}}return Do(arguments[0],arguments[1])}function Lo(n,e){return n.TAG===0?n:{TAG:1,_0:e(n._0)}}function Qr(){if(arguments.length===1){const n=arguments;return function(t){return Lo(t,n[0])}}return Lo(arguments[0],arguments[1])}var qf=n=>({TAG:0,_0:n}),y=n=>({TAG:1,_0:n});function ie(n,e){const t=e?new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:e}):new Event(n,{bubbles:!0,cancelable:!0});document.dispatchEvent(t)}function Is(n,e){if(!("BroadcastChannel"in window))return;new BroadcastChannel(n).postMessage(e)}async function J(n,e,t,r,s,a,i){const o=new AbortController,{signal:c}=o;let u,f,m=i||"omit";try{u=new Request(n,{method:t,headers:{"x-caller":"web",...r},body:s,cache:"no-cache",credentials:m,mode:a,signal:c});const _=window.setTimeout(()=>{o.abort(new Error("Timeout"))},2e3);if(f=await fetch(u),window.clearTimeout(_),!f.ok){const h=await f.json();return y(d(l,h,{context:{request:{url:n,body:s==null?void 0:s.toString()},response:{statusText:f.statusText},code:f.status}}))}if(f.redirected){window.location.href=f.url;return}return Gr(e==="json"?f.json():f.text())}catch(_){return _ instanceof Error?y(d(l,_.message,{cause:_,context:{}})):y(d(l,typeof _=="string"?_:"Opps! Qualcosa è andato storto",{cause:_,context:{request:{url:n,body:await(u==null?void 0:u.text())},response:f?{statusText:f.statusText,body:await f.clone().text()}:void 0}}))}}const z=n=>e=>{const t=n.safeParse(e);if(!t.success){const r=t.error.errors.map(s=>`Errore nella proprietà ${s.path}: ${s.message}`);throw d(l,"Invalid response",{context:{error:r}})}return t.data};function D(n){return zf(n,e=>e,e=>{var r;if(e instanceof l){if((r=e.context)!=null&&r.response)throw e;const s=d(l,e.message,{cause:e,context:{...e.context,response:{statusText:"Unknown error",body:"No response available"}}});throw Object.setPrototypeOf(s,Object.getPrototypeOf(e)),Object.assign(s,e),s}const t=e instanceof Error?e.message:typeof e=="string"?e:"Opps! Qualcosa è andato storto";throw d(l,t,{cause:e,context:{response:{statusText:"Unknown error",body:"No response available"}}})})}async function Jf(){var s,a,i,o,c,u,f,m,_;let n="",e="",t="",r="0";try{const h=(s=window==null?void 0:window.Rai)==null?void 0:s.FingerPrintManager,O=await((a=h==null?void 0:h.getFid)==null?void 0:a.call(h));n=(O==null?void 0:O.anonymized)??"",e=(O==null?void 0:O.anonymized19)??""}catch(h){console.error("[profile-manager] loadAsyncParameters/getFid:",h)}if(n){const h=(i=window.Rai)==null?void 0:i.ProfileManager,O=(o=h==null?void 0:h.getUserProfile)==null?void 0:o.call(h);O&&(t=O.lid??"")}try{const h=(c=window==null?void 0:window.Rai)==null?void 0:c.PolicyManager,O=(u=window==null?void 0:window.Rai)==null?void 0:u.IdentifierService,A=await((f=h==null?void 0:h.getCustomPurposesConsents)==null?void 0:f.call(h)),Z=await((m=O==null?void 0:O.getSid)==null?void 0:m.call(O)),ee=Z==null?void 0:Z.country;(_=A==null?void 0:A[1])!=null&&_.li&&typeof ee=="string"&&ee.match(/(^ital|san marino|vatican)/gi)&&(r="1")}catch(h){console.error("[profile-manager] loadAsyncParameters/consents:",h)}
vendor: 54,853 bytes, line 9
9return{fid:n,fid19:e,lid:t,fwd_pnp:r}}const Mo=["M","F","A"],$o=["TEXT","SELECT","DATE","CHECKBOX","EMAIL","DATETIME","RADIO","BUTTON"],Fo=["BOOLEAN","STRING","AGE"];var F;(function(n){n.assertEqual=s=>{};function e(s){}n.assertIs=e;function t(s){throw new Error}n.assertNever=t,n.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},n.getValidEnumValues=s=>{const a=n.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return n.objectValues(i)},n.objectValues=s=>n.objectKeys(s).map(function(a){return s[a]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},n.find=(s,a)=>{for(const i of s)if(a(i))return i},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}n.joinValues=r,n.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Uo;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Uo||(Uo={}));const b=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xe=n=>{switch(typeof n){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(n)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(n)?b.array:n===null?b.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?b.promise:typeof Map<"u"&&n instanceof Map?b.map:typeof Set<"u"&&n instanceof Set?b.set:typeof Date<"u"&&n instanceof Date?b.date:b.object;default:return b.unknown}},p=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class je extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),r}static assert(e){if(!(e instanceof je))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}je.create=n=>new je(n);const Rs=(n,e)=>{let t;switch(n.code){case p.invalid_type:n.received===b.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case p.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,F.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:t=`Unrecognized key(s) in object: ${F.joinValues(n.keys,", ")}`;break;case p.invalid_union:t="Invalid input";break;case p.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${F.joinValues(n.options)}`;break;case p.invalid_enum_value:t=`Invalid enum value. Expected ${F.joinValues(n.options)}, received '${n.received}'`;break;case p.invalid_arguments:t="Invalid function arguments";break;case p.invalid_return_type:t="Invalid function return type";break;case p.invalid_date:t="Invalid date";break;case p.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:F.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case p.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case p.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case p.custom:t="Invalid input";break;case p.invalid_intersection_types:t="Intersection results could not be merged";break;case p.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case p.not_finite:t="Number must be finite";break;default:t=e.defaultError,F.assertNever(n)}return{message:t}};let Gf=Rs;function Qf(){return Gf}const Bf=n=>{const{data:e,path:t,errorMaps:r,issueData:s}=n,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function w(n,e){const t=Qf(),r=Bf({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Rs?void 0:Rs].filter(s=>!!s)});n.common.issues.push(r)}class ce{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const s of t){if(s.status==="aborted")return N;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const s of t){const a=await s.key,i=await s.value;r.push({key:a,value:i})}return ce.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return N;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const N=Object.freeze({status:"aborted"}),dr=n=>({status:"dirty",value:n}),ke=n=>({status:"valid",value:n}),Vo=n=>n.status==="aborted",jo=n=>n.status==="dirty",Mt=n=>n.status==="valid",Br=n=>typeof Promise<"u"&&n instanceof Promise;var S;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(S||(S={}));var Kr=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},zo=function(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},hr,mr;class De{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Zo=(n,e)=>{if(Mt(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new je(n.common.issues);return this._error=t,this._error}}};function P(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:s}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:c}=n;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??t??o.defaultError}},description:s}}class M{get description(){return this._def.description}_getType(e){return Xe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:Xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Br(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Zo(r,s)}"~validate"(e){var r,s;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return Mt(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(s=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>Mt(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)},s=this._parse({data:e,path:r.path,parent:r}),a=await(Br(s)?s:Promise.resolve(s));return Zo(r,a)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:p.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new Vt({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return tt.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Le.create(this)}promise(){return tn.create(this,this._def)}or(e){return Hr.create([this,e],this._def)}and(e){return Xr.create(this,e,this._def)}transform(e){return new Vt({...P(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ms({...P(this._def),innerType:this,defaultValue:t,typeName:R.ZodDefault})}brand(){return new vd({typeName:R.ZodBranded,type:this,...P(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new $s({...P(this._def),innerType:this,catchValue:t,typeName:R.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fs.create(this,e)}readonly(){return Us.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Kf=/^c[^\s-]{8,}$/i,Yf=/^[0-9a-z]+$/,Hf=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xf=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ed=/^[a-z0-9_-]{21}$/i,td=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rd=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sd="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ns;const ad=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,id=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,od=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cd=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ud=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ld=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fd=new RegExp(`^${Wo}$`);function qo(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function dd(n){return new RegExp(`^${qo(n)}$`)}function hd(n){let e=`${Wo}T${qo(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function md(n,e){return!!((e==="v4"||!e)&&ad.test(n)||(e==="v6"||!e)&&od.test(n))}function pd(n,e){if(!td.test(n))return!1;try{const[t]=n.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function yd(n,e){return!!((e==="v4"||!e)&&id.test(n)||(e==="v6"||!e)&&cd.test(n))}class ze extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){const a=this._getOrReturnCtx(e);return w(a,{code:p.invalid_type,expected:b.string,received:a.parsedType}),N}const r=new ce;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?w(s,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&w(s,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")nd.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"email",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ns||(Ns=new RegExp(sd,"u")),Ns.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"emoji",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Xf.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"uuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")ed.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"nanoid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Kf.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Yf.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cuid2",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Hf.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"ulid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),w(s,{validation:"url",code:p.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"regex",code:p.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?hd(a).test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?fd.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?dd(a).test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:p.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?rd.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"duration",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?md(e.data,a.version)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"ip",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?pd(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"jwt",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?yd(e.data,a.version)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cidr",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?ud.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"base64",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?ld.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"base64url",code:p.invalid_string,message:a.message}),r.dirty()):F.assertNever(a);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(s=>e.test(s),{validation:t,code:p.invalid_string,...S.errToObj(r)})}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...S.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...S.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...S.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new ze({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ze({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ze({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ze.create=n=>new ze({checks:[],typeName:R.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...P(n)});function gd(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=t>r?t:r,a=Number.parseInt(n.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class $t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==b.number){const a=this._getOrReturnCtx(e);return w(a,{code:p.invalid_type,expected:b.number,received:a.parsedType}),N}let r;const s=new ce;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:p.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?gd(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),w(r,{code:p.not_finite,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,s){return new $t({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(s)}]})}_addCheck(e){return new $t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}$t.create=n=>new $t({checks:[],typeName:R.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...P(n)});class pr extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==b.bigint)return this._getInvalidInput(e);let r;const s=new ce;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),w(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return w(t,{code:p.invalid_type,expected:b.bigint,received:t.parsedType}),N}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,s){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(s)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}pr.create=n=>new pr({checks:[],typeName:R.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...P(n)});class As extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.boolean,received:r.parsedType}),N}return ke(e.data)}}As.create=n=>new As({typeName:R.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...P(n)});class Yr extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){const a=this._getOrReturnCtx(e);return w(a,{code:p.invalid_type,expected:b.date,received:a.parsedType}),N}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return w(a,{code:p.invalid_date}),N}const r=new ce;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:p.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:p.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):F.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Yr.create=n=>new Yr({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:R.ZodDate,...P(n)});class Jo extends M{_parse(e){if(this._getType(e)!==b.symbol){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.symbol,received:r.parsedType}),N}return ke(e.data)}}Jo.create=n=>new Jo({typeName:R.ZodSymbol,...P(n)});class Go extends M{_parse(e){if(this._getType(e)!==b.undefined){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.undefined,received:r.parsedType}),N}return ke(e.data)}}Go.create=n=>new Go({typeName:R.ZodUndefined,...P(n)});class Cs extends M{_parse(e){if(this._getType(e)!==b.null){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.null,received:r.parsedType}),N}return ke(e.data)}}Cs.create=n=>new Cs({typeName:R.ZodNull,...P(n)});class yr extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return ke(e.data)}}yr.create=n=>new yr({typeName:R.ZodAny,...P(n)});class Ps extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ke(e.data)}}Ps.create=n=>new Ps({typeName:R.ZodUnknown,...P(n)});class et extends M{_parse(e){const t=this._getOrReturnCtx(e);return w(t,{code:p.invalid_type,expected:b.never,received:t.parsedType}),N}}et.create=n=>new et({typeName:R.ZodNever,...P(n)});class Qo extends M{_parse(e){if(this._getType(e)!==b.undefined){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.void,received:r.parsedType}),N}return ke(e.data)}}Qo.create=n=>new Qo({typeName:R.ZodVoid,...P(n)});class Le extends M{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==b.array)return w(t,{code:p.invalid_type,expected:b.array,received:t.parsedType}),N;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(w(t,{code:i?p.too_big:p.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(w(t,{code:p.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(w(t,{code:p.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new De(t,i,t.path,o)))).then(i=>ce.mergeArray(r,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new De(t,i,t.path,o)));return ce.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new Le({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new Le({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new Le({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}Le.create=(n,e)=>new Le({type:n,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...P(e)});function Ft(n){if(n instanceof G){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=tt.create(Ft(r))}return new G({...n._def,shape:()=>e})}else return n instanceof Le?new Le({...n._def,type:Ft(n.element)}):n instanceof tt?tt.create(Ft(n.unwrap())):n instanceof jt?jt.create(Ft(n.unwrap())):n instanceof yt?yt.create(n.items.map(e=>Ft(e))):n}class G extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=F.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==b.object){const u=this._getOrReturnCtx(e);return w(u,{code:p.invalid_type,expected:b.object,received:u.parsedType}),N}const{status:r,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof et&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const c=[];for(const u of i){const f=a[u],m=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new De(s,m,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof et){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(w(s,{code:p.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const m=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new De(s,m,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of c){const m=await f.key,_=await f.value;u.push({key:m,value:_,alwaysSet:f.alwaysSet})}return u}).then(u=>ce.mergeObjectSync(r,u)):ce.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new G({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const s=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:S.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new G({...this._def,unknownKeys:"strip"})}passthrough(){return new G({...this._def,unknownKeys:"passthrough"})}extend(e){return new G({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new G({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new G({...this._def,catchall:e})}pick(e){const t={};for(const r of F.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new G({...this._def,shape:()=>t})}omit(e){const t={};for(const r of F.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new G({...this._def,shape:()=>t})}deepPartial(){return Ft(this)}partial(e){const t={};for(const r of F.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?t[r]=s:t[r]=s.optional()}return new G({...this._def,shape:()=>t})}required(e){const t={};for(const r of F.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof tt;)a=a._def.innerType;t[r]=a}return new G({...this._def,shape:()=>t})}keyof(){return Yo(F.objectKeys(this.shape))}}G.create=(n,e)=>new G({shape:()=>n,unknownKeys:"strip",catchall:et.create(),typeName:R.ZodObject,...P(e)}),G.strictCreate=(n,e)=>new G({shape:()=>n,unknownKeys:"strict",catchall:et.create(),typeName:R.ZodObject,...P(e)}),G.lazycreate=(n,e)=>new G({shape:n,unknownKeys:"strip",catchall:et.create(),typeName:R.ZodObject,...P(e)});class Hr extends M{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new je(o.ctx.common.issues));return w(t,{code:p.invalid_union,unionErrors:i}),N}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const c of r){const u={...t,common:{...t.common,issues:[]},parent:null},f=c._parseSync({data:t.data,path:t.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new je(c));return w(t,{code:p.invalid_union,unionErrors:o}),N}}get options(){return this._def.options}}Hr.create=(n,e)=>new Hr({options:n,typeName:R.ZodUnion,...P(e)});function Ds(n,e){const t=Xe(n),r=Xe(e);if(n===e)return{valid:!0,data:n};if(t===b.object&&r===b.object){const s=F.objectKeys(e),a=F.objectKeys(n).filter(o=>s.indexOf(o)!==-1),i={...n,...e};for(const o of a){const c=Ds(n[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(t===b.array&&r===b.array){if(n.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<n.length;a++){const i=n[a],o=e[a],c=Ds(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return t===b.date&&r===b.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Xr extends M{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=(a,i)=>{if(Vo(a)||Vo(i))return N;const o=Ds(a.value,i.value);return o.valid?((jo(a)||jo(i))&&t.dirty(),{status:t.value,value:o.data}):(w(r,{code:p.invalid_intersection_types}),N)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Xr.create=(n,e,t)=>new Xr({left:n,right:e,typeName:R.ZodIntersection,...P(t)});class yt extends M{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==b.array)return w(r,{code:p.invalid_type,expected:b.array,received:r.parsedType}),N;if(r.data.length<this._def.items.length)return w(r,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&r.data.length>this._def.items.length&&(w(r,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new De(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>ce.mergeArray(t,i)):ce.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new yt({...this._def,rest:e})}}yt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yt({items:n,typeName:R.ZodTuple,rest:null,...P(e)})};class en extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==b.object)return w(r,{code:p.invalid_type,expected:b.object,received:r.parsedType}),N;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)s.push({key:a._parse(new De(r,o,r.path,o)),value:i._parse(new De(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?ce.mergeObjectAsync(t,s):ce.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof M?new en({keyType:e,valueType:t,typeName:R.ZodRecord,...P(r)}):new en({keyType:ze.create(),valueType:e,typeName:R.ZodRecord,...P(t)})}}class Bo extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==b.map)return w(r,{code:p.invalid_type,expected:b.map,received:r.parsedType}),N;const s=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,c],u)=>({key:s._parse(new De(r,o,r.path,[u,"key"])),value:a._parse(new De(r,c,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return N;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),o.set(u.value,f.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const c of i){const u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return N;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),o.set(u.value,f.value)}return{status:t.value,value:o}}}}Bo.create=(n,e,t)=>new Bo({valueType:e,keyType:n,typeName:R.ZodMap,...P(t)});class gr extends M{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==b.set)return w(r,{code:p.invalid_type,expected:b.set,received:r.parsedType}),N;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(w(r,{code:p.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(w(r,{code:p.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(c){const u=new Set;for(const f of c){if(f.status==="aborted")return N;f.status==="dirty"&&t.dirty(),u.add(f.value)}return{status:t.value,value:u}}const o=[...r.data.values()].map((c,u)=>a._parse(new De(r,c,r.path,u)));return r.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,t){return new gr({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new gr({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gr.create=(n,e)=>new gr({valueType:n,minSize:null,maxSize:null,typeName:R.ZodSet,...P(e)});class Ko extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ko.create=(n,e)=>new Ko({getter:n,typeName:R.ZodLazy,...P(e)});class Ls extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return w(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ls.create=(n,e)=>new Ls({value:n,typeName:R.ZodLiteral,...P(e)});function Yo(n,e){return new Ut({values:n,typeName:R.ZodEnum,...P(e)})}class Ut extends M{constructor(){super(...arguments),hr.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return w(t,{expected:F.joinValues(r),received:t.parsedType,code:p.invalid_type}),N}if(Kr(this,hr,"f")||zo(this,hr,new Set(this._def.values),"f"),!Kr(this,hr,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return w(t,{received:t.data,code:p.invalid_enum_value,options:r}),N}return ke(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ut.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ut.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}hr=new WeakMap,Ut.create=Yo;class Ho extends M{constructor(){super(...arguments),mr.set(this,void 0)}_parse(e){const t=F.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==b.string&&r.parsedType!==b.number){const s=F.objectValues(t);return w(r,{expected:F.joinValues(s),received:r.parsedType,code:p.invalid_type}),N}if(Kr(this,mr,"f")||zo(this,mr,new Set(F.getValidEnumValues(this._def.values)),"f"),!Kr(this,mr,"f").has(e.data)){const s=F.objectValues(t);return w(r,{received:r.data,code:p.invalid_enum_value,options:s}),N}return ke(e.data)}get enum(){return this._def.values}}mr=new WeakMap,Ho.create=(n,e)=>new Ho({values:n,typeName:R.ZodNativeEnum,...P(e)});class tn extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return w(t,{code:p.invalid_type,expected:b.promise,received:t.parsedType}),N;const r=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return ke(r.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}tn.create=(n,e)=>new tn({type:n,typeName:R.ZodPromise,...P(e)});class Vt extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{w(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return N;const c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?N:c.status==="dirty"||t.value==="dirty"?dr(c.value):c});{if(t.value==="aborted")return N;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?N:o.status==="dirty"||t.value==="dirty"?dr(o.value):o}}if(s.type==="refinement"){const i=o=>{const c=s.refinement(o,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?N:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?N:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Mt(i))return i;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Mt(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);F.assertNever(s)}}Vt.create=(n,e,t)=>new Vt({schema:n,typeName:R.ZodEffects,effect:e,...P(t)}),Vt.createWithPreprocess=(n,e,t)=>new Vt({schema:e,effect:{type:"preprocess",transform:n},typeName:R.ZodEffects,...P(t)});class tt extends M{_parse(e){return this._getType(e)===b.undefined?ke(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tt.create=(n,e)=>new tt({innerType:n,typeName:R.ZodOptional,...P(e)});class jt extends M{_parse(e){return this._getType(e)===b.null?ke(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jt.create=(n,e)=>new jt({innerType:n,typeName:R.ZodNullable,...P(e)});class Ms extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===b.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ms.create=(n,e)=>new Ms({innerType:n,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...P(e)});class $s extends M{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Br(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new je(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new je(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}$s.create=(n,e)=>new $s({innerType:n,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...P(e)});class Xo extends M{_parse(e){if(this._getType(e)!==b.nan){const r=this._getOrReturnCtx(e);return w(r,{code:p.invalid_type,expected:b.nan,received:r.parsedType}),N}return{status:"valid",value:e.data}}}Xo.create=n=>new Xo({typeName:R.ZodNaN,...P(n)});class vd extends M{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fs extends M{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?N:a.status==="dirty"?(t.dirty(),dr(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?N:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,t){return new Fs({in:e,out:t,typeName:R.ZodPipeline})}}class Us extends M{_parse(e){const t=this._def.innerType._parse(e),r=s=>(Mt(s)&&(s.value=Object.freeze(s.value)),s);return Br(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}}Us.create=(n,e)=>new Us({innerType:n,typeName:R.ZodReadonly,...P(e)});function ec(n,e){const t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function tc(n,e={},t){return n?yr.create().superRefine((r,s)=>{const a=n(r);if(a instanceof Promise)return a.then(i=>{if(!i){const o=ec(e,r),c=o.fatal??t??!0;s.addIssue({code:"custom",...o,fatal:c})}});if(!a){const i=ec(e,r),o=i.fatal??t??!0;s.addIssue({code:"custom",...i,fatal:o})}}):yr.create()}var R;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",
9n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(R||(R={}));const k=ze.create,Ne=$t.create,ne=As.create,rn=Cs.create;yr.create;const wd=Ps.create;et.create;const rt=Le.create,Me=G.create,nt=G.strictCreate,rc=Hr.create;Xr.create,yt.create;const nn=en.create,_d=Ls.create,zt=Ut.create;tn.create,tt.create,jt.create;const vr=Me({message:k().optional(),response:zt(["OK","KO"]).optional(),title:k().optional(),detail:k().optional(),esito:zt(["OK","KO","true","false"]).optional()}),$e=vr,bd=nt({key:k(),value:k()}).partial(),nc=Me({index:Ne(),type:zt($o),subType:zt(Fo),label:k(),code:k(),format:k(),values:rt(bd),validators:nn(k()),current_value:k()}).partial(),sc=Me({title:k(),name:k(),message:k(),footer:k(),submit:k(),user_data_token:k(),fields:rt(nc).optional()}).partial(),ac=sc,ic=sc.extend({fields:rt(nc).optional()}).partial(),Sd=n=>n>=0,kd=Ne().refine(Sd,n=>({message:`${n} non è un numero positivo`})),Od=n=>typeof n!="string"?!1:T.fromFormat(n,"yyyy-MM-dd").isValid,oc=tc(n=>Od(n)),Td=n=>typeof n!="string"?!1:T.fromISO(n).isValid,Zt=tc(n=>Td(n)),cc=Me({ua:k(),age:kd,birthDate:oc,gender:zt(Mo),uid:Ne(),firstName:k(),lastName:k(),email:k().email(),lid:k(),userDomain:Me({refreshToken:k()}),photoURL:k().optional().nullable(),lastToken:rc([rn(),Zt]).optional(),pubblicitaProfilata:ne().optional(),pubblicitaProfilataV:k().optional().or(rn()),privacyPubblicita:ne().optional(),privacyPolicy:ne().optional(),personalizzazione:ne().optional(),privacy_Policy_isAccepted:ne().optional(),privacy_Pubblicita_isAccepted:ne().optional(),user_update:rt(ac).optional().or(rn()),user_data_update:ic.optional().nullable(),need_password_change:ne().optional(),parental_control:Me({pin:k(),level:Ne(),created_date:Zt,last_modified_date:Zt.nullable()}).nullable().optional()}),uc=Me({loginProvider:k(),photoURL:k().optional().nullable(),thumbnailURL:k().optional().nullable()});vr.extend({authorization:k().optional(),ente_accreditato:ne().optional(),raisso:cc.optional(),refreshToken:k().optional(),social:uc.optional(),ua:k().optional()});const lc=vr.partial().extend({pubblicitaProfilata:ne().optional(),pubblicitaProfilataV:k().optional(),privacyPubblicita:ne().optional(),privacyPolicy:ne().optional(),personalizzazione:ne().optional(),privacy_Policy_isAccepted:ne().optional(),privacy_Pubblicita_isAccepted:ne().optional()}),Ed=lc,fc=lc.pick({pubblicitaProfilata:!0,pubblicitaProfilataV:!0,privacyPubblicita:!0,privacy_Pubblicita_isAccepted:!0}).partial(),xd=nt({personalizzazione:ne()}),Id=nt({scope:k(),refresh_token:k(),access_token:k(),expires_in:Ne().gte(0),token_type:k()}).partial(),Rd=nt({message:k(),path:k(),code:Ne()}).partial(),Nd=nt({code:k(),state:k(),redirect_uri:k()}).partial(),Ad=uc,Cd=cc,Pd=ic;Me({ua:k().optional(),authorization:k().optional(),refreshToken:k().optional(),ente_accreditato:ne().optional(),social:Ad.optional(),raisso:Cd.optional(),user_data_update:Pd.optional(),user_update:rt(ac).optional().or(rn()),response:k().optional()}).merge(vr);const Wt=nt({rtkn:k(),appID:Ne(),pin:Ne().gte(0),qrCode:k(),url:k()}).extend(vr.shape).partial(),Dd=nt({id:Ne(),brand:k(),model:k(),"model-id":k(),domain:k(),users:rt(Ne()).min(0),created:oc.optional(),modified:Zt.optional()}).partial(),Ld=nt({uid:Ne(),marca:k().optional(),modello:k().optional(),deviceID:k().optional(),dataCreazione:Zt.optional(),dataModifica:Zt.optional(),dominio:k().optional()}),dc=rc([Me({status:zt(["NOT_PRESENT","PENDING","PROCESSED","ERROR"])}),Me({status:_d("READY"),link:k()})]),Ze=`${Ce}/device`;function We(n){console.error("[device-controller] Error:",n)}const ln=class ln{constructor(){}static get instance(){return this._instance||(this._instance=new ln),this._instance}async unparing(e){const t=`${Ze}/unpairing`;try{const r=await J(t,"json","POST",{"x-auth-token":e});return j(r,z(Wt))}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r})))}}async pairing(e){const t=`${Ze}/pairing`;try{const r=await E.callAuthFetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return j(r,z(Wt))}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{data:JSON.stringify(e)}})))}}async pairingLogged(e){const t=`${Ze}/pairing/logged`;try{const r=await E.callAuthFetch(t,{method:"POST",headers:e?{appI
9d:e}:{}});return j(r,z(Wt))}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r})))}}async pairingInit(e){const t=`${Ze}/pairing/init`;try{const r=await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e));let s=j(r,z(Wt));return s=Qr(s,a=>(a.context&&(a.context.request={url:t,body:JSON.stringify(e)}),a)),s}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r})))}}async pairingCheck(e){const t=`${Ze}/pairing/check`;try{const r=await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e));let s=j(r,z(Wt));return s=Qr(s,a=>(a.context&&(a.context.request={url:t,body:JSON.stringify(e)}),a)),s}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r})))}}async getAppId(e){const t=`${Ze}/getAppID`;try{const r=await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e));let s=j(r,z(Wt));return s=Qr(s,a=>(a.context&&(a.context.request={url:t,body:JSON.stringify(e)}),a)),s}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r})))}}async appId(e){const t=`${Ze}/${e}`;try{const r=await J(t,"json","GET");let s=j(r,z(Dd));return s=Qr(s,a=>(a.context&&(a.context.request={url:t}),a)),s}catch(r){return r instanceof l?y(r):(We(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{data:e}})))}}async users(){const e=`${Ze}/users`;try{const t=await E.callAuthFetch(e,{method:"GET"}),r=nn(rt(k()));return j(t,z(r))}catch(t){return t instanceof l?y(t):(We(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t})))}}async list(){const e=`${Ze}/list`;try{const t=await E.callAuthFetch(e,{method:"GET"}),r=rt(Ld);return j(t,z(r))}catch(t){return t instanceof l?y(t):(We(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t})))}}};g(ln,"_instance");let st=ln;const Vs=`${Ce}/oauth`;function js(n){console.error("[google-oauth-controller] Error:",n)}const fn=class fn{constructor(){}static get instance(){return this._instance||(this._instance=new fn),this._instance}async token(e,t,r,s,a,i){let o=`${Vs}/token`;const c=new URL(o,window.location.origin);c.searchParams.set("client_id",e),c.searchParams.set("client_secret",t),c.searchParams.set("grant_type",r),s&&c.searchParams.set("code",s),a&&c.searchParams.set("scope",a),i&&c.searchParams.set("refresh_token",i),o=c.href;try{const u=await J(o,"json","POST");return j(u,z(Id))}catch(u){return js(u),y(d(l,u instanceof Error?u.message:"Opps! Qualcosa è andato storto",{cause:u,context:{request:{url:o}}}))}}async tokenValidate(e){let t=`${Vs}/token/validate/`;const r=new URL(t,window.location.origin);r.searchParams.set("token",e),t=r.href;try{const s=await J(t,"json","POST");return j(s,z(Rd))}catch(s){return js(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:t}}}))}}async authorize(e){const t=`${Vs}/authorize/`;try{const r=await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e));return j(r,z(Nd))}catch(r){return js(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}};g(fn,"_instance");let zs=fn;const Zs=`${Ce}/login`;function hc(n){console.error("[login-controller] Error:",n)}const dn=class dn{constructor(){}static get instance(){return this._instance||(this._instance=new dn),this._instance}async social(e){const t=`${Zs}/social`;try{return await J(t,"json","POST",{"content-type":"application/json"},e)}catch(r){return hc(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:e}}}))}}async site(e,t,r,s,a,i){const o=i?`${Ce}/oauth2/raisso/login/site`:`${Zs}/site`;let c="omit";const u=new URLSearchParams({domainApiKey:e,email:t,password:r});s&&u.set("appId",s),a&&u.set("ente",`${a}`),i&&(c="include");try{return await J(o,"json","POST",{"content-type":"application/x-www-form-urlencoded"},u.toString(),void 0,c)}catch(f){return hc(f),y(d(l,f instanceof Error?f.message:"Opps! Qualcosa è andato storto",{cause:f,context:{request:{url:o,body:u.toString()}}}))}}};g(dn,"_instance");let sn=dn;const qt=`${Ce}/privacy`;function Jt(n){console.error("[privacy-controller] Error:",n)}const hn=class hn{constructor(){}static get instance(){return this._instance||(this._instance=new hn),this._instance}async get(){const e=`${qt}`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z(Ed))}catch(t){return Jt(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async update(e){const t=`${qt}/update`;try{const r=await E.callAuthFetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return j(r,z($e))}catch(r){return Jt(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async pubblicitaProfilata(){const e=`${qt}/pubblicitaprofilata`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z(fc))}catch(t){return Jt(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async savePubblicitaProfilata(e){const t=`${qt}/pubblicitaprofilata`;try{const r=await E.callAuthFetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return j(r,z(fc))}catch(r){return Jt(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async personalizzazione(){const e=`${qt}/personalizzazione`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z(xd))}catch(t){return Jt(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async savePersonalizzazione(e){const t=`${qt}/personalizzazione`;try{const r=await E.callAuthFetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return j(r,z($e))}catch(r){return Jt(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}};g(hn,"_instance");let at=hn;const mc=`${Ce}`;function pc(n){console.error("[registration-controller] Error:",n)}const mn=class mn{constructor(){}static get instance(){return this._instance||(this._instance=new mn),this._instance}async registration(e){const t=`${mc}/registration`;try{return await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e))}catch(r){return pc(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async resendActivationMail(e,t){let r=`${mc}/user/resendActivationMail`;const s=new URL(r,window.location.origin);s.searchParams.set("email",e),s.searchParams.set("domainApiKey",t),r=s.href;try{return await J(r,"json","GET")}catch(a){return pc(a),y(d(l,a instanceof Error?a.message:"Opps! Qualcosa è andato storto",{cause:a,context:{request:{url:r}}}))}}};g(mn,"_instance");let an=mn;const yc=`${Ce}/token`;function gc(n){console.error("[token-controller] Error:",n)}const pn=class pn{constructor(){}static get instance(){return this._instance||(this._instance=new pn),this._instance}async refresh({domainApiKey:e,refreshToken:t,appId:r}){const s=`${yc}/refresh`,a=new URLSearchParams({domainApiKey:e,refreshToken:t});r&&a.append("appId",r);try{return await J(s,"json","POST",{"content-type":"application/x-www-form-urlencoded"},a)}catch(i){return gc(i),y(d(l,i instanceof Error?i.message:"Opps! Qualcosa è andato storto",{cause:i,context:{request:{url:s,body:a.toString()}}}))}}async check({domainApiKey:e,accessToken:t,refreshToken:r,appId:s}){if(!t)throw y(d(l,"L'access_token è obbligatorio"));const a=`${yc}/check`,i=new URLSearchParams({domainApiKey:e,refreshToken:r});s&&i.append("appId",s);try{return await J(a,"json","POST",{"content-type":"application/x-www-form-urlencoded","X-Auth-Token":t},i.toString())}catch(o){return gc(o),y(d(l,o instanceof Error?o.message:"Opps! Qualcosa è andato storto",{cause:o,context:{request:{url:a,body:i.toString()}}}))}}};g(pn,"_instance");let wr=pn;function Md(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var $d=Md;const Fd=le($d);var Ud=Array.isArray,Vd=Ud;const jd=le(Vd),zd=n=>n instanceof Blob,Zd=n=>n instanceof File,Wd=n=>typeof n=="boolean",qd=n=>n===null,Jd=n=>
9n===void 0,Ws=(n,e,t,r)=>{const s=r??"";if(qd(n)||Jd(n)){e.excludeNull||t.append(s,"");return}if(Zd(n)){t.append(s,n);return}if(zd(n)){t.append(s,n);return}if(jd(n)){n.forEach((a,i)=>{let o=s;e.useBrackets&&(o=`[${e.arrayIndexes?i:""}]`),Ws(a,e,t,o)});return}if(Fd(n)){Object.entries(n).forEach(([a,i])=>{let o=a;r&&(o=e.useDotSeparator?`${r}.${a}`:`${r}[${a}]`),Ws(i,e,t,o)});return}if(Wd(n)){e.booleanAsNumbers?t.append(s,`${Number(n)}`):t.append(s,n?"true":"false");return}t.append(s,n)},Gd={arrayIndexes:!0,excludeNull:!0,useDotSeparator:!1,useBrackets:!0,booleanAsNumbers:!1},Qd=(n,e={},t=new FormData)=>{if(!n)return t;const r=Object.assign({},Gd,e);return Ws(n,r,t),t},te=`${Ce}/user`,vc=`${te}/infox`;function re(n){console.error("[user-controller] Error:",n)}const yn=class yn{constructor(){}static get instance(){return this._instance||(this._instance=new yn),this._instance}async update(e){const t=`${te}/update`;try{return await E.callAuthFetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}catch(r){return re(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async socialPair(e){const t=`${te}/socialpair`;try{return await J(t,"json","POST",{"x-auth-token":e})}catch(r){return re(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r}))}}async reports(e){const t=`${te}/reports`;try{const r=await J(t,"json","POST",{"content-type":"application/json"},JSON.stringify(e));return j(r,z($e))}catch(r){return re(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async deleteEmail(){const e=`${te}/delete/email`;try{const t=await E.callAuthFetch(e,{method:"POST"});return j(t,z($e))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async credentialTokenChange(e,t){const r=`${te}/credential/token/change`;try{const s=await E.callAuthFetch(r,{method:"POST",headers:{oldPassword:e,newPassword:t}});return j(s,z($e))}catch(s){return re(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:r,body:JSON.stringify({oldPassword:e,newPassword:t})}}}))}}async credentialRecovery(e){let t=`${te}/credential/recovery`;const r=new URL(t,window.location.origin);r.searchParams.set("email",e),t=r.href;try{const s=await J(t,"json","POST");return j(s,z($e))}catch(s){return re(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:t}}}))}}async credentialChange(e,t){const r=`${te}/credential/change`;try{const s=await J(r,"json","POST");return j(s,z($e))}catch(s){return re(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:r,body:JSON.stringify({password:e,tokenChangePassword:t})}}}))}}async appUpdate(e){let t=`${te}/app/update`;const r=Qd(e);try{const s=await E.callAuthFetch(t,{method:"POST",body:r});return j(s,z($e))}catch(s){return re(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async trackRequest(){const e=`${te}/track/request`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z(dc))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async trackExport(){const e=`${te}/track/export`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z(dc))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async trackDownload(e){const t=`${te}/track/download/${encodeURIComponent(e)}`;try{return await J(t,"text","GET")}catch(r){return re(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t}}}))}}async trackDomain(e){const t=`${te}/track/domain/${encodeURIComponent(e)}`;try{return await E.callAuthFetch(t,{method:"GET"},"text")}catch(r){return re(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r}))}}async service(){const e=`${te}/service`;try{const t=await E.callAuthFetch(e,{method:"GET"}
9),r=nn(ne());return j(t,z(r))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async serviceNl(){const e=`${te}/service/nl`;try{const t=await E.callAuthFetch(e,{method:"GET"}),r=nn(wd());return j(t,z(r))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async infox(){const e=vc;try{return await E.callAuthFetch(e,{method:"GET"})}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async credentialRequestTokenChange(){const e=`${te}/credential/request/token/change`;try{const t=await E.callAuthFetch(e,{method:"GET"});return j(t,z($e))}catch(t){return re(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t}))}}async credentialRequestChange(e,t){const r=`${te}/credential/request/change`;try{return await J(r,"json","GET",{email:e,domainApiKey:t})}catch(s){return re(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s,context:{request:{url:r,body:JSON.stringify(e)}}}))}}async activation(e){let t=`${te}/activation`;const r=new URL(t,window.location.origin),s=new URLSearchParams(e);s.has("t")?r.search=s.toString():r.searchParams.set("t",e),t=r.href;try{const a=await J(t,"json","GET");return j(a,z($e))}catch(a){return re(a),y(d(l,a instanceof Error?a.message:"Opps! Qualcosa è andato storto",{cause:a,context:{request:{url:t}}}))}}};g(yn,"_instance");let Q=yn;const it=`${Ce}/parental-control`;function ot(n){console.error("[parental-control-controller] Error:",n)}const gn=class gn{constructor(){}static get instance(){return this._instance||(this._instance=new gn),this._instance}async updatePin(e){const t=`${it}/pin`;try{return await E.callAuthFetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){return ot(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async savePin(e){const t=`${it}/pin`;try{return await E.callAuthFetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPin:e})})}catch(r){return ot(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify({newPin:e})}}}))}}async validatePin(e){const t=`${it}/validate`;try{return await E.callAuthFetch(t,{method:"POST",headers:{"Content-Type":"application/json",pin:e}})}catch(r){return ot(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify({pin:e})}}}))}}async updateLevel(e){const t=`${it}/level`;try{return await E.callAuthFetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){return ot(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify(e)}}}))}}async resetPin(e,t,r){const s=`${it}/reset/pin`;try{return await E.callAuthFetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":t,"Reset-Pin-Token":r},body:JSON.stringify(e)})}catch(a){return ot(a),y(d(l,a instanceof Error?a.message:"Opps! Qualcosa è andato storto",{cause:a,context:{request:{url:s,body:JSON.stringify(e)}}}))}}async requestPinReset(){const e=`${it}/request/pin-reset`;try{return await E.callAuthFetch(e,{method:"POST"})}catch(t){return ot(t),y(d(l,t instanceof Error?t.message:"Opps! Qualcosa è andato storto",{cause:t,context:{request:{url:e}}}))}}async delete(e){const t=`${it}`;try{return await E.callAuthFetch(t,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPin:e})})}catch(r){return ot(r),y(d(l,r instanceof Error?r.message:"Opps! Qualcosa è andato storto",{cause:r,context:{request:{url:t,body:JSON.stringify({currentPin:e})}}}))}}async checkTokenResetPin(e,t){const r=`${it}/request/pin-reset/check-token`;try{return await E.callAuthFetch(r,{method:"GET",headers:{"Content-Type":"application/json","X-Auth-Token":e,"Reset-Pin-Token":t}})}catch(s){return ot(s),y(d(l,s instanceof Error?s.message:"Opps! Qualcosa è andato storto",{cause:s}))}}};g(gn,"_instance");let Fe=gn;const L=Jr.getService();class Bd{constructor(){g(this,"canRefreshUserDetails",!0);g(this,"settings",{AUDITEL_ENCRYPT:"rai:auditel-encrypt"})}get broadcastChannel(){return"rai:raisso"}get events$(){return ye.asObservable()}async userInfoUpdate(e,t){var s,a;let r;try{switch(t){case"profile_update":r=await Q.instance.appUpdate(e);break;case"user_data_update":r=await Q.instance.update(e);break;case"user_privacy_update":r=await at.instance.update(e);break;default:throw new TypeError("Invalid type "+t)}const i=D(r);if(t==="user_privacy_update"||t==="user_data_update"){const o=(s=this.getUserProfile())==null?void 0:s.toJSON();if(o){(a=o.user_update)==null||a.forEach(u=>{var f,m,_,h;
9if(u.name===t){const O=e;if((f=O.fields)!=null&&f.length){const A=O.fields.map(Z=>Z.code);u.fields=(m=u.fields)==null?void 0:m.filter(Z=>!Z.code||!A.includes(Z.code))}else{const A=(_=o.user_update)==null?void 0:_.findIndex(Z=>Z.name===t);A&&A!==-1&&((h=o.user_update)==null||h.splice(A,1))}}});const c=pe.fromJSON(o);L.setProfile(c)}}return i}catch(i){throw i instanceof l?I.fromRaisso(i):i instanceof Error?i:(console.log("[profile-manager] userInfoUpdate:",i),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:i,context:{data:JSON.stringify({type:t,detail:e})}})))}}getUserUpdate(e){var r;const t=(r=this.getUserProfile())==null?void 0:r.user_update;return e?t==null?void 0:t.find(s=>s.name===e):t}getUserDataUpdate(){var e;return(e=this.getUserProfile())==null?void 0:e.user_data_update}async getInfox(){return this.canRefreshUserDetails=!0,await this.refreshUserDetails()}async refreshUserDetails(){if(!this.canRefreshUserDetails)throw de.fromRaisso(d(l,"Cannot refresh user details"));this.canRefreshUserDetails=!1;try{if(!L.getAccessToken())throw Re.fromRaisso(d(l,"User not logged in",{context:{needLogin:!0}}));const t=await Q.instance.infox(),r=D(t);if(!r)throw C.fromRaisso(d(l,"User details is undefined"));const{state:s,need_password_change:a}=r;if(s===3)throw Ts.fromRaisso(d(l,"Requested logout and login"));const i=L.getProfile();r.photoURL=r.photoURL??(i==null?void 0:i.photoURL)??void 0;const o=pe.fromLogin({ente_accreditato:(i==null?void 0:i.user_type)==="ente",social:i==null?void 0:i.social,raisso:r});return console.log("raisso",o),L.setProfile(o),o.user_update&&(ye.next(new CustomEvent(Pe,{detail:o,bubbles:!0,cancelable:!0})),ie(Pe,o)),o.user_data_update&&(ye.next(new CustomEvent(He,{detail:o,bubbles:!0,cancelable:!0})),ie(He,o)),i?(ye.next(new CustomEvent(xs,{detail:o,bubbles:!0,cancelable:!0})),ie(xs,o)):(ye.next(new CustomEvent(Lt,{detail:o,bubbles:!0,cancelable:!0})),ie(Lt,o),Is(this.broadcastChannel,{action:"login",tabId:E.tabId})),this.canRefreshUserDetails=!0,a&&ie("rai:ssoWidget-openRequest",{mode:"changePassword",respData:r}),o}catch(e){throw console.error(e),e instanceof l?I.fromRaisso(e):e instanceof Error?e:I.fromRaisso(d(l,"refreshUserDetails"))}}async confirmUserByUrl(){const e=new URL(window.location.href);try{const t=await Q.instance.activation(e.search),r=D(t);if(r.response==="KO")throw C.fromRaisso(d(l,r,{context:{data:e.search}}));return r}catch(t){throw t instanceof l?I.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] confirmUserByUrl:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:e.search}})))}}async associateUserByUrl(){const t=new URL(window.location.href).searchParams.get("t")??"";try{const r=await Q.instance.socialPair(t),s=D(r);if(s.response==="KO")throw C.fromRaisso(d(l,s,{context:{data:t}}));return s}catch(r){throw r instanceof l?I.fromRaisso(r):r instanceof Error?r:I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:r,context:{data:t}}))}}async getPrivacyPolicyInfo(){try{const e=await at.instance.get(),t=D(e),r=L.getProfile();return r&&(r.setPrivacyData(t),L.setProfile(r)),t}catch(e){throw e instanceof l?I.fromRaisso(e):e instanceof Error?e:(console.error(e),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:e})))}}async setPrivacyPolicyInfo(e){try{const t=await at.instance.update(e),r=D(t);if(r.response==="KO")throw C.fromRaisso(d(l,r,{context:{data:JSON.stringify(e)}}));return r}catch(t){throw t instanceof l?I.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] setPrivacyPolicyInfo",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.parse(JSON.stringify(e))}})))}}async setPersonalizzazione(e){try{const t=await at.instance.savePersonalizzazione({personalizzazione:e}),r=D(t);if(r.response==="KO")throw C.fromRaisso(d(l,r,{context:{data:e}}));const s=this.getUserProfile();return s&&(s.setPrivacyData({personalizzazione:e}),L.setProfile(s)),r}catch(t){throw t instanceof l?I.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] setPersonalizzazione:",t),I.fromRaisso(d(l,"Opps! qualcosa è andato storto",{cause:t,context:{data:e}})))}}async getPubblicitaProfilata(){try{const e=await at.instance.pubblicitaProfilata(),t=D(e),r=L.getProfile();if(r){const{privacy_Pubblicita_isAccepted:s,pubblicitaProfilata:a}=t;r.setPrivacyData({pubblicitaProfilata:a,privacy_Pubblicita_isAccepted:s}),L.setProfile(r)}return t}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:(console.error("[profile-manager] getPubblicitaProfilata:",e),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:e})))}}async setPubblicitaProfilata(e){try{const t=await at.instance.savePubblicitaProfilata({pubblicitaProfilata:e});return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] setPubblicitaProfilata:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:e}})))}}hasPubblicitaProfilata(){if(!E.checkLogin())return!1;const e=this.getUserProfile();return(e==null?void 0:e.pubblicitaProfilata)&&e.pubblicitaProfilataIsAccepted}isSocialInAppBrowser(){const e=navigator.userAgent||navigator.vendor||window.opera;return e.indexOf("FBAN")>-1||e.indexOf("FBAV")>-1||e.indexOf("Instagram")>-1}
9isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)}getUserProfile(){return L.getProfile()}isEnte(){const e=this.getUserProfile();return(e==null?void 0:e.user_type)==="ente"}async sendReport(e){try{const t=await Q.instance.reports(e);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] sendReport:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.stringify(e)}})))}}async sendRecover(e){if(!Io(e))throw de.fromRaisso(d(l,"Email non valida",{context:{data:e}}));try{const t=await Q.instance.credentialRecovery(e);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] sendRecover:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:e}})))}}async changePassword(e,t,r){if(!Lf(t))throw de.fromRaisso(d(l,"Password non valida",{context:{data:JSON.stringify({new_password:t})}}));try{let s;if(e){if(!L.getAccessToken())throw Re.fromRaisso(d(l,"Richiesta la login",{context:{needLogin:!0}}));s=await Q.instance.credentialTokenChange(e,t)}else if(r)s=await Q.instance.credentialChange(t,r);else throw de.fromRaisso(d(l,"Parametri non validi",{context:{data:JSON.stringify({new_password:t,old_password:e,token:r})}}));return D(s)}catch(s){throw s instanceof l?C.fromRaisso(s):s instanceof Error?s:(console.error("[profile-manager] changePassword:",s),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:s,context:{data:JSON.stringify({new_password:t,old_password:e,token:r})}})))}}async resetPassword(e,t){if(e&&!Io(e))throw de.fromRaisso(d(l,"Email non valida",{context:{data:e}}));try{let r;if(e&&t)r=await Q.instance.credentialRequestChange(e,t);else{if(!L.getAccessToken())throw Re.fromRaisso(d(l,"Richiesta la login",{context:{needLogin:!0}}));r=await Q.instance.credentialRequestTokenChange()}return D(r)}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] resetPassword:",r),I.fromRaisso(d(l,{title:"Opps! ",message:"Qualcosa è andato storto"},{cause:r,context:{data:e}})))}}async userServices(){try{const e=await Q.instance.service();return D(e)}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:(console.error("[profile-manager] userServices:",e),I.fromRaisso(d(l,"Opps! qualcosa è andato storto",{cause:e})))}}async userServiceActivities(e){try{const t=await Q.instance.trackDomain(e);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] userServicesAttivities:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:e}})))}}async exportUserInfo(e,t){const r=L.getAccessToken(),s=L.getRefreshToken();if(!r&&!s)throw Re.fromRaisso(d(l,"Richiesta la login",{context:{needLogin:!0}}));let a;try{switch(e){case"request":a=await Q.instance.trackRequest();break;case"status":a=await Q.instance.trackExport();break;case"download":if(!t)throw de.fromRaisso(d(l,"Parametro obbligatorio mancante",{context:{data:JSON.stringify({method:e,downloadToken:t})}}));a=await Q.instance.trackDownload(t);break}return D(a)}catch(i){throw i instanceof l?C.fromRaisso(i):i instanceof Error?i:(console.error("[profile-manager] exportUserInfo",i),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:i,context:{data:JSON.stringify({method:e,downloadToken:t})}})))}}async sendProfileUpdate(e){try{const t=await Q.instance.appUpdate(e),r=D(t),{firstName:s,lastName:a,gender:i,image:o,birthDate:c}=e,u=T.fromFormat(c,"dd/MM/yyyy"),f=this.getUserProfile();if(f&&u.isValid){const m=f.toJSON(),_=pe.fromJSON(Object.assign(m,{firstName:s,lastName:a,gender:i,birthDate:u.toFormat("dd-MM-yyyy")},o?{photoURL:o}:{}));L.setProfile(_)}return r}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] sendProfileUpdate:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:e}})))}}genericLogin(e,t,r=!1,s=!1){return this.sendLogin(e,t,fe,!1,r,s)}async sendLogin(e,t,r,s=!1,a=!1,i=!1){try{const o=await sn.instance.site(r,e,t,void 0,a,i),c=D(o),{response:u,detail:f,message:m,title:_}=c;if(u==="KO"){const h={detail:f,message:m??"Opps! Qualcosa è andato storto",response:u,title:_};throw f==="ACTIVATIONREQUIRED"?Os.fromRaisso(d(l,h,{context:{data:{email:e,password:t,domainApiKey:r,isEnte:a}}})):C.fromRaisso(d(l,h,{context:{data:{email:e,password:t,domainApiKey:r,isEnte:a}}}))}return s?c:this.logUser(c)}catch(o){throw o instanceof l?C.fromRaisso(o):o instanceof Error?o:(console.error("[profile-manager] sendLogin:",o),I.fromRaisso(d(l,{message:"Opps! Qualcosa è andato storto",title:"Attenzione!"},{cause:o,context:{data:{email:e,password:t,domainApiKey:r,isEnte:a}}})))}}sendSocialLoginCustom(e,t){if(!e||!t)throw new Error("Mancano i parametri della firma: provider e/o redirectUrl");const r=`${Ce}/social/login/${e}?redirectUrl=${t}`;window.location.href=r}socialLogin(e,t){return new Promise((r,s)=>{const i={provider:e,authFlow:"redirect",redirectURL:t??window.location.href,callback:o=>{o.errorCode!==0?s(C.fromRaisso(d(l,o.errorMessage,{context:{data:e}}))):r(this.sendSocialLogin(o))}};window.gigya.socialize.login(i)})}
9checkGigyaLogin(){E.isSocialLoginInProgress()&&window.gigya.socialize.getUserInfo({callback:this.onGigyaLogin.bind(this)})}onGigyaLogin(e){if(e.errorCode!==0)throw C.fromRaisso(d(l,e.errorMessage));if(E.checkLogin()){console.log("[profile-manager] onGigyaLogin: Utente già loggato, skip del processo di login");return}try{const t=document.location.protocol+"//"+document.location.host+document.location.pathname;window.history.replaceState(null,document.title,t)}catch{}this.sendSocialLogin(e)}async sendSocialLogin(e){if(!e)throw console.error("[profile-manager] sendSocialLogin: Parametri obbligatori mancanti (data)"),de.fromRaisso(d(l,"Parametri obbligatori mancanti",{context:{data:JSON.stringify(e)}}));const t={...e,domainApiKey:fe};try{const r=await sn.instance.social(JSON.stringify(t)),s=D(r),{detail:a,raisso:i}=s;switch(a){case"NOUSER":{const{firstName:o,lastName:c,email:u,UID:f,loginProvider:m}=e.user;return ie("rai:ssoWidget-openRequest",{mode:"registrationSocial",data:{firstName:o,lastName:c,email:u,socialUID:f,socialProvider:m},respData:s}),s}case"DELETEREQUIRED":throw ie("rai:ssoWidget-openRequest",{mode:"registration",respData:s}),Es.fromRaisso(d(l,"necessaria la regisrazione",{context:{needRegistration:!0}}));case"ACTIVATIONREQUIRED":return ie("rai:ssoWidget-activation-required",s),s;case"SOCIAL_OVER_NOUSER_NO_ACTIVATION_MAIL":return this.logUser(s)}return i!=null&&i.need_password_change&&ie("rai:ssoWidget-openRequest",{mode:"changePassword",respData:s}),this.logUser(s)}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] sendSocialLogin:",r),I.fromRaisso(d(l,{title:"Opps! ",message:"Qualcosa è andato storto"},{cause:r,context:{data:JSON.stringify(e)}})))}}logUser(e){return this._setUserObject(e)}setAuditelPayload(e,t){const r=new TextEncoder,s=r.encode(e),a=r.encode(t),i=s.map((u,f)=>u^a[f%a.length]);let c=btoa(String.fromCharCode(...i)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");c=`2${c}`,sessionStorage.setItem(this.settings.AUDITEL_ENCRYPT,c)}async setAuditelEncrypt(){const e="zX9#vL2p!Qn8*Rk5T@uW4mY7bV1eC6xA",t=Math.round(Math.random()*1e10),{fid:r,fid19:s,lid:a,fwd_pnp:i}=await Jf();let c=`${a}|${r!==""?r:s}|${t}|${i}`;this.setAuditelPayload(c,e)}getAuditelEncrypt(){const e=sessionStorage.getItem(this.settings.AUDITEL_ENCRYPT);return e||null}deleteAuditelEncrypt(){sessionStorage.removeItem(this.settings.AUDITEL_ENCRYPT)}async _setUserObject(e){const{raisso:t,authorization:r,refreshToken:s,social:a,ente_accreditato:i,user_data_update:o,user_update:c}=e;if(!t||!r||!s){const u=d(l,"Login non valida",{context:{data:JSON.stringify(e)}});throw Re.fromRaisso(u)}t.photoURL||(t.photoURL=(a==null?void 0:a.photoURL)??void 0);try{const u=pe.fromLogin({raisso:t,social:a,ente_accreditato:i,user_data_update:o,user_update:c});return L.setProfile(u),L.setToken({authToken:r,refreshToken:s}),this.setAuditelEncrypt(),ye.next(new CustomEvent(Lt,{detail:u,bubbles:!0,cancelable:!0})),ie(Lt,u),Is(this.broadcastChannel,{action:"login"}),u.user_update&&(ye.next(new CustomEvent(Pe,{detail:u,bubbles:!0,cancelable:!0})),ie(Pe,u)),u}catch(u){throw u instanceof Error?u:(console.error("[profile-manager] _setUserObject:",u),I.fromRaisso(d(l,{title:"Opps! ",message:"Qualcosa è andato storto"},{cause:u,context:{data:JSON.stringify(e)}})))}}softLogout(e,t){var r;this.deleteAuditelEncrypt(),E.softLogout(e,t),(r=window.permutive)==null||r.reset(),Is(this.broadcastChannel,{action:"logout",tabId:E.tabId})}async softLogoutForEnti(e){if(!E.checkLogin())return!1;const t=this.getUserProfile();if(this.deleteAuditelEncrypt(),!t)return!1;const r=t.toJSON();try{const s=await this.sendLogin(t.email,e,fe,!0);if(!s||!s.raisso)return!1;const a=pe.fromJSON(Object.assign(r,{user_type:"persona"}));return L.setProfile(a,null),E.softLogout(!0,!0)}catch(s){console.error("[profile-manager] softLogoutForEnti:",s);const a=pe.fromJSON(Object.assign(r,{user_type:"ente"}));return L.setProfile(a),!1}}logout(){var e;try{this.softLogout(!0,!0);const t=Uf("prevUrl")??new URLSearchParams(location.search).get("prevUrl");(e=window.permutive)==null||e.reset(),t&&t.indexOf("user")==-1&&window.location.replace(t)}catch{}}async registration(e){e.domainApiKey||(e.domainApiKey=fe);try{const t=await an.instance.registration(e);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] registration:",t),I.fromRaisso(d(l,{title:"Opps! ",message:"Qualcosa è andato storto"},{cause:t,context:{data:JSON.stringify(e)}})))}}async resendActivationMail(e){try{const t=await an.instance.resendActivationMail(e,fe);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] resendActivation:",t),I.fromRaisso(d(l,{title:"Opps! ",message:"Qualcosa è andato storto"},{cause:t,context:{data:e}})))}}async checkPrivacyPolicy(){let e=E.checkPrivacy();if(!e)try{await this.getPrivacyPolicyInfo(),e=E.checkPrivacy()}catch{}return e}async deleteUser(){if(!E.checkLogin())throw console.error("[profile-manager] deleteUser: Utente non loggato"),Re.fromRaisso(d(l,"Utente non loggato",{context:{needLogin:!0}}));try{const e=await Q.instance.deleteEmail();return D(e).response==="OK"}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:(console.error("[profile-manager] deleteUser:",e),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:e})))}}async pairingGetAppId(e){try{const t={...e,domainApiKey:fe},r=await st.instance.getAppId(t),s=D(r);return s.response==="OK"&&s.appID&&L.setDeviceAppId(s.appID),s}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] pairingGetAppId:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.parse(JSON.stringify(e))}})))}}async pairingInit(e){try{const t=L.getDeviceAppId();if(Number.isNaN(t))throw de.fromRaisso(d(l,"AppID non valido",{context:{data:t}}));const r={...e,domainApiKey:fe,appID:t},s=await st.instance.pairingInit(r);return D(s)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] pairingInit:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.parse(JSON.stringify(e))}})))}}async pairing(e){try{const t=await st.instance.pairing(e);return D(t)}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] pairing:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.parse(JSON.stringify(e))}})))}}async pairingCheck(e){try{const t=L.getDeviceAppId();if(Number.isNaN(t))throw de.fromRaisso(d(l,"AppID non valido",{context:{data:t}}));const r={...e,domainApiKey:fe,appID:t},s=await st.instance.pairingCheck(r),a=D(s);return a.rtkn&&L.setToken({authToken:"",refreshToken:a.rtkn}),a}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] pairingCheck:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.parse(JSON.stringify(e))}})))}}async pairedDeviceList(){try{const e=await st.instance.list();return D(e)}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:(console.error("[profile-manager] pairedDeviceList:",e),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:e})))}}async pairingRefreshToken(e,t){try{const r=t??L.getRefreshToken();if(!r)throw console.error("[profile-manager] pairingRefreshToken: Refresh Token non trovato"),de.fromRaisso(d(l,"Refresh Token non trovato"));let s=e;if(!s){const o=L.getDeviceAppId();if(Number.isNaN(o))throw de.fromRaisso(d(l,"AppID non trovato"));s=o.toString(10)}const a=await wr.instance.refresh({domainApiKey:fe,refreshToken:r,appId:s}),i=D(a);return i.token&&(L.setToken({authToken:i.token,refreshToken:r}),L.setTokenLastDate()),i}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] pairingRefreshToken:",r),d(l,"Opps! Qualcosa è andato storto",{cause:r,context:{data:{appId:e,refreshToken:t}}}))}}async unpairingDevice(e){const t=e??L.getAccessToken();if(!t)throw console.error("[profile-manager] unpairingDevice: Authorization Token mancante"),de.fromRaisso(d(l,"Authorization Token mancante",{context:{needLogin:!0}}));try{if(!E.checkLogin())throw Re.fromRaisso(d(l,"Richiesta l'autenticazione",{context:{needLogin:!0}}));const r=await st.instance.unparing(t);return D(r)}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] unpairingDevice:",r),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:r,context:{data:t}})))}}async getNewsletter(){try{const e=await Q.instance.serviceNl();return D(e)}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:(console.error("[profile-manager] getNewsletter:",e),I.fromRaisso(d(l,"Opps! qualcosa è andato storto",{cause:e})))}}async oAuthAuthorize(e){try{const t=await zs.instance.authorize(e),r=Wf(t,s=>
9({code:"500",state:s.code}));return D(r)}catch(t){return console.error("[profile-manager] oAuthAuthorize:",t),{code:"500",state:"Opps! Qualcosa è andato storto"}}}async saveAccessToken(e){L.setToken({authToken:e,refreshToken:""})}async parentalControlCreatePin(e){try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const t=await Fe.instance.savePin(e),r=D(t);if(r.esito==="OK"||r.response==="OK"){let s=this.getUserProfile();if(s||(s=await this.refreshUserDetails()),s&&!s.parental_control){const a=s.toJSON();a.parental_control={pin:e,level:0,created_date:new Date().toJSON(),last_modified_date:null},L.setProfile(pe.fromJSON(a))}}return r}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] parentalControlCreatePin:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t,context:{data:JSON.stringify({newPin:e})}})))}}async parentalControlUpdatePin(e){var t;try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const r=this.getUserProfile(),s=(t=r==null?void 0:r.parental_control)==null?void 0:t.pin;if(!s)return{response:"KO",esito:"KO",message:"Pin non presente. Creare il PIN"};const a=await Fe.instance.updatePin({currentPin:s,newPin:e,confirmNewPin:e,level:String(r.parental_control.level)}),i=D(a);return(i.esito==="OK"||i.response==="OK")&&r.parental_control&&(r.parental_control.pin=e,r.parental_control.last_modified_date=new Date().toJSON(),L.setProfile(r)),i}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] parentalControlCreatePin:",r),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:r,context:{data:JSON.stringify({newPin:e})}})))}}async parentalControlUpdateLevel(e){var t;try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const r=this.getUserProfile(),s=(t=r==null?void 0:r.parental_control)==null?void 0:t.pin;if(!s)return{response:"KO",esito:"KO",message:"Pin non presente. Creare il PIN"};const a=await Fe.instance.updateLevel({currentPin:s,level:e}),i=D(a);return(i.esito==="OK"||i.response==="OK")&&r.parental_control&&(r.parental_control.level=e,r.parental_control.last_modified_date=new Date().toJSON(),L.setProfile(r)),i}catch(r){throw r instanceof l?C.fromRaisso(r):r instanceof Error?r:(console.error("[profile-manager] parentalControlCreatePin:",r),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:r,context:{data:JSON.stringify({level:e})}})))}}async parentalControlDelete(){var e;try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const t=this.getUserProfile(),r=(e=t==null?void 0:t.parental_control)==null?void 0:e.pin;if(!r)return{response:"KO",esito:"KO",message:"Pin non presente. Creare il PIN"};const s=await Fe.instance.delete(r),a=D(s);if(a.esito==="OK"||a.response==="OK"){const i=t.toJSON();i.parental_control=void 0;const o=pe.fromJSON(i);L.setProfile(o)}return a}catch(t){throw t instanceof l?C.fromRaisso(t):t instanceof Error?t:(console.error("[profile-manager] parentalControlCreatePin:",t),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:t})))}}async parentalControlRequestResetPin(){try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const e=await Fe.instance.requestPinReset(),t=D(e);return await this.refreshUserDetails(),t}catch(e){throw e instanceof l?C.fromRaisso(e):e instanceof Error?e:I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:e}))}}async parentalControlResetPin(e,t){var s;const r=L.getAccessToken();if(!r)throw Re.fromRaisso(d(l,"User not logged in",{context:{needLogin:!0}}));try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const a=this.getUserProfile();if(!((s=a==null?void 0:a.parental_control)==null?void 0:s.pin))return{response:"KO",esito:"KO",message:"Pin non presente. Creare il PIN"};const o=await Fe.instance.resetPin({newPin:e,confirmNewPin:e},r,t),c=D(o);return(c.esito==="OK"||c.response==="OK")&&a.parental_control&&(a.parental_control.pin=e,a.parental_control.last_modified_date=new Date().toJSON(),L.setProfile(a)),c}catch(a){throw a instanceof l?C.fromRaisso(a):a instanceof Error?a:(console.error("[profile-manager] parentalControlCreatePin:",a),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto",{cause:a,context:{data:JSON.stringify({newPin:e})}})))}}async parentalControlCheckTokenReset(e){var r;const t=L.getAccessToken();if(!t)throw Re.fromRaisso(d(l,"User not logged in",{context:{needLogin:!0}}));try{if(!E.checkLogin())return{response:"KO",esito:"KO",message:"Utente non loggato"};const s=this.getUserProfile();if(!((r=s==null?void 0:s.parental_control)==null?void 0:r.pin))return{response:"KO",esito:"KO",message:"Pin non presente. Creare il PIN"};const i=await Fe.instance.checkTokenResetPin(t,e);return D(i)}catch(s){throw s instanceof l?C.fromRaisso(s):s instanceof Error?s:(console.error("[profile-manager] parentalControlCheckTokenReset:",s),I.fromRaisso(d(l,"Opps! Qualcosa è andato storto")))}}}
9const qs=new Bd,Kd=`//cdns.gigya.com/js/socialize.js?apiKey=${((n,e)=>{let t=e.gigyaApiKey;return t||(t=Dt.raiPlay,/-(dev|pre|int)\.rai\.it$/g.test(n)?t="3_j85AJRao6Juhh_I_gponGAA4oGNKjFhtAvBw3slTTfCgfn0lMwZzweBE865vDZEZ":/^www\.(rairadio|radiorai|raiplayradio|raiplaysound)\.it$/.test(n)?t=Dt.radio:/raisport\.rai\.it$/.test(n)?t=Dt.raiSport:/sttest\.rai\.it$/.test(n)?t=Dt.stTest:/^www\.rai\.tv$/.test(n)?t=Dt.raiTv:/\.rai\.it$/.test(n)&&(t=Dt.rai),e.gigyaApiKey=t),t})(document.location.hostname,window)}`;function Yd(n,e,t){(!("gigya"in e)||!e.gigya)&&!n.body.classList.contains("iframe")&&!n.body.classList.contains("video")&&function(r,s,a){var c;const i=r.getElementsByTagName(s)[0];if(r.getElementById(a))return;const o=r.createElement(s);o.id=a,o.onload=t||function(){},o.src=`${Kd}&lang=it`,(c=i==null?void 0:i.parentNode)==null||c.insertBefore(o,i)}(n,"script","gigya-sdk")}const Js="dismissAutoSignIn";class Hd{constructor(){g(this,"silent",!1)}async tryLogin(){const e=!!this.storage();if(window.PasswordCredential&&!e)try{const t=await navigator.credentials.get({mediation:this.silent?"silent":"optional"});if((t==null?void 0:t.type)==="password"&&t.password!==null){const{id:r,password:s}=t,a=async()=>{const i=await qs.sendLogin(r,s,fe);return this.storage("REMOVE"),i};return await new Promise(i=>{window.gigya?i():Yd(document,window,()=>{i()})}),await a()}else this.storage("SET")}catch(t){throw console.error(t),t instanceof Error?t:t instanceof Response?d(l,t.statusText,{context:{response:{statusText:t.statusText,body:await t.clone().text()}}}):d(l,"Opps! Qualcosa è andato storto",{cause:t})}}async preventSilentLogin(){var e;(e=navigator.credentials)!=null&&e.preventSilentAccess&&await navigator.credentials.preventSilentAccess(),this.storage("SET")}storage(e){let t;switch(e){case"SET":sessionStorage.setItem(Js,String(!0)),t=!0;break;case"REMOVE":sessionStorage.removeItem(Js),t=!0;break;default:{t=sessionStorage.getItem(Js)==="true";break}}return t}}const wc=new Hd;class Xd{constructor(){g(this,"handlers",new Map);g(this,"eventQueue",[]);g(this,"isReady",!1);g(this,"isSetup",!1)}addEventListener(e,t){this.handlers.has(e)||this.handlers.set(e,[]),this.handlers.get(e).push(t),this.isReady&&this.processQueuedEventsForType(e)}removeEventListener(e,t){const r=this.handlers.get(e);if(r){const s=r.indexOf(t);s>-1&&r.splice(s,1)}}processQueuedEventsForType(e){const t=this.handlers.get(e);t&&(this.eventQueue=this.eventQueue.filter(r=>r.type===e?(t.forEach(s=>s(r.event)),!1):!0))}processQueuedEvents(){this.eventQueue.forEach(({type:e,event:t})=>{const r=this.handlers.get(e);r&&r.forEach(s=>s(t))}),this.eventQueue=[]}setReady(){this.isReady=!0,this.processQueuedEvents()}hasHandlers(e){const t=this.handlers.get(e);return t!==void 0&&t.length>0}getHandlers(e){return this.handlers.get(e)}queueEvent(e,t){this.eventQueue.push({type:e,event:t})}setupCriticalEventListeners(e){this.isSetup||(e.forEach(t=>{document.addEventListener(t,this.handleEarlyEvent.bind(this))}),this.isSetup=!0)}handleEarlyEvent(e){this.hasHandlers(e.type)?this.getHandlers(e.type).forEach(r=>r(e)):this.queueEvent(e.type,e)}}const eh=new Xd,B=Jr.getService();function Nh(n){}async function th(){var t;const n=B.getRefreshToken();if(!n)return console.error("[raisso] checkTokenFromServer: Refresh token non presente"),y(d(l,"Refresh token non presente",{context:{needLogin:!0}}));const e=B.getAccessToken();if(!e)return Gs();try{const r=await wr.instance.check({domainApiKey:fe,refreshToken:n,accessToken:e});if(Co(r,s=>{const{token:a,user_update:i,user_data_update:o}=s;if(a&&(B.setToken({authToken:a,refreshToken:n}),B.setTokenLastDate()),i||o){let c=B.getProfile();if(c){const u=c.toJSON();u.user_update=i,u.user_data_update=o,c=pe.fromJSON(u),B.setProfile(c),Pe&&(ye.next(new CustomEvent(Pe,{detail:c,bubbles:!0,cancelable:!0})),ie(Pe,c)),He&&(ye.next(new CustomEvent(He,{detail:c,bubbles:!0,cancelable:!0})),ie(He,c))}}}),fr(r)){switch((t=r._0.context)==null?void 0:t.code){case 401:_r.instance.softLogout(!1),location.reload();break}return r}return Gr(Promise.resolve())}catch(r){return r instanceof l?y(r):(console.error("[raisso] Error:",r),r instanceof Error?y(d(l,r.message,{cause:r,context:{needLogin:!0}})):y(d(l,"Errore nella chiamata al servizio di check-token",{cause:r,context:{needLogin:!0}})))}}async function Gs(){var n;try{const e=B.getRefreshToken();if(!e)return console.error("[raisso] refreshTokenRequest: Refresh token non valido"),y(d(l,"Refresh token non valido"));const t=await wr.instance.refresh({domainApiKey:fe,refreshToken:e});if(Co(t,r=>{var o;const{token:s,user_update:a,user_data_update:i}=r;if(!s)throw d(l,"Errore nella chiamata al servizio di refresh-token");if(B.setToken({authToken:s,refreshToken:e}),B.setTokenLastDate(),((a==null?void 0:a.length)??0)>0||a){const c=(o=B.getProfile())==null?void 0:o.toJSON();if(c){c.user_update=a,c.user_data_update=i;const u=pe.fromJSON(c);B.setProfile(u),a&&(ye.next(new CustomEvent(Pe,{detail:u,bubbles:!0,cancelable:!0})),ie(Pe,u)),i&&(ye.next(new CustomEvent(He,{detail:u,bubbles:!0,cancelable:!0})),ie(He,u))}}}),fr(t)){switch((n=t._0.context)==null?void 0:n.code){case 401:_r.instance.softLogout(!1),location.reload();break}return t}else return Gr(Promise.resolve())}catch(e){return e instanceof l?y(e):(console.error("[raisso] refreshTokenRequest: ",e),e instanceof Error?y(d(l,e.message,{cause:e})):y(d(l,"Errore nella chiamata al servizio di refresh-token",{context:{needLogin:!0}})))}}function rh(n){const e=B.getProfile(),{url:t}=n;return!(e&&e.user_type==="ente"&&t!==vc&&!t.includes(Zs))}function nh(){return!!B.getAccessToken()}function sh(n){if(n.headers.set("domainApiKey",fe),!n.headers.has("X-Auth-Token")){const e=B.getAccessToken();if(!e)throw new l("Access token non presente");n.headers.set("X-Auth-Token",e)}return n.headers.set("X-Caller","web"),n.headers.set("X-Caller-Version","1.0"),n}const vt=class vt{constructor(){g(this,"isTokenRefreshed",!1);g(this,"_isTokenChecking$",new xa(!1));g(this,"_tabId");g(this,"_earlyEventSystem");g(this,"refresh",Gs.bind(this));this._tabId=this.generateTabId(),this._earlyEventSystem=eh}get isMinor(){const e=B.getProfile();return!!(e!=null&&e.age)&&e.age<=18}get events(){return Pf}get isEnte(){const e=B.getProfile();return e&&e.user_type==="ente"}get domainApiKey(){return fe}static get instance(){return vt._instance||(vt._instance=new vt),vt._instance}get isTokenChecking(){return this._isTokenChecking$.value}set isTokenChecking(e){this._isTokenChecking$.next(e)}get tabId(){return this._tabId}getTabId(){return this._tabId}get earlyEventSystem(){return this._earlyEventSystem}generateTabId(){return`tab_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}async tryAutoLogin(){this.checkLogin()||await wc.tryLogin()}async callAuthService(e,t="GET",r,s){var f;if(!this.checkLogin())return d(l,"User not logged in",{context:{needLogin:!0}});const a=((f=s==null?void 0:s.headers)==null?void 0:f["Content-Type"])??"application/json";let i;typeof r=="string"||r==null?i=r:a==="application/json"?i=JSON.stringify(r):i=r.toString();const o={method:t,credentials:"omit",cache:"no-cache",headers:{Accept:"application/json",...r?{"Content-Type":"application/json"}:{},...Object.entries((s==null?void 0:s.headers)??{}).reduce((m,[_,h])=>(h&&(m[_]=`${h}`),m),{})},referrerPolicy:"origin-when-cross-origin",body:i};let c=`${(s==null?void 0:s.baseURL)??""}${e}`;if(s!=null&&s.params){const m=new URLSearchParams(s.params);c+="?"+m.toString()}const u=await this.callAuthFetch(c,o);return D(u)}async callAuthFetch(e,t,r="json"){var o;if(!this.checkLogin())return y(d(l,"Utente non loggato",{context:{needLogin:!0}}));
9const s=new Request(e,t);if(!rh(s))return y(d(l,"L'utente non è abilitato a chiamare il servizio",{context:{request:{url:s.url,body:await s.clone().json()}}}));if(!nh()&&!this.isTokenChecking){""+s.url,this.isTokenChecking=!0;try{const c=await th();if(Zf(c,u=>(u.context&&typeof u.context=="object"&&"needLogin"in u.context&&u.context.needLogin&&this.softLogout(!0,!0),Gr(Promise.resolve()))),fr(c))return c}catch(c){return this.softLogout(!0,!1),c instanceof l?y(c):(console.error(c),y(d(l,(c instanceof Error?c.message:"")??"L'utente deve effettuare la login",{cause:c,context:{needLogin:!0}})))}finally{this.isTokenChecking=!1}}const a=new xa(s),i=a.pipe(Tu(()=>this._isTokenChecking$.pipe(Wa(c=>!c))),Ht(sh),Ht(c=>new Request(c.clone(),{credentials:"omit",cache:"no-cache"})),Ja(c=>Eu(c)),Ja(async c=>{if(c.ok){const u=c.clone();return qf(r==="json"?await u.json():await u.text())}else{const u=await c.json(),f={request:{url:s.url,body:await s.clone().text()},response:{statusText:c.statusText,body:JSON.stringify(u)}};c.status===401&&(f.needRefresh=!0);const m=d(l,u,{context:f});return y(m)}}));try{let c=await qn(i);if(fr(c)&&(o=c._0.context)!=null&&o.needRefresh&&!this.isTokenRefreshed){this.isTokenChecking=!0;try{const m=await Gs();if(fr(m))return c}finally{this.isTokenChecking=!1}a.next(s),c=await qn(i)}return c}catch(c){return c instanceof l?y(d(l,c.message,{cause:c})):(console.error(c),y(d(l,"Errore nella chiamata al servizio "+s.url,{cause:c,context:{request:{url:s.url,body:await s.clone().text()}}})))}}checkLogin(){const e=B.getProfile();return B.getRefreshToken()?!0:(e&&this.softLogout(!1,!1),!1)}isSocialLoginInProgress(){return new URLSearchParams(document.location.search).get("social_login")==="ok"}checkLogin$(){return this.checkLogin()?za(!0):this.isSocialLoginInProgress()?xo().pipe(Ht(()=>this.checkLogin())):za(!1)}async checkAsyncLogin(){return qn(this.checkLogin$())}checkPrivacy(){if(this.checkLogin()){const e=B.getProfile();return!!(e!=null&&e.privacyPolicyIsAccepted)}return!1}softLogout(e,t){if(this.isEnte)throw d(l,"L'utente di tipo ente non può fare logout");B.clearToken(),B.clearProfile();try{window.gigya.socialize.logout()}catch{}return e&&ie(Eo,void 0),t&&wc.preventSilentLogin().catch(()=>{}),!0}};g(vt,"_instance");let _r=vt;const E=_r.instance,Qs=(n,e)=>e.some(t=>n instanceof t);let _c,bc;function ah(){return _c||(_c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ih(){return bc||(bc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Bs=new WeakMap,Ks=new WeakMap,on=new WeakMap;function oh(n){const e=new Promise((t,r)=>{const s=()=>{n.removeEventListener("success",a),n.removeEventListener("error",i)},a=()=>{t(gt(n.result)),s()},i=()=>{r(n.error),s()};n.addEventListener("success",a),n.addEventListener("error",i)});return on.set(e,n),e}function ch(n){if(Bs.has(n))return;const e=new Promise((t,r)=>{const s=()=>{n.removeEventListener("complete",a),n.removeEventListener("error",i),n.removeEventListener("abort",i)},a=()=>{t(),s()},i=()=>{r(n.error||new DOMException("AbortError","AbortError")),s()};n.addEventListener("complete",a),n.addEventListener("error",i),n.addEventListener("abort",i)});Bs.set(n,e)}let Ys={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return Bs.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return gt(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Sc(n){Ys=n(Ys)}function uh(n){return ih().includes(n)?function(...e){return n.apply(Hs(this),e),gt(this.request)}:function(...e){return gt(n.apply(Hs(this),e))}}function lh(n){return typeof n=="function"?uh(n):(n instanceof IDBTransaction&&ch(n),Qs(n,ah())?new Proxy(n,Ys):n)}function gt(n){if(n instanceof IDBRequest)return oh(n);if(Ks.has(n))return Ks.get(n);const e=lh(n);return e!==n&&(Ks.set(n,e),on.set(e,n)),e}const Hs=n=>on.get(n);function fh(n,e,{blocked:t,upgrade:r,blocking:s,terminated:a}={}){const i=indexedDB.open(n,e),o=gt(i);return r&&i.addEventListener("upgradeneeded",c=>{r(gt(i.result),c.oldVersion,c.newVersion,gt(i.transaction),c)}),t&&i.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),o.then(c=>{a&&c.addEventListener("close",()=>a()),s&&c.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}const dh=["get","getKey","getAll","getAllKeys","count"],hh=["put","add","delete","clear"],Xs=new Map;function kc(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Xs.get(e))return Xs.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,s=hh.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(s||dh.includes(t)))return;const a=async function(i,...o){const c=this.transaction(i,s?"readwrite":"readonly");let u=c.store;
9return r&&(u=u.index(o.shift())),(await Promise.all([u[t](...o),s&&c.done]))[0]};return Xs.set(e,a),a}Sc(n=>({...n,get:(e,t,r)=>kc(e,t)||n.get(e,t,r),has:(e,t)=>!!kc(e,t)||n.has(e,t)}));const mh=["continue","continuePrimaryKey","advance"],Oc={},ea=new WeakMap,Tc=new WeakMap,ph={get(n,e){if(!mh.includes(e))return n[e];let t=Oc[e];return t||(t=Oc[e]=function(...r){ea.set(this,Tc.get(this)[e](...r))}),t}};async function*yh(...n){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...n)),!e)return;e=e;const t=new Proxy(e,ph);for(Tc.set(t,e),on.set(t,Hs(e));e;)yield t,e=await(ea.get(t)||e.continue()),ea.delete(t)}function Ec(n,e){return e===Symbol.asyncIterator&&Qs(n,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&Qs(n,[IDBIndex,IDBObjectStore])}Sc(n=>({...n,get(e,t,r){return Ec(e,t)?yh:n.get(e,t,r)},has(e,t){return Ec(e,t)||n.has(e,t)}}));const gh="rai:settings";class vh{constructor(){g(this,"db");if(!("indexedDB"in window)){console.log("This browser doesn't support IndexedDB.");return}this.setUpDB()}async setUpDB(){this.db=await fh(gh,3,{upgrade(e,t,r,s){r===3&&(s.db.objectStoreNames.contains("rai:users")&&s.db.deleteObjectStore("rai:users"),s.db.createObjectStore("rai:users",{keyPath:"uid_utente"}))}})}async getUser(e){return await this.db.get("rai:users",e)}async getAllUsers(){return await this.db.getAll("rai:users")}async addUser(e){const t={uid_utente:e,timestamp:Math.round(Date.now()/1e3),autoplay_preview:!0,audio:!0,allowed_previews:[]};return await this.db.add("rai:users",t),t}async editUser(e){const t=this.db.transaction("rai:users","readwrite");t.addEventListener("abort",()=>{const a=t.error;console.error("editUser:",a==null?void 0:a.name)});const s={...await t.store.get(e.uid_utente),...e};s.timestamp=Math.round(Date.now()/1e3),await t.store.put(s),await t.done}async deleteUser(e){await this.db.delete("rai:users",e)}}const wh=new vh,Ae={MSG:"PARENTAL CONTROL: ",LOCAL_STORAGE:"rai:parental-control"};function _h(n,e){bh(Ae.MSG,n,e)}function bh(...n){console.warn(n)}const K={SAVE:"save",DELETE:"delete",RESET:"reset",UPDATE:"update",REQUEST_RESET:"requestReset",VALIDATE:"validate",VALIDATE_ERROR:"validateError",ERROR:"error"},Oe={PIN_INCORRECT:"Il PIN inserito non è corretto",PIN_VERIFIED:"Ora puoi guardare questo contenuto",PIN_CREATED:"Hai creato il PIN per il Parental control, ricorda di tenerlo al sicuro",PIN_CHANGED:"Hai modificato il PIN per il Parental Control. Tienilo al sicuro",PIN_ALREADY_SAVED:"Il PIN per il Parental Control è già stato salvato",PIN_ALREADY_DELETED:"Non è presente nessun PIN per il Parental Control da cancellare",PIN_ALREADY_EDITED:"Non è presente nessun PIN per il Parental Control da modificare",PARENTAL_CONTROL_DISABLED:"Hai disattivato il Parental Control",PIN_RESET_REQUEST_NOT_ALLOWED:"Per richiedere il reseet del PIN devi effettuare la login"},Sh={GENERIC_ERROR:"rai:parental-control-pin-error"};function Y(n,e){let t="";(!e||"_0"in e&&e._0.esito!=="OK")&&(t=Sh.GENERIC_ERROR),window.dispatchEvent(new CustomEvent(t,{detail:e})),_h(n,e)}function cn(){return new Date().toISOString().replace("Z","+00:00")}class kh{constructor(){g(this,"_parentalControlController",Fe.instance);g(this,"_isLogged",!1);g(this,"_user",null);g(this,"_message",{})}get user(){if(this.isLogged){const e=window.Rai.ProfileManager.getUserProfile();e&&(this._user=e.parental_control)}else{const e=localStorage.getItem(Ae.LOCAL_STORAGE);this._user=e?JSON.parse(e):null}return this._user}get isLogged(){return this._isLogged=window.Rai.Raisso.checkLogin(),this._isLogged}async savePin(e){if(e)if(this.isLogged){const t=await this._parentalControlController.savePin(e);return(t._0.esito==="OK"||t._0.response==="OK")&&(this.editParentalControlInSSO(),Y(K.SAVE,t)),t}else{if(localStorage.getItem(Ae.LOCAL_STORAGE))return this._message={esito:"KO",message:Oe.PIN_ALREADY_SAVED},Y(K.ERROR,this._message),this._message;{const t={pin:e,created_date:cn()};return this._message={message:Oe.PIN_CREATED},localStorage.setItem(Ae.LOCAL_STORAGE,JSON.stringify(t)),Y(K.SAVE,this._message),this._message}}}async deletePin(e){var t;if(e)if(this.isLogged){const r=await this._parentalControlController.delete(e);return(r._0.esito==="OK"||r._0.response==="OK")&&(Y(K.DELETE,r),this.deleteParentalControlInSSO()),r}else{const r=localStorage.getItem(Ae.LOCAL_STORAGE);return r?(this._user=JSON.parse(r),((t=this._user)==null?void 0:t.pin)===e?(this._message={esito:"OK",message:Oe.PARENTAL_CONTROL_DISABLED},localStorage.removeItem(Ae.LOCAL_STORAGE),Y(K.DELETE,this._message),this._message):(this._message={esito:"KO",message:Oe.PIN_INCORRECT},Y(K.ERROR,this._message),this._message)):(this._message={esito:"KO",message:Oe.PIN_ALREADY_DELETED},Y(K.ERROR,this._message),this._message)}}async updatePin(e,t){if(!(!e||!t))if(this.isLogged){const r=await this._parentalControlController.updatePin({newPin:e,confirmNewPin:e,currentPin:t,level:""});return(r._0.esito==="OK"||r._0.response=="OK")&&(Y(K.UPDATE,r),this.editParentalControlInSSO(!0)),r}else{const r=localStorage.getItem(Ae.LOCAL_STORAGE);if(r){const s=JSON.parse(r);if(s.pin===t)s.pin=e,s.last_modified_date=cn(),localStorage.setItem(Ae.LOCAL_STORAGE,JSON.stringify(s)),this._message={esito:"OK",message:Oe.PIN_CHANGED},Y(K.UPDATE,this._message);else return this._message={esito:"KO",message:Oe.PIN_INCORRECT},Y(K.ERROR,this._message),this._message}else return Y(K.ERROR,{esito:"KO",message:Oe.PIN_ALREADY_EDITED}),this._message}}async requestResetPin(){if(!this.isLogged)return this._message={esito:"KO",message:Oe.PIN_RESET_REQUEST_NOT_ALLOWED},Y(K.ERROR,this._message),this._message;const e=await this._parentalControlController.requestPinReset();return(e._0.esito==="OK"||e._0.response==="OK")&&Y(K.REQUEST_RESET,e),e}async resetPin(e,t){if(!this.isLogged)return this._message={esito:"KO",message:Oe.PIN_RESET_REQUEST_NOT_ALLOWED},Y(K.ERROR,this._message),this._message;const r=localStorage.getItem("rai:access_token")||null;if(r){const s=await this._parentalControlController.resetPin({newPin:e,confirmNewPin:e},r,t);return(s._0.esito==="OK"||s._0.response==="OK")&&(Y(K.RESET,s),this.editParentalControlInSSO(!0)),s}else return this._message={esito:"KO",message:"Access token non presente"},Y(K.ERROR,this._message),this._message}async validatePin(e){var t;if(e)if(this.isLogged){const r=await this._parentalControlController.validatePin(e);return r._0.esito==="OK"||r._0.response==="OK"?Y(K.VALIDATE,r):Y(K.VALIDATE_ERROR,r),r}else{const r=localStorage.getItem(Ae.LOCAL_STORAGE);return r?(this._user=JSON.parse(r),((t=this._user)==null?void 0:t.pin)===e?(this._message={esito:"OK",message:Oe.PIN_VERIFIED},Y(K.VALIDATE,this._message),this._message):(this._message={esito:"KO",message:Oe.PIN_INCORRECT},Y(K.ERROR,this._message),this._message)):(this._message={esito:"KO",message:"Nessun PIN presente"},Y(K.ERROR,this._message),this._message)}}async createOrResetLocalPin(e){return e?(localStorage.getItem(Ae.LOCAL_STORAGE)&&localStorage.removeItem(Ae.LOCAL_STORAGE),await this.savePin(e)):void 0}deleteParentalControlInSSO(){const e=localStorage.getItem("rai:raiSso");if(e){const t=JSON.parse(e);t.parental_control=null,localStorage.setItem("rai:raiSso",JSON.stringify(t))}}editParentalControlInSSO(e=!1){const t=localStorage.getItem("rai:raiSso");if(t){const r=JSON.parse(t);e?r.parental_control.last_modified_date=cn():r.parental_control={created_date:cn()},localStorage.setItem("rai:raiSso",JSON.stringify(r))}}}const Oh=new kh;window.Rai=window.Rai??{},window.Rai.Raisso=E,window.Rai.ProfileManager=qs,window.Rai.SettingsManager=wh,window.Rai.ParentalControlManager=Oh,function(){const e=["rai:ssoWidget-openRequest","rai:ssoWidget-closeRequest","rai:ssoWidget-activation-required","loginrequired"];E.earlyEventSystem.setupCriticalEventListeners(e)}(),new URLSearchParams(location.search).has("webview")||(window.onGigyaServiceReady=function(){qs.checkGigyaLogin()},function(){var t;if(!window||!document||(t=window.gigya)!=null&&t.isGigya)return;const e=document.querySelectorAll("script");for(const r of e)if(/.*\.gigya\.com\/js\/socialize\.js\?/.test(r.src)){r.addEventListener("error",()=>{const s=document.createElement("div");s.setAttribute("style","padding: 0.5rem; background-color: rgba(255, 0, 0, .7); color: white; display: flex; justify-content: center;");const a=document.createElement("p");a.innerHTML=`Attenzione, per problemi di connettività o per la presenza di qualche plugin di offuscamento 10 il browser non riesce a scaricare le librerie necessarie per la login sul sito.<br> 11 Ti invitiamo a disabilitare adblock e plugin simili e riprovare.`,s.appendChild(a);let i=document.querySelector("#main-header");i||(i=document.body),i.prepend(s)});break}}()),ue.genders=Mo,ue.userDataUpdateFieldSubtypes=Fo,ue.userDataUpdateFieldTypes=$o,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}); 12//# sourceMappingURL=raisso_v3.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.