PageSourceSearch

https://diamondresortphuket.com/wp-content/plugins/travelanium-ele…/build/form-reservation.min.js?ver=0.1

js diamondresortphuket.com collected 2026-09-30 16:52:16 UTC 9,102 bytes, 1 lines download raw bytes

1(()=>{function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,n){return(t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,n)}function n(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n);if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===e(i)?i:String(i)),r)}var i}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var c=wp.i18n,u=c.__,l=c._n,s=(c._x,c.sprintf),d=function(){function e(t){var n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),t instanceof HTMLElement?this.formEl=t:"string"==typeof t&&(this.formEl=document.querySelector(t)),this.hiddenCode=i.hiddenCode,this.dateTextFormat=null!==(n=i.dateTextFormat)&&void 0!==n?n:"ddd, DD MMM",this.dateTextSeparator=null!==(o=i.dateTextSeparator)&&void 0!==o?o:"&mdash;",this.additionalParams=i.additionalParams,this.formEl.ReservationForm=this,this._applyAdditionalParams(),this._attachEvents()}return a(e,[{key:"_applyHiddencode",value:function(){var e=this;""==this.get("accesscode").trim()&&(this.set("accesscode",this.hiddenCode),this.formEl.addEventListener("reservationFormAfterSubmit",(function t(n){e.set("accesscode",""),e.formEl.removeEventListener("reservationFormAfterSubmit",t)})))}},{key:"_applyAdditionalParams",value:function(){var e=this.additionalParams;for(var t in e){var n=t,o=e[t];this.set(n,o)}}},{key:"_attachEvents",value:function(){var e=this;this.formEl.addEventListener("submit",(function(t){t.preventDefault(),t.target.dispatchEvent(new CustomEvent("reservationFormBeforeSubmit")),e._applyHiddencode(),t.target.submit(),t.target.dispatchEvent(new CustomEvent("reservationFormAfterSubmit"))}))}},{key:"_createEvent",value:function(e,t){var n=null!=t?t:"";return this.formEl.dispatchEvent(new CustomEvent(e,{detail:n}))}},{key:"get",value:function(e){return this.formEl.querySelector('[name="'+e+'"]').value}},{key:"set",value:function(e,t){if(this.formEl.querySelector('[name="'+e+'"]'))return this.update(e,t);var n=document.createElement("input");return n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),this.formEl.appendChild(n),n}},{key:"update",value:function(e,t){var n=this.formEl.querySelector('[name="'+e+'"]');return!!n&&(n.setAttribute("value",t),n)}},{key:"getNight",value:function(){var e=this.get("checkin"),t=this.get("checkout");return moment(t).diff(e,"d")}},{key:"setDates",value:function(e,t){if(e&&t){var n=moment(e).format(this.dateTextFormat),o=moment(t).format(this.dateTextFormat),r=s("%1$s %3$s %2$s",n,o,this.dateTextSeparator);this.set("checkin",moment(e).format("YYYY-MM-DD")),this.set("checkout",moment(t).format("YYYY-MM-DD")),this._createEvent("setDates",{start:e,end:t,text:r});var i=this.formEl.querySelector(".group-dates");i&&(i.querySelector(".group-text").innerHTML=r)}}},{key:"setCapacity",value:function(e,t,n){var o=t+n,r=s(l("%s room","%s rooms",e,"verandagroup"),e),i=s(l("%s guest","%s guests",o,"verandagroup"),o),a=s("%1$s, %2$s",r,i);this.set("numofroom",e),this.set("numofadult",t),this.set("numofchild",n);var c=this.formEl.querySelector(".group-capacity");c&&(c.querySelector(".group-text").textContent=a),this._createEvent("setCapacity",{numofroom:e,numofadult:t,numofchild:n,text:a})}},{key:"setCode",value:function(e){this.set("accesscode",e),this._createEvent("setCode",{code:e})}},{key:"setHiddenCode",value:function(e){this.hiddencode=e,this._createEvent("setHiddenCode",{code:e})}}]),e}(),f=function(e){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}(s,elementorModules.frontend.handlers.Base);var i,c,l=(i=s,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=o(i);if(c){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function s(){return r(this,s),l.apply(this,arguments)}return a(s,[{key:"onInit",value:function(){var e,t=".elementor-element-".concat(this.$element.data("id")),n=t+" .travelanium-reservation-form",o=t+" .date-easepick",r=this.getElementSettings(),i=r.attributes;if(i){var a=i.split("\n");e={},a.forEach((function(t){var n=t.split(":");e[n[0]]=n[1]}))}var c,l,s=new d(n,{hiddenCode:r.hidden_accesscode,additionalParams:e}),f=moment().add(r.default_checkinauto,"d").toDate(),m=moment(f).add(r.default_numofnight,"d").toDate();if("1"===r.show_dates_field){var p,h=new easepick.create({element:o,css:["https://cdn.jsdelivr.net/npm/@easepick/[email protected]/dist/index.min.css",window.TravelaniumElementor.plugin_uri+"/modules/reservation-form/build/custom-easepick.css"],plugins:["RangePlugin","LockPlugin"],firstDay:0,lang:null!==(p=document.documentElement.lang.substring(0,2))&&void 0!==p?p:"en",RangePlugin:{tooltip:!0,repick:!1,locale:{one:u("night","verandagroup"),other:u("nights","verandagroup")},tooltipNumber:function(e){return e-1}},LockPlugin:{minDate:new Date,minDays:2},inline:!0,zIndex:99,setup:function(e){var t,n=null!==(t=r.picker_accent_color)&&void 0!==t?t:"#333333",o=new CSSStyleSheet;o.replaceSync("\n            :host {\n              --primary-color: ".concat(n,";\n              --color-fg-accent: ").concat(n,";\n              --color-fg-primary: ").concat(n,";\n              --color-btn-primary-fg: ").concat(n,";\n              --color-btn-primary-border: ").concat(n,";\n              --color-btn-primary-hover-bg: ").concat(n,";\n              --color-btn-primary-hover-border: ").concat(n,";\n              --color-btn-primary-disabled-bg: ").concat(tinycolor(n).lighten(20).toString(),";\n              --color-btn-primary-disabled-border: ").concat(tinycolor(n).lighten(20).toString(),";\n              --color-bg-inrange: ").concat(tinycolor(n).setAlpha(.2),";\n            }\n          ")),e.ui.shadowRoot.adoptedStyleSheets=[o],e.on("select",(function(e){var t=e.detail,n=t.start,o=t.end;s.setDates(n,o),c.hide(),l.show()}))}}),v=this.$element[0].querySelector(".group-dates"),y=v.querySelector(".group-text"),g=v.querySelector(".group-dropdown");g.style.display="block",c=tippy(y,{content:g,allowHTML:!0,interactive:!0,trigger:"click",arrow:!1,theme:"light easepick",placement:"bottom-start",inlinePosition:!1,appendTo:document.querySelector(n)}),h.setDateRange(f,m)}if(s.setDates(f,m),s.setCapacity(r.default_numofroom,r.default_numofadult,r.default_numofchild),"1"===r.show_capacity_field){var b=this.$element[0].querySelector(".group-capacity"),S=b.querySelector(".group-text"),E=b.querySelector(".group-dropdown");E.style.display="block",l=tippy(S,{content:E,allowHTML:!0,interactive:!0,trigger:"click",arrow:!1,theme:"light reservation-form",placement:"bottom-start",inlinePosition:!1,appendTo:document.querySelector(n),onShow:function(e){var t=function(e){return parseInt(e)},n=e.popper,o=n.querySelector(".input-numofroom"),r=n.querySelector(".input-numofadult"),i=n.querySelector(".input-numofchild"),a=t(s.get("numofroom")),c=t(s.get("numofadult")),u=t(s.get("numofchild"));o.value=a,r.value=c,i.value=u,o.addEventListener("spinnerChange",(function(e){var n=t(e.detail.value);s.setCapacity(n,t(s.get("numofadult")),t(s.get("numofchild")))})),r.addEventListener("spinnerChange",(function(e){var n=t(e.detail.value);s.setCapacity(t(s.get("numofroom")),n,t(s.get("numofchild")))})),i.addEventListener("spinnerChange",(function(e){var n=t(e.detail.value);s.setCapacity(t(s.get("numofroom")),t(s.get("numofadult")),n)}))}})}}},{key:"onElementChange",value:function(e){}}]),s}();window.addEventListener("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/reservation-form.default",(function(e){elementorFrontend.elementsHandler.addHandler(f,{$element:e})}))}))})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.