holidoit 1.0.132 → 1.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/holidoit.umd.js +1 -1
- package/package.json +1 -1
package/dist/holidoit.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see holidoit.umd.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Holidoit",[],e):"object"==typeof exports?exports.Holidoit=e():t.Holidoit=e()}(this,()=>(()=>{var t={172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},317:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},353:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",u="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},v=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(o,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,l),r=n-i<0,a=e.clone().add(o+(r?-1:1),l);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:l,y:d,w:u,d:s,D:f,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},_="en",b={};b[_]=g;var w="$isDayjsObject",M=function(t){return t instanceof k||!(!t||!t[w])},x=function t(e,n,o){var i;if(!e)return _;if("string"==typeof e){var r=e.toLowerCase();b[r]&&(i=r),n&&(b[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;b[s]=e,i=s}return!o&&i&&(_=i),i||!o&&_},S=function(t,e){if(M(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new k(n)},O=y;O.l=x,O.i=M,O.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var k=function(){function g(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return S(t)<this.startOf(e)},v.isBefore=function(t,e){return this.endOf(e)<S(t)},v.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(t,e){var n=this,o=!!O.u(e)||e,c=O.p(t),h=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return o?h(1,0):h(31,11);case l:return o?h(1,g):h(0,g+1);case u:var _=this.$locale().weekStart||0,b=(p<_?p+7:p)-_;return h(o?v-b:v+(6-b),g);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case r:return m(y+"Seconds",2);case i:return m(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(t){return this.startOf(t,!1)},v.$set=function(t,e){var n,u=O.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[l]=c+"Month",n[d]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[u],m=u===s?this.$D+(e-this.$W):e;if(u===l||u===d){var p=this.clone().set(f,1);p.$d[h](m),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},v.set=function(t,e){return this.clone().$set(t,e)},v.get=function(t){return this[O.p(t)]()},v.add=function(o,c){var f,h=this;o=Number(o);var m=O.p(c),p=function(t){var e=S(h);return O.w(e.date(e.date()+Math.round(t*o)),h)};if(m===l)return this.set(l,this.$M+o);if(m===d)return this.set(d,this.$y+o);if(m===s)return p(1);if(m===u)return p(7);var g=(f={},f[r]=e,f[a]=n,f[i]=t,f)[m]||1,v=this.$d.getTime()+o*g;return O.w(v,this)},v.subtract=function(t,e){return this.add(-1*t,e)},v.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),r=this.$H,a=this.$m,s=this.$M,u=n.weekdays,l=n.months,c=n.meridiem,d=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},f=function(t){return O.s(r%12||12,t,"0")},m=c||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(p,function(t,o){return o||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return O.s(e.$y,4,"0");case"M":return s+1;case"MM":return O.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,l,3);case"MMMM":return d(l,s);case"D":return e.$D;case"DD":return O.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(n.weekdaysMin,e.$W,u,2);case"ddd":return d(n.weekdaysShort,e.$W,u,3);case"dddd":return u[e.$W];case"H":return String(r);case"HH":return O.s(r,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(r,a,!0);case"A":return m(r,a,!1);case"m":return String(a);case"mm":return O.s(a,2,"0");case"s":return String(e.$s);case"ss":return O.s(e.$s,2,"0");case"SSS":return O.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(o,f,h){var m,p=this,g=O.p(f),v=S(o),y=(v.utcOffset()-this.utcOffset())*e,_=this-v,b=function(){return O.m(p,v)};switch(g){case d:m=b()/12;break;case l:m=b();break;case c:m=b()/3;break;case u:m=(_-y)/6048e5;break;case s:m=(_-y)/864e5;break;case a:m=_/n;break;case r:m=_/e;break;case i:m=_/t;break;default:m=_}return h?m:O.a(m)},v.daysInMonth=function(){return this.endOf(l).$D},v.$locale=function(){return b[this.$L]},v.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=x(t,e,!0);return o&&(n.$L=o),n},v.clone=function(){return O.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),D=k.prototype;return S.prototype=D,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",l],["$y",d],["$D",f]].forEach(function(t){D[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),S.extend=function(t,e){return t.$i||(t(e,k,S),t.$i=!0),S},S.locale=x,S.isDayjs=M,S.unix=function(t){return S(1e3*t)},S.en=b[_],S.Ls=b,S.p={},S}()},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var o in e)n.unshift(o);return function t(){for(;n.length;)if((o=n.pop())in e)return t.value=o,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},445:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(o,i,r){var a=i.prototype;r.utc=function(t){return new i({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=r(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var l=a.utcOffset;a.utcOffset=function(o,i){var r=this.$utils().u;if(r(o))return this.$u?0:r(this.$offset)?l.call(this):this.$offset;if("string"==typeof o&&(o=function(t){void 0===t&&(t="");var o=t.match(e);if(!o)return null;var i=(""+o[0]).match(n)||["-",0,0],r=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===r?a:-a}(o),null===o))return this;var a=Math.abs(o)<=16?60*o:o;if(0===a)return this.utc(i);var s=this.clone();if(i)return s.$offset=a,s.$u=!1,s;var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+u,t)).$offset=a,s.$x.$localOffset=u,s};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var o=this.local(),i=r(t).local();return f.call(o,i,e,n)}}}()},494:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(t,e,n){var i=o[n];return Array.isArray(i)&&(i=i[e?0:1]),i.replace("%d",t)}var r={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return n.default.locale(r,null,!0),r}(n(353))},519:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},546:t=>{function e(n,o,i,r){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,o,i){function r(n,o){e(t,n,function(t){return this._invoke(n,o,t)})}n?a?a(t,n,{value:o,enumerable:!i,configurable:!i,writable:!i}):t[n]=o:(r("next",0),r("throw",1),r("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,i,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,o,i){var r,a=function(t,n,o){void 0===o&&(o={});var i=new Date(t),r=function(t,n){void 0===n&&(n={});var o=n.timeZoneName||"short",i=t+"|"+o,r=e[i];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:o}),e[i]=r),r}(n,o);return r.formatToParts(i)},s=function(e,n){for(var o=a(e,n),r=[],s=0;s<o.length;s+=1){var u=o[s],l=u.type,c=u.value,d=t[l];d>=0&&(r[d]=parseInt(c,10))}var f=r[3],h=24===f?0:f,m=r[0]+"-"+r[1]+"-"+r[2]+" "+h+":"+r[4]+":"+r[5]+":000",p=+e;return(i.utc(m).valueOf()-(p-=p%1e3))/6e4},u=o.prototype;u.tz=function(t,e){void 0===t&&(t=r);var n,o=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:t}),u=Math.round((a-new Date(s))/1e3/60),l=15*-Math.round(a.getTimezoneOffset()/15)-u;if(Number(l)){if(n=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(l,!0),e){var c=n.utcOffset();n=n.add(o-c,"minute")}}else n=this.utcOffset(0,e);return n.$x.$timezone=t,n},u.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var l=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var o=n&&e,a=n||e||r,u=s(+i(),a);if("string"!=typeof t)return i(t).tz(a);var l=function(t,e,n){var o=t-60*e*1e3,i=s(o,n);if(e===i)return[o,e];var r=s(o-=60*(i-e)*1e3,n);return i===r?[o,i]:[t-60*Math.min(i,r)*1e3,Math.max(i,r)]}(i.utc(t,o).valueOf(),u,a),c=l[0],d=l[1],f=i(c).utcOffset(d);return f.$x.$timezone=a,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){r=t}}}()},579:(t,e,n)=>{var o=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(o(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},633:(t,e,n)=>{var o=n(172),i=n(993),r=n(869),a=n(887),s=n(791),u=n(373),l=n(579);function c(){"use strict";var e=i(),n=e.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))}var h={throw:1,return:2,break:3,continue:3};function m(t){var e,n;return function(o){e||(e={stop:function(){return n(o.a,2)},catch:function(){return o.v},abrupt:function(t,e){return n(o.a,h[t],e)},delegateYield:function(t,i,r){return e.resultName=i,n(o.d,l(t),r)},finish:function(t){return n(o.f,t)}},n=function(t,n,i){o.p=e.prev,o.n=e.next;try{return t(n,i)}finally{e.next=o.n}}),e.resultName&&(e[e.resultName]=o.v,e.resultName=void 0),e.sent=o.v,e.next=o.n;try{return t.call(this,e)}finally{o.p=e.prev,o.n=e.next}}}return(t.exports=c=function(){return{wrap:function(t,n,o,i){return e.w(m(t),n,o,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new o(t,e)},AsyncIterator:s,async:function(t,e,n,o,i){return(f(e)?a:r)(m(t),e,n,o,i)},keys:u,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var o=n(633)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},791:(t,e,n)=>{var o=n(172),i=n(546);t.exports=function t(e,n){function r(t,i,a,s){try{var u=e[t](i),l=u.value;return l instanceof o?n.resolve(l.v).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):n.resolve(l).then(function(t){u.value=t,a(u)},function(t){return r("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,o){function i(){return new n(function(e,n){r(t,o,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},813:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return n.default.locale(o,null,!0),o}(n(353))},826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}}}()},840:function(t){t.exports=function(){"use strict";return function(t,e,n){var o=e.prototype,i=function(t){return t&&(t.indexOf?t:t.s)},r=function(t,e,n,o,r){var a=t.name?t:t.$locale(),s=i(a[e]),u=i(a[n]),l=s||u.map(function(t){return t.slice(0,o)});if(!r)return l;var c=a.weekStart;return l.map(function(t,e){return l[(e+(c||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(t,e){return t.formats[e]||function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,n){return e||n.slice(1)})}(t.formats[e.toUpperCase()])},u=function(){var t=this;return{months:function(e){return e?e.format("MMMM"):r(t,"months")},monthsShort:function(e){return e?e.format("MMM"):r(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):r(t,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):r(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):r(t,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return s(t.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return u.bind(this)()},n.localeData=function(){var t=a();return{firstDayOfWeek:function(){return t.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(e){return s(t,e)},meridiem:t.meridiem,ordinal:t.ordinal}},n.months=function(){return r(a(),"months")},n.monthsShort=function(){return r(a(),"monthsShort","months",3)},n.weekdays=function(t){return r(a(),"weekdays",null,null,t)},n.weekdaysShort=function(t){return r(a(),"weekdaysShort","weekdays",3,t)},n.weekdaysMin=function(t){return r(a(),"weekdaysMin","weekdays",2,t)}}}()},869:(t,e,n)=>{var o=n(887);t.exports=function(t,e,n,i,r){var a=o(t,e,n,i,r);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var o=n(993),i=n(791);t.exports=function(t,e,n,r,a){return new i(o().w(t,e,n,r),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},993:(t,e,n)=>{var o=n(546);function i(){var e,n,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function u(t,i,r,a){var s=i&&i.prototype instanceof c?i:c,u=Object.create(s.prototype);return o(u,"_invoke",function(t,o,i){var r,a,s,u=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return r=t,a=0,s=e,f.n=n,l}};function h(t,o){for(a=t,s=o,n=0;!d&&u&&!i&&n<c.length;n++){var i,r=c[n],h=f.p,m=r[2];t>3?(i=m===o)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=h&&((i=t<2&&h<r[1])?(a=0,f.v=o,f.n=r[1]):h<m&&(i=t<3||r[0]>o||o>m)&&(r[4]=t,r[5]=o,f.n=m,a=0))}if(i||t>1)return l;throw d=!0,o}return function(i,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,m),a=c,s=m;(n=a<2?e:s)||!d;){r||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(u=2,r){if(a||(i="next"),n=r[i]){if(!(n=n.call(r,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=r.return)&&n.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);r=e}else if((n=(d=f.n<0)?s:t.call(o,f))!==l)break}catch(t){r=e,a=1,s=t}finally{u=1}}return{value:n,done:d}}}(t,r,a),!0),u}var l={};function c(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(o(n={},a,function(){return this}),n),m=f.prototype=c.prototype=Object.create(h);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t}return d.prototype=f,o(m,"constructor",f),o(f,"constructor",d),d.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(m),o(m,s,"Generator"),o(m,a,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:u,m:p}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";function t(t,e,n,o,i,r,a){try{var s=t[r](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(o,i)}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}function a(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{Languages:()=>v,changeLanguage:()=>I,close:()=>D,closeEmbed:()=>A,destroy:()=>L,init:()=>O,open:()=>k,openEmbed:()=>Y,renderHolidoitEmbed:()=>H,toggle:()=>$,toggleEmbed:()=>E,version:()=>T});var s=n(756),u=n.n(s),l=n(353),c=n.n(l),d=(n(494),n(826),n(317),n(813),n(519),n(840)),f=n.n(d),h=n(569),m=n.n(h),p=n(445),g=n.n(p);c().extend(g()),c().extend(m()),c().extend(f());var v=function(t){return t.ITALIAN="it",t.ENGLISH="en",t.SPANISH="es",t.FRENCH="fr",t.GERMAN="de",t}({}),y=(c()().locale("it").localeData().months(),c()().locale("it").localeData().weekdays(),c()().locale("en").localeData().months(),c()().locale("en").localeData().weekdays(),c()().locale("de").localeData().months(),c()().locale("de").localeData().weekdays(),c()().locale("es").localeData().months(),c()().locale("es").localeData().weekdays(),c()().locale("fr").localeData().months(),c()().locale("fr").localeData().weekdays(),"2.0.0"),_="_holidoit_payment_session";function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var M=function(){if("undefined"==typeof window)return null;try{var t=new URLSearchParams(window.location.search),e=t.get("payment_intent");if(!e)return null;var n={paymentIntent:e,paymentIntentClientSecret:t.get("payment_intent_client_secret"),redirectStatus:t.get("redirect_status")};"localhost"===window.location.hostname||window.location.hostname;return n}catch(t){return null}}(),x=!1,S=new(function(){return e=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,"config",null),a(this,"embedConfig",null),a(this,"iframe",null),a(this,"container",null),a(this,"floatingButton",null),a(this,"isOpen",!1),a(this,"isReady",!1),a(this,"pendingMessages",[]),a(this,"savedScrollPosition",0),a(this,"savedViewportContent",null),a(this,"embedOrigin",""),a(this,"resolvedEmbedUrl",""),a(this,"resolvedApiUrl",""),a(this,"handleExternalMessage",function(t){var n=t.data;if(n&&n.action)switch(e.log("Received external message",n),n.action){case"holidoitExperienceSelected":n.experienceId&&(e.log("Experience selected from external iframe",n.experienceId),e.open({experienceId:n.experienceId}));break;case"holidoitIFrameChangeLanguage":n.language&&(e.log("Language change from external iframe",n.language),e.changeLanguage(n.language));break;case"holidoitExperienceCount":if(t.source===window){e.log("Ignoring holidoitExperienceCount from same window");break}if(e.log("Experience count from external iframe",n.count),"number"==typeof n.height){var o=document.getElementById("holidoit-iframe");o&&(o.style.height="".concat(n.height,"px"),e.log("Adjusted holidoit-iframe height to",n.height))}}}),a(this,"handleMessage",function(t){var n,o,i,r;if(t.origin===e.embedOrigin){var a=t.data;if(a&&a.type&&a.type.startsWith("HOLIDOIT_"))switch(e.log("Received message from embed iframe",a),a.type){case"HOLIDOIT_READY":e.log("Embed is ready, sending HOLIDOIT_INIT");var s="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname;e.postMessage({type:"HOLIDOIT_INIT",payload:{embedId:e.config.embedId,language:e.config.language,floatingButton:e.config.floatingButton,floatingButtonOptions:e.config.floatingButtonOptions,parentOrigin:window.location.origin,parentUrl:window.location.href,isMobile:window.innerWidth<775,debug:e.config.debug||s}}),e.isReady=!0,e.pendingMessages.forEach(function(t){return e.postMessage(t)}),e.pendingMessages=[];break;case"HOLIDOIT_OPENED":break;case"HOLIDOIT_CLOSED":setTimeout(function(){e.close()},300);break;case"HOLIDOIT_BOOKING_COMPLETE":var u=a.payload;e.log("Booking complete",u),null===(n=e.config)||void 0===n||null===(o=n.onBookingComplete)||void 0===o||o.call(n,u);break;case"HOLIDOIT_PAYMENT_REDIRECT_START":var l=a.payload;if(null!=l&&l.session){e.log("Saving payment session for redirect",l.session);try{localStorage.setItem(_,JSON.stringify(l.session))}catch(t){e.log("Failed to save payment session (incognito mode?)",t)}}break;case"HOLIDOIT_LANGUAGE_CHANGED":var c=a.payload;null!=c&&c.language&&(e.log("Language changed from embed:",c.language),e.config&&(e.config.language=c.language),e.updateFloatingButtonText(c.language),window.postMessage({action:"holidoitEmbedChangeLanguage",language:c.language},"*"));break;case"HOLIDOIT_ERROR":var d=a.payload;null===(i=e.config)||void 0===i||null===(r=i.onError)||void 0===r||r.call(i,(null==d?void 0:d.message)||"Unknown error");break;case"HOLIDOIT_NAVIGATE_TO":var f=a.payload;null!=f&&f.url&&(e.log("Navigating parent page to:",f.url),window.location.href=f.url)}}})},n=[{key:"init",value:function(t){var e=this;if(t.embedId){if(this.container)return this.log("Holidoit already initialized, skipping duplicate init"),void(this.config=w(w({},this.config),t));this.config=t,window.location.hostname,this.resolvedEmbedUrl=t.embedUrl||"https://cdn.holidoit.com/embed.html",this.resolvedApiUrl="https://engine.holydoit.com",this.embedOrigin=this.getEmbedOrigin(this.resolvedEmbedUrl),this.log("Initializing Holidoit embed",{embedId:t.embedId,version:y}),this.createContainer(),this.createIframe(),this.setupMessageListener(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){return e.bindBookNowButtons()}):this.bindBookNowButtons(),this.fetchEmbedConfig().then(function(){var n;((null===(n=e.embedConfig)||void 0===n?void 0:n.has_floating_button)||t.floatingButton)&&e.createFloatingButton()}),this.checkPaymentRedirect()}}},{key:"fetchEmbedConfig",value:(i=u().mark(function t(){var e,n,o,i,r;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(e=this.config)&&void 0!==e&&e.embedId){t.next=1;break}return t.abrupt("return");case 1:return n="".concat(this.resolvedApiUrl,"/partner/v0/embed-config/").concat(this.config.embedId,"/get"),this.log("Fetching embed config from:",n),t.prev=2,t.next=3,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 3:if((o=t.sent).ok){t.next=4;break}throw new Error("Failed to fetch embed config: ".concat(o.status));case 4:return t.next=5,o.json();case 5:i=t.sent,this.embedConfig=i,this.log("Embed config loaded:",i),!this.config.language&&i.language&&(this.config.language=i.language,this.log("Language set from API config:",i.language)),i.floating_button_config&&(this.config.floatingButtonOptions=this.mergeFloatingButtonOptions(this.config.floatingButtonOptions,i.floating_button_config),this.log("Merged floating button options:",this.config.floatingButtonOptions)),t.next=7;break;case 6:t.prev=6,r=t.catch(2),this.log("Failed to fetch embed config, using local options:",r);case 7:case"end":return t.stop()}},t,this,[[2,6]])}),s=function(){var e=this,n=arguments;return new Promise(function(o,r){var a=i.apply(e,n);function s(e){t(a,o,r,s,u,"next",e)}function u(e){t(a,o,r,s,u,"throw",e)}s(void 0)})},function(){return s.apply(this,arguments)})},{key:"mergeFloatingButtonOptions",value:function(t,e){var n,o,i,r;return t?{desktop:w(w({},t.desktop),e.desktop),mobile:w(w({},t.mobile),e.mobile),zIndex:null!==(n=e.zIndex)&&void 0!==n?n:t.zIndex,callToAction:null!==(o=e.callToAction)&&void 0!==o?o:t.callToAction,italianCallToAction:null!==(i=e.italianCallToAction)&&void 0!==i?i:t.italianCallToAction,englishCallToAction:null!==(r=e.englishCallToAction)&&void 0!==r?r:t.englishCallToAction}:e}},{key:"open",value:function(t){var e,n,o;this.log("Opening embed",t),this.iframe&&this.container&&(this.isOpen=!0,this.savedScrollPosition=window.scrollY,this.container.style.display="block",this.container.style.pointerEvents="auto",document.body.style.setProperty("overflow","hidden","important"),document.documentElement.style.setProperty("overflow","hidden","important"),this.disableHostZoom(),this.floatingButton&&(this.floatingButton.style.display="none"),this.postMessage({type:"HOLIDOIT_OPEN",payload:{embedId:(null==t?void 0:t.embedId)||(null===(e=this.config)||void 0===e?void 0:e.embedId),experienceId:null==t?void 0:t.experienceId,test:null==t?void 0:t.test}}),null===(n=this.config)||void 0===n||null===(o=n.onOpen)||void 0===o||o.call(n))}},{key:"close",value:function(){var t,e,n;this.log("Closing embed"),this.isOpen=!1,this.container&&(this.container.style.display="none",this.container.style.pointerEvents="none"),document.body.style.removeProperty("overflow"),document.documentElement.style.removeProperty("overflow"),this.restoreHostZoom(),window.scrollTo(0,this.savedScrollPosition),this.floatingButton&&(this.floatingButton.style.display="flex",this.floatingButton.style.visibility="visible",this.floatingButton.style.opacity="1"),null!==(t=this.iframe)&&void 0!==t&&t.contentWindow&&this.postMessage({type:"HOLIDOIT_CLOSE"}),null===(e=this.config)||void 0===e||null===(n=e.onClose)||void 0===n||n.call(e)}},{key:"toggle",value:function(t){this.isOpen?this.close():this.open(t)}},{key:"changeLanguage",value:function(t){this.log("Changing language",t),this.config&&(this.config.language=t),this.updateFloatingButtonText(t),this.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:t}})}},{key:"updateFloatingButtonText",value:function(t){var e;if(this.floatingButton&&this.config){var n,o=this.config.floatingButtonOptions,i=(null==o||null===(e=o.desktop)||void 0===e?void 0:e.textColor)||"white",r=a(a(a(a(a({},v.ITALIAN,"Prenota ora"),v.ENGLISH,"Book now"),v.SPANISH,"Reservar ahora"),v.FRENCH,"Réserver maintenant"),v.GERMAN,"Jetzt buchen");n=t===v.ITALIAN&&null!=o&&o.italianCallToAction?o.italianCallToAction:t===v.ENGLISH&&null!=o&&o.englishCallToAction?o.englishCallToAction:null!=o&&o.callToAction?o.callToAction:r[t]||r[v.ENGLISH];var s='<svg style="fill: '.concat(i,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(i,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(i," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(s," ").concat(n,"</span>"),this.log("Updated floating button text to:",n)}}},{key:"destroy",value:function(){this.log("Destroying embed"),this.container&&(this.container.remove(),this.container=null),this.floatingButton&&(this.floatingButton.remove(),this.floatingButton=null),this.iframe=null,this.config=null,this.isOpen=!1,this.isReady=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("message",this.handleExternalMessage)}},{key:"createContainer",value:function(){this.container=document.createElement("div"),this.container.id="holidoit-container",this.container.style.cssText="\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 2147483647 !important;\n display: none;\n pointer-events: none;\n ",document.body.appendChild(this.container)}},{key:"createIframe",value:function(){var t=this;this.container&&this.config&&(this.iframe=document.createElement("iframe"),this.iframe.id="holidoit-iframe",this.iframe.src=this.resolvedEmbedUrl,this.iframe.allow="payment",this.iframe.style.cssText="\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n border: none !important;\n background: transparent !important;\n ",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation"),this.container.appendChild(this.iframe),this.iframe.onload=function(){t.log("Iframe loaded, waiting for HOLIDOIT_READY from embed")})}},{key:"createFloatingButton",value:function(){var t,e,n,o,i,r,s,u,l,c,d,f,h,m,p,g,y,_,b,w,M,x,S,O,k=this;if(this.config){var D=this.config.floatingButtonOptions,$=window.innerWidth<775;this.floatingButton=document.createElement("button"),this.floatingButton.id="holidoit-floating-button";var I,L=function(t,e,n){return $&&void 0!==e?e:void 0!==t?t:n},T=L(null==D||null===(t=D.desktop)||void 0===t?void 0:t.width,null==D||null===(e=D.mobile)||void 0===e?void 0:e.width,$?window.innerWidth-34:190),H=L(null==D||null===(n=D.desktop)||void 0===n?void 0:n.height,null==D||null===(o=D.mobile)||void 0===o?void 0:o.height,$?50:56),E=L(null==D||null===(i=D.desktop)||void 0===i?void 0:i.backgroundColor,null==D||null===(r=D.mobile)||void 0===r?void 0:r.backgroundColor,"black"),Y=L(null==D||null===(s=D.desktop)||void 0===s?void 0:s.textColor,null==D||null===(u=D.mobile)||void 0===u?void 0:u.textColor,"white"),A=L(null==D||null===(l=D.desktop)||void 0===l?void 0:l.borderRounding,null==D||null===(c=D.mobile)||void 0===c?void 0:c.borderRounding,30),C=L(null==D||null===(d=D.desktop)||void 0===d?void 0:d.fontSize,null==D||null===(f=D.mobile)||void 0===f?void 0:f.fontSize,$?15.5:16),P=L(null==D||null===(h=D.desktop)||void 0===h?void 0:h.fontWeight,null==D||null===(m=D.mobile)||void 0===m?void 0:m.fontWeight,600),j=L(null==D||null===(p=D.desktop)||void 0===p?void 0:p.textCase,null==D||null===(g=D.mobile)||void 0===g?void 0:g.textCase,"none"),N=L(null==D||null===(y=D.desktop)||void 0===y?void 0:y.bottomPosition,null==D||null===(_=D.mobile)||void 0===_?void 0:_.bottomPosition,$?22:30),B=L(null==D||null===(b=D.desktop)||void 0===b?void 0:b.rightPosition,null==D||null===(w=D.mobile)||void 0===w?void 0:w.rightPosition,$?17:30),z=L(null==D||null===(M=D.desktop)||void 0===M?void 0:M.leftPosition,null==D||null===(x=D.mobile)||void 0===x?void 0:x.leftPosition,void 0),R=L(null==D||null===(S=D.desktop)||void 0===S?void 0:S.topPosition,null==D||null===(O=D.mobile)||void 0===O?void 0:O.topPosition,void 0),F=(null==D?void 0:D.zIndex)||2147483646,U=a(a(a(a(a({},v.ITALIAN,"Prenota ora"),v.ENGLISH,"Book now"),v.SPANISH,"Reservar ahora"),v.FRENCH,"Réserver maintenant"),v.GERMAN,"Jetzt buchen"),G=this.config.language||v.ITALIAN;I=G===v.ITALIAN&&null!=D&&D.italianCallToAction?D.italianCallToAction:G===v.ENGLISH&&null!=D&&D.englishCallToAction?D.englishCallToAction:null!=D&&D.callToAction?D.callToAction:U[G]||U[v.ENGLISH],this.floatingButton.style.cssText="\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 10px !important;\n position: fixed !important;\n z-index: ".concat(F," !important;\n width: ").concat(T,"px !important;\n height: ").concat(H,"px !important;\n background: ").concat(E," !important;\n color: ").concat(Y," !important;\n border: none !important;\n border-radius: ").concat(A,"px !important;\n font-size: ").concat(C,"px !important;\n font-weight: ").concat(P," !important;\n text-transform: ").concat("uppercase"===j?"uppercase":"capitalize"===j?"capitalize":"none",' !important;\n cursor: pointer !important;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;\n padding: 10px 20px !important;\n font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;\n ').concat(void 0!==N?"bottom: ".concat(N,"px !important;"):"","\n ").concat(void 0!==B?"right: ".concat(B,"px !important;"):"","\n ").concat(void 0!==z?"left: ".concat(z,"px !important;"):"left: auto !important;","\n ").concat(void 0!==R?"top: ".concat(R,"px !important;"):"top: auto !important;","\n ");var V='<svg style="fill: '.concat(Y,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(Y,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(Y," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(V," ").concat(I,"</span>"),this.floatingButton.addEventListener("click",function(){return k.open()}),document.body.appendChild(this.floatingButton),window.addEventListener("resize",function(){var t;k.floatingButton&&null!==(t=k.config)&&void 0!==t&&t.floatingButtonOptions&&(k.floatingButton.remove(),k.createFloatingButton())})}}},{key:"bindBookNowButtons",value:function(){var t=this,e=document.querySelectorAll(".book-now-button");if(0!==e.length){var n=0;e.forEach(function(e){var o=e;"true"!==o.dataset.holidoitBound&&(o.dataset.holidoitBound="true",n++,o.addEventListener("click",function(e){e.stopPropagation();var n=e.target;("A"===n.tagName||n.closest("a"))&&e.preventDefault();var i=parseInt(o.getAttribute("data-product-number")||"",10);isNaN(i)?t.toggle():t.toggle({experienceId:i})}))}),n>0&&this.log("Bound click handlers to ".concat(n," .book-now-button element(s)"))}}},{key:"setupMessageListener",value:function(){window.addEventListener("message",this.handleMessage),window.addEventListener("message",this.handleExternalMessage)}},{key:"postMessage",value:function(t){var e;return null!==(e=this.iframe)&&void 0!==e&&e.contentWindow?this.isReady||"HOLIDOIT_INIT"===t.type?(this.log("Posting message to iframe",t),void this.iframe.contentWindow.postMessage(t,this.embedOrigin)):(this.log("Embed not ready, queueing message",t),void this.pendingMessages.push(t)):(this.log("Iframe not ready, queueing message",t),void this.pendingMessages.push(t))}},{key:"checkPaymentRedirect",value:function(){var t=this;if(x)this.log("Payment redirect already processed, skipping");else{var e=null,n=null,o=null;if(M)e=M.paymentIntent,n=M.redirectStatus,o=M.paymentIntentClientSecret,this.log("Using captured Stripe params",M);else{var i=new URLSearchParams(window.location.search);e=i.get("payment_intent"),n=i.get("redirect_status"),o=i.get("payment_intent_client_secret")}if(e&&n){this.log("Payment redirect detected",{paymentIntent:e,redirectStatus:n}),x=!0;var r=null;try{r=localStorage.getItem(_)}catch(t){this.log("localStorage not available (incognito mode?)",t)}if(r)try{var a=JSON.parse(r);this.log("Found payment session",a),this.open(),this.isReady?t.postMessage({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}):this.pendingMessages.push({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}),this.cleanUrlParams();try{localStorage.removeItem(_)}catch(t){this.log("Failed to remove payment session from localStorage",t)}}catch(t){this.log("Failed to parse payment session",t)}else this.log("Payment redirect params found but no session - cleaning URL"),this.cleanUrlParams()}}}},{key:"cleanUrlParams",value:function(){var t=new URL(window.location.href);t.searchParams.delete("payment_intent"),t.searchParams.delete("payment_intent_client_secret"),t.searchParams.delete("redirect_status"),window.history.replaceState({},"",t.toString())}},{key:"getEmbedOrigin",value:function(t){try{return new URL(t).origin}catch(t){return window.location.origin}}},{key:"disableHostZoom",value:function(){var t=document.querySelector('meta[name="viewport"]');t?(this.savedViewportContent=t.getAttribute("content"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")):(this.savedViewportContent=null,(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(t)),this.log("Disabled host page zoom")}},{key:"restoreHostZoom",value:function(){var t=document.querySelector('meta[name="viewport"]');t&&(null!==this.savedViewportContent?t.setAttribute("content",this.savedViewportContent):t.remove()),this.log("Restored host page zoom")}},{key:"log",value:function(){var t,e="undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);if(null!==(t=this.config)&&void 0!==t&&t.debug||e){for(var n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];(n=console).log.apply(n,["[Holidoit]"].concat(i))}}}],n&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,o,i,s}()),O=function(t){return S.init(t)},k=function(t){return S.open(t)},D=function(){return S.close()},$=function(t){return S.toggle(t)},I=function(t){return S.changeLanguage(t)},L=function(){return S.destroy()},T=y,H=function(t,e,n){t&&S.init({embedId:t,floatingButton:null==e||e,floatingButtonOptions:n})},E=function(t,e,n){S.toggle({embedId:t,experienceId:e?parseInt(e,10):void 0,test:n})},Y=function(){return S.open()},A=function(){return S.close()},C={init:O,open:k,close:D,toggle:$,changeLanguage:I,destroy:L,version:T,renderHolidoitEmbed:H,toggleEmbed:E,openEmbed:Y,closeEmbed:A};if("undefined"!=typeof window){window.Holidoit=C;var P=document.currentScript,j=function(){var t=window.HolidoitConfig;if(null!=t&&t.embedId)S.init(t);else if(null!=P&&P.getAttribute("data-embed-id")){var e=P.getAttribute("data-embed-id"),n=P.getAttribute("data-floating-button"),o=P.getAttribute("data-language"),i=P.getAttribute("data-embed-url"),r=P.getAttribute("data-debug");S.init({embedId:e,floatingButton:"true"===n,language:o||void 0,embedUrl:i||void 0,debug:"true"===r})}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j):j()}})(),o})());
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Holidoit",[],e):"object"==typeof exports?exports.Holidoit=e():t.Holidoit=e()}(this,()=>(()=>{var t={172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},317:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},353:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,o="millisecond",i="second",r="minute",a="hour",s="day",u="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},v=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(o,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var o=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(o,l),r=n-i<0,a=e.clone().add(o+(r?-1:1),l);return+(-(o+(n-i)/(r?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:l,y:d,w:u,d:s,D:f,h:a,m:r,s:i,ms:o,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",_={};_[b]=g;var w="$isDayjsObject",M=function(t){return t instanceof k||!(!t||!t[w])},x=function t(e,n,o){var i;if(!e)return b;if("string"==typeof e){var r=e.toLowerCase();_[r]&&(i=r),n&&(_[r]=n,i=r);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var s=e.name;_[s]=e,i=s}return!o&&i&&(b=i),i||!o&&b},S=function(t,e){if(M(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new k(n)},O=y;O.l=x,O.i=M,O.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var k=function(){function g(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(m);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return S(t)<this.startOf(e)},v.isBefore=function(t,e){return this.endOf(e)<S(t)},v.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(t,e){var n=this,o=!!O.u(e)||e,c=O.p(t),h=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return o?i:i.endOf(s)},m=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return o?h(1,0):h(31,11);case l:return o?h(1,g):h(0,g+1);case u:var b=this.$locale().weekStart||0,_=(p<b?p+7:p)-b;return h(o?v-_:v+(6-_),g);case s:case f:return m(y+"Hours",0);case a:return m(y+"Minutes",1);case r:return m(y+"Seconds",2);case i:return m(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(t){return this.startOf(t,!1)},v.$set=function(t,e){var n,u=O.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[l]=c+"Month",n[d]=c+"FullYear",n[a]=c+"Hours",n[r]=c+"Minutes",n[i]=c+"Seconds",n[o]=c+"Milliseconds",n)[u],m=u===s?this.$D+(e-this.$W):e;if(u===l||u===d){var p=this.clone().set(f,1);p.$d[h](m),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},v.set=function(t,e){return this.clone().$set(t,e)},v.get=function(t){return this[O.p(t)]()},v.add=function(o,c){var f,h=this;o=Number(o);var m=O.p(c),p=function(t){var e=S(h);return O.w(e.date(e.date()+Math.round(t*o)),h)};if(m===l)return this.set(l,this.$M+o);if(m===d)return this.set(d,this.$y+o);if(m===s)return p(1);if(m===u)return p(7);var g=(f={},f[r]=e,f[a]=n,f[i]=t,f)[m]||1,v=this.$d.getTime()+o*g;return O.w(v,this)},v.subtract=function(t,e){return this.add(-1*t,e)},v.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),r=this.$H,a=this.$m,s=this.$M,u=n.weekdays,l=n.months,c=n.meridiem,d=function(t,n,i,r){return t&&(t[n]||t(e,o))||i[n].slice(0,r)},f=function(t){return O.s(r%12||12,t,"0")},m=c||function(t,e,n){var o=t<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(p,function(t,o){return o||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return O.s(e.$y,4,"0");case"M":return s+1;case"MM":return O.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,l,3);case"MMMM":return d(l,s);case"D":return e.$D;case"DD":return O.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(n.weekdaysMin,e.$W,u,2);case"ddd":return d(n.weekdaysShort,e.$W,u,3);case"dddd":return u[e.$W];case"H":return String(r);case"HH":return O.s(r,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(r,a,!0);case"A":return m(r,a,!1);case"m":return String(a);case"mm":return O.s(a,2,"0");case"s":return String(e.$s);case"ss":return O.s(e.$s,2,"0");case"SSS":return O.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(o,f,h){var m,p=this,g=O.p(f),v=S(o),y=(v.utcOffset()-this.utcOffset())*e,b=this-v,_=function(){return O.m(p,v)};switch(g){case d:m=_()/12;break;case l:m=_();break;case c:m=_()/3;break;case u:m=(b-y)/6048e5;break;case s:m=(b-y)/864e5;break;case a:m=b/n;break;case r:m=b/e;break;case i:m=b/t;break;default:m=b}return h?m:O.a(m)},v.daysInMonth=function(){return this.endOf(l).$D},v.$locale=function(){return _[this.$L]},v.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),o=x(t,e,!0);return o&&(n.$L=o),n},v.clone=function(){return O.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),D=k.prototype;return S.prototype=D,[["$ms",o],["$s",i],["$m",r],["$H",a],["$W",s],["$M",l],["$y",d],["$D",f]].forEach(function(t){D[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),S.extend=function(t,e){return t.$i||(t(e,k,S),t.$i=!0),S},S.locale=x,S.isDayjs=M,S.unix=function(t){return S(1e3*t)},S.en=_[b],S.Ls=_,S.p={},S}()},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var o in e)n.unshift(o);return function t(){for(;n.length;)if((o=n.pop())in e)return t.value=o,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},445:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(o,i,r){var a=i.prototype;r.utc=function(t){return new i({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=r(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var l=a.utcOffset;a.utcOffset=function(o,i){var r=this.$utils().u;if(r(o))return this.$u?0:r(this.$offset)?l.call(this):this.$offset;if("string"==typeof o&&(o=function(t){void 0===t&&(t="");var o=t.match(e);if(!o)return null;var i=(""+o[0]).match(n)||["-",0,0],r=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===r?a:-a}(o),null===o))return this;var a=Math.abs(o)<=16?60*o:o;if(0===a)return this.utc(i);var s=this.clone();if(i)return s.$offset=a,s.$u=!1,s;var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+u,t)).$offset=a,s.$x.$localOffset=u,s};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var o=this.local(),i=r(t).local();return f.call(o,i,e,n)}}}()},494:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function i(t,e,n){var i=o[n];return Array.isArray(i)&&(i=i[e?0:1]),i.replace("%d",t)}var r={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return n.default.locale(r,null,!0),r}(n(353))},519:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return n.default.locale(o,null,!0),o}(n(353))},546:t=>{function e(n,o,i,r){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,o,i){function r(n,o){e(t,n,function(t){return this._invoke(n,o,t)})}n?a?a(t,n,{value:o,enumerable:!i,configurable:!i,writable:!i}):t[n]=o:(r("next",0),r("throw",1),r("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,i,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,o,i){var r,a=function(t,n,o){void 0===o&&(o={});var i=new Date(t),r=function(t,n){void 0===n&&(n={});var o=n.timeZoneName||"short",i=t+"|"+o,r=e[i];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:o}),e[i]=r),r}(n,o);return r.formatToParts(i)},s=function(e,n){for(var o=a(e,n),r=[],s=0;s<o.length;s+=1){var u=o[s],l=u.type,c=u.value,d=t[l];d>=0&&(r[d]=parseInt(c,10))}var f=r[3],h=24===f?0:f,m=r[0]+"-"+r[1]+"-"+r[2]+" "+h+":"+r[4]+":"+r[5]+":000",p=+e;return(i.utc(m).valueOf()-(p-=p%1e3))/6e4},u=o.prototype;u.tz=function(t,e){void 0===t&&(t=r);var n,o=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:t}),u=Math.round((a-new Date(s))/1e3/60),l=15*-Math.round(a.getTimezoneOffset()/15)-u;if(Number(l)){if(n=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(l,!0),e){var c=n.utcOffset();n=n.add(o-c,"minute")}}else n=this.utcOffset(0,e);return n.$x.$timezone=t,n},u.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var l=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var o=n&&e,a=n||e||r,u=s(+i(),a);if("string"!=typeof t)return i(t).tz(a);var l=function(t,e,n){var o=t-60*e*1e3,i=s(o,n);if(e===i)return[o,e];var r=s(o-=60*(i-e)*1e3,n);return i===r?[o,i]:[t-60*Math.min(i,r)*1e3,Math.max(i,r)]}(i.utc(t,o).valueOf(),u,a),c=l[0],d=l[1],f=i(c).utcOffset(d);return f.$x.$timezone=a,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){r=t}}}()},579:(t,e,n)=>{var o=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(o(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},633:(t,e,n)=>{var o=n(172),i=n(993),r=n(869),a=n(887),s=n(791),u=n(373),l=n(579);function c(){"use strict";var e=i(),n=e.m(c),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))}var h={throw:1,return:2,break:3,continue:3};function m(t){var e,n;return function(o){e||(e={stop:function(){return n(o.a,2)},catch:function(){return o.v},abrupt:function(t,e){return n(o.a,h[t],e)},delegateYield:function(t,i,r){return e.resultName=i,n(o.d,l(t),r)},finish:function(t){return n(o.f,t)}},n=function(t,n,i){o.p=e.prev,o.n=e.next;try{return t(n,i)}finally{e.next=o.n}}),e.resultName&&(e[e.resultName]=o.v,e.resultName=void 0),e.sent=o.v,e.next=o.n;try{return t.call(this,e)}finally{o.p=e.prev,o.n=e.next}}}return(t.exports=c=function(){return{wrap:function(t,n,o,i){return e.w(m(t),n,o,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new o(t,e)},AsyncIterator:s,async:function(t,e,n,o,i){return(f(e)?a:r)(m(t),e,n,o,i)},keys:u,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var o=n(633)();t.exports=o;try{regeneratorRuntime=o}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},791:(t,e,n)=>{var o=n(172),i=n(546);t.exports=function t(e,n){function r(t,i,a,s){try{var u=e[t](i),l=u.value;return l instanceof o?n.resolve(l.v).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):n.resolve(l).then(function(t){u.value=t,a(u)},function(t){return r("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,o){function i(){return new n(function(e,n){r(t,o,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},813:function(t,e,n){t.exports=function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return n.default.locale(o,null,!0),o}(n(353))},826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}}}()},840:function(t){t.exports=function(){"use strict";return function(t,e,n){var o=e.prototype,i=function(t){return t&&(t.indexOf?t:t.s)},r=function(t,e,n,o,r){var a=t.name?t:t.$locale(),s=i(a[e]),u=i(a[n]),l=s||u.map(function(t){return t.slice(0,o)});if(!r)return l;var c=a.weekStart;return l.map(function(t,e){return l[(e+(c||0))%7]})},a=function(){return n.Ls[n.locale()]},s=function(t,e){return t.formats[e]||function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,n){return e||n.slice(1)})}(t.formats[e.toUpperCase()])},u=function(){var t=this;return{months:function(e){return e?e.format("MMMM"):r(t,"months")},monthsShort:function(e){return e?e.format("MMM"):r(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):r(t,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):r(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):r(t,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return s(t.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return u.bind(this)()},n.localeData=function(){var t=a();return{firstDayOfWeek:function(){return t.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(e){return s(t,e)},meridiem:t.meridiem,ordinal:t.ordinal}},n.months=function(){return r(a(),"months")},n.monthsShort=function(){return r(a(),"monthsShort","months",3)},n.weekdays=function(t){return r(a(),"weekdays",null,null,t)},n.weekdaysShort=function(t){return r(a(),"weekdaysShort","weekdays",3,t)},n.weekdaysMin=function(t){return r(a(),"weekdaysMin","weekdays",2,t)}}}()},869:(t,e,n)=>{var o=n(887);t.exports=function(t,e,n,i,r){var a=o(t,e,n,i,r);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var o=n(993),i=n(791);t.exports=function(t,e,n,r,a){return new i(o().w(t,e,n,r),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},993:(t,e,n)=>{var o=n(546);function i(){var e,n,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function u(t,i,r,a){var s=i&&i.prototype instanceof c?i:c,u=Object.create(s.prototype);return o(u,"_invoke",function(t,o,i){var r,a,s,u=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return r=t,a=0,s=e,f.n=n,l}};function h(t,o){for(a=t,s=o,n=0;!d&&u&&!i&&n<c.length;n++){var i,r=c[n],h=f.p,m=r[2];t>3?(i=m===o)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=h&&((i=t<2&&h<r[1])?(a=0,f.v=o,f.n=r[1]):h<m&&(i=t<3||r[0]>o||o>m)&&(r[4]=t,r[5]=o,f.n=m,a=0))}if(i||t>1)return l;throw d=!0,o}return function(i,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,m),a=c,s=m;(n=a<2?e:s)||!d;){r||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(u=2,r){if(a||(i="next"),n=r[i]){if(!(n=n.call(r,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=r.return)&&n.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);r=e}else if((n=(d=f.n<0)?s:t.call(o,f))!==l)break}catch(t){r=e,a=1,s=t}finally{u=1}}return{value:n,done:d}}}(t,r,a),!0),u}var l={};function c(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(o(n={},a,function(){return this}),n),m=f.prototype=c.prototype=Object.create(h);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t}return d.prototype=f,o(m,"constructor",f),o(f,"constructor",d),d.displayName="GeneratorFunction",o(f,s,"GeneratorFunction"),o(m),o(m,s,"Generator"),o(m,a,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:u,m:p}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";function t(t,e,n,o,i,r,a){try{var s=t[r](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(o,i)}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,i(o.key),o)}}function a(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{Languages:()=>v,changeLanguage:()=>I,close:()=>D,closeEmbed:()=>A,destroy:()=>L,init:()=>O,open:()=>k,openEmbed:()=>Y,renderHolidoitEmbed:()=>H,toggle:()=>$,toggleEmbed:()=>E,version:()=>T});var s=n(756),u=n.n(s),l=n(353),c=n.n(l),d=(n(494),n(826),n(317),n(813),n(519),n(840)),f=n.n(d),h=n(569),m=n.n(h),p=n(445),g=n.n(p);c().extend(g()),c().extend(m()),c().extend(f());var v=function(t){return t.ITALIAN="it",t.ENGLISH="en",t.SPANISH="es",t.FRENCH="fr",t.GERMAN="de",t}({}),y=(c()().locale("it").localeData().months(),c()().locale("it").localeData().weekdays(),c()().locale("en").localeData().months(),c()().locale("en").localeData().weekdays(),c()().locale("de").localeData().months(),c()().locale("de").localeData().weekdays(),c()().locale("es").localeData().months(),c()().locale("es").localeData().weekdays(),c()().locale("fr").localeData().months(),c()().locale("fr").localeData().weekdays(),"2.0.0"),b="_holidoit_payment_session";function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var M=function(){if("undefined"==typeof window)return null;try{var t=new URLSearchParams(window.location.search),e=t.get("payment_intent");if(!e)return null;var n={paymentIntent:e,paymentIntentClientSecret:t.get("payment_intent_client_secret"),redirectStatus:t.get("redirect_status")};"localhost"===window.location.hostname||window.location.hostname;return n}catch(t){return null}}(),x=!1,S=new(function(){return e=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,"config",null),a(this,"embedConfig",null),a(this,"iframe",null),a(this,"container",null),a(this,"floatingButton",null),a(this,"isOpen",!1),a(this,"isReady",!1),a(this,"pendingMessages",[]),a(this,"savedScrollPosition",0),a(this,"savedViewportContent",null),a(this,"embedOrigin",""),a(this,"resolvedEmbedUrl",""),a(this,"resolvedApiUrl",""),a(this,"handleExternalMessage",function(t){var n=t.data;if(n&&n.action)switch(e.log("Received external message",n),n.action){case"holidoitExperienceSelected":n.experienceId&&(e.log("Experience selected from external iframe",n.experienceId),e.open({experienceId:n.experienceId}));break;case"holidoitIFrameChangeLanguage":n.language&&(e.log("Language change from external iframe",n.language),e.changeLanguage(n.language));break;case"holidoitExperienceCount":if(t.source===window){e.log("Ignoring holidoitExperienceCount from same window");break}if(e.log("Experience count from external iframe",n.count),"number"==typeof n.height){var o=document.getElementById("holidoit-iframe");o&&(o.style.height="".concat(n.height,"px"),e.log("Adjusted holidoit-iframe height to",n.height))}}}),a(this,"handleMessage",function(t){var n,o,i,r;if(t.origin===e.embedOrigin){var a=t.data;if(a&&a.type&&a.type.startsWith("HOLIDOIT_"))switch(e.log("Received message from embed iframe",a),a.type){case"HOLIDOIT_READY":e.log("Embed is ready, sending HOLIDOIT_INIT");var s="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname;e.postMessage({type:"HOLIDOIT_INIT",payload:{embedId:e.config.embedId,language:e.config.language,floatingButton:e.config.floatingButton,floatingButtonOptions:e.config.floatingButtonOptions,parentOrigin:window.location.origin,parentUrl:window.location.href,isMobile:window.innerWidth<775,debug:e.config.debug||s}}),e.isReady=!0,e.pendingMessages.forEach(function(t){return e.postMessage(t)}),e.pendingMessages=[];break;case"HOLIDOIT_OPENED":break;case"HOLIDOIT_CLOSED":setTimeout(function(){e.close()},300);break;case"HOLIDOIT_BOOKING_COMPLETE":var u=a.payload;e.log("Booking complete",u),null===(n=e.config)||void 0===n||null===(o=n.onBookingComplete)||void 0===o||o.call(n,u);break;case"HOLIDOIT_PAYMENT_REDIRECT_START":var l=a.payload;if(null!=l&&l.session){e.log("Saving payment session for redirect",l.session);try{localStorage.setItem(b,JSON.stringify(l.session))}catch(t){e.log("Failed to save payment session (incognito mode?)",t)}}break;case"HOLIDOIT_LANGUAGE_CHANGED":var c=a.payload;null!=c&&c.language&&(e.log("Language changed from embed:",c.language),e.config&&(e.config.language=c.language),e.updateFloatingButtonText(c.language),window.postMessage({action:"holidoitEmbedChangeLanguage",language:c.language},"*"));break;case"HOLIDOIT_ERROR":var d=a.payload;null===(i=e.config)||void 0===i||null===(r=i.onError)||void 0===r||r.call(i,(null==d?void 0:d.message)||"Unknown error");break;case"HOLIDOIT_NAVIGATE_TO":var f=a.payload;null!=f&&f.url&&(e.log("Navigating parent page to:",f.url),window.location.href=f.url)}}})},n=[{key:"init",value:function(t){var e=this;if(t.embedId){if(this.container)return this.log("Holidoit already initialized, skipping duplicate init"),void(this.config=w(w({},this.config),t));this.config=t,window.location.hostname,this.resolvedEmbedUrl=t.embedUrl||"https://cdn.holidoit.com/embed.html",this.resolvedApiUrl="https://engine.holydoit.com",this.embedOrigin=this.getEmbedOrigin(this.resolvedEmbedUrl),this.log("Initializing Holidoit embed",{embedId:t.embedId,version:y}),this.createContainer(),this.createIframe(),this.setupMessageListener();var n=function(){e.bindBookNowButtons(),e.observeForBookNowButtons()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n(),this.fetchEmbedConfig().then(function(){var n;((null===(n=e.embedConfig)||void 0===n?void 0:n.has_floating_button)||t.floatingButton)&&e.createFloatingButton()}),this.checkPaymentRedirect()}}},{key:"fetchEmbedConfig",value:(i=u().mark(function t(){var e,n,o,i,r;return u().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(e=this.config)&&void 0!==e&&e.embedId){t.next=1;break}return t.abrupt("return");case 1:return n="".concat(this.resolvedApiUrl,"/partner/v0/embed-config/").concat(this.config.embedId,"/get"),this.log("Fetching embed config from:",n),t.prev=2,t.next=3,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 3:if((o=t.sent).ok){t.next=4;break}throw new Error("Failed to fetch embed config: ".concat(o.status));case 4:return t.next=5,o.json();case 5:i=t.sent,this.embedConfig=i,this.log("Embed config loaded:",i),!this.config.language&&i.language&&(this.config.language=i.language,this.log("Language set from API config:",i.language)),i.floating_button_config&&(this.config.floatingButtonOptions=this.mergeFloatingButtonOptions(this.config.floatingButtonOptions,i.floating_button_config),this.log("Merged floating button options:",this.config.floatingButtonOptions)),t.next=7;break;case 6:t.prev=6,r=t.catch(2),this.log("Failed to fetch embed config, using local options:",r);case 7:case"end":return t.stop()}},t,this,[[2,6]])}),s=function(){var e=this,n=arguments;return new Promise(function(o,r){var a=i.apply(e,n);function s(e){t(a,o,r,s,u,"next",e)}function u(e){t(a,o,r,s,u,"throw",e)}s(void 0)})},function(){return s.apply(this,arguments)})},{key:"mergeFloatingButtonOptions",value:function(t,e){var n,o,i,r;return t?{desktop:w(w({},t.desktop),e.desktop),mobile:w(w({},t.mobile),e.mobile),zIndex:null!==(n=e.zIndex)&&void 0!==n?n:t.zIndex,callToAction:null!==(o=e.callToAction)&&void 0!==o?o:t.callToAction,italianCallToAction:null!==(i=e.italianCallToAction)&&void 0!==i?i:t.italianCallToAction,englishCallToAction:null!==(r=e.englishCallToAction)&&void 0!==r?r:t.englishCallToAction}:e}},{key:"open",value:function(t){var e,n,o;this.log("Opening embed",t),this.iframe&&this.container&&(this.isOpen=!0,this.savedScrollPosition=window.scrollY,this.container.style.display="block",this.container.style.pointerEvents="auto",document.body.style.setProperty("overflow","hidden","important"),document.documentElement.style.setProperty("overflow","hidden","important"),this.disableHostZoom(),this.floatingButton&&(this.floatingButton.style.display="none"),this.postMessage({type:"HOLIDOIT_OPEN",payload:{embedId:(null==t?void 0:t.embedId)||(null===(e=this.config)||void 0===e?void 0:e.embedId),experienceId:null==t?void 0:t.experienceId,test:null==t?void 0:t.test}}),null===(n=this.config)||void 0===n||null===(o=n.onOpen)||void 0===o||o.call(n))}},{key:"close",value:function(){var t,e,n;this.log("Closing embed"),this.isOpen=!1,this.container&&(this.container.style.display="none",this.container.style.pointerEvents="none"),document.body.style.removeProperty("overflow"),document.documentElement.style.removeProperty("overflow"),this.restoreHostZoom(),window.scrollTo(0,this.savedScrollPosition),this.floatingButton&&(this.floatingButton.style.display="flex",this.floatingButton.style.visibility="visible",this.floatingButton.style.opacity="1"),null!==(t=this.iframe)&&void 0!==t&&t.contentWindow&&this.postMessage({type:"HOLIDOIT_CLOSE"}),null===(e=this.config)||void 0===e||null===(n=e.onClose)||void 0===n||n.call(e)}},{key:"toggle",value:function(t){this.isOpen?this.close():this.open(t)}},{key:"changeLanguage",value:function(t){this.log("Changing language",t),this.config&&(this.config.language=t),this.updateFloatingButtonText(t),this.postMessage({type:"HOLIDOIT_CHANGE_LANGUAGE",payload:{language:t}})}},{key:"updateFloatingButtonText",value:function(t){var e;if(this.floatingButton&&this.config){var n,o=this.config.floatingButtonOptions,i=(null==o||null===(e=o.desktop)||void 0===e?void 0:e.textColor)||"white",r=a(a(a(a(a({},v.ITALIAN,"Prenota ora"),v.ENGLISH,"Book now"),v.SPANISH,"Reservar ahora"),v.FRENCH,"Réserver maintenant"),v.GERMAN,"Jetzt buchen");n=t===v.ITALIAN&&null!=o&&o.italianCallToAction?o.italianCallToAction:t===v.ENGLISH&&null!=o&&o.englishCallToAction?o.englishCallToAction:null!=o&&o.callToAction?o.callToAction:r[t]||r[v.ENGLISH];var s='<svg style="fill: '.concat(i,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(i,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(i," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(s," ").concat(n,"</span>"),this.log("Updated floating button text to:",n)}}},{key:"destroy",value:function(){this.log("Destroying embed"),this.container&&(this.container.remove(),this.container=null),this.floatingButton&&(this.floatingButton.remove(),this.floatingButton=null),this.iframe=null,this.config=null,this.isOpen=!1,this.isReady=!1,window.removeEventListener("message",this.handleMessage),window.removeEventListener("message",this.handleExternalMessage)}},{key:"createContainer",value:function(){this.container=document.createElement("div"),this.container.id="holidoit-container",this.container.style.cssText="\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 2147483647 !important;\n display: none;\n pointer-events: none;\n ",document.body.appendChild(this.container)}},{key:"createIframe",value:function(){var t=this;this.container&&this.config&&(this.iframe=document.createElement("iframe"),this.iframe.id="holidoit-iframe",this.iframe.src=this.resolvedEmbedUrl,this.iframe.allow="payment",this.iframe.style.cssText="\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n border: none !important;\n background: transparent !important;\n ",this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation"),this.container.appendChild(this.iframe),this.iframe.onload=function(){t.log("Iframe loaded, waiting for HOLIDOIT_READY from embed")})}},{key:"createFloatingButton",value:function(){var t,e,n,o,i,r,s,u,l,c,d,f,h,m,p,g,y,b,_,w,M,x,S,O,k=this;if(this.config){var D=this.config.floatingButtonOptions,$=window.innerWidth<775;this.floatingButton=document.createElement("button"),this.floatingButton.id="holidoit-floating-button";var I,L=function(t,e,n){return $?void 0!==e?e:n:void 0!==t?t:n},T=L(null==D||null===(t=D.desktop)||void 0===t?void 0:t.width,null==D||null===(e=D.mobile)||void 0===e?void 0:e.width,$?window.innerWidth-34:190),H=L(null==D||null===(n=D.desktop)||void 0===n?void 0:n.height,null==D||null===(o=D.mobile)||void 0===o?void 0:o.height,$?50:56),E=L(null==D||null===(i=D.desktop)||void 0===i?void 0:i.backgroundColor,null==D||null===(r=D.mobile)||void 0===r?void 0:r.backgroundColor,"black"),Y=L(null==D||null===(s=D.desktop)||void 0===s?void 0:s.textColor,null==D||null===(u=D.mobile)||void 0===u?void 0:u.textColor,"white"),A=L(null==D||null===(l=D.desktop)||void 0===l?void 0:l.borderRounding,null==D||null===(c=D.mobile)||void 0===c?void 0:c.borderRounding,30),C=L(null==D||null===(d=D.desktop)||void 0===d?void 0:d.fontSize,null==D||null===(f=D.mobile)||void 0===f?void 0:f.fontSize,$?15.5:16),N=L(null==D||null===(h=D.desktop)||void 0===h?void 0:h.fontWeight,null==D||null===(m=D.mobile)||void 0===m?void 0:m.fontWeight,600),P=L(null==D||null===(p=D.desktop)||void 0===p?void 0:p.textCase,null==D||null===(g=D.mobile)||void 0===g?void 0:g.textCase,"none"),j=L(null==D||null===(y=D.desktop)||void 0===y?void 0:y.bottomPosition,null==D||null===(b=D.mobile)||void 0===b?void 0:b.bottomPosition,$?22:30),B=L(null==D||null===(_=D.desktop)||void 0===_?void 0:_.rightPosition,null==D||null===(w=D.mobile)||void 0===w?void 0:w.rightPosition,$?17:30),z=L(null==D||null===(M=D.desktop)||void 0===M?void 0:M.leftPosition,null==D||null===(x=D.mobile)||void 0===x?void 0:x.leftPosition,void 0),F=L(null==D||null===(S=D.desktop)||void 0===S?void 0:S.topPosition,null==D||null===(O=D.mobile)||void 0===O?void 0:O.topPosition,void 0),R=(null==D?void 0:D.zIndex)||2147483646,U=a(a(a(a(a({},v.ITALIAN,"Prenota ora"),v.ENGLISH,"Book now"),v.SPANISH,"Reservar ahora"),v.FRENCH,"Réserver maintenant"),v.GERMAN,"Jetzt buchen"),G=this.config.language||v.ITALIAN;I=G===v.ITALIAN&&null!=D&&D.italianCallToAction?D.italianCallToAction:G===v.ENGLISH&&null!=D&&D.englishCallToAction?D.englishCallToAction:null!=D&&D.callToAction?D.callToAction:U[G]||U[v.ENGLISH],this.floatingButton.style.cssText="\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 10px !important;\n position: fixed !important;\n z-index: ".concat(R," !important;\n width: ").concat(T,"px !important;\n height: ").concat(H,"px !important;\n background: ").concat(E," !important;\n color: ").concat(Y," !important;\n border: none !important;\n border-radius: ").concat(A,"px !important;\n font-size: ").concat(C,"px !important;\n font-weight: ").concat(N," !important;\n text-transform: ").concat("uppercase"===P?"uppercase":"capitalize"===P?"capitalize":"none",' !important;\n cursor: pointer !important;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;\n padding: 10px 20px !important;\n font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;\n ').concat(void 0!==j?"bottom: ".concat(j,"px !important;"):"","\n ").concat(void 0!==B?"right: ".concat(B,"px !important;"):"","\n ").concat(void 0!==z?"left: ".concat(z,"px !important;"):"left: auto !important;","\n ").concat(void 0!==F?"top: ".concat(F,"px !important;"):"top: auto !important;","\n ");var V='<svg style="fill: '.concat(Y,' !important;" xmlns="http://www.w3.org/2000/svg" height="19" width="19" viewBox="0 0 448 512"><path style="fill: ').concat(Y,' !important;" d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/></svg>');this.floatingButton.innerHTML='<span style="display: flex; align-items: center; gap: 10px; color: '.concat(Y," !important; font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: inherit !important; font-weight: inherit !important;\">").concat(V," ").concat(I,"</span>"),this.floatingButton.addEventListener("click",function(){return k.open()}),document.body.appendChild(this.floatingButton),window.addEventListener("resize",function(){var t;k.floatingButton&&null!==(t=k.config)&&void 0!==t&&t.floatingButtonOptions&&(k.floatingButton.remove(),k.createFloatingButton())})}}},{key:"bindBookNowButtons",value:function(){var t=this,e=document.querySelectorAll(".book-now-button");if(0!==e.length){var n=0;e.forEach(function(e){var o=e,i="_holidoitClickBound";o[i]||(o[i]=!0,n++,o.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),t.log("Book now button clicked",{element:o.tagName,productNumber:o.getAttribute("data-product-number")});var n=parseInt(o.getAttribute("data-product-number")||"",10);isNaN(n)?t.toggle():t.toggle({experienceId:n})}))}),n>0&&this.log("Bound click handlers to ".concat(n," .book-now-button element(s)"))}}},{key:"observeForBookNowButtons",value:function(){var t=this;window._holidoitObserverActive||(window._holidoitObserverActive=!0,new MutationObserver(function(e){for(var n=!1,o=0;o<e.length;o++){var i=e[o];if("childList"===i.type)for(var r=0;r<i.addedNodes.length;r++){var a,s,u=i.addedNodes[r];if(u instanceof HTMLElement&&(null!==(a=u.classList)&&void 0!==a&&a.contains("book-now-button")||null!==(s=u.querySelector)&&void 0!==s&&s.call(u,".book-now-button"))){n=!0;break}}if(n)break}n&&(t.log("Detected dynamically added .book-now-button elements, binding..."),t.bindBookNowButtons())}).observe(document.body,{childList:!0,subtree:!0}),this.log("MutationObserver active for .book-now-button elements"))}},{key:"setupMessageListener",value:function(){window.addEventListener("message",this.handleMessage),window.addEventListener("message",this.handleExternalMessage)}},{key:"postMessage",value:function(t){var e;return null!==(e=this.iframe)&&void 0!==e&&e.contentWindow?this.isReady||"HOLIDOIT_INIT"===t.type?(this.log("Posting message to iframe",t),void this.iframe.contentWindow.postMessage(t,this.embedOrigin)):(this.log("Embed not ready, queueing message",t),void this.pendingMessages.push(t)):(this.log("Iframe not ready, queueing message",t),void this.pendingMessages.push(t))}},{key:"checkPaymentRedirect",value:function(){var t=this;if(x)this.log("Payment redirect already processed, skipping");else{var e=null,n=null,o=null;if(M)e=M.paymentIntent,n=M.redirectStatus,o=M.paymentIntentClientSecret,this.log("Using captured Stripe params",M);else{var i=new URLSearchParams(window.location.search);e=i.get("payment_intent"),n=i.get("redirect_status"),o=i.get("payment_intent_client_secret")}if(e&&n){this.log("Payment redirect detected",{paymentIntent:e,redirectStatus:n}),x=!0;var r=null;try{r=localStorage.getItem(b)}catch(t){this.log("localStorage not available (incognito mode?)",t)}if(r)try{var a=JSON.parse(r);this.log("Found payment session",a),this.open(),this.isReady?t.postMessage({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}):this.pendingMessages.push({type:"HOLIDOIT_PAYMENT_REDIRECT",payload:{paymentIntent:e,paymentIntentClientSecret:o||void 0,redirectStatus:n,session:a}}),this.cleanUrlParams();try{localStorage.removeItem(b)}catch(t){this.log("Failed to remove payment session from localStorage",t)}}catch(t){this.log("Failed to parse payment session",t)}else this.log("Payment redirect params found but no session - cleaning URL"),this.cleanUrlParams()}}}},{key:"cleanUrlParams",value:function(){var t=new URL(window.location.href);t.searchParams.delete("payment_intent"),t.searchParams.delete("payment_intent_client_secret"),t.searchParams.delete("redirect_status"),window.history.replaceState({},"",t.toString())}},{key:"getEmbedOrigin",value:function(t){try{return new URL(t).origin}catch(t){return window.location.origin}}},{key:"disableHostZoom",value:function(){var t=document.querySelector('meta[name="viewport"]');t?(this.savedViewportContent=t.getAttribute("content"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")):(this.savedViewportContent=null,(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(t)),this.log("Disabled host page zoom")}},{key:"restoreHostZoom",value:function(){var t=document.querySelector('meta[name="viewport"]');t&&(null!==this.savedViewportContent?t.setAttribute("content",this.savedViewportContent):t.remove()),this.log("Restored host page zoom")}},{key:"log",value:function(){var t,e="undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);if(null!==(t=this.config)&&void 0!==t&&t.debug||e){for(var n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];(n=console).log.apply(n,["[Holidoit]"].concat(i))}}}],n&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,o,i,s}()),O=function(t){return S.init(t)},k=function(t){return S.open(t)},D=function(){return S.close()},$=function(t){return S.toggle(t)},I=function(t){return S.changeLanguage(t)},L=function(){return S.destroy()},T=y,H=function(t,e,n){t&&S.init({embedId:t,floatingButton:null==e||e,floatingButtonOptions:n})},E=function(t,e,n){S.toggle({embedId:t,experienceId:e?parseInt(e,10):void 0,test:n})},Y=function(){return S.open()},A=function(){return S.close()},C={init:O,open:k,close:D,toggle:$,changeLanguage:I,destroy:L,version:T,renderHolidoitEmbed:H,toggleEmbed:E,openEmbed:Y,closeEmbed:A};if("undefined"!=typeof window){window.Holidoit=C;var N=document.currentScript,P=function(){var t=window.HolidoitConfig;if(null!=t&&t.embedId)S.init(t);else if(null!=N&&N.getAttribute("data-embed-id")){var e=N.getAttribute("data-embed-id"),n=N.getAttribute("data-floating-button"),o=N.getAttribute("data-language"),i=N.getAttribute("data-embed-url"),r=N.getAttribute("data-debug");S.init({embedId:e,floatingButton:"true"===n,language:o||void 0,embedUrl:i||void 0,debug:"true"===r})}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",P):P()}})(),o})());
|
package/package.json
CHANGED