@salla.sa/twilight-components 2.11.20 → 2.11.21
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-button_37.cjs.entry.js +2 -3
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +4 -5
- package/dist/collection/components/salla-slider/salla-slider.js +2 -2
- package/dist/components/salla-file-upload2.js +2 -3
- package/dist/components/salla-slider2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button_37.entry.js +2 -3
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-button_37.entry.js +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-5f625abf.entry.js +36 -0
- package/dist/twilight/p-5fc3f873.system.js +1 -1
- package/dist/twilight/{p-c46d9ddb.system.entry.js → p-a55496d9.system.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +4 -4
- package/dist/twilight/p-7182281b.entry.js +0 -36
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,h as i,H as e,g as n,c as o}from"./p-7dc66c07.js";import{a,c as r,g as s}from"./p-f84bae34.js";const l=class{constructor(i){t(this,i),this.hostAttributes={},this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after"}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host.querySelector("button").removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(t){return this.text.innerHTML=t,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),this.hostAttributes}button(){return i("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),i("span",{class:"s-button-text",ref:t=>this.text=t},i("slot",null)),this.loading?i("span",{class:"s-button-loader"}):"")}render(){var t;return(null===(t=this.host.closest(".swiper-slide"))||void 0===t?void 0:t.classList.contains("swiper-slide-duplicate"))?"":i(e,{class:"s-button-wrap"},this.href?i("a",{href:this.href},this.button()):this.button())}get host(){return n(this)}};l.style="";const c='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>cart</title>\n<path d="M15.426 28.084c0-1.412-0.85-2.684-2.156-3.226-1.305-0.54-2.807-0.241-3.805 0.758-0.999 0.998-1.298 2.5-0.758 3.805 0.54 1.303 1.815 2.155 3.226 2.155 1.928-0.003 3.49-1.564 3.492-3.492h0.001zM10.597 28.084h0.001c0-0.54 0.326-1.027 0.825-1.235 0.498-0.206 1.074-0.091 1.455 0.29 0.383 0.382 0.497 0.957 0.29 1.456-0.208 0.5-0.695 0.825-1.235 0.825-0.355 0-0.695-0.142-0.944-0.391-0.251-0.251-0.392-0.591-0.392-0.946h-0.001l0.001 0.001zM28.23 28.084c0-1.412-0.85-2.684-2.155-3.226-1.305-0.54-2.807-0.241-3.806 0.758s-1.297 2.5-0.756 3.805c0.54 1.303 1.813 2.155 3.226 2.155 1.927-0.003 3.49-1.564 3.491-3.492zM23.401 28.084c0-0.54 0.326-1.027 0.825-1.235 0.5-0.206 1.075-0.091 1.457 0.29s0.497 0.957 0.289 1.456c-0.206 0.5-0.693 0.825-1.233 0.825-0.738 0-1.337-0.599-1.337-1.337l-0.001 0.001zM1.953 0.234l-0.342-0.059c-0.29-0.064-0.594-0.004-0.839 0.166-0.247 0.169-0.414 0.436-0.463 0.734-0.050 0.3 0.023 0.607 0.201 0.85s0.444 0.402 0.738 0.44l0.341 0.059c1.825 0.324 3.248 1.794 3.548 3.662l1.981 12.369h-0.001c0.218 1.387 0.913 2.651 1.96 3.563s2.379 1.412 3.754 1.41h14.242c0.601 0 1.088-0.498 1.088-1.112s-0.487-1.112-1.088-1.112h-14.242c-1.679-0.001-3.139-1.183-3.525-2.854h11.463c1.614 0.004 3.188-0.518 4.493-1.49 1.305-0.973 2.271-2.346 2.762-3.918l1.298-4.136c0.145-0.455 0.065-0.953-0.213-1.336-0.278-0.385-0.72-0.608-1.187-0.602h-20.467l-0.181-1.141c-0.218-1.367-0.849-2.631-1.802-3.615-0.954-0.983-2.184-1.64-3.518-1.878h-0.001zM26.946 9.096l-0.993 3.169v-0.001c-0.353 1.122-1.044 2.101-1.975 2.796s-2.056 1.067-3.208 1.067h-11.833l-1.125-7.042 19.134 0.011z"></path>\n</svg>\n';var p={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},u={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},h=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],d={CSS:{},springs:{}};function f(t,i,e){return Math.min(Math.max(t,i),e)}function g(t,i){return t.indexOf(i)>-1}function _(t,i){return t.apply(null,i)}var m={arr:function(t){return Array.isArray(t)},obj:function(t){return g(Object.prototype.toString.call(t),"Object")},pth:function(t){return m.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||m.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return m.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return m.hex(t)||m.rgb(t)||m.hsl(t)},key:function(t){return!p.hasOwnProperty(t)&&!u.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function v(t){var i=/\(([^)]+)\)/.exec(t);return i?i[1].split(",").map((function(t){return parseFloat(t)})):[]}function b(t,i){var e=v(t),n=f(m.und(e[0])?1:e[0],.1,100),o=f(m.und(e[1])?100:e[1],.1,100),a=f(m.und(e[2])?10:e[2],.1,100),r=f(m.und(e[3])?0:e[3],.1,100),s=Math.sqrt(o/n),l=a/(2*Math.sqrt(o*n)),c=l<1?s*Math.sqrt(1-l*l):0,p=l<1?(l*s-r)/c:-r+s;function u(t){var e=i?i*t/1e3:t;return e=l<1?Math.exp(-e*l*s)*(1*Math.cos(c*e)+p*Math.sin(c*e)):(1+p*e)*Math.exp(-e*s),0===t||1===t?t:1-e}return i?u:function(){var i=d.springs[t];if(i)return i;for(var e=1/6,n=0,o=0;;)if(1===u(n+=e)){if(++o>=16)break}else o=0;var a=n*e*1e3;return d.springs[t]=a,a}}function x(t){return void 0===t&&(t=10),function(i){return Math.ceil(f(i,1e-6,1)*t)*(1/t)}}var w,y,k=function(){var t=.1;function i(t,i){return 1-3*i+3*t}function e(t,i){return 3*i-6*t}function n(t){return 3*t}function o(t,o,a){return((i(o,a)*t+e(o,a))*t+n(o))*t}function a(t,o,a){return 3*i(o,a)*t*t+2*e(o,a)*t+n(o)}return function(i,e,n,r){if(0<=i&&i<=1&&0<=n&&n<=1){var s=new Float32Array(11);if(i!==e||n!==r)for(var l=0;l<11;++l)s[l]=o(l*t,i,n);return function(l){return i===e&&n===r||0===l||1===l?l:o(function(e){for(var r=0,l=1;10!==l&&s[l]<=e;++l)r+=t;--l;var c=r+(e-s[l])/(s[l+1]-s[l])*t,p=a(c,i,n);return p>=.001?function(t,i,e,n){for(var r=0;r<4;++r){var s=a(i,e,n);if(0===s)return i;i-=(o(i,e,n)-t)/s}return i}(e,c,i,n):0===p?c:function(t,i,e,n,a){var r,s,l=0;do{(r=o(s=i+(e-i)/2,n,a)-t)>0?e=s:i=s}while(Math.abs(r)>1e-7&&++l<10);return s}(e,r,r+t,i,n)}(l),e,r)}}}}(),E=(w={linear:function(){return function(t){return t}}},y={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var i,e=4;t<((i=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*i-2)/22-t,2)}},Elastic:function(t,i){void 0===t&&(t=1),void 0===i&&(i=.5);var e=f(t,1,10),n=f(i,.1,2);return function(t){return 0===t||1===t?t:-e*Math.pow(2,10*(t-1))*Math.sin((t-1-n/(2*Math.PI)*Math.asin(1/e))*(2*Math.PI)/n)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,i){y[t]=function(){return function(t){return Math.pow(t,i+2)}}})),Object.keys(y).forEach((function(t){var i=y[t];w["easeIn"+t]=i,w["easeOut"+t]=function(t,e){return function(n){return 1-i(t,e)(1-n)}},w["easeInOut"+t]=function(t,e){return function(n){return n<.5?i(t,e)(2*n)/2:1-i(t,e)(-2*n+2)/2}},w["easeOutIn"+t]=function(t,e){return function(n){return n<.5?(1-i(t,e)(1-2*n))/2:(i(t,e)(2*n-1)+1)/2}}})),w);function T(t,i){if(m.fnc(t))return t;var e=t.split("(")[0],n=E[e],o=v(t);switch(e){case"spring":return b(t,i);case"cubicBezier":return _(k,o);case"steps":return _(x,o);default:return _(n,o)}}function I(t){try{return document.querySelectorAll(t)}catch(t){return}}function A(t,i){for(var e=t.length,n=arguments.length>=2?arguments[1]:void 0,o=[],a=0;a<e;a++)if(a in t){var r=t[a];i.call(n,r,a,t)&&o.push(r)}return o}function M(t){return t.reduce((function(t,i){return t.concat(m.arr(i)?M(i):i)}),[])}function D(t){return m.arr(t)?t:(m.str(t)&&(t=I(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function R(t,i){return t.some((function(t){return t===i}))}function O(t){var i={};for(var e in t)i[e]=t[e];return i}function S(t,i){var e=O(t);for(var n in t)e[n]=i.hasOwnProperty(n)?i[n]:t[n];return e}function L(t,i){var e=O(t);for(var n in i)e[n]=m.und(t[n])?i[n]:t[n];return e}function C(t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(i)return i[1]}function P(t,i){return m.fnc(t)?t(i.target,i.id,i.total):t}function G(t,i){return t.getAttribute(i)}function z(t,i,e){if(R([e,"deg","rad","turn"],C(i)))return i;var n=d.CSS[i+e];if(!m.und(n))return n;var o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=100+e;var r=100/o.offsetWidth;a.removeChild(o);var s=r*parseFloat(i);return d.CSS[i+e]=s,s}function N(t,i,e){if(i in t.style){var n=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=t.style[i]||getComputedStyle(t).getPropertyValue(n)||"0";return e?z(t,o,e):o}}function B(t,i){return m.dom(t)&&!m.inp(t)&&(!m.nil(G(t,i))||m.svg(t)&&t[i])?"attribute":m.dom(t)&&R(h,i)?"transform":m.dom(t)&&"transform"!==i&&N(t,i)?"css":null!=t[i]?"object":void 0}function F(t){if(m.dom(t)){for(var i,e=t.style.transform||"",n=/(\w+)\(([^)]*)\)/g,o=new Map;i=n.exec(e);)o.set(i[1],i[2]);return o}}function U(t,i,e,n){switch(B(t,i)){case"transform":return function(t,i,e,n){var o=g(i,"scale")?1:0+function(t){return g(t,"translate")||"perspective"===t?"px":g(t,"rotate")||g(t,"skew")?"deg":void 0}(i),a=F(t).get(i)||o;return e&&(e.transforms.list.set(i,a),e.transforms.last=i),n?z(t,a,n):a}(t,i,n,e);case"css":return N(t,i,e);case"attribute":return G(t,i);default:return t[i]||0}}function j(t,i){var e=/^(\*=|\+=|-=)/.exec(t);if(!e)return t;var n=C(t)||0,o=parseFloat(i),a=parseFloat(t.replace(e[0],""));switch(e[0][0]){case"+":return o+a+n;case"-":return o-a+n;case"*":return o*a+n}}function H(t,i){if(m.col(t))return function(t){return m.rgb(t)?(e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(i=t))?"rgba("+e[1]+",1)":i:m.hex(t)?function(t){var i=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,i,e,n){return i+i+e+e+n+n})),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);return"rgba("+parseInt(e[1],16)+","+parseInt(e[2],16)+","+parseInt(e[3],16)+",1)"}(t):m.hsl(t)?function(t){var i,e,n,o=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),a=parseInt(o[1],10)/360,r=parseInt(o[2],10)/100,s=parseInt(o[3],10)/100,l=o[4]||1;function c(t,i,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(i-t)*e:e<.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t}if(0==r)i=e=n=s;else{var p=s<.5?s*(1+r):s+r-s*r,u=2*s-p;i=c(u,p,a+1/3),e=c(u,p,a),n=c(u,p,a-1/3)}return"rgba("+255*i+","+255*e+","+255*n+","+l+")"}(t):void 0;var i,e}(t);if(/\s/g.test(t))return t;var e=C(t),n=e?t.substr(0,t.length-e.length):t;return i?n+i:n}function V(t,i){return Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))}function Y(t){for(var i,e=t.points,n=0,o=0;o<e.numberOfItems;o++){var a=e.getItem(o);o>0&&(n+=V(i,a)),i=a}return n}function W(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*G(t,"r")}(t);case"rect":return function(t){return 2*G(t,"width")+2*G(t,"height")}(t);case"line":return function(t){return V({x:G(t,"x1"),y:G(t,"y1")},{x:G(t,"x2"),y:G(t,"y2")})}(t);case"polyline":return Y(t);case"polygon":return function(t){var i=t.points;return Y(t)+V(i.getItem(i.numberOfItems-1),i.getItem(0))}(t)}}function q(t,i){var e=i||{},n=e.el||function(t){for(var i=t.parentNode;m.svg(i)&&m.svg(i.parentNode);)i=i.parentNode;return i}(t),o=n.getBoundingClientRect(),a=G(n,"viewBox"),r=o.width,s=o.height,l=e.viewBox||(a?a.split(" "):[0,0,r,s]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:r,h:s,vW:l[2],vH:l[3]}}function Z(t,i,e){function n(e){return void 0===e&&(e=0),t.el.getPointAtLength(i+e>=1?i+e:0)}var o=q(t.el,t.svg),a=n(),r=n(-1),s=n(1),l=e?1:o.w/o.vW,c=e?1:o.h/o.vH;switch(t.property){case"x":return(a.x-o.x)*l;case"y":return(a.y-o.y)*c;case"angle":return 180*Math.atan2(s.y-r.y,s.x-r.x)/Math.PI}}function $(t,i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=H(m.pth(t)?t.totalLength:t,i)+"";return{original:n,numbers:n.match(e)?n.match(e).map(Number):[0],strings:m.str(t)||i?n.split(e):[]}}function X(t){return A(t?M(m.arr(t)?t.map(D):D(t)):[],(function(t,i,e){return e.indexOf(t)===i}))}function K(t){var i=X(t);return i.map((function(t,e){return{target:t,id:e,total:i.length,transforms:{list:F(t)}}}))}function Q(t,i){var e=O(i);if(/^spring/.test(e.easing)&&(e.duration=b(e.easing)),m.arr(t)){var n=t.length;2!==n||m.obj(t[0])?m.fnc(i.duration)||(e.duration=i.duration/n):t={value:t}}var o=m.arr(t)?t:[t];return o.map((function(t,e){var n=m.obj(t)&&!m.pth(t)?t:{value:t};return m.und(n.delay)&&(n.delay=e?0:i.delay),m.und(n.endDelay)&&(n.endDelay=e===o.length-1?i.endDelay:0),n})).map((function(t){return L(t,e)}))}var J={css:function(t,i,e){return t.style[i]=e},attribute:function(t,i,e){return t.setAttribute(i,e)},object:function(t,i,e){return t[i]=e},transform:function(t,i,e,n,o){if(n.list.set(i,e),i===n.last||o){var a="";n.list.forEach((function(t,i){a+=i+"("+t+") "})),t.style.transform=a}}};function tt(t,i){K(t).forEach((function(t){for(var e in i){var n=P(i[e],t),o=t.target,a=C(n),r=U(o,e,a,t),s=j(H(n,a||C(r)),r),l=B(o,e);J[l](o,e,s,t.transforms,!0)}}))}function it(t,i){return A(M(t.map((function(t){return i.map((function(i){return function(t,i){var e=B(t.target,i.name);if(e){var n=function(t,i){var e;return t.tweens.map((function(n){var o=function(t,i){var e={};for(var n in t){var o=P(t[n],i);m.arr(o)&&1===(o=o.map((function(t){return P(t,i)}))).length&&(o=o[0]),e[n]=o}return e.duration=parseFloat(e.duration),e.delay=parseFloat(e.delay),e}(n,i),a=o.value,r=m.arr(a)?a[1]:a,s=C(r),l=U(i.target,t.name,s,i),c=e?e.to.original:l,p=m.arr(a)?a[0]:c,u=C(p)||C(l),h=s||u;return m.und(r)&&(r=c),o.from=$(p,h),o.to=$(j(r,p),h),o.start=e?e.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=T(o.easing,o.duration),o.isPath=m.pth(a),o.isPathTargetInsideSVG=o.isPath&&m.svg(i.target),o.isColor=m.col(o.from.original),o.isColor&&(o.round=1),e=o,o}))}(i,t),o=n[n.length-1];return{type:e,property:i.name,animatable:t,tweens:n,duration:o.end,delay:n[0].delay,endDelay:o.endDelay}}}(t,i)}))}))),(function(t){return!m.und(t)}))}function et(t,i){var e=t.length,n=function(t){return t.timelineOffset?t.timelineOffset:0},o={};return o.duration=e?Math.max.apply(Math,t.map((function(t){return n(t)+t.duration}))):i.duration,o.delay=e?Math.min.apply(Math,t.map((function(t){return n(t)+t.delay}))):i.delay,o.endDelay=e?o.duration-Math.max.apply(Math,t.map((function(t){return n(t)+t.duration-t.endDelay}))):i.endDelay,o}var nt=0,ot=[],at=function(){var t;function i(e){for(var n=ot.length,o=0;o<n;){var a=ot[o];a.paused?(ot.splice(o,1),n--):(a.tick(e),o++)}t=o>0?requestAnimationFrame(i):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){st.suspendWhenDocumentHidden&&(rt()?t=cancelAnimationFrame(t):(ot.forEach((function(t){return t._onDocumentVisibility()})),at()))})),function(){t||rt()&&st.suspendWhenDocumentHidden||!(ot.length>0)||(t=requestAnimationFrame(i))}}();function rt(){return!!document&&document.hidden}function st(t){void 0===t&&(t={});var i,e=0,n=0,o=0,a=0,r=null;function s(t){var i=window.Promise&&new Promise((function(t){return r=t}));return t.finished=i,i}var l=function(t){var i=S(p,t),e=S(u,t),n=function(t,i){var e=[],n=i.keyframes;for(var o in n&&(i=L(function(t){for(var i=A(M(t.map((function(t){return Object.keys(t)}))),(function(t){return m.key(t)})).reduce((function(t,i){return t.indexOf(i)<0&&t.push(i),t}),[]),e={},n=function(n){var o=i[n];e[o]=t.map((function(t){var i={};for(var e in t)m.key(e)?e==o&&(i.value=t[e]):i[e]=t[e];return i}))},o=0;o<i.length;o++)n(o);return e}(n),i)),i)m.key(o)&&e.push({name:o,tweens:Q(i[o],t)});return e}(e,t),o=K(t.targets),a=it(o,n),r=et(a,e),s=nt;return nt++,L(i,{id:s,children:[],animatables:o,animations:a,duration:r.duration,delay:r.delay,endDelay:r.endDelay})}(t);function c(){var t=l.direction;"alternate"!==t&&(l.direction="normal"!==t?"normal":"reverse"),l.reversed=!l.reversed,i.forEach((function(t){return t.reversed=l.reversed}))}function h(t){return l.reversed?l.duration-t:t}function d(){e=0,n=h(l.currentTime)*(1/st.speed)}function g(t,i){i&&i.seek(t-i.timelineOffset)}function _(t){for(var i=0,e=l.animations,n=e.length;i<n;){var o=e[i],a=o.animatable,r=o.tweens,s=r.length-1,c=r[s];s&&(c=A(r,(function(i){return t<i.end}))[0]||c);for(var p=f(t-c.start-c.delay,0,c.duration)/c.duration,u=isNaN(p)?1:c.easing(p),h=c.to.strings,d=c.round,g=[],_=c.to.numbers.length,m=void 0,v=0;v<_;v++){var b=void 0,x=c.to.numbers[v],w=c.from.numbers[v]||0;b=c.isPath?Z(c.value,u*x,c.isPathTargetInsideSVG):w+u*(x-w),d&&(c.isColor&&v>2||(b=Math.round(b*d)/d)),g.push(b)}var y=h.length;if(y){m=h[0];for(var k=0;k<y;k++){var E=h[k+1],T=g[k];isNaN(T)||(m+=E?T+E:T+" ")}}else m=g[0];J[o.type](a.target,o.property,m,a.transforms),o.currentValue=m,i++}}function v(t){l[t]&&!l.passThrough&&l[t](l)}function b(t){var p=l.duration,u=l.delay,d=p-l.endDelay,m=h(t);l.progress=f(m/p*100,0,100),l.reversePlayback=m<l.currentTime,i&&function(t){if(l.reversePlayback)for(var e=a;e--;)g(t,i[e]);else for(var n=0;n<a;n++)g(t,i[n])}(m),!l.began&&l.currentTime>0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),m<=u&&0!==l.currentTime&&_(0),(m>=d&&l.currentTime!==p||!p)&&_(p),m>u&&m<d?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),_(m)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=f(m,0,p),l.began&&v("update"),t>=p&&(n=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(e=o,v("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&c()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(r(),s(l)))))}return s(l),l.reset=function(){var t=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===t,l.remaining=l.loop;for(var e=a=(i=l.children).length;e--;)l.children[e].reset();(l.reversed&&!0!==l.loop||"alternate"===t&&1===l.loop)&&l.remaining++,_(l.reversed?l.duration:0)},l._onDocumentVisibility=d,l.set=function(t,i){return tt(t,i),l},l.tick=function(t){o=t,e||(e=o),b((o+(n-e))*st.speed)},l.seek=function(t){b(h(t))},l.pause=function(){l.paused=!0,d()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,ot.push(l),d(),at())},l.reverse=function(){c(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.remove=function(t){ct(X(t),l)},l.reset(),l.autoplay&&l.play(),l}function lt(t,i){for(var e=i.length;e--;)R(t,i[e].animatable.target)&&i.splice(e,1)}function ct(t,i){var e=i.animations,n=i.children;lt(t,e);for(var o=n.length;o--;){var a=n[o],r=a.animations;lt(t,r),r.length||a.children.length||n.splice(o,1)}e.length||n.length||i.pause()}st.version="3.2.1",st.speed=1,st.suspendWhenDocumentHidden=!0,st.running=ot,st.remove=function(t){for(var i=X(t),e=ot.length;e--;)ct(i,ot[e])},st.get=U,st.set=tt,st.convertPx=z,st.path=function(t,i){var e=m.str(t)?I(t)[0]:t,n=i||100;return function(t){return{property:t,el:e,svg:q(e),totalLength:W(e)*(n/100)}}},st.setDashoffset=function(t){var i=W(t);return t.setAttribute("stroke-dasharray",i),i},st.stagger=function(t,i){void 0===i&&(i={});var e=i.direction||"normal",n=i.easing?T(i.easing):null,o=i.grid,a=i.axis,r=i.from||0,s="first"===r,l="center"===r,c="last"===r,p=m.arr(t),u=p?parseFloat(t[0]):parseFloat(t),h=p?parseFloat(t[1]):0,d=C(p?t[1]:t)||0,f=i.start||0+(p?u:0),g=[],_=0;return function(t,i,m){if(s&&(r=0),l&&(r=(m-1)/2),c&&(r=m-1),!g.length){for(var v=0;v<m;v++){if(o){var b=l?(o[0]-1)/2:r%o[0],x=l?(o[1]-1)/2:Math.floor(r/o[0]),w=b-v%o[0],y=x-Math.floor(v/o[0]),k=Math.sqrt(w*w+y*y);"x"===a&&(k=-w),"y"===a&&(k=-y),g.push(k)}else g.push(Math.abs(r-v));_=Math.max.apply(Math,g)}n&&(g=g.map((function(t){return n(t/_)*_}))),"reverse"===e&&(g=g.map((function(t){return a?t<0?-1*t:-t:Math.abs(_-t)})))}return f+(p?(h-u)/_:u)*(Math.round(100*g[i])/100)+d}},st.timeline=function(t){void 0===t&&(t={});var i=st(t);return i.duration=0,i.add=function(e,n){var o=ot.indexOf(i),a=i.children;function r(t){t.passThrough=!0}o>-1&&ot.splice(o,1);for(var s=0;s<a.length;s++)r(a[s]);var l=L(e,S(u,t));l.targets=l.targets||t.targets;var c=i.duration;l.autoplay=!1,l.direction=i.direction,l.timelineOffset=m.und(n)?c:j(n,c),r(i),i.seek(l.timelineOffset);var p=st(l);r(p),a.push(p);var h=et(a,t);return i.delay=h.delay,i.endDelay=h.endDelay,i.duration=h.duration,i.seek(0),i.reset(),i.autoplay&&i.play(),i},i},st.easing=T,st.penner=E,st.random=function(t,i){return Math.floor(Math.random()*(i-t+1))+t};const pt=class{constructor(i){t(this,i),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!(null==t?void 0:t.src))return void salla.log("Failed to get the img element");let i=this.host.querySelector("#s-cart-icon"),e=i.getBoundingClientRect(),n=e.top+window.scrollY,o=e.left+window.scrollX,a=t.getBoundingClientRect(),r=t.offsetWidth+"px",s=t.offsetHeight+"px",l=a.top,c=a.left,p=document.createElement("img");p.src=t.getAttribute("src"),p.className="s-cart-thumb",p.setAttribute("style","object-fit:cover; width:"+r+"; height:"+s+"; top:"+l+"px; left:"+c+"px;z-index:99999999; "),document.body.append(p);let u=document.querySelector(".s-cart-thumb");i.classList.remove("animated","rubberBand"),(new st.timeline).add({targets:u,width:[150,30],height:[150,30],top:[l,window.scrollY>0?n-window.scrollY-40:n-40],left:[c,o],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:u,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?n-window.scrollY-40:n-40,window.scrollY>0?n-window.scrollY+10:n+10],left:[o,o+10]},"-=500").add({complete:function(){i.classList.add("animated","rubberBand"),u.remove()}},"-=1700")}render(){return i(e,null,i("a",{class:"s-cart-summary-wrapper",href:salla.url.get("cart")},i("div",{id:"s-cart-icon"},i("slot",{name:"icon"},i("i",{class:"s-cart-summary-icon",innerHTML:c}))),i("span",{class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),i("b",{class:"s-cart-summary-total"},salla.money(this.cartSummaryTotal))))}get host(){return n(this)}};pt.style="";
|
|
5
|
+
/*!
|
|
6
|
+
* vanilla-picker v2.12.1
|
|
7
|
+
* https://vanilla-picker.js.org
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
10
|
+
* Released under the ISC license.
|
|
11
|
+
*/
|
|
12
|
+
var ut=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},ht=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(i,e,n){return e&&t(i.prototype,e),n&&t(i,n),i}}(),dt=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var e=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(e.push(r.value),!i||e.length!==i);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return e}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,i){for(var e=this;e.length<t;)e=i+e;return e};var ft={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function gt(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=i>0?t.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):t.toString();return e||"0"}var _t=function(){function t(i,e,n,o){ut(this,t);var a=this;if(void 0===i);else if(Array.isArray(i))this.rgba=i;else if(void 0===n){var r=i&&""+i;r&&function(i){if(i.startsWith("hsl")){var e=i.match(/([\-\d\.e]+)/g).map(Number),n=dt(e,4),o=n[0],r=n[1],s=n[2],l=n[3];void 0===l&&(l=1),a.hsla=[o/=360,r/=100,s/=100,l]}else if(i.startsWith("rgb")){var c=i.match(/([\-\d\.e]+)/g).map(Number),p=dt(c,4),u=p[3];void 0===u&&(u=1),a.rgba=[p[0],p[1],p[2],u]}else a.rgba=i.startsWith("#")?t.hexToRgb(i):t.nameToRgb(i)||t.hexToRgb(i)}(r.toLowerCase())}else this.rgba=[i,e,n,void 0===o?1:o]}return ht(t,[{key:"printRGB",value:function(t){var i=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,i){return gt(t,3===i?3:0)}));return t?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(t){var i=[360,100,100,1],e=["","%","%",""],n=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,n){return gt(t*i[n],3===n?3:1)+e[n]}));return t?"hsla("+n+")":"hsl("+n+")"}},{key:"printHex",value:function(t){var i=this.hex;return t?i:i.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,i){return i<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(i){this.rgba=t.hexToRgb(i)}}],[{key:"hexToRgb",value:function(t){var i=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!i.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var e=i.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return e[3]=e[3]/255,e}},{key:"nameToRgb",value:function(i){var e=i.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),n=ft[e];return void 0===n?n:t.hexToRgb(n.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var i=dt(t,4),e=i[0],n=i[1],o=i[2],a=i[3];e/=255,n/=255,o/=255;var r=Math.max(e,n,o),s=Math.min(e,n,o),l=void 0,c=void 0,p=(r+s)/2;if(r===s)l=c=0;else{var u=r-s;switch(c=p>.5?u/(2-r-s):u/(r+s),r){case e:l=(n-o)/u+(n<o?6:0);break;case n:l=(o-e)/u+2;break;case o:l=(e-n)/u+4}l/=6}return[l,c,p,a]}},{key:"hslToRgb",value:function(t){var i=dt(t,4),e=i[0],n=i[1],o=i[2],a=i[3],r=void 0,s=void 0,l=void 0;if(0===n)r=s=l=o;else{var c=function(t,i,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(i-t)*e:e<.5?i:e<2/3?t+(i-t)*(2/3-e)*6:t},p=o<.5?o*(1+n):o+n-o*n,u=2*o-p;r=c(u,p,e+1/3),s=c(u,p,e),l=c(u,p,e-1/3)}var h=[255*r,255*s,255*l].map(Math.round);return h[3]=a,h}}]),t}(),mt=function(){function t(){ut(this,t),this._events=[]}return ht(t,[{key:"add",value:function(t,i,e){t.addEventListener(i,e,!1),this._events.push({target:t,type:i,handler:e})}},{key:"remove",value:function(i,e,n){this._events=this._events.filter((function(o){var a=!0;return i&&i!==o.target&&(a=!1),e&&e!==o.type&&(a=!1),n&&n!==o.handler&&(a=!1),a&&t._doRemove(o.target,o.type,o.handler),!a}))}},{key:"destroy",value:function(){this._events.forEach((function(i){return t._doRemove(i.target,i.type,i.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,i,e){t.removeEventListener(i,e,!1)}}]),t}();function vt(t,i,e){var n=!1;function o(t,i,e){return Math.max(i,Math.min(t,e))}function a(t,a,r){if(r&&(n=!0),n){t.preventDefault();var s=i.getBoundingClientRect(),l=s.width,c=s.height,p=a.clientY,u=o(a.clientX-s.left,0,l),h=o(p-s.top,0,c);e(u/l,h/c)}}function r(t,i){1===(void 0===t.buttons?t.which:t.buttons)?a(t,t,i):n=!1}function s(t,i){1===t.touches.length?a(t,t.touches[0],i):n=!1}t.add(i,"mousedown",(function(t){r(t,!0)})),t.add(i,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",r),t.add(i,"touchmove",s),t.add(window,"mouseup",(function(){n=!1})),t.add(i,"touchend",(function(){n=!1})),t.add(i,"touchcancel",(function(){n=!1}))}function bt(t,i){return(i||document).querySelector(t)}function xt(t){t.preventDefault(),t.stopPropagation()}function wt(t,i,e,n,o){t.add(i,"keydown",(function(t){e.indexOf(t.key)>=0&&(o&&xt(t),n(t))}))}var yt=function(){function t(i){ut(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new mt,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(i)}return ht(t,[{key:"setOptions",value:function(t){var i=this;if(t){var e=this.settings;if(t instanceof HTMLElement)e.parent=t;else{e.parent&&t.parent&&e.parent!==t.parent&&(this._events.remove(e.parent),this._popupInited=!1),function(t,i){for(var e in t)i[e]=t[e]}(t,e),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var n=t.color||t.colour;n&&this._setColor(n)}var o=e.parent;if(o&&e.popup&&!this._popupInited){var a=function(t){return i.openHandler(t)};this._events.add(o,"click",a),wt(this._events,o,[" ","Spacebar","Enter"],a),this._popupInited=!0}else t.parent&&!e.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var i=t&&"keydown"===t.type?this._domEdit:this.domElement;setTimeout((function(){return i.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var i=t&&t.type,e=!1;t?"mousedown"===i||"focusin"===i?t.timeStamp>(this.__containedEvent||0)+100&&(e=!0):(xt(t),e=!0):e=!0,e&&this.hide()&&(this.settings.parent.style.pointerEvents="","mousedown"!==i&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,i){this.closeHandler(),this.setOptions(t),i&&this.openHandler()}},{key:"setColor",value:function(t,i){this._setColor(t,{silent:i})}},{key:"_setColor",value:function(t,i){if("string"==typeof t&&(t=t.trim()),t){i=i||{};var e=void 0;try{e=new _t(t)}catch(t){if(i.failSilently)return;throw t}if(!this.settings.alpha){var n=e.hsla;n[3]=1,e.hsla=n}this.colour=this.color=e,this._setHSLA(null,null,null,null,i)}}},{key:"setColour",value:function(t,i){this.setColor(t,i)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var i,e,n=(i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',(e=document.createElement("div")).innerHTML=i,e.firstElementChild);return this.domElement=n,this._domH=bt(".picker_hue",n),this._domSL=bt(".picker_sl",n),this._domA=bt(".picker_alpha",n),this._domEdit=bt(".picker_editor input",n),this._domSample=bt(".picker_sample",n),this._domOkay=bt(".picker_done button",n),this._domCancel=bt(".picker_cancel button",n),n.classList.add("layout_"+this.settings.layout),this.settings.alpha||n.classList.add("no_alpha"),this.settings.editor||n.classList.add("no_editor"),this.settings.cancelButton||n.classList.add("no_cancel"),this._ifPopup((function(){return n.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,i=this,e=this.domElement,n=this._events;function o(t,i,e){n.add(t,i,e)}o(e,"click",(function(t){return t.preventDefault()})),vt(n,this._domH,(function(t){return i._setHSLA(t)})),vt(n,this._domSL,(function(t,e){return i._setHSLA(null,t,1-e)})),this.settings.alpha&&vt(n,this._domA,(function(t,e){return i._setHSLA(null,null,null,1-e)}));var a=this._domEdit;o(a,"input",(function(){i._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(a,"focus",(function(){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var i=function(i){return t.closeHandler(i)};o(window,"mousedown",i),o(window,"focusin",i),wt(n,e,["Esc","Escape"],i);var a=function(i){t.__containedEvent=i.timeStamp};o(e,"mousedown",a),o(e,"focusin",a),o(t._domCancel,"click",i)}));var r=function(i){t._ifPopup((function(){return t.closeHandler(i)})),t.onDone&&t.onDone(t.colour)};o(this._domOkay,"click",r),wt(n,e,["Enter"],r)}},{key:"_setPosition",value:function(){var t=this.settings.parent,i=this.domElement;t!==i.parentNode&&t.appendChild(i),this._ifPopup((function(e){"static"===getComputedStyle(t).position&&(t.style.position="relative");var n=!0===e?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===n?i.classList.add(t):i.classList.remove(t)})),i.classList.add(n)}))}},{key:"_setHSLA",value:function(t,i,e,n,o){o=o||{};var a=this.colour,r=a.hsla;[t,i,e,n].forEach((function(t,i){(t||0===t)&&(r[i]=t)})),a.hsla=r,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(a)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var i=this.colour,e=i.hsla,n="hsl("+360*e[0]+", 100%, 50%)",o=i.hslString,a=i.hslaString,r=this._domSL,s=this._domA,l=bt(".picker_selector",this._domH),c=bt(".picker_selector",r),p=bt(".picker_selector",s);g(0,l,e[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,g(0,c,e[1]),_(0,c,1-e[2]),r.style.color=o,_(0,p,1-e[3]);var u=o,h=u.replace("hsl","hsla").replace(")",", 0)");if(this._domA.style.background="linear-gradient("+[u,h]+"), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var d=this.settings.alpha,f=void 0;switch(this.settings.editorFormat){case"rgb":f=i.printRGB(d);break;case"hsl":f=i.printHSL(d);break;default:f=i.printHex(d)}this._domEdit.value=f}this._domSample.style.color=a}function g(t,i,e){i.style.left=100*e+"%"}function _(t,i,e){i.style.top=100*e+"%"}}},{key:"_ifPopup",value:function(t,i){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):i&&i()}},{key:"_toggleDOM",value:function(t){var i=this.domElement;if(!i)return!1;var e=t?"":"none",n=i.style.display!==e;return n&&(i.style.display=e),n}}]),t}(),kt=document.createElement("style");kt.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(kt),yt.StyleElement=kt;const Et='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_down</title>\n<path d="M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z"></path>\n</svg>\n',Tt=class{constructor(i){t(this,i),this.colorChanged=o(this,"colorChanged",7),this.submitted=o(this,"submitted",7),this.popupOpened=o(this,"popupOpened",7),this.popupClosed=o(this,"popupClosed",7),this.name="color",this.required=!1,this.color="#5dd5c4",this.format="hex",this.showCancelButton=!1,this.showTextField=!0,this.enableAlpha=!1}colorChangeHandler(t){this.colorInput.value=t.hex,this.colorChanged.emit(t)}submittedHandler(t){this.setColorValue(t.rgbaString,!0),this.canvas.style.backgroundColor=t.rgbString,this.colorInput.value=t.hex,this.colorInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.submitted.emit(t)}popupOpenedHandler(t){this.setPopIpPosition(),this.popupOpened.emit(t)}popupClosedHandler(t){this.popupClosed.emit(t)}async setPickerOption(t){this.picker.setOptions(t)}async movePopUp(t,i){this.picker.movePopup(t,i)}async setColorValue(t,i){this.picker.setColor(t,i)}async openPicker(){this.picker.show()}async closePicker(){this.picker.hide()}async destroyPicker(){this.picker.destroy()}componentDidLoad(){this.canvas.style.backgroundColor=this.color,this.initColorPicker()}setPopIpPosition(){const t=this.host.querySelector(".picker_wrapper"),i=this.host.querySelector(".s-color-picker-widget").getBoundingClientRect(),e=window.innerWidth/2-i.width/2,n=e>i.x,o=e<i.x,a=e===i.x,r=window.innerWidth<768;r&&n&&(t.style.left="0"),r&&o&&(t.style.left="auto"),(!r||r&&(!o&&!n||a))&&(t.style.left="-95px")}initColorPicker(){this.picker=new yt({parent:this.host,color:this.color,popup:"bottom",alpha:this.enableAlpha,editor:this.showTextField,editorFormat:this.format,cancelButton:this.showCancelButton,onChange:t=>this.colorChangeHandler(t),onDone:t=>this.submittedHandler(t),onOpen:t=>this.popupOpenedHandler(t),onClose:t=>this.popupClosedHandler(t)})}render(){return i(e,{class:"s-color-picker-main"},i("slot",{name:"widget"},i("div",{class:"s-color-picker-widget"},i("div",{class:"s-color-picker-widget-canvas",ref:t=>this.canvas=t}),i("span",{innerHTML:Et}))),i("input",{type:"hidden",name:this.name,required:this.required,value:this.color,ref:t=>this.colorInput=t}))}get host(){return n(this)}};Tt.style="";const It=class{constructor(i){t(this,i),this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit"),salla.lang.onLoaded((()=>{this.placeholder=salla.lang.get("blocks.comments.placeholder"),this.submitText=salla.lang.get("blocks.comments.submit")})),salla.onReady((()=>{this.canComment=salla.config.get("user.can_comment"),this.itemId=salla.config.get("page.id"),this.type=salla.url.is_page("page-single")?"page":"product"}))}submit(){this.commentForm.reportValidity()?this.submitBtn.load().then((()=>salla.comment.add({id:this.itemId,comment:this.commentField.value,type:this.type}))).finally((()=>this.submitBtn.stop)):salla.log("CommentForm:: validation error!")}render(){return i(e,null,this.canComment?i("form",{ref:t=>this.commentForm=t},i("div",{class:"s-comment-form-wrapper"},this.showAvatar?i("img",{class:"s-comment-form-avatar",src:salla.config.get("user.avatar"),alt:"user avatar"}):"",i("div",{class:"s-comment-form-content"},i("textarea",{cols:30,rows:5,minlength:"4",maxlength:"500",ref:t=>this.commentField=t,placeholder:this.placeholder,class:"s-comment-form-input",required:!0}),i("br",null),i("div",{class:"s-comment-form-action"},i("salla-button",{ref:t=>this.submitBtn=t,"loader-position":"center",onClick:()=>this.submit()},this.submitText))))):"")}};It.style=":host{display:block}";const At=class{constructor(i){t(this,i)}hideAllOptions(t){this.host.querySelectorAll(`[data-show-when^="options[${t}"]`).forEach((t=>{t.classList.add("hidden"),this.hideAllOptions(t.dataset.optionId),this.disableInputs(t)}))}disableInputs(t){t.querySelectorAll("[name]").forEach((t=>{var i;t.setAttribute("disabled",""),t.removeAttribute("required"),"select"===(null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase())&&(t.value=""),["checkbox"].includes(t.getAttribute("type"))&&t.hasOwnProperty("checked")&&(t.checked=!1)}))}changeHandler(t){var i;if(salla.event.emit("salla-onditional-fields::change",t),salla.log("Received the change event: ",t),!t.target||!["SELECT"].includes(t.target.tagName)&&!["checkbox"].includes(t.target.getAttribute("type")))return void salla.log("Ignore the change because is not support input: "+((null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.tagName)||"N/A"));let e=t.target.name.replace("[]",""),n="checkbox"===t.target.getAttribute("type");salla.log("Trying to find all the element with condition:",`[data-show-when^="${e}"]`),this.host.querySelectorAll(`[data-show-when^="${e}"]`).forEach((i=>{let e,o=!(null==i?void 0:i.dataset.showWhen.includes("!=")),a=null==i?void 0:i.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();e=n?Array.from(this.host.querySelectorAll(`input[name="${t.target.name}"]:checked`),(t=>null==t?void 0:t.value)).includes(a.toString()):a===t.target.value,salla.log("The input is ",n?"Multiple":"Single"," value:",e),o&&e||!o&&!e?(i.classList.remove("hidden"),i.querySelectorAll("[name]").forEach((t=>{t.removeAttribute("disabled"),!["checkbox"].includes(t.getAttribute("type"))&&i.getElementsByClassName("required").length&&t.setAttribute("required","")}))):(this.hideAllOptions(i.dataset.optionId),i.classList.add("hidden"),this.disableInputs(i))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((t=>{var i;let e=null===(i=null==t?void 0:t.dataset)||void 0===i?void 0:i.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();e&&this.changeHandler({target:this.host.querySelector('[name^="'+e+'"]')})}))}render(){return i(e,null,i("slot",null))}get host(){return n(this)}};var Mt=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Dt={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var i=new Date(t.getTime());i.setHours(0,0,0,0),i.setDate(i.getDate()+3-(i.getDay()+6)%7);var e=new Date(i.getFullYear(),0,4);return 1+Math.round(((i.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Rt={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var i=t%100;if(i>3&&i<21)return"th";switch(i%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ot=function(t,i){return void 0===i&&(i=2),("000"+t).slice(-1*i)},St=function(t){return!0===t?1:0};function Lt(t,i){var e;return function(){var n=this,o=arguments;clearTimeout(e),e=setTimeout((function(){return t.apply(n,o)}),i)}}var Ct=function(t){return t instanceof Array?t:[t]};function Pt(t,i,e){if(!0===e)return t.classList.add(i);t.classList.remove(i)}function Gt(t,i,e){var n=window.document.createElement(t);return e=e||"",n.className=i=i||"",void 0!==e&&(n.textContent=e),n}function zt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Nt(t,i){return i(t)?t:t.parentNode?Nt(t.parentNode,i):void 0}function Bt(t,i){var e=Gt("div","numInputWrapper"),n=Gt("input","numInput "+t),o=Gt("span","arrowUp"),a=Gt("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==i)for(var r in i)n.setAttribute(r,i[r]);return e.appendChild(n),e.appendChild(o),e.appendChild(a),e}function Ft(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(i){return t.target}}var Ut=function(){},jt=function(t,i,e){return e.months[i?"shorthand":"longhand"][t]},Ht={D:Ut,F:function(t,i,e){t.setMonth(e.months.longhand.indexOf(i))},G:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},H:function(t,i){t.setHours(parseFloat(i))},J:function(t,i){t.setDate(parseFloat(i))},K:function(t,i,e){t.setHours(t.getHours()%12+12*St(new RegExp(e.amPM[1],"i").test(i)))},M:function(t,i,e){t.setMonth(e.months.shorthand.indexOf(i))},S:function(t,i){t.setSeconds(parseFloat(i))},U:function(t,i){return new Date(1e3*parseFloat(i))},W:function(t,i,e){var n=parseInt(i),o=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+e.firstDayOfWeek),o},Y:function(t,i){t.setFullYear(parseFloat(i))},Z:function(t,i){return new Date(i)},d:function(t,i){t.setDate(parseFloat(i))},h:function(t,i){t.setHours((t.getHours()>=12?12:0)+parseFloat(i))},i:function(t,i){t.setMinutes(parseFloat(i))},j:function(t,i){t.setDate(parseFloat(i))},l:Ut,m:function(t,i){t.setMonth(parseFloat(i)-1)},n:function(t,i){t.setMonth(parseFloat(i)-1)},s:function(t,i){t.setSeconds(parseFloat(i))},u:function(t,i){return new Date(parseFloat(i))},w:Ut,y:function(t,i){t.setFullYear(2e3+parseFloat(i))}},Vt={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Yt={Z:function(t){return t.toISOString()},D:function(t,i,e){return i.weekdays.shorthand[Yt.w(t,i,e)]},F:function(t,i,e){return jt(Yt.n(t,i,e)-1,!1,i)},G:function(t,i,e){return Ot(Yt.h(t,i,e))},H:function(t){return Ot(t.getHours())},J:function(t,i){return void 0!==i.ordinal?t.getDate()+i.ordinal(t.getDate()):t.getDate()},K:function(t,i){return i.amPM[St(t.getHours()>11)]},M:function(t,i){return jt(t.getMonth(),!0,i)},S:function(t){return Ot(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,i,e){return e.getWeek(t)},Y:function(t){return Ot(t.getFullYear(),4)},d:function(t){return Ot(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Ot(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,i){return i.weekdays.longhand[t.getDay()]},m:function(t){return Ot(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Wt=function(t){var i=t.config,e=void 0===i?Dt:i,n=t.l10n,o=void 0===n?Rt:n,a=t.isMobile,r=void 0!==a&&a;return function(t,i,n){var a=n||o;return void 0===e.formatDate||r?i.split("").map((function(i,n,o){return Yt[i]&&"\\"!==o[n-1]?Yt[i](t,a,e):"\\"!==i?i:""})).join(""):e.formatDate(t,i,a)}},qt=function(t){var i=t.config,e=void 0===i?Dt:i,n=t.l10n,o=void 0===n?Rt:n;return function(t,i,n,a){if(0===t||t){var r,s=a||o,l=t;if(t instanceof Date)r=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)r=new Date(t);else if("string"==typeof t){var c=i||(e||Dt).dateFormat,p=String(t).trim();if("today"===p)r=new Date,n=!0;else if(e&&e.parseDate)r=e.parseDate(t,c);else if(/Z$/.test(p)||/GMT$/.test(p))r=new Date(t);else{for(var u=void 0,h=[],d=0,f=0,g="";d<c.length;d++){var _=c[d],m="\\"===_;if(Vt[_]&&"\\"!==c[d-1]&&!m){g+=Vt[_];var v=new RegExp(g).exec(t);v&&(u=!0)&&h["Y"!==_?"push":"unshift"]({fn:Ht[_],val:v[++f]})}else m||(g+=".")}r=e&&e.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),h.forEach((function(t){return r=(0,t.fn)(r,t.val,s)||r})),r=u?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===n&&r.setHours(0,0,0,0),r;e.errorHandler(new Error("Invalid date provided: "+l))}}};function Zt(t,i,e){return void 0===e&&(e=!0),!1!==e?new Date(t.getTime()).setHours(0,0,0,0)-new Date(i.getTime()).setHours(0,0,0,0):t.getTime()-i.getTime()}var $t=function(t,i,e){return 3600*t+60*i+e};function Xt(t){var i=t.defaultHour,e=t.defaultMinute,n=t.defaultSeconds;if(void 0!==t.minDate){var o=t.minDate.getHours(),a=t.minDate.getMinutes(),r=t.minDate.getSeconds();i<o&&(i=o),i===o&&e<a&&(e=a),i===o&&e===a&&n<r&&(n=t.minDate.getSeconds())}if(void 0!==t.maxDate){var s=t.maxDate.getHours(),l=t.maxDate.getMinutes();(i=Math.min(i,s))===s&&(e=Math.min(l,e)),i===s&&e===l&&(n=t.maxDate.getSeconds())}return{hours:i,minutes:e,seconds:n}}"function"!=typeof Object.assign&&(Object.assign=function(t){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var n=function(i){i&&Object.keys(i).forEach((function(e){return t[e]=i[e]}))},o=0,a=i;o<a.length;o++){var r=a[o];n(r)}return t});var Kt=function(){return(Kt=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var o in i=arguments[e])Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o]);return t}).apply(this,arguments)},Qt=function(){for(var t=0,i=0,e=arguments.length;i<e;i++)t+=arguments[i].length;var n=Array(t),o=0;for(i=0;i<e;i++)for(var a=arguments[i],r=0,s=a.length;r<s;r++,o++)n[o]=a[r];return n};function Jt(t,i){var e={config:Kt(Kt({},Dt),ii.defaultConfig),l10n:Rt};function n(){var t;return(null===(t=e.calendarContainer)||void 0===t?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(e)}function a(){var t=e.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==e.calendarContainer&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),void 0!==e.daysContainer){var i=(e.days.offsetWidth+1)*t.showMonths;e.daysContainer.style.width=i+"px",e.calendarContainer.style.width=i+(void 0!==e.weekWrapper?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}}))}function r(t){if(0===e.selectedDates.length){var i=void 0===e.config.minDate||Zt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),n=Xt(e.config);i.setHours(n.hours,n.minutes,n.seconds,i.getMilliseconds()),e.selectedDates=[i],e.latestSelectedDateObj=i}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var i="keydown"===t.type,n=Ft(t),o=n;void 0!==e.amPM&&n===e.amPM&&(e.amPM.textContent=e.l10n.amPM[St(e.amPM.textContent===e.l10n.amPM[0])]);var a=parseFloat(o.getAttribute("min")),r=parseFloat(o.getAttribute("max")),s=parseFloat(o.getAttribute("step")),l=parseInt(o.value,10),c=l+s*(t.delta||(i?38===t.which?1:-1:0));if(void 0!==o.value&&2===o.value.length){var p=o===e.hourElement,u=o===e.minuteElement;c<a?(c=r+c+St(!p)+(St(p)&&St(!e.amPM)),u&&g(void 0,-1,e.hourElement)):c>r&&(c=o===e.hourElement?c-r-St(!e.amPM):a,u&&g(void 0,1,e.hourElement)),e.amPM&&p&&(1===s?c+l===23:Math.abs(c-l)>s)&&(e.amPM.textContent=e.l10n.amPM[St(e.amPM.textContent===e.l10n.amPM[0])]),o.value=Ot(c)}}(t);var o=e._input.value;s(),J(),e._input.value!==o&&e._debouncedChange()}function s(){if(void 0!==e.hourElement&&void 0!==e.minuteElement){var t=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(e.minuteElement.value,10)||0)%60,n=void 0!==e.secondElement?(parseInt(e.secondElement.value,10)||0)%60:0;void 0!==e.amPM&&(t=t%12+12*St(e.amPM.textContent===e.l10n.amPM[1]));var o=void 0!==e.config.minTime||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&0===Zt(e.latestSelectedDateObj,e.config.minDate,!0),a=void 0!==e.config.maxTime||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&0===Zt(e.latestSelectedDateObj,e.config.maxDate,!0);if(void 0!==e.config.maxTime&&void 0!==e.config.minTime&&e.config.minTime>e.config.maxTime){var r=$t(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),s=$t(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),l=$t(t,i,n);if(l>s&&l<r){var p=function(t){var i=Math.floor(t/3600),e=(t-3600*i)/60;return[i,e,t-3600*i-60*e]}(r);t=p[0],i=p[1],n=p[2]}}else{if(a){var u=void 0!==e.config.maxTime?e.config.maxTime:e.config.maxDate;(t=Math.min(t,u.getHours()))===u.getHours()&&(i=Math.min(i,u.getMinutes())),i===u.getMinutes()&&(n=Math.min(n,u.getSeconds()))}if(o){var h=void 0!==e.config.minTime?e.config.minTime:e.config.minDate;(t=Math.max(t,h.getHours()))===h.getHours()&&i<h.getMinutes()&&(i=h.getMinutes()),i===h.getMinutes()&&(n=Math.max(n,h.getSeconds()))}}c(t,i,n)}}function l(t){var i=t||e.latestSelectedDateObj;i&&i instanceof Date&&c(i.getHours(),i.getMinutes(),i.getSeconds())}function c(t,i,n){void 0!==e.latestSelectedDateObj&&e.latestSelectedDateObj.setHours(t%24,i,n||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Ot(e.config.time_24hr?t:(12+t)%12+12*St(t%12==0)),e.minuteElement.value=Ot(i),void 0!==e.amPM&&(e.amPM.textContent=e.l10n.amPM[St(t>=12)]),void 0!==e.secondElement&&(e.secondElement.value=Ot(n)))}function p(t){var i=Ft(t),e=parseInt(i.value)+(t.delta||0);(e/1e3>1||"Enter"===t.key&&!/[^\d]/.test(e.toString()))&&R(e)}function u(t,i,n,o){return i instanceof Array?i.forEach((function(i){return u(t,i,n,o)})):t instanceof Array?t.forEach((function(t){return u(t,i,n,o)})):(t.addEventListener(i,n,o),void e._handlers.push({remove:function(){return t.removeEventListener(i,n,o)}}))}function h(){Z("onChange")}function d(t,i){var n=void 0!==t?e.parseDate(t):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),o=e.currentYear,a=e.currentMonth;try{void 0!==n&&(e.currentYear=n.getFullYear(),e.currentMonth=n.getMonth())}catch(t){t.message="Invalid date supplied: "+n,e.config.errorHandler(t)}i&&e.currentYear!==o&&(Z("onYearChange"),y()),!i||e.currentYear===o&&e.currentMonth===a||Z("onMonthChange"),e.redraw()}function f(t){var i=Ft(t);~i.className.indexOf("arrow")&&g(t,i.classList.contains("arrowUp")?1:-1)}function g(t,i,e){var n=t&&Ft(t),o=e||n&&n.parentNode&&n.parentNode.firstChild,a=$("increment");a.delta=i,o&&o.dispatchEvent(a)}function _(t,i,n,o){var a=O(i,!0),r=Gt("span",t,i.getDate().toString());return r.dateObj=i,r.$i=o,r.setAttribute("aria-label",e.formatDate(i,e.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===Zt(i,e.now)&&(e.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),a?(r.tabIndex=-1,X(i)&&(r.classList.add("selected"),e.selectedDateElem=r,"range"===e.config.mode&&(Pt(r,"startRange",e.selectedDates[0]&&0===Zt(i,e.selectedDates[0],!0)),Pt(r,"endRange",e.selectedDates[1]&&0===Zt(i,e.selectedDates[1],!0)),"nextMonthDay"===t&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===e.config.mode&&function(t){return!("range"!==e.config.mode||e.selectedDates.length<2)&&Zt(t,e.selectedDates[0])>=0&&Zt(t,e.selectedDates[1])<=0}(i)&&!X(i)&&r.classList.add("inRange"),e.weekNumbers&&1===e.config.showMonths&&"prevMonthDay"!==t&&o%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(i)+"</span>"),Z("onDayCreate",r),r}function m(t){t.focus(),"range"===e.config.mode&&P(t)}function v(t){for(var i=t>0?e.config.showMonths:-1,n=t>0?0:e.config.showMonths-1;n!=i;n+=t)for(var o=e.daysContainer.children[n],a=t>0?o.children.length:-1,r=t>0?0:o.children.length-1;r!=a;r+=t){var s=o.children[r];if(-1===s.className.indexOf("hidden")&&O(s.dateObj))return s}}function b(t,i){var o=n(),a=S(o||document.body),r=void 0!==t?t:a?o:void 0!==e.selectedDateElem&&S(e.selectedDateElem)?e.selectedDateElem:void 0!==e.todayDateElem&&S(e.todayDateElem)?e.todayDateElem:v(i>0?1:-1);void 0===r?e._input.focus():a?function(t,i){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():e.currentMonth,o=i>0?e.config.showMonths:-1,a=i>0?1:-1,r=n-e.currentMonth;r!=o;r+=a)for(var s=e.daysContainer.children[r],l=s.children.length,c=n-e.currentMonth===r?t.$i+i:i<0?s.children.length-1:0;c>=0&&c<l&&c!=(i>0?l:-1);c+=a){var p=s.children[c];if(-1===p.className.indexOf("hidden")&&O(p.dateObj)&&Math.abs(t.$i-c)>=Math.abs(i))return m(p)}e.changeMonth(a),b(v(a),0)}(r,i):m(r)}function x(t,i){for(var n=(new Date(t,i,1).getDay()-e.l10n.firstDayOfWeek+7)%7,o=e.utils.getDaysInMonth((i-1+12)%12,t),a=e.utils.getDaysInMonth(i,t),r=window.document.createDocumentFragment(),s=e.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",p=o+1-n,u=0;p<=o;p++,u++)r.appendChild(_("flatpickr-day "+l,new Date(t,i-1,p),0,u));for(p=1;p<=a;p++,u++)r.appendChild(_("flatpickr-day",new Date(t,i,p),0,u));for(var h=a+1;h<=42-n&&(1===e.config.showMonths||u%7!=0);h++,u++)r.appendChild(_("flatpickr-day "+c,new Date(t,i+1,h%a),0,u));var d=Gt("div","dayContainer");return d.appendChild(r),d}function w(){if(void 0!==e.daysContainer){zt(e.daysContainer),e.weekNumbers&&zt(e.weekNumbers);for(var t=document.createDocumentFragment(),i=0;i<e.config.showMonths;i++){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i),t.appendChild(x(n.getFullYear(),n.getMonth()))}e.daysContainer.appendChild(t),e.days=e.daysContainer.firstChild,"range"===e.config.mode&&1===e.selectedDates.length&&P()}}function y(){if(!(e.config.showMonths>1||"dropdown"!==e.config.monthSelectorType)){var t=function(t){return!(void 0!==e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&t<e.config.minDate.getMonth()||void 0!==e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()&&t>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++)if(t(i)){var n=Gt("option","flatpickr-monthDropdown-month");n.value=new Date(e.currentYear,i).getMonth().toString(),n.textContent=jt(i,e.config.shorthandCurrentMonth,e.l10n),n.tabIndex=-1,e.currentMonth===i&&(n.selected=!0),e.monthsDropdownContainer.appendChild(n)}}}function k(){var t,i=Gt("div","flatpickr-month"),n=window.document.createDocumentFragment();e.config.showMonths>1||"static"===e.config.monthSelectorType?t=Gt("span","cur-month"):(e.monthsDropdownContainer=Gt("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),u(e.monthsDropdownContainer,"change",(function(t){var i=Ft(t),n=parseInt(i.value,10);e.changeMonth(n-e.currentMonth),Z("onMonthChange")})),y(),t=e.monthsDropdownContainer);var o=Bt("cur-year",{tabindex:"-1"}),a=o.getElementsByTagName("input")[0];a.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&a.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(a.setAttribute("max",e.config.maxDate.getFullYear().toString()),a.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var r=Gt("div","flatpickr-current-month");return r.appendChild(t),r.appendChild(o),n.appendChild(r),i.appendChild(n),{container:i,yearElement:a,monthElement:t}}function E(){zt(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var t=e.config.showMonths;t--;){var i=k();e.yearElements.push(i.yearElement),e.monthElements.push(i.monthElement),e.monthNav.appendChild(i.container)}e.monthNav.appendChild(e.nextMonthNav)}function T(){e.weekdayContainer?zt(e.weekdayContainer):e.weekdayContainer=Gt("div","flatpickr-weekdays");for(var t=e.config.showMonths;t--;){var i=Gt("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(i)}return I(),e.weekdayContainer}function I(){if(e.weekdayContainer){var t=e.l10n.firstDayOfWeek,i=Qt(e.l10n.weekdays.shorthand);t>0&&t<i.length&&(i=Qt(i.splice(t,i.length),i.splice(0,t)));for(var n=e.config.showMonths;n--;)e.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+i.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function A(t,i){void 0===i&&(i=!0);var n=i?t:t-e.currentMonth;n<0&&!0===e._hidePrevMonthArrow||n>0&&!0===e._hideNextMonthArrow||(e.currentMonth+=n,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Z("onYearChange"),y()),w(),Z("onMonthChange"),K())}function M(t){return e.calendarContainer.contains(t)}function D(t){if(e.isOpen&&!e.config.inline){var i=Ft(t),n=M(i),o=!(i===e.input||i===e.altInput||e.element.contains(i)||t.path&&t.path.indexOf&&(~t.path.indexOf(e.input)||~t.path.indexOf(e.altInput))||n||M(t.relatedTarget)),a=!e.config.ignoredFocusElements.some((function(t){return t.contains(i)}));o&&a&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),void 0!==e.timeContainer&&void 0!==e.minuteElement&&void 0!==e.hourElement&&""!==e.input.value&&void 0!==e.input.value&&r(),e.close(),e.config&&"range"===e.config.mode&&1===e.selectedDates.length&&e.clear(!1))}}function R(t){if(!(!t||e.config.minDate&&t<e.config.minDate.getFullYear()||e.config.maxDate&&t>e.config.maxDate.getFullYear())){var i=e.currentYear!==t;e.currentYear=t||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),i&&(e.redraw(),Z("onYearChange"),y())}}function O(t,i){var n;void 0===i&&(i=!0);var o=e.parseDate(t,void 0,i);if(e.config.minDate&&o&&Zt(o,e.config.minDate,void 0!==i?i:!e.minDateHasTime)<0||e.config.maxDate&&o&&Zt(o,e.config.maxDate,void 0!==i?i:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&0===e.config.disable.length)return!0;if(void 0===o)return!1;for(var a=!!e.config.enable,r=null!==(n=e.config.enable)&&void 0!==n?n:e.config.disable,s=0,l=void 0;s<r.length;s++){if("function"==typeof(l=r[s])&&l(o))return a;if(l instanceof Date&&void 0!==o&&l.getTime()===o.getTime())return a;if("string"==typeof l){var c=e.parseDate(l,void 0,!0);return c&&c.getTime()===o.getTime()?a:!a}if("object"==typeof l&&void 0!==o&&l.from&&l.to&&o.getTime()>=l.from.getTime()&&o.getTime()<=l.to.getTime())return a}return!a}function S(t){return void 0!==e.daysContainer&&-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&e.daysContainer.contains(t)}function L(t){var i=t.target===e._input,n=e._input.value.trimEnd()!==Q();!i||!n||t.relatedTarget&&M(t.relatedTarget)||e.setDate(e._input.value,!0,t.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function C(i){var o=Ft(i),a=e.config.wrap?t.contains(o):o===e._input,l=e.config.allowInput,c=e.isOpen&&(!l||!a),p=e.config.inline&&a&&!l;if(13===i.keyCode&&a){if(l)return e.setDate(e._input.value,!0,o===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),o.blur();e.open()}else if(M(o)||c||p){var u=!!e.timeContainer&&e.timeContainer.contains(o);switch(i.keyCode){case 13:u?(i.preventDefault(),r(),j()):H(i);break;case 27:i.preventDefault(),j();break;case 8:case 46:a&&!e.config.allowInput&&(i.preventDefault(),e.clear());break;case 37:case 39:if(u||a)e.hourElement&&e.hourElement.focus();else{i.preventDefault();var h=n();if(void 0!==e.daysContainer&&(!1===l||h&&S(h))){var d=39===i.keyCode?1:-1;i.ctrlKey?(i.stopPropagation(),A(d),b(v(1),0)):b(void 0,d)}}break;case 38:case 40:i.preventDefault();var f=40===i.keyCode?1:-1;e.daysContainer&&void 0!==o.$i||o===e.input||o===e.altInput?i.ctrlKey?(i.stopPropagation(),R(e.currentYear-f),b(v(1),0)):u||b(void 0,7*f):o===e.currentYearElement?R(e.currentYear-f):e.config.enableTime&&(!u&&e.hourElement&&e.hourElement.focus(),r(i),e._debouncedChange());break;case 9:if(u){var g=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter((function(t){return t})),_=g.indexOf(o);if(-1!==_){var m=g[_+(i.shiftKey?-1:1)];i.preventDefault(),(m||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(o)&&i.shiftKey&&(i.preventDefault(),e._input.focus())}}if(void 0!==e.amPM&&o===e.amPM)switch(i.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],s(),J();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],s(),J()}(a||M(o))&&Z("onKeyDown",i)}function P(t,i){if(void 0===i&&(i="flatpickr-day"),1===e.selectedDates.length&&(!t||t.classList.contains(i)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),o=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),a=Math.min(n,e.selectedDates[0].getTime()),r=Math.max(n,e.selectedDates[0].getTime()),s=!1,l=0,c=0,p=a;p<r;p+=864e5)O(new Date(p),!0)||(s=s||p>a&&p<r,p<o&&(!l||p>l)?l=p:p>o&&(!c||p<c)&&(c=p));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+i)).forEach((function(i){var a,r,p,u=i.dateObj.getTime(),h=l>0&&u<l||c>0&&u>c;if(h)return i.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){i.classList.remove(t)}));s&&!h||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){i.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=e.selectedDates[0].getTime()?"startRange":"endRange"),o<n&&u===o?i.classList.add("startRange"):o>n&&u===o&&i.classList.add("endRange"),u>=l&&(0===c||u<=c)&&(r=o,p=n,(a=u)>Math.min(r,p)&&a<Math.max(r,p))&&i.classList.add("inRange")))}))}}function G(){!e.isOpen||e.config.static||e.config.inline||F()}function z(t){return function(i){var n=e.config["_"+t+"Date"]=e.parseDate(i,e.config.dateFormat),o=e.config["_"+("min"===t?"max":"min")+"Date"];void 0!==n&&(e["min"===t?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter((function(t){return O(t)})),e.selectedDates.length||"min"!==t||l(n),J()),e.daysContainer&&(U(),void 0!==n?e.currentYearElement[t]=n.getFullYear().toString():e.currentYearElement.removeAttribute(t),e.currentYearElement.disabled=!!o&&void 0!==n&&o.getFullYear()===n.getFullYear())}}function N(){return e.config.wrap?t.querySelector("[data-input]"):t}function B(){"object"!=typeof e.config.locale&&void 0===ii.l10ns[e.config.locale]&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Kt(Kt({},ii.l10ns.default),"object"==typeof e.config.locale?e.config.locale:"default"!==e.config.locale?ii.l10ns[e.config.locale]:void 0),Vt.D="("+e.l10n.weekdays.shorthand.join("|")+")",Vt.l="("+e.l10n.weekdays.longhand.join("|")+")",Vt.M="("+e.l10n.months.shorthand.join("|")+")",Vt.F="("+e.l10n.months.longhand.join("|")+")",Vt.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",void 0===Kt(Kt({},i),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===ii.defaultConfig.time_24hr&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Wt(e),e.parseDate=qt({config:e.config,l10n:e.l10n})}function F(t){if("function"!=typeof e.config.position){if(void 0!==e.calendarContainer){Z("onPreCalendarPosition");var i=t||e._positionElement,n=Array.prototype.reduce.call(e.calendarContainer.children,(function(t,i){return t+i.offsetHeight}),0),o=e.calendarContainer.offsetWidth,a=e.config.position.split(" "),r=a[0],s=a.length>1?a[1]:null,l=i.getBoundingClientRect(),c=window.innerHeight-l.bottom,p="above"===r||"below"!==r&&c<n&&l.top>n,u=window.pageYOffset+l.top+(p?-n-2:i.offsetHeight+2);if(Pt(e.calendarContainer,"arrowTop",!p),Pt(e.calendarContainer,"arrowBottom",p),!e.config.inline){var h=window.pageXOffset+l.left,d=!1,f=!1;"center"===s?(h-=(o-l.width)/2,d=!0):"right"===s&&(h-=o-l.width,f=!0),Pt(e.calendarContainer,"arrowLeft",!d&&!f),Pt(e.calendarContainer,"arrowCenter",d),Pt(e.calendarContainer,"arrowRight",f);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right),_=h+o>window.document.body.offsetWidth,m=g+o>window.document.body.offsetWidth;if(Pt(e.calendarContainer,"rightMost",_),!e.config.static)if(e.calendarContainer.style.top=u+"px",_)if(m){var v=function(){for(var t=null,i=0;i<document.styleSheets.length;i++){var e=document.styleSheets[i];if(e.cssRules){t=e;break}}return null!=t?t:function(){var t=document.createElement("style");return document.head.appendChild(t),t.sheet}()}();if(void 0===v)return;var b=window.document.body.offsetWidth,x=Math.max(0,b/2-o/2),w=v.cssRules.length,y="{left:"+l.left+"px;right:auto;}";Pt(e.calendarContainer,"rightMost",!1),Pt(e.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,w),e.calendarContainer.style.left=x+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=g+"px";else e.calendarContainer.style.left=h+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,t)}function U(){e.config.noCalendar||e.isMobile||(y(),K(),w())}function j(){e._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(e.close,0):e.close()}function H(t){t.preventDefault(),t.stopPropagation();var i=Nt(Ft(t),(function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")}));if(void 0!==i){var n=i,o=e.latestSelectedDateObj=new Date(n.dateObj.getTime()),a=(o.getMonth()<e.currentMonth||o.getMonth()>e.currentMonth+e.config.showMonths-1)&&"range"!==e.config.mode;if(e.selectedDateElem=n,"single"===e.config.mode)e.selectedDates=[o];else if("multiple"===e.config.mode){var r=X(o);r?e.selectedDates.splice(parseInt(r),1):e.selectedDates.push(o)}else"range"===e.config.mode&&(2===e.selectedDates.length&&e.clear(!1,!1),e.latestSelectedDateObj=o,e.selectedDates.push(o),0!==Zt(o,e.selectedDates[0],!0)&&e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()})));if(s(),a){var l=e.currentYear!==o.getFullYear();e.currentYear=o.getFullYear(),e.currentMonth=o.getMonth(),l&&(Z("onYearChange"),y()),Z("onMonthChange")}K(),w(),J(),a||"range"===e.config.mode||1!==e.config.showMonths?void 0!==e.selectedDateElem&&void 0===e.hourElement&&e.selectedDateElem&&e.selectedDateElem.focus():m(n),void 0!==e.hourElement&&void 0!==e.hourElement&&e.hourElement.focus(),e.config.closeOnSelect&&("single"===e.config.mode&&!e.config.enableTime||"range"===e.config.mode&&2===e.selectedDates.length&&!e.config.enableTime)&&j(),h()}}e.parseDate=qt({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=u,e._setHoursFromDate=l,e._positionCalendar=F,e.changeMonth=A,e.changeYear=R,e.clear=function(t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!0),e.input.value="",void 0!==e.altInput&&(e.altInput.value=""),void 0!==e.mobileInput&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,!0===i&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),!0===e.config.enableTime){var n=Xt(e.config);c(n.hours,n.minutes,n.seconds)}e.redraw(),t&&Z("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(void 0!==e.calendarContainer&&e.calendarContainer.classList.remove("open"),void 0!==e._input&&e._input.classList.remove("active")),Z("onClose")},e.onMouseOver=P,e._createElement=Gt,e.createDay=_,e.destroy=function(){void 0!==e.config&&Z("onDestroy");for(var t=e._handlers.length;t--;)e._handlers[t].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var i=e.calendarContainer.parentNode;if(i.lastChild&&i.removeChild(i.lastChild),i.parentNode){for(;i.firstChild;)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete e[t]}catch(t){}}))},e.isEnabled=O,e.jumpToDate=d,e.updateValue=J,e.open=function(t,i){if(void 0===i&&(i=e._positionElement),!0===e.isMobile){if(t){t.preventDefault();var n=Ft(t);n&&n.blur()}return void 0!==e.mobileInput&&(e.mobileInput.focus(),e.mobileInput.click()),void Z("onOpen")}if(!e._input.disabled&&!e.config.inline){var o=e.isOpen;e.isOpen=!0,o||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Z("onOpen"),F(i)),!0===e.config.enableTime&&!0===e.config.noCalendar&&(!1!==e.config.allowInput||void 0!==t&&e.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return e.hourElement.select()}),50))}},e.redraw=U,e.set=function(t,i){if(null!==t&&"object"==typeof t)for(var n in Object.assign(e.config,t),t)void 0!==V[n]&&V[n].forEach((function(t){return t()}));else e.config[t]=i,void 0!==V[t]?V[t].forEach((function(t){return t()})):Mt.indexOf(t)>-1&&(e.config[t]=Ct(i));e.redraw(),J(!0)},e.setDate=function(t,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=e.config.dateFormat),0!==t&&!t||t instanceof Array&&0===t.length)return e.clear(i);Y(t,n),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),d(void 0,i),l(),0===e.selectedDates.length&&e.clear(!1),J(i),i&&Z("onChange")},e.toggle=function(t){if(!0===e.isOpen)return e.close();e.open(t)};var V={locale:[B,I],showMonths:[E,a,T],minDate:[d],maxDate:[d],positionElement:[q],clickOpens:[function(){!0===e.config.clickOpens?(u(e._input,"focus",e.open),u(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Y(t,i){var n=[];if(t instanceof Array)n=t.map((function(t){return e.parseDate(t,i)}));else if(t instanceof Date||"number"==typeof t)n=[e.parseDate(t,i)];else if("string"==typeof t)switch(e.config.mode){case"single":case"time":n=[e.parseDate(t,i)];break;case"multiple":n=t.split(e.config.conjunction).map((function(t){return e.parseDate(t,i)}));break;case"range":n=t.split(e.l10n.rangeSeparator).map((function(t){return e.parseDate(t,i)}))}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));e.selectedDates=e.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&O(t,!1)})),"range"===e.config.mode&&e.selectedDates.sort((function(t,i){return t.getTime()-i.getTime()}))}function W(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?e.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:e.parseDate(t.from,void 0),to:e.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function q(){e._positionElement=e.config.positionElement||e._input}function Z(t,i){if(void 0!==e.config){var n=e.config[t];if(void 0!==n&&n.length>0)for(var o=0;n[o]&&o<n.length;o++)n[o](e.selectedDates,e.input.value,e,i);"onChange"===t&&(e.input.dispatchEvent($("change")),e.input.dispatchEvent($("input")))}}function $(t){var i=document.createEvent("Event");return i.initEvent(t,!0,!0),i}function X(t){for(var i=0;i<e.selectedDates.length;i++){var n=e.selectedDates[i];if(n instanceof Date&&0===Zt(n,t))return""+i}return!1}function K(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach((function(t,i){var n=new Date(e.currentYear,e.currentMonth,1);n.setMonth(e.currentMonth+i),e.config.showMonths>1||"static"===e.config.monthSelectorType?e.monthElements[i].textContent=jt(n.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),e._hidePrevMonthArrow=void 0!==e.config.minDate&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=void 0!==e.config.maxDate&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Q(t){var i=t||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map((function(t){return e.formatDate(t,i)})).filter((function(t,i,n){return"range"!==e.config.mode||e.config.enableTime||n.indexOf(t)===i})).join("range"!==e.config.mode?e.config.conjunction:e.l10n.rangeSeparator)}function J(t){void 0===t&&(t=!0),void 0!==e.mobileInput&&e.mobileFormatStr&&(e.mobileInput.value=void 0!==e.latestSelectedDateObj?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Q(e.config.dateFormat),void 0!==e.altInput&&(e.altInput.value=Q(e.config.altFormat)),!1!==t&&Z("onValueUpdate")}function tt(t){var i=Ft(t),n=e.prevMonthNav.contains(i),o=e.nextMonthNav.contains(i);n||o?A(n?-1:1):e.yearElements.indexOf(i)>=0?i.select():i.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):i.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=Kt(Kt({},JSON.parse(JSON.stringify(t.dataset||{}))),i),r={};e.config.parseDate=a.parseDate,e.config.formatDate=a.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(t){e.config._enable=W(t)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(t){e.config._disable=W(t)}});var s="time"===a.mode;a.dateFormat||!a.enableTime&&!s||(r.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):(ii.defaultConfig.dateFormat||Dt.dateFormat)+" H:i"+(a.enableSeconds?":S":"")),a.altInput&&(a.enableTime||s)&&!a.altFormat&&(r.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):(ii.defaultConfig.altFormat||Dt.altFormat)+" h:i"+(a.enableSeconds?":S":"")+" K"),Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:z("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:z("max")});var l=function(t){return function(i){e.config["min"===t?"_minTime":"_maxTime"]=e.parseDate(i,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:l("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:l("max")}),"time"===a.mode&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,r,a);for(var c=0;c<n.length;c++)e.config[n[c]]=!0===e.config[n[c]]||"true"===e.config[n[c]];for(Mt.filter((function(t){return void 0!==e.config[t]})).forEach((function(t){e.config[t]=Ct(e.config[t]||[]).map(o)})),e.isMobile=!e.config.disableMobile&&!e.config.inline&&"single"===e.config.mode&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),c=0;c<e.config.plugins.length;c++){var p=e.config.plugins[c](e)||{};for(var u in p)Mt.indexOf(u)>-1?e.config[u]=Ct(p[u]).map(o).concat(e.config[u]):void 0===a[u]&&(e.config[u]=p[u])}a.altInputClass||(e.config.altInputClass=N().className+" "+e.config.altInputClass),Z("onParseConfig")}(),B(),e.input=N(),e.input?(e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Gt(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),q()):e.config.errorHandler(new Error("Invalid input element specified")),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var t=e.config.defaultDate||("INPUT"!==e.input.nodeName&&"TEXTAREA"!==e.input.nodeName||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);t&&Y(t,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),void 0!==e.config.minTime&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),void 0!==e.config.maxTime&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(t,i){return void 0===t&&(t=e.currentMonth),void 0===i&&(i=e.currentYear),1===t&&(i%4==0&&i%100!=0||i%400==0)?29:e.l10n.daysInMonth[t]}},e.isMobile||function(){var t=window.document.createDocumentFragment();if(e.calendarContainer=Gt("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(t.appendChild((e.monthNav=Gt("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Gt("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Gt("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,E(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(t){e.__hidePrevMonthArrow!==t&&(Pt(e.prevMonthNav,"flatpickr-disabled",t),e.__hidePrevMonthArrow=t)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(t){e.__hideNextMonthArrow!==t&&(Pt(e.nextMonthNav,"flatpickr-disabled",t),e.__hideNextMonthArrow=t)}}),e.currentYearElement=e.yearElements[0],K(),e.monthNav)),e.innerContainer=Gt("div","flatpickr-innerContainer"),e.config.weekNumbers){var i=function(){e.calendarContainer.classList.add("hasWeeks");var t=Gt("div","flatpickr-weekwrapper");t.appendChild(Gt("span","flatpickr-weekday",e.l10n.weekAbbreviation));var i=Gt("div","flatpickr-weeks");return t.appendChild(i),{weekWrapper:t,weekNumbers:i}}(),n=i.weekWrapper,o=i.weekNumbers;e.innerContainer.appendChild(n),e.weekNumbers=o,e.weekWrapper=n}e.rContainer=Gt("div","flatpickr-rContainer"),e.rContainer.appendChild(T()),e.daysContainer||(e.daysContainer=Gt("div","flatpickr-days"),e.daysContainer.tabIndex=-1),w(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),t.appendChild(e.innerContainer)}e.config.enableTime&&t.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var t=Xt(e.config);e.timeContainer=Gt("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var i=Gt("span","flatpickr-time-separator",":"),n=Bt("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=n.getElementsByTagName("input")[0];var o=Bt("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=o.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Ot(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),e.minuteElement.value=Ot(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():t.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(n),e.timeContainer.appendChild(i),e.timeContainer.appendChild(o),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var a=Bt("flatpickr-second");e.secondElement=a.getElementsByTagName("input")[0],e.secondElement.value=Ot(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():t.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Gt("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(a)}return e.config.time_24hr||(e.amPM=Gt("span","flatpickr-am-pm",e.l10n.amPM[St((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Pt(e.calendarContainer,"rangeMode","range"===e.config.mode),Pt(e.calendarContainer,"animate",!0===e.config.animate),Pt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(t);var a=void 0!==e.config.appendTo&&void 0!==e.config.appendTo.nodeType;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!a&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):void 0!==e.config.appendTo&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var r=Gt("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(r,e.element),r.appendChild(e.element),e.altInput&&r.appendChild(e.altInput),r.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(void 0!==e.config.appendTo?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+t+"]"),(function(i){return u(i,"click",e[t])}))})),e.isMobile)!function(){var t=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Gt("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=t,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",void 0!==e.altInput&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch(t){}u(e.mobileInput,"change",(function(t){e.setDate(Ft(t).value,!1,e.mobileFormatStr),Z("onChange"),Z("onClose")}))}();else{var t=Lt(G,50);if(e._debouncedChange=Lt(h,300),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&u(e.daysContainer,"mouseover",(function(t){"range"===e.config.mode&&P(Ft(t))})),u(e._input,"keydown",C),void 0!==e.calendarContainer&&u(e.calendarContainer,"keydown",C),e.config.inline||e.config.static||u(window,"resize",t),void 0!==window.ontouchstart?u(window.document,"touchstart",D):u(window.document,"mousedown",D),u(window.document,"focus",D,{capture:!0}),!0===e.config.clickOpens&&(u(e._input,"focus",e.open),u(e._input,"click",e.open)),void 0!==e.daysContainer&&(u(e.monthNav,"click",tt),u(e.monthNav,["keyup","increment"],p),u(e.daysContainer,"click",H)),void 0!==e.timeContainer&&void 0!==e.minuteElement&&void 0!==e.hourElement){u(e.timeContainer,["increment"],r),u(e.timeContainer,"blur",r,{capture:!0}),u(e.timeContainer,"click",f),u([e.hourElement,e.minuteElement],["focus","click"],(function(t){return Ft(t).select()})),void 0!==e.secondElement&&u(e.secondElement,"focus",(function(){return e.secondElement&&e.secondElement.select()})),void 0!==e.amPM&&u(e.amPM,"click",(function(t){r(t)}))}e.config.allowInput&&u(e._input,"blur",L)}}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),J(!1)),a();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&n&&F(),Z("onReady")}(),e}function ti(t,i){for(var e=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],o=0;o<e.length;o++){var a=e[o];try{if(null!==a.getAttribute("data-fp-omit"))continue;void 0!==a._flatpickr&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=Jt(a,i||{}),n.push(a._flatpickr)}catch(t){console.error(t)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return ti(this,t)},HTMLElement.prototype.flatpickr=function(t){return ti([this],t)});var ii=function(t,i){return"string"==typeof t?ti(window.document.querySelectorAll(t),i):t instanceof Node?ti([t],i):ti(t,i)};ii.defaultConfig={},ii.l10ns={en:Kt({},Rt),default:Kt({},Rt)},ii.localize=function(t){ii.l10ns.default=Kt(Kt({},ii.l10ns.default),t)},ii.setDefaults=function(t){ii.defaultConfig=Kt(Kt({},ii.defaultConfig),t)},ii.parseDate=qt({}),ii.formatDate=Wt({}),ii.compareDates=Zt,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(t){return ti(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof t?parseInt(t,10):t))},"undefined"!=typeof window&&(window.flatpickr=ii);const ei=class{constructor(i){t(this,i),this.picked=o(this,"picked",7),this.value=null,this.placeholder=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.allowInput=!0,this.allowInvalidPreload=!1,this.altFormat="F j, Y",this.altInput=!1,this.appendTo=void 0,this.ariaDateFormat="F j, Y",this.autoFillDefaultTime=!0,this.clickOpens=!0,this.closeOnSelect=!0,this.dateFormat="Y-m-d",this.defaultHour=12,this.defaultMinute=0,this.defaultSeconds=0,this.disable=[],this.disableMobile=!1,this.enable=[()=>!0],this.enableSeconds=!1,this.enableTime=!1,this.hourIncrement=1,this.inline=!1,this.locale="en",this.maxDate=null,this.maxTime=null,this.minDate=null,this.minTime=null,this.minuteIncrement=5,this.mode="single",this.monthSelectorType="dropdown",this.nextArrow='<span class="sicon-keyboard_arrow_right"></span>',this.noCalendar=!1,this.position="auto",this.prevArrow='<span class="sicon-keyboard_arrow_left"></span>',this.shorthandCurrentMonth=!1,this.static=!1,this.showMonths=1,this.time_24hr=!1,this.weekNumbers=!1,this.wrap=!1}render(){return i("div",{class:"s-datetime-picker"},i("input",{type:"datetime",name:this.name,value:this.value,required:this.required,placeholder:this.placeholder,class:"s-datetime-picker-input",ref:t=>this.dateInput=t}))}componentDidLoad(){let t={allowInput:this.allowInput,allowInvalidPreload:this.allowInvalidPreload,altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,appendTo:this.appendTo,ariaDateFormat:this.ariaDateFormat,autoFillDefaultTime:this.autoFillDefaultTime,clickOpens:this.clickOpens,closeOnSelect:this.closeOnSelect,conjunction:this.conjunction,dateFormat:this.dateFormat,defaultDate:this.value?Date.parse(this.value):this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,defaultSeconds:this.defaultSeconds,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableSeconds:this.enableSeconds,enableTime:this.enableTime,formatDate:this.formatDate,hourIncrement:this.hourIncrement,inline:this.inline,locale:this.locale,maxDate:this.maxDate,maxTime:this.maxTime,minDate:this.minDate,minTime:this.minTime,minuteIncrement:this.minuteIncrement,mode:this.mode,monthSelectorType:this.monthSelectorType,nextArrow:this.nextArrow,noCalendar:this.noCalendar,parseDate:this.dateParser,position:this.position,positionElement:this.positionElement,prevArrow:this.prevArrow,shorthandCurrentMonth:this.shorthandCurrentMonth,static:this.static,showMonths:this.showMonths,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,onChange:(t,i)=>this.picked.emit(this.value=i)};ii(this.dateInput,t)}};ei.style='.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:\'\';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\\0;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}';var ni=a((function(t,i){
|
|
13
|
+
/*!
|
|
14
|
+
* FilePond 4.30.4
|
|
15
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
16
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
17
|
+
*/
|
|
18
|
+
!function(t){var i=function(t){return t instanceof HTMLElement},e=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=Object.assign({},t),o=[],a=[],r=function(){var t=[].concat(a);a.length=0,t.forEach((function(t){s(t.type,t.data)}))},s=function(t,i,e){!e||document.hidden?(u[t]&&u[t](i),o.push({type:t,data:i})):a.push({type:t,data:i})},l=function(t){for(var i,e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return p[t]?(i=p)[t].apply(i,n):null},c={getState:function(){return Object.assign({},n)},processActionQueue:function(){var t=[].concat(o);return o.length=0,t},processDispatchQueue:r,dispatch:s,query:l},p={};i.forEach((function(t){p=Object.assign({},t(n),{},p)}));var u={};return e.forEach((function(t){u=Object.assign({},t(s,l,n),{},u)})),c},n=function(t,i){for(var e in t)t.hasOwnProperty(e)&&i(e,t[e])},o=function(t){var i={};return n(t,(function(e){!function(t,i,e){"function"!=typeof e?Object.defineProperty(t,i,Object.assign({},e)):t[i]=e}(i,e,t[e])})),i},a=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===e)return t.getAttribute(i)||t.hasAttribute(i);t.setAttribute(i,e)},r="http://www.w3.org/2000/svg",s=["svg","path"],l=function(t){return s.includes(t)},c=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof i&&(e=i,i=null);var o=l(t)?document.createElementNS(r,t):document.createElement(t);return i&&(l(t)?a(o,"class",i):o.className=i),n(e,(function(t,i){a(o,t,i)})),o},p=function(t){return function(i,e){void 0!==e&&t.children[e]?t.insertBefore(i,t.children[e]):t.appendChild(i)}},u=function(t,i){return function(t,e){return void 0!==e?i.splice(e,0,t):i.push(t),t}},h=function(t,i){return function(e){return i.splice(i.indexOf(e),1),e.element.parentNode&&t.removeChild(e.element),e}},d="undefined"!=typeof window&&void 0!==window.document,f=function(){return d},g="children"in(f()?c("svg"):{})?function(t){return t.children.length}:function(t){return t.childNodes.length},_=function(t,i,e,n){var o=e[0]||t.left,a=e[1]||t.top,r=o+t.width,s=a+t.height*(n[1]||1),l={element:Object.assign({},t),inner:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},outer:{left:o,top:a,right:r,bottom:s}};return i.filter((function(t){return!t.isRectIgnored()})).map((function(t){return t.rect})).forEach((function(t){m(l.inner,Object.assign({},t.inner)),m(l.outer,Object.assign({},t.outer))})),v(l.inner),l.outer.bottom+=l.element.marginBottom,l.outer.right+=l.element.marginRight,v(l.outer),l},m=function(t,i){i.top+=t.top,i.right+=t.left,i.bottom+=t.top,i.left+=t.left,i.bottom>t.bottom&&(t.bottom=i.bottom),i.right>t.right&&(t.right=i.right)},v=function(t){t.width=t.right-t.left,t.height=t.bottom-t.top},b=function(t){return"number"==typeof t},x=function(t,i,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(t-i)<n&&Math.abs(e)<n},w=function(t){return t<.5?2*t*t:(4-2*t)*t-1},y={spring:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.stiffness,e=void 0===i?.5:i,n=t.damping,a=void 0===n?.75:n,r=t.mass,s=void 0===r?10:r,l=null,c=null,p=0,u=!1,h=o({interpolate:function(t,i){if(!u){if(!b(l)||!b(c))return u=!0,void(p=0);x(c+=p+=-(c-l)*e/s,l,p*=a)||i?(p=0,u=!0,h.onupdate(c=l),h.oncomplete(c)):h.onupdate(c)}},target:{set:function(t){if(b(t)&&!b(c)&&(c=t),null===l&&(l=t,c=t),c===(l=t)||void 0===l)return u=!0,p=0,h.onupdate(c),void h.oncomplete(c);u=!1},get:function(){return l}},resting:{get:function(){return u}},onupdate:function(){},oncomplete:function(){}});return h},tween:function(){var t,i,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.duration,a=void 0===n?500:n,r=e.easing,s=void 0===r?w:r,l=e.delay,c=void 0===l?0:l,p=null,u=!0,h=!1,d=null,f=o({interpolate:function(e,n){u||null===d||(null===p&&(p=e),e-p<c||((t=e-p-c)>=a||n?(t=1,f.onupdate((i=h?0:1)*d),f.oncomplete(i*d),u=!0):(i=t/a,f.onupdate((t>=0?s(h?1-i:i):0)*d))))},target:{get:function(){return h?0:d},set:function(t){if(null===d)return d=t,f.onupdate(t),void f.oncomplete(t);t<d?(d=1,h=!0):(h=!1,d=t),u=!1,p=null}},resting:{get:function(){return u}},onupdate:function(){},oncomplete:function(){}});return f}},k=function(t,i,e){var n=t[i]&&"object"==typeof t[i][e]?t[i][e]:t[i]||t,o="string"==typeof n?n:n.type,a="object"==typeof n?Object.assign({},n):{};return y[o]?y[o](a):null},E=function(t,i,e){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(i=Array.isArray(i)?i:[i]).forEach((function(i){t.forEach((function(t){var o=t,a=function(){return e[t]},r=function(i){return e[t]=i};"object"==typeof t&&(o=t.key,a=t.getter||a,r=t.setter||r),i[o]&&!n||(i[o]={get:a,set:r})}))}))},T=function(t){return null!=t},I={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},A=function(t,i){if(Object.keys(t).length!==Object.keys(i).length)return!0;for(var e in i)if(i[e]!==t[e])return!0;return!1},M=function(t,i){var e=i.opacity,n=i.perspective,o=i.translateX,a=i.translateY,r=i.scaleX,s=i.scaleY,l=i.rotateX,c=i.rotateY,p=i.rotateZ,u=i.originX,h=i.originY,d=i.width,f=i.height,g="",_="";(T(u)||T(h))&&(_+="transform-origin: "+(u||0)+"px "+(h||0)+"px;"),T(n)&&(g+="perspective("+n+"px) "),(T(o)||T(a))&&(g+="translate3d("+(o||0)+"px, "+(a||0)+"px, 0) "),(T(r)||T(s))&&(g+="scale3d("+(T(r)?r:1)+", "+(T(s)?s:1)+", 1) "),T(p)&&(g+="rotateZ("+p+"rad) "),T(l)&&(g+="rotateX("+l+"rad) "),T(c)&&(g+="rotateY("+c+"rad) "),g.length&&(_+="transform:"+g+";"),T(e)&&(_+="opacity:"+e+";",0===e&&(_+="visibility:hidden;"),e<1&&(_+="pointer-events:none;")),T(f)&&(_+="height:"+f+"px;"),T(d)&&(_+="width:"+d+"px;");var m=t.elementCurrentStyle||"";_.length===m.length&&_===m||(t.style.cssText=_,t.elementCurrentStyle=_)},D={styles:function(t){var i=t.mixinConfig,e=t.viewProps,n=t.viewInternalAPI,o=t.viewExternalAPI,a=t.view,r=Object.assign({},e),s={};E(i,[n,o],e);var l=function(){return a.rect?_(a.rect,a.childViews,[e.translateX||0,e.translateY||0],[e.scaleX||0,e.scaleY||0]):null};return n.rect={get:l},o.rect={get:l},i.forEach((function(t){e[t]=void 0===r[t]?I[t]:r[t]})),{write:function(){if(A(s,e))return M(a.element,e),Object.assign(s,Object.assign({},e)),!0},destroy:function(){}}},listeners:function(t){var i,e=t.viewExternalAPI,n=t.view,o=[],a=(i=n.element,function(t,e){i.addEventListener(t,e)}),r=function(t){return function(i,e){t.removeEventListener(i,e)}}(n.element);return e.on=function(t,i){o.push({type:t,fn:i}),a(t,i)},e.off=function(t,i){o.splice(o.findIndex((function(e){return e.type===t&&e.fn===i})),1),r(t,i)},{write:function(){return!0},destroy:function(){o.forEach((function(t){r(t.type,t.fn)}))}}},animations:function(t){var i=t.mixinConfig,e=t.viewProps,o=t.viewInternalAPI,a=t.viewExternalAPI,r=Object.assign({},e),s=[];return n(i,(function(t,i){var n=k(i);n&&(n.onupdate=function(i){e[t]=i},n.target=r[t],E([{key:t,setter:function(t){n.target!==t&&(n.target=t)},getter:function(){return e[t]}}],[o,a],e,!0),s.push(n))})),{write:function(t){var i=document.hidden,e=!0;return s.forEach((function(n){n.resting||(e=!1),n.interpolate(t,i)})),e},destroy:function(){}}},apis:function(t){E(t.mixinConfig,t.viewExternalAPI,t.viewProps)}},R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.layoutCalculated||(t.paddingTop=parseInt(e.paddingTop,10)||0,t.marginTop=parseInt(e.marginTop,10)||0,t.marginRight=parseInt(e.marginRight,10)||0,t.marginBottom=parseInt(e.marginBottom,10)||0,t.marginLeft=parseInt(e.marginLeft,10)||0,i.layoutCalculated=!0),t.left=i.offsetLeft||0,t.top=i.offsetTop||0,t.width=i.offsetWidth||0,t.height=i.offsetHeight||0,t.right=t.left+t.width,t.bottom=t.top+t.height,t.scrollTop=i.scrollTop,t.hidden=null===i.offsetParent,t},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.tag,e=void 0===i?"div":i,n=t.name,a=void 0===n?null:n,r=t.attributes,s=void 0===r?{}:r,l=t.read,d=void 0===l?function(){}:l,f=t.write,m=void 0===f?function(){}:f,v=t.create,b=void 0===v?function(){}:v,x=t.destroy,w=void 0===x?function(){}:x,y=t.filterFrameActionsForChild,k=void 0===y?function(t,i){return i}:y,E=t.didCreateView,T=void 0===E?function(){}:E,I=t.didWriteView,A=void 0===I?function(){}:I,M=t.ignoreRect,O=void 0!==M&&M,S=t.ignoreRectUpdate,L=void 0!==S&&S,C=t.mixins,P=void 0===C?[]:C;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=c(e,"filepond--"+a,s),r=window.getComputedStyle(n,null),l=R(),f=null,v=!1,x=[],y=[],E={},I={},M=[m],S=[d],C=[w],G=function(){return n},z=function(){return x.concat()},N=function(t){return function(i,e){return i(t,e)}},B=function(){return f||(f=_(l,x,[0,0],[1,1]))},F=function(){f=null,x.forEach((function(t){return t._read()})),!(L&&l.width&&l.height)&&R(l,n,r);var t={root:q,props:i,rect:l};S.forEach((function(i){return i(t)}))},U=function(t,e,n){var o=0===e.length;return M.forEach((function(a){!1===a({props:i,root:q,actions:e,timestamp:t,shouldOptimize:n})&&(o=!1)})),y.forEach((function(i){!1===i.write(t)&&(o=!1)})),x.filter((function(t){return!!t.element.parentNode})).forEach((function(i){i._write(t,k(i,e),n)||(o=!1)})),x.forEach((function(i,a){i.element.parentNode||(q.appendChild(i.element,a),i._read(),i._write(t,k(i,e),n),o=!1)})),v=o,A({props:i,root:q,actions:e,timestamp:t}),o},j=function(){y.forEach((function(t){return t.destroy()})),C.forEach((function(t){t({root:q,props:i})})),x.forEach((function(t){return t._destroy()}))},H={element:{get:G},style:{get:function(){return r}},childViews:{get:z}},V=Object.assign({},H,{rect:{get:B},ref:{get:function(){return E}},is:function(t){return a===t},appendChild:p(n),createChildView:N(t),linkView:function(t){return x.push(t),t},unlinkView:function(t){x.splice(x.indexOf(t),1)},appendChildView:u(0,x),removeChildView:h(n,x),registerWriter:function(t){return M.push(t)},registerReader:function(t){return S.push(t)},registerDestroyer:function(t){return C.push(t)},invalidateLayout:function(){return n.layoutCalculated=!1},dispatch:t.dispatch,query:t.query}),Y={element:{get:G},childViews:{get:z},rect:{get:B},resting:{get:function(){return v}},isRectIgnored:function(){return O},_read:F,_write:U,_destroy:j},W=Object.assign({},H,{rect:{get:function(){return l}}});Object.keys(P).sort((function(t,i){return"styles"===t?1:"styles"===i?-1:0})).forEach((function(t){var e=D[t]({mixinConfig:P[t],viewProps:i,viewState:I,viewInternalAPI:V,viewExternalAPI:Y,view:o(W)});e&&y.push(e)}));var q=o(V);b({root:q,props:i});var Z=g(n);return x.forEach((function(t,i){q.appendChild(t.element,Z+i)})),T(q),o(Y)}},S=function(t,i){return function(e){var n=e.root,o=e.props,a=e.actions,r=void 0===a?[]:a,s=e.timestamp,l=e.shouldOptimize;r.filter((function(i){return t[i.type]})).forEach((function(i){return t[i.type]({root:n,props:o,action:i.data,timestamp:s,shouldOptimize:l})})),i&&i({root:n,props:o,actions:r,timestamp:s,shouldOptimize:l})}},L=function(t,i){return i.parentNode.insertBefore(t,i)},C=function(t,i){return i.parentNode.insertBefore(t,i.nextSibling)},P=function(t){return Array.isArray(t)},G=function(t){return null==t},z=function(t){return t.trim()},N=function(t){return""+t},B=function(t){return"boolean"==typeof t},F=function(t){return B(t)?t:"true"===t},U=function(t){return"string"==typeof t},j=function(t){return b(t)?t:U(t)?N(t).replace(/[a-z]+/gi,""):0},H=function(t){return parseInt(j(t),10)},V=function(t){return parseFloat(j(t))},Y=function(t){return b(t)&&isFinite(t)&&Math.floor(t)===t},W=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(Y(t))return t;var e=N(t).trim();return/MB$/i.test(e)?(e=e.replace(/MB$i/,"").trim(),H(e)*i*i):/KB/i.test(e)?(e=e.replace(/KB$i/,"").trim(),H(e)*i):H(e)},q=function(t){return"function"==typeof t},Z={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},$=function(t,i,e,n,o){if(null===i)return null;if("function"==typeof i)return i;var a={url:"GET"===e||"PATCH"===e?"?"+t+"=":"",method:e,headers:o,withCredentials:!1,timeout:n,onload:null,ondata:null,onerror:null};if(U(i))return a.url=i,a;if(Object.assign(a,i),U(a.headers)){var r=a.headers.split(/:(.+)/);a.headers={header:r[0],value:r[1]}}return a.withCredentials=F(a.withCredentials),a},X=function(t){return"object"==typeof t&&null!==t},K=function(t){return P(t)?"array":function(t){return null===t}(t)?"null":Y(t)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(t)?"bytes":function(t){return X(t)&&U(t.url)&&X(t.process)&&X(t.revert)&&X(t.restore)&&X(t.fetch)}(t)?"api":typeof t},Q={array:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return G(t)?[]:P(t)?t:N(t).split(i).map(z).filter((function(t){return t.length}))},boolean:F,int:function(t){return"bytes"===K(t)?W(t):H(t)},number:V,float:V,bytes:W,string:function(t){return q(t)?t:N(t)},function:function(t){return function(t){for(var i=self,e=t.split("."),n=null;n=e.shift();)if(!(i=i[n]))return null;return i}(t)},serverapi:function(t){return(e={}).url=U(i=t)?i:i.url||"",e.timeout=i.timeout?parseInt(i.timeout,10):0,e.headers=i.headers?i.headers:{},n(Z,(function(t){e[t]=$(t,i[t],Z[t],e.timeout,e.headers)})),e.process=i.process||U(i)||i.url?e.process:null,e.remove=i.remove||null,delete e.headers,e;var i,e},object:function(t){try{return JSON.parse(t.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'))}catch(t){return null}}},J=function(t,i,e){if(t===i)return t;var n=K(t);if(n!==e){var o=Q[e](t);if(n=K(o),null===o)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+e+'"';t=o}return t},tt=function(t){var i={};return n(t,(function(e){var n,o,a,r=t[e];i[e]=(o=r[1],a=n=r[0],{enumerable:!0,get:function(){return a},set:function(t){a=J(t,n,o)}})})),o(i)},it=function(t){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:tt(t)}},et=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return t.split(/(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join(i)},nt=function(t,i){var e={};return n(i,(function(i){e[i]={get:function(){return t.getState().options[i]},set:function(e){t.dispatch("SET_"+et(i,"_").toUpperCase(),{value:e})}}})),e},ot=function(t){return function(i,e,o){var a={};return n(t,(function(t){var e=et(t,"_").toUpperCase();a["SET_"+e]=function(n){try{o.options[t]=n.value}catch(t){}i("DID_SET_"+e,{value:o.options[t]})}})),a}},at=function(t){return function(i){var e={};return n(t,(function(t){e["GET_"+et(t,"_").toUpperCase()]=function(){return i.options[t]}})),e}},rt=1,st=2,lt=3,ct=4,pt=5,ut=function(){return Math.random().toString(36).substring(2,11)};function ht(t,i){if(null==t)return{};var e,n,o=function(t,i){if(null==t)return{};var e,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)i.indexOf(e=a[n])>=0||(o[e]=t[e]);return o}(t,i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i.indexOf(e=a[n])>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function dt(t){return function(t){if(Array.isArray(t)){for(var i=0,e=new Array(t.length);i<t.length;i++)e[i]=t[i];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var ft,gt,_t=function(t,i){return t.splice(i,1)},mt=function(){var t=[],i=function(i,e){_t(t,t.findIndex((function(t){return t.event===i&&(t.cb===e||!e)})))},e=function(i,e,n){t.filter((function(t){return t.event===i})).map((function(t){return t.cb})).forEach((function(t){return function(t,i){i?t():document.hidden?Promise.resolve(1).then(t):setTimeout(t,0)}((function(){return t.apply(void 0,dt(e))}),n)}))};return{fireSync:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e(t,n,!0)},fire:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];e(t,n,!1)},on:function(i,e){t.push({event:i,cb:e})},onOnce:function(e,n){t.push({event:e,cb:function(){i(e,n),n.apply(void 0,arguments)}})},off:i}},vt=function(t,i,e){Object.getOwnPropertyNames(t).filter((function(t){return!e.includes(t)})).forEach((function(e){return Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}))},bt=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],xt=function(t){var i={};return vt(t,i,bt),i},wt=function(t){t.forEach((function(i,e){i.released&&_t(t,e)}))},yt={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},kt={INPUT:1,LIMBO:2,LOCAL:3},Et=function(t){return/[^0-9]+/.exec(t)},Tt=function(){return Et(1.1.toLocaleString())[0]},It={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},At=[],Mt=function(t,i,e){return new Promise((function(n,o){var a=At.filter((function(i){return i.key===t})).map((function(t){return t.cb}));if(0!==a.length){var r=a.shift();a.reduce((function(t,i){return t.then((function(t){return i(t,e)}))}),r(i,e)).then((function(t){return n(t)})).catch((function(t){return o(t)}))}else n(i)}))},Dt=function(t,i,e){return At.filter((function(i){return i.key===t})).map((function(t){return t.cb(i,e)}))},Rt=function(t,i){return At.push({key:t,cb:i})},Ot=function(){return Object.assign({},St)},St={id:[null,It.STRING],name:["filepond",It.STRING],disabled:[!1,It.BOOLEAN],className:[null,It.STRING],required:[!1,It.BOOLEAN],captureMethod:[null,It.STRING],allowSyncAcceptAttribute:[!0,It.BOOLEAN],allowDrop:[!0,It.BOOLEAN],allowBrowse:[!0,It.BOOLEAN],allowPaste:[!0,It.BOOLEAN],allowMultiple:[!1,It.BOOLEAN],allowReplace:[!0,It.BOOLEAN],allowRevert:[!0,It.BOOLEAN],allowRemove:[!0,It.BOOLEAN],allowProcess:[!0,It.BOOLEAN],allowReorder:[!1,It.BOOLEAN],allowDirectoriesOnly:[!1,It.BOOLEAN],storeAsFile:[!1,It.BOOLEAN],forceRevert:[!1,It.BOOLEAN],maxFiles:[null,It.INT],checkValidity:[!1,It.BOOLEAN],itemInsertLocationFreedom:[!0,It.BOOLEAN],itemInsertLocation:["before",It.STRING],itemInsertInterval:[75,It.INT],dropOnPage:[!1,It.BOOLEAN],dropOnElement:[!0,It.BOOLEAN],dropValidation:[!1,It.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],It.ARRAY],instantUpload:[!0,It.BOOLEAN],maxParallelUploads:[2,It.INT],allowMinimumUploadDuration:[!0,It.BOOLEAN],chunkUploads:[!1,It.BOOLEAN],chunkForce:[!1,It.BOOLEAN],chunkSize:[5e6,It.INT],chunkRetryDelays:[[500,1e3,3e3],It.ARRAY],server:[null,It.SERVER_API],fileSizeBase:[1e3,It.INT],labelFileSizeBytes:["bytes",It.STRING],labelFileSizeKilobytes:["KB",It.STRING],labelFileSizeMegabytes:["MB",It.STRING],labelFileSizeGigabytes:["GB",It.STRING],labelDecimalSeparator:[Tt(),It.STRING],labelThousandsSeparator:[(ft=Tt(),gt=1e3.toLocaleString(),gt!==1e3.toString()?Et(gt)[0]:"."===ft?",":"."),It.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',It.STRING],labelInvalidField:["Field contains invalid files",It.STRING],labelFileWaitingForSize:["Waiting for size",It.STRING],labelFileSizeNotAvailable:["Size not available",It.STRING],labelFileCountSingular:["file in list",It.STRING],labelFileCountPlural:["files in list",It.STRING],labelFileLoading:["Loading",It.STRING],labelFileAdded:["Added",It.STRING],labelFileLoadError:["Error during load",It.STRING],labelFileRemoved:["Removed",It.STRING],labelFileRemoveError:["Error during remove",It.STRING],labelFileProcessing:["Uploading",It.STRING],labelFileProcessingComplete:["Upload complete",It.STRING],labelFileProcessingAborted:["Upload cancelled",It.STRING],labelFileProcessingError:["Error during upload",It.STRING],labelFileProcessingRevertError:["Error during revert",It.STRING],labelTapToCancel:["tap to cancel",It.STRING],labelTapToRetry:["tap to retry",It.STRING],labelTapToUndo:["tap to undo",It.STRING],labelButtonRemoveItem:["Remove",It.STRING],labelButtonAbortItemLoad:["Abort",It.STRING],labelButtonRetryItemLoad:["Retry",It.STRING],labelButtonAbortItemProcessing:["Cancel",It.STRING],labelButtonUndoItemProcessing:["Undo",It.STRING],labelButtonRetryItemProcessing:["Retry",It.STRING],labelButtonProcessItem:["Upload",It.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',It.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',It.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',It.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',It.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',It.STRING],oninit:[null,It.FUNCTION],onwarning:[null,It.FUNCTION],onerror:[null,It.FUNCTION],onactivatefile:[null,It.FUNCTION],oninitfile:[null,It.FUNCTION],onaddfilestart:[null,It.FUNCTION],onaddfileprogress:[null,It.FUNCTION],onaddfile:[null,It.FUNCTION],onprocessfilestart:[null,It.FUNCTION],onprocessfileprogress:[null,It.FUNCTION],onprocessfileabort:[null,It.FUNCTION],onprocessfilerevert:[null,It.FUNCTION],onprocessfile:[null,It.FUNCTION],onprocessfiles:[null,It.FUNCTION],onremovefile:[null,It.FUNCTION],onpreparefile:[null,It.FUNCTION],onupdatefiles:[null,It.FUNCTION],onreorderfiles:[null,It.FUNCTION],beforeDropFile:[null,It.FUNCTION],beforeAddFile:[null,It.FUNCTION],beforeRemoveFile:[null,It.FUNCTION],beforePrepareFile:[null,It.FUNCTION],stylePanelLayout:[null,It.STRING],stylePanelAspectRatio:[null,It.STRING],styleItemPanelAspectRatio:[null,It.STRING],styleButtonRemoveItemPosition:["left",It.STRING],styleButtonProcessItemPosition:["right",It.STRING],styleLoadIndicatorPosition:["right",It.STRING],styleProgressIndicatorPosition:["right",It.STRING],styleButtonRemoveItemAlign:[!1,It.BOOLEAN],files:[[],It.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],It.ARRAY]},Lt=function(t,i){return G(i)?t[0]||null:Y(i)?t[i]||null:("object"==typeof i&&(i=i.id),t.find((function(t){return t.id===i}))||null)},Ct=function(t){if(G(t))return t;if(/:/.test(t)){var i=t.split(":");return i[1]/i[0]}return parseFloat(t)},Pt=function(t){return t.filter((function(t){return!t.archived}))},Gt={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},zt=null,Nt=[yt.LOAD_ERROR,yt.PROCESSING_ERROR,yt.PROCESSING_REVERT_ERROR],Bt=[yt.LOADING,yt.PROCESSING,yt.PROCESSING_QUEUED,yt.INIT],Ft=[yt.PROCESSING_COMPLETE],Ut=function(t){return Nt.includes(t.status)},jt=function(t){return Bt.includes(t.status)},Ht=function(t){return Ft.includes(t.status)},Vt=function(t){return X(t.options.server)&&(X(t.options.server.process)||q(t.options.server.process))},Yt=function(t){return{GET_STATUS:function(){var i=Pt(t.items),e=Gt.ERROR,n=Gt.BUSY,o=Gt.IDLE,a=Gt.READY;return 0===i.length?Gt.EMPTY:i.some(Ut)?e:i.some(jt)?n:i.some(Ht)?a:o},GET_ITEM:function(i){return Lt(t.items,i)},GET_ACTIVE_ITEM:function(i){return Lt(Pt(t.items),i)},GET_ACTIVE_ITEMS:function(){return Pt(t.items)},GET_ITEMS:function(){return t.items},GET_ITEM_NAME:function(i){var e=Lt(t.items,i);return e?e.filename:null},GET_ITEM_SIZE:function(i){var e=Lt(t.items,i);return e?e.fileSize:null},GET_STYLES:function(){return Object.keys(t.options).filter((function(t){return/^style/.test(t)})).map((function(i){return{name:i,value:t.options[i]}}))},GET_PANEL_ASPECT_RATIO:function(){return/circle/.test(t.options.stylePanelLayout)?1:Ct(t.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return t.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(i){return Pt(t.items).filter((function(t){return t.status===i}))},GET_TOTAL_ITEMS:function(){return Pt(t.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return t.options.storeAsFile&&function(){if(null===zt)try{var t=new DataTransfer;t.items.add(new File(["hello world"],"This_Works.txt"));var i=document.createElement("input");i.setAttribute("type","file"),i.files=t.files,zt=1===i.files.length}catch(t){zt=!1}return zt}()&&!Vt(t)},IS_ASYNC:function(){return Vt(t)},GET_FILE_SIZE_LABELS:function(t){return{labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},Wt=function(t,i,e){return Math.max(Math.min(e,t),i)},qt=function(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(t)},Zt=function(t){return t.split("/").pop().split("?").shift()},$t=function(t){return t.split(".").pop()},Xt=function(t){if("string"!=typeof t)return"";var i=t.split("/").pop();return/svg/.test(i)?"svg":/zip|compressed/.test(i)?"zip":/plain/.test(i)?"txt":/msword/.test(i)?"doc":/[a-z]+/.test(i)?"jpeg"===i?"jpg":i:""},Kt=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(i+t).slice(-i.length)},Qt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return t.getFullYear()+"-"+Kt(t.getMonth()+1,"00")+"-"+Kt(t.getDate(),"00")+"_"+Kt(t.getHours(),"00")+"-"+Kt(t.getMinutes(),"00")+"-"+Kt(t.getSeconds(),"00")},Jt=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=t.slice(0,t.size,"string"==typeof e?e:t.type);return o.lastModifiedDate=new Date,t._relativePath&&(o._relativePath=t._relativePath),U(i)||(i=Qt()),i&&null===n&&$t(i)?o.name=i:(n=n||Xt(o.type),o.name=i+(n?"."+n:"")),o},ti=function(t,i){var e=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(e){var n=new e;return n.append(t),n.getBlob(i)}return new Blob([t],{type:i})},ii=function(t){return(/^data:(.+);/.exec(t)||[])[1]||null},ei=function(t){var i=ii(t);return function(t,i){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return ti(e,i)}(function(t){return atob(function(t){return t.split(",")[1].replace(/\s/g,"")}(t))}(t),i)},ni=function(t){if(!/^content-disposition:/i.test(t))return null;var i=t.split(/filename=|filename\*=.+''/).splice(1).map((function(t){return t.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(t){return t.length}));return i.length?decodeURI(i[i.length-1]):null},oi=function(t){if(/content-length:/i.test(t)){var i=t.match(/[0-9]+/)[0];return i?parseInt(i,10):null}return null},ai=function(t){return/x-content-transfer-id:/i.test(t)&&(t.split(":")[1]||"").trim()||null},ri=function(t){var i={source:null,name:null,size:null},e=t.split("\n"),n=!0,o=!1,a=void 0;try{for(var r,s=e[Symbol.iterator]();!(n=(r=s.next()).done);n=!0){var l=r.value,c=ni(l);if(c)i.name=c;else{var p=oi(l);if(p)i.size=p;else{var u=ai(l);u&&(i.source=u)}}}}catch(t){o=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return i},si=function(t){var i={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},e=function(e){t?(i.timestamp=Date.now(),i.request=t(e,(function(t){i.duration=Date.now()-i.timestamp,i.complete=!0,t instanceof Blob&&(t=Jt(t,t.name||Zt(e))),n.fire("load",t instanceof Blob?t:t?t.body:null)}),(function(t){n.fire("error","string"==typeof t?{type:"error",code:0,body:t}:t)}),(function(t,e,o){o&&(i.size=o),i.duration=Date.now()-i.timestamp,t?(i.progress=e/o,n.fire("progress",i.progress)):i.progress=null}),(function(){n.fire("abort")}),(function(t){var e=ri("string"==typeof t?t:t.headers);n.fire("meta",{size:i.size||e.size,filename:e.name,source:e.source})}))):n.fire("error",{type:"error",body:"Can't load URL",code:400})},n=Object.assign({},mt(),{setSource:function(t){return i.source=t},getProgress:function(){return i.progress},abort:function(){i.request&&i.request.abort&&i.request.abort()},load:function(){var t,o,a=i.source;n.fire("init",a),a instanceof File?n.fire("load",a):a instanceof Blob?n.fire("load",Jt(a,a.name)):qt(a)?n.fire("load",Jt(ei(a),t,null,o)):e(a)}});return n},li=function(t){return/GET|HEAD/.test(t)},ci=function(t,i,e){var n={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){o=!0,r.abort()}},o=!1,a=!1;e=Object.assign({method:"POST",headers:{},withCredentials:!1},e),i=encodeURI(i),li(e.method)&&t&&(i=""+i+encodeURIComponent("string"==typeof t?t:JSON.stringify(t)));var r=new XMLHttpRequest;return(li(e.method)?r:r.upload).onprogress=function(t){o||n.onprogress(t.lengthComputable,t.loaded,t.total)},r.onreadystatechange=function(){r.readyState<2||4===r.readyState&&0===r.status||a||(a=!0,n.onheaders(r))},r.onload=function(){r.status>=200&&r.status<300?n.onload(r):n.onerror(r)},r.onerror=function(){return n.onerror(r)},r.onabort=function(){o=!0,n.onabort()},r.ontimeout=function(){return n.ontimeout(r)},r.open(e.method,i,!0),Y(e.timeout)&&(r.timeout=e.timeout),Object.keys(e.headers).forEach((function(t){var i=unescape(encodeURIComponent(e.headers[t]));r.setRequestHeader(t,i)})),e.responseType&&(r.responseType=e.responseType),e.withCredentials&&(r.withCredentials=!0),r.send(t),n},pi=function(t,i,e,n){return{type:t,code:i,body:e,headers:n}},ui=function(t){return function(i){t(pi("error",0,"Timeout",i.getAllResponseHeaders()))}},hi=function(t){return/\?/.test(t)},di=function(){for(var t="",i=arguments.length,e=new Array(i),n=0;n<i;n++)e[n]=arguments[n];return e.forEach((function(i){t+=hi(t)&&hi(i)?i.replace(/\?/,"&"):i})),t},fi=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;if("function"==typeof i)return i;if(!i||!U(i.url))return null;var e=i.onload||function(t){return t},n=i.onerror||function(){return null};return function(o,a,r,s,l,c){var p=ci(o,di(t,i.url),Object.assign({},i,{responseType:"blob"}));return p.onload=function(t){var n=t.getAllResponseHeaders(),r=ri(n).name||Zt(o);a(pi("load",t.status,"HEAD"===i.method?null:Jt(e(t.response),r),n))},p.onerror=function(t){r(pi("error",t.status,n(t.response)||t.statusText,t.getAllResponseHeaders()))},p.onheaders=function(t){c(pi("headers",t.status,null,t.getAllResponseHeaders()))},p.ontimeout=ui(r),p.onprogress=s,p.onabort=l,p}},gi=0,_i=1,mi=2,vi=3,bi=4,xi=function(t,i,e,n,o,a,r,s,l,c,p){for(var u=[],h=p.chunkServer,d=p.chunkSize,f=p.chunkRetryDelays,g={serverId:p.chunkTransferId,aborted:!1},_=i.ondata||function(t){return t},m=i.onload||function(t,i){return"HEAD"===i?t.getResponseHeader("Upload-Offset"):t.response},v=i.onerror||function(){return null},b=Math.floor(n.size/d),x=0;x<=b;x++){var w=x*d,y=n.slice(w,w+d,"application/offset+octet-stream");u[x]={index:x,size:y.size,offset:w,data:y,file:n,progress:0,retries:dt(f),status:gi,error:null,request:null,timeout:null}}var k,E,T,I,A=function(t){return t.status===gi||t.status===vi},M=function(i){if(!g.aborted)if(i=i||u.find(A)){i.status=mi,i.progress=null;var e=h.ondata||function(t){return t},o=h.onerror||function(){return null},s=di(t,h.url,g.serverId),c="function"==typeof h.headers?h.headers(i):Object.assign({},h.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":i.offset,"Upload-Length":n.size,"Upload-Name":n.name}),p=i.request=ci(e(i.data),s,Object.assign({},h,{headers:c}));p.onload=function(){i.status=_i,i.request=null,O()},p.onprogress=function(t,e){i.progress=t?e:null,R()},p.onerror=function(t){i.status=vi,i.request=null,i.error=o(t.response)||t.statusText,D(i)||r(pi("error",t.status,o(t.response)||t.statusText,t.getAllResponseHeaders()))},p.ontimeout=function(t){i.status=vi,i.request=null,D(i)||ui(r)(t)},p.onabort=function(){i.status=gi,i.request=null,l()}}else u.every((function(t){return t.status===_i}))&&a(g.serverId)},D=function(t){return 0!==t.retries.length&&(t.status=bi,clearTimeout(t.timeout),t.timeout=setTimeout((function(){M(t)}),t.retries.shift()),!0)},R=function(){var t=u.reduce((function(t,i){return null===t||null===i.progress?null:t+i.progress}),0);if(null===t)return s(!1,0,0);var i=u.reduce((function(t,i){return t+i.size}),0);s(!0,t,i)},O=function(){u.filter((function(t){return t.status===mi})).length>=1||M()};return g.serverId?(k=function(t){g.aborted||(u.filter((function(i){return i.offset<t})).forEach((function(t){t.status=_i,t.progress=t.size})),O())},E=di(t,h.url,g.serverId),T={headers:"function"==typeof i.headers?i.headers(g.serverId):Object.assign({},i.headers),method:"HEAD"},(I=ci(null,E,T)).onload=function(t){return k(m(t,T.method))},I.onerror=function(t){return r(pi("error",t.status,v(t.response)||t.statusText,t.getAllResponseHeaders()))},I.ontimeout=ui(r)):function(a){var s=new FormData;X(o)&&s.append(e,JSON.stringify(o));var l="function"==typeof i.headers?i.headers(n,o):Object.assign({},i.headers,{"Upload-Length":n.size}),c=Object.assign({},i,{headers:l}),p=ci(_(s),di(t,i.url),c);p.onload=function(t){return a(m(t,c.method))},p.onerror=function(t){return r(pi("error",t.status,v(t.response)||t.statusText,t.getAllResponseHeaders()))},p.ontimeout=ui(r)}((function(t){g.aborted||(c(t),g.serverId=t,O())})),{abort:function(){g.aborted=!0,u.forEach((function(t){clearTimeout(t.timeout),t.request&&t.request.abort()}))}}},wi=function(t,i,e,n){return function(o,a,r,s,l,c,p){if(o){var u=n.chunkUploads;if(o instanceof Blob&&u&&(u&&o.size>n.chunkSize||n.chunkForce))return xi(t,i,e,o,a,r,s,l,c,p,n);var h=i.ondata||function(t){return t},d=i.onload||function(t){return t},f=i.onerror||function(){return null},g="function"==typeof i.headers?i.headers(o,a)||{}:Object.assign({},i.headers),_=Object.assign({},i,{headers:g}),m=new FormData;X(a)&&m.append(e,JSON.stringify(a)),(o instanceof Blob?[{name:null,file:o}]:o).forEach((function(t){m.append(e,t.file,null===t.name?t.file.name:""+t.name+t.file.name)}));var v=ci(h(m),di(t,i.url),_);return v.onload=function(t){r(pi("load",t.status,d(t.response),t.getAllResponseHeaders()))},v.onerror=function(t){s(pi("error",t.status,f(t.response)||t.statusText,t.getAllResponseHeaders()))},v.ontimeout=ui(s),v.onprogress=l,v.onabort=c,v}}},yi=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;if("function"==typeof i)return i;if(!i||!U(i.url))return function(t,i){return i()};var e=i.onload||function(t){return t},n=i.onerror||function(){return null};return function(o,a,r){var s=ci(o,t+i.url,i);return s.onload=function(t){a(pi("load",t.status,e(t.response),t.getAllResponseHeaders()))},s.onerror=function(t){r(pi("error",t.status,n(t.response)||t.statusText,t.getAllResponseHeaders()))},s.ontimeout=ui(r),s}},ki=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t+Math.random()*(i-t)},Ei=function(t,i){var e={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},n=i.allowMinimumUploadDuration,o=function(){e.request&&(e.perceivedPerformanceUpdater.clear(),e.request.abort&&e.request.abort(),e.complete=!0)},a=n?function(){return e.progress?Math.min(e.progress,e.perceivedProgress):null}:function(){return e.progress||null},r=n?function(){return Math.min(e.duration,e.perceivedDuration)}:function(){return e.duration},s=Object.assign({},mt(),{process:function(i,o){var a=function(){0!==e.duration&&null!==e.progress&&s.fire("progress",s.getProgress())},r=function(){e.complete=!0,s.fire("load-perceived",e.response.body)};s.fire("start"),e.timestamp=Date.now(),e.perceivedPerformanceUpdater=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:25,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=null,a=Date.now();return i>0&&function r(){var s=Date.now()-a,l=ki(e,n);s+l>i&&(l=s+l-i);var c=s/i;c>=1||document.hidden?t(1):(t(c),o=setTimeout(r,l))}(),{clear:function(){clearTimeout(o)}}}((function(t){e.perceivedProgress=t,e.perceivedDuration=Date.now()-e.timestamp,a(),e.response&&1===e.perceivedProgress&&!e.complete&&r()}),n?ki(750,1500):0),e.request=t(i,o,(function(t){e.response=X(t)?t:{type:"load",code:200,body:""+t,headers:{}},e.duration=Date.now()-e.timestamp,e.progress=1,s.fire("load",e.response.body),(!n||n&&1===e.perceivedProgress)&&r()}),(function(t){e.perceivedPerformanceUpdater.clear(),s.fire("error",X(t)?t:{type:"error",code:0,body:""+t})}),(function(t,i,n){e.duration=Date.now()-e.timestamp,e.progress=t?i/n:null,a()}),(function(){e.perceivedPerformanceUpdater.clear(),s.fire("abort",e.response?e.response.body:null)}),(function(t){s.fire("transfer",t)}))},abort:o,getProgress:a,getDuration:r,reset:function(){o(),e.complete=!1,e.perceivedProgress=0,e.progress=0,e.timestamp=null,e.perceivedDuration=0,e.duration=0,e.request=null,e.response=null}});return s},Ti=function(t){return t.substring(0,t.lastIndexOf("."))||t},Ii=function(t){var i=[t.name,t.size,t.type];return t instanceof Blob||qt(t)?i[0]=t.name||Qt():qt(t)?(i[1]=t.length,i[2]=ii(t)):U(t)&&(i[0]=Zt(t),i[1]=0,i[2]="application/octet-stream"),{name:i[0],size:i[1],type:i[2]}},Ai=function(t){return!!(t instanceof File||t instanceof Blob&&t.name)},Mi=function t(i){if(!X(i))return i;var e=P(i)?[]:{};for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];e[n]=o&&X(o)?t(o):o}return e},Di=function(t,i){var e=function(t,i){return G(i)?0:U(i)?t.findIndex((function(t){return t.id===i})):-1}(t,i);if(!(e<0))return t[e]||null},Ri=function(t,i,e,n,o,a){var r=ci(null,t,{method:"GET",responseType:"blob"});return r.onload=function(e){var n=e.getAllResponseHeaders(),o=ri(n).name||Zt(t);i(pi("load",e.status,Jt(e.response,o),n))},r.onerror=function(t){e(pi("error",t.status,t.statusText,t.getAllResponseHeaders()))},r.onheaders=function(t){a(pi("headers",t.status,null,t.getAllResponseHeaders()))},r.ontimeout=ui(e),r.onprogress=n,r.onabort=o,r},Oi=function(t){return 0===t.indexOf("//")&&(t=location.protocol+t),t.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},Si=function(t){return function(){return q(t)?t.apply(void 0,arguments):t}},Li=function(t,i){clearTimeout(i.listUpdateTimeout),i.listUpdateTimeout=setTimeout((function(){t("DID_UPDATE_ITEMS",{items:Pt(i.items)})}),0)},Ci=function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return new Promise((function(i){if(!t)return i(!0);var n=t.apply(void 0,e);return null==n?i(!0):"boolean"==typeof n?i(n):void("function"==typeof n.then&&n.then(i))}))},Pi=function(t,i){t.items.sort((function(t,e){return i(xt(t),xt(e))}))},Gi=function(t,i){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.query,o=e.success,a=void 0===o?function(){}:o,r=e.failure,s=void 0===r?function(){}:r,l=ht(e,["query","success","failure"]),c=Lt(t.items,n);c?i(c,a,s,l||{}):s({error:pi("error",0,"Item not found"),file:null})}},zi=function(t,i,e){return{ABORT_ALL:function(){Pt(e.items).forEach((function(t){t.freeze(),t.abortLoad(),t.abortProcessing()}))},DID_SET_FILES:function(i){var n=i.value,o=(void 0===n?[]:n).map((function(t){return{source:t.source?t.source:t,options:t.options}})),a=Pt(e.items);a.forEach((function(i){o.find((function(t){return t.source===i.source||t.source===i.file}))||t("REMOVE_ITEM",{query:i,remove:!1})})),a=Pt(e.items),o.forEach((function(i,e){a.find((function(t){return t.source===i.source||t.file===i.source}))||t("ADD_ITEM",Object.assign({},i,{interactionMethod:pt,index:e}))}))},DID_UPDATE_ITEM_METADATA:function(n){var o=n.id,a=n.action,r=n.change;r.silent||(clearTimeout(e.itemUpdateTimeout),e.itemUpdateTimeout=setTimeout((function(){var n,s=Di(e.items,o);if(i("IS_ASYNC")){s.origin===kt.LOCAL&&t("DID_LOAD_ITEM",{id:s.id,error:null,serverFileReference:s.source});var l=function(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:o})}),32)};return s.status===yt.PROCESSING_COMPLETE?(n=e.options.instantUpload,void s.revert(yi(e.options.server.url,e.options.server.revert),i("GET_FORCE_REVERT")).then(n?l:function(){}).catch((function(){}))):s.status===yt.PROCESSING?function(t){s.abortProcessing().then(t?l:function(){})}(e.options.instantUpload):void(e.options.instantUpload&&l())}Mt("SHOULD_PREPARE_OUTPUT",!1,{item:s,query:i,action:a,change:r}).then((function(e){var n=i("GET_BEFORE_PREPARE_FILE");n&&(e=n(s,e)),e&&t("REQUEST_PREPARE_OUTPUT",{query:o,item:s,success:function(i){t("DID_PREPARE_OUTPUT",{id:o,file:i})}},!0)}))}),0))},MOVE_ITEM:function(t){var i=t.index,n=Lt(e.items,t.query);if(n){var o=e.items.indexOf(n);o!==(i=Wt(i,0,e.items.length-1))&&e.items.splice(i,0,e.items.splice(o,1)[0])}},SORT:function(n){Pi(e,n.compare),t("DID_SORT_ITEMS",{items:i("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(e){var n=e.items,o=e.index,a=e.interactionMethod,r=e.success,s=void 0===r?function(){}:r,l=e.failure,c=void 0===l?function(){}:l,p=o;if(-1===o||void 0===o){var u=i("GET_ITEM_INSERT_LOCATION"),h=i("GET_TOTAL_ITEMS");p="before"===u?0:h}var d=i("GET_IGNORED_FILES"),f=n.filter((function(t){return Ai(t)?!d.includes(t.name.toLowerCase()):!G(t)})).map((function(i){return new Promise((function(e,n){t("ADD_ITEM",{interactionMethod:a,source:i.source||i,success:e,failure:n,index:p++,options:i.options||{}})}))}));Promise.all(f).then(s).catch(c)},ADD_ITEM:function(n){var a=n.source,r=n.index,s=void 0===r?-1:r,l=n.interactionMethod,c=n.success,p=void 0===c?function(){}:c,u=n.failure,h=void 0===u?function(){}:u,d=n.options,f=void 0===d?{}:d;if(G(a))h({error:pi("error",0,"No source"),file:null});else if(!Ai(a)||!e.options.ignoredFiles.includes(a.name.toLowerCase())){if(!function(t){var i=Pt(t.items).length;if(!t.options.allowMultiple)return 0===i;var e=t.options.maxFiles;return null===e||i<e}(e)){if(e.options.allowMultiple||!e.options.allowMultiple&&!e.options.allowReplace){var g=pi("warning",0,"Max files");return t("DID_THROW_MAX_FILES",{source:a,error:g}),void h({error:g,file:null})}var _=Pt(e.items)[0];if(_.status===yt.PROCESSING_COMPLETE||_.status===yt.PROCESSING_REVERT_ERROR){var m=i("GET_FORCE_REVERT");if(_.revert(yi(e.options.server.url,e.options.server.revert),m).then((function(){m&&t("ADD_ITEM",{source:a,index:s,interactionMethod:l,success:p,failure:h,options:f})})).catch((function(){})),m)return}t("REMOVE_ITEM",{query:_.id})}var v="local"===f.type?kt.LOCAL:"limbo"===f.type?kt.LIMBO:kt.INPUT,b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=ut(),a={archived:!1,frozen:!1,released:!1,source:null,file:e,serverFileReference:i,transferId:null,processingAborted:!1,status:i?yt.PROCESSING_COMPLETE:yt.INIT,activeLoader:null,activeProcessor:null},r=null,s={},l=function(t){return a.status=t},c=function(t){if(!a.released&&!a.frozen){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];h.fire.apply(h,[t].concat(e))}},p=function t(i,e){if(a.processingAborted)a.processingAborted=!1;else if(l(yt.PROCESSING),r=null,a.file instanceof Blob){i.on("load",(function(t){a.transferId=null,a.serverFileReference=t})),i.on("transfer",(function(t){a.transferId=t})),i.on("load-perceived",(function(t){a.activeProcessor=null,a.transferId=null,a.serverFileReference=t,l(yt.PROCESSING_COMPLETE),c("process-complete",t)})),i.on("start",(function(){c("process-start")})),i.on("error",(function(t){a.activeProcessor=null,l(yt.PROCESSING_ERROR),c("process-error",t)})),i.on("abort",(function(t){a.activeProcessor=null,a.serverFileReference=t,l(yt.IDLE),c("process-abort"),r&&r()})),i.on("progress",(function(t){c("process-progress",t)}));var n=console.error;e(a.file,(function(t){a.archived||i.process(t,Object.assign({},s))}),n),a.activeProcessor=i}else h.on("load",(function(){t(i,e)}))},u=function(t,i,e){var n=t.split("."),o=n[0],a=n.pop(),r=s;n.forEach((function(t){return r=r[t]})),JSON.stringify(r[a])!==JSON.stringify(i)&&(r[a]=i,c("metadata-update",{key:o,value:s[o],silent:e}))},h=Object.assign({id:{get:function(){return n}},origin:{get:function(){return t},set:function(i){return t=i}},serverId:{get:function(){return a.serverFileReference}},transferId:{get:function(){return a.transferId}},status:{get:function(){return a.status}},filename:{get:function(){return a.file.name}},filenameWithoutExtension:{get:function(){return Ti(a.file.name)}},fileExtension:{get:function(){return $t(a.file.name)}},fileType:{get:function(){return a.file.type}},fileSize:{get:function(){return a.file.size}},file:{get:function(){return a.file}},relativePath:{get:function(){return a.file._relativePath}},source:{get:function(){return a.source}},getMetadata:function(t){return Mi(t?s[t]:s)},setMetadata:function(t,i,e){if(X(t)){var n=t;return Object.keys(n).forEach((function(t){u(t,n[t],i)})),t}return u(t,i,e),i},extend:function(t,i){return d[t]=i},abortLoad:function(){a.activeLoader?a.activeLoader.abort():(l(yt.INIT),c("load-abort"))},retryLoad:function(){a.activeLoader&&a.activeLoader.load()},requestProcessing:function(){a.processingAborted=!1,l(yt.PROCESSING_QUEUED)},abortProcessing:function(){return new Promise((function(t){if(!a.activeProcessor)return a.processingAborted=!0,l(yt.IDLE),c("process-abort"),void t();r=function(){t()},a.activeProcessor.abort()}))},load:function(i,e,n){a.source=i,h.fireSync("init"),a.file?h.fireSync("load-skip"):(a.file=Ii(i),e.on("init",(function(){c("load-init")})),e.on("meta",(function(i){a.file.size=i.size,a.file.filename=i.filename,i.source&&(t=kt.LIMBO,a.serverFileReference=i.source,a.status=yt.PROCESSING_COMPLETE),c("load-meta")})),e.on("progress",(function(t){l(yt.LOADING),c("load-progress",t)})),e.on("error",(function(t){l(yt.LOAD_ERROR),c("load-request-error",t)})),e.on("abort",(function(){l(yt.INIT),c("load-abort")})),e.on("load",(function(i){a.activeLoader=null;var e=function(i){a.file=Ai(i)?i:a.file,l(t===kt.LIMBO&&a.serverFileReference?yt.PROCESSING_COMPLETE:yt.IDLE),c("load")};a.serverFileReference?e(i):n(i,e,(function(t){a.file=i,c("load-meta"),l(yt.LOAD_ERROR),c("load-file-error",t)}))})),e.setSource(i),a.activeLoader=e,e.load())},process:p,revert:function(t,i){return new Promise((function(e,n){var o=null!==a.serverFileReference?a.serverFileReference:a.transferId;null!==o?(t(o,(function(){a.serverFileReference=null,a.transferId=null,e()}),(function(t){i?(l(yt.PROCESSING_REVERT_ERROR),c("process-revert-error"),n(t)):e()})),l(yt.IDLE),c("process-revert")):e()}))}},mt(),{freeze:function(){return a.frozen=!0},release:function(){return a.released=!0},released:{get:function(){return a.released}},archive:function(){return a.archived=!0},archived:{get:function(){return a.archived}}}),d=o(h);return d}(v,v===kt.INPUT?null:a,f.file);Object.keys(f.metadata||{}).forEach((function(t){b.setMetadata(t,f.metadata[t])})),Dt("DID_CREATE_ITEM",b,{query:i,dispatch:t});var x=i("GET_ITEM_INSERT_LOCATION");e.options.itemInsertLocationFreedom||(s="before"===x?-1:e.items.length),function(t,i,e){G(i)||(void 0===e?t.push(i):function(t,i,e){t.splice(i,0,e)}(t,e=Wt(e,0,t.length),i))}(e.items,b,s),q(x)&&a&&Pi(e,x);var w=b.id;b.on("init",(function(){t("DID_INIT_ITEM",{id:w})})),b.on("load-init",(function(){t("DID_START_ITEM_LOAD",{id:w})})),b.on("load-meta",(function(){t("DID_UPDATE_ITEM_META",{id:w})})),b.on("load-progress",(function(i){t("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:w,progress:i})})),b.on("load-request-error",(function(i){var n=Si(e.options.labelFileLoadError)(i);if(i.code>=400&&i.code<500)return t("DID_THROW_ITEM_INVALID",{id:w,error:i,status:{main:n,sub:i.code+" ("+i.body+")"}}),void h({error:i,file:xt(b)});t("DID_THROW_ITEM_LOAD_ERROR",{id:w,error:i,status:{main:n,sub:e.options.labelTapToRetry}})})),b.on("load-file-error",(function(i){t("DID_THROW_ITEM_INVALID",{id:w,error:i.status,status:i.status}),h({error:i.status,file:xt(b)})})),b.on("load-abort",(function(){t("REMOVE_ITEM",{query:w})})),b.on("load-skip",(function(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:a,success:p}})})),b.on("load",(function(){var n=function(n){n?(b.on("metadata-update",(function(i){t("DID_UPDATE_ITEM_METADATA",{id:w,change:i})})),Mt("SHOULD_PREPARE_OUTPUT",!1,{item:b,query:i}).then((function(n){var o=i("GET_BEFORE_PREPARE_FILE");o&&(n=o(b,n));var r=function(){t("COMPLETE_LOAD_ITEM",{query:w,item:b,data:{source:a,success:p}}),Li(t,e)};n?t("REQUEST_PREPARE_OUTPUT",{query:w,item:b,success:function(i){t("DID_PREPARE_OUTPUT",{id:w,file:i}),r()}},!0):r()}))):t("REMOVE_ITEM",{query:w})};Mt("DID_LOAD_ITEM",b,{query:i,dispatch:t}).then((function(){Ci(i("GET_BEFORE_ADD_FILE"),xt(b)).then(n)})).catch((function(i){if(!i||!i.error||!i.status)return n(!1);t("DID_THROW_ITEM_INVALID",{id:w,error:i.error,status:i.status})}))})),b.on("process-start",(function(){t("DID_START_ITEM_PROCESSING",{id:w})})),b.on("process-progress",(function(i){t("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:w,progress:i})})),b.on("process-error",(function(i){t("DID_THROW_ITEM_PROCESSING_ERROR",{id:w,error:i,status:{main:Si(e.options.labelFileProcessingError)(i),sub:e.options.labelTapToRetry}})})),b.on("process-revert-error",(function(i){t("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:w,error:i,status:{main:Si(e.options.labelFileProcessingRevertError)(i),sub:e.options.labelTapToRetry}})})),b.on("process-complete",(function(i){t("DID_COMPLETE_ITEM_PROCESSING",{id:w,error:null,serverFileReference:i}),t("DID_DEFINE_VALUE",{id:w,value:i})})),b.on("process-abort",(function(){t("DID_ABORT_ITEM_PROCESSING",{id:w})})),b.on("process-revert",(function(){t("DID_REVERT_ITEM_PROCESSING",{id:w}),t("DID_DEFINE_VALUE",{id:w,value:null})})),t("DID_ADD_ITEM",{id:w,index:s,interactionMethod:l}),Li(t,e);var y=e.options.server||{},k=y.url,E=y.load,T=y.restore,I=y.fetch;b.load(a,si(v===kt.INPUT?U(a)&&function(t){return(t.indexOf(":")>-1||t.indexOf("//")>-1)&&Oi(location.href)!==Oi(t)}(a)&&I?fi(k,I):Ri:fi(k,v===kt.LIMBO?T:E)),(function(t,e,n){Mt("LOAD_FILE",t,{query:i}).then(e).catch(n)}))}},REQUEST_PREPARE_OUTPUT:function(t){var e=t.item,n=t.success,o=t.failure,a=void 0===o?function(){}:o,r={error:pi("error",0,"Item not found"),file:null};if(e.archived)return a(r);Mt("PREPARE_OUTPUT",e.file,{query:i,item:e}).then((function(t){Mt("COMPLETE_PREPARE_OUTPUT",t,{query:i,item:e}).then((function(t){if(e.archived)return a(r);n(t)}))}))},COMPLETE_LOAD_ITEM:function(n){var o=n.item,a=n.data,r=a.success,s=a.source,l=i("GET_ITEM_INSERT_LOCATION");if(q(l)&&s&&Pi(e,l),t("DID_LOAD_ITEM",{id:o.id,error:null,serverFileReference:o.origin===kt.INPUT?null:s}),r(xt(o)),o.origin!==kt.LOCAL)return o.origin===kt.LIMBO?(t("DID_COMPLETE_ITEM_PROCESSING",{id:o.id,error:null,serverFileReference:s}),void t("DID_DEFINE_VALUE",{id:o.id,value:o.serverId||s})):void(i("IS_ASYNC")&&e.options.instantUpload&&t("REQUEST_ITEM_PROCESSING",{query:o.id}));t("DID_LOAD_LOCAL_ITEM",{id:o.id})},RETRY_ITEM_LOAD:Gi(e,(function(t){t.retryLoad()})),REQUEST_ITEM_PREPARE:Gi(e,(function(i,e,n){t("REQUEST_PREPARE_OUTPUT",{query:i.id,item:i,success:function(n){t("DID_PREPARE_OUTPUT",{id:i.id,file:n}),e({file:i,output:n})},failure:n},!0)})),REQUEST_ITEM_PROCESSING:Gi(e,(function(n,o,a){if(n.status===yt.IDLE||n.status===yt.PROCESSING_ERROR)n.status!==yt.PROCESSING_QUEUED&&(n.requestProcessing(),t("DID_REQUEST_ITEM_PROCESSING",{id:n.id}),t("PROCESS_ITEM",{query:n,success:o,failure:a},!0));else{var r=function(){return t("REQUEST_ITEM_PROCESSING",{query:n,success:o,failure:a})},s=function(){return document.hidden?r():setTimeout(r,32)};n.status===yt.PROCESSING_COMPLETE||n.status===yt.PROCESSING_REVERT_ERROR?n.revert(yi(e.options.server.url,e.options.server.revert),i("GET_FORCE_REVERT")).then(s).catch((function(){})):n.status===yt.PROCESSING&&n.abortProcessing().then(s)}})),PROCESS_ITEM:Gi(e,(function(n,o,a){var r=i("GET_MAX_PARALLEL_UPLOADS");if(i("GET_ITEMS_BY_STATUS",yt.PROCESSING).length!==r){if(n.status!==yt.PROCESSING){var s=function i(){var n=e.processingQueue.shift();if(n){var o=n.id,a=n.success,r=n.failure,s=Lt(e.items,o);s&&!s.archived?t("PROCESS_ITEM",{query:o,success:a,failure:r},!0):i()}};n.onOnce("process-complete",(function(){if(o(xt(n)),s(),e.options.instantUpload&&n.origin===kt.LOCAL&&q(e.options.server.remove)){var a=function(){};n.origin=kt.LIMBO,e.options.server.remove(n.source,a,a)}i("GET_ITEMS_BY_STATUS",yt.PROCESSING_COMPLETE).length===e.items.length&&t("DID_COMPLETE_ITEM_PROCESSING_ALL")})),n.onOnce("process-error",(function(t){a({error:t,file:xt(n)}),s()}));var l=e.options;n.process(Ei(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;return"function"==typeof i?function(){for(var t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return i.apply(void 0,[e].concat(o,[n]))}:i&&U(i.url)?wi(t,i,e,n):null}(l.server.url,l.server.process,l.name,{chunkTransferId:n.transferId,chunkServer:l.server.patch,chunkUploads:l.chunkUploads,chunkForce:l.chunkForce,chunkSize:l.chunkSize,chunkRetryDelays:l.chunkRetryDelays}),{allowMinimumUploadDuration:i("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(e,o,a){Mt("PREPARE_OUTPUT",e,{query:i,item:n}).then((function(i){t("DID_PREPARE_OUTPUT",{id:n.id,file:i}),o(i)})).catch(a)}))}}else e.processingQueue.push({id:n.id,success:o,failure:a})})),RETRY_ITEM_PROCESSING:Gi(e,(function(i){t("REQUEST_ITEM_PROCESSING",{query:i})})),REQUEST_REMOVE_ITEM:Gi(e,(function(e){Ci(i("GET_BEFORE_REMOVE_FILE"),xt(e)).then((function(i){i&&t("REMOVE_ITEM",{query:e})}))})),RELEASE_ITEM:Gi(e,(function(t){t.release()})),REMOVE_ITEM:Gi(e,(function(n,o,a,r){var s=function(){var i=n.id;Di(e.items,i).archive(),t("DID_REMOVE_ITEM",{error:null,id:i,item:n}),Li(t,e),o(xt(n))},l=e.options.server;n.origin===kt.LOCAL&&l&&q(l.remove)&&!1!==r.remove?(t("DID_START_ITEM_REMOVE",{id:n.id}),l.remove(n.source,(function(){return s()}),(function(i){t("DID_THROW_ITEM_REMOVE_ERROR",{id:n.id,error:pi("error",0,i,null),status:{main:Si(e.options.labelFileRemoveError)(i),sub:e.options.labelTapToRetry}})}))):((r.revert&&n.origin!==kt.LOCAL&&null!==n.serverId||e.options.chunkUploads&&n.file.size>e.options.chunkSize||e.options.chunkUploads&&e.options.chunkForce)&&n.revert(yi(e.options.server.url,e.options.server.revert),i("GET_FORCE_REVERT")),s())})),ABORT_ITEM_LOAD:Gi(e,(function(t){t.abortLoad()})),ABORT_ITEM_PROCESSING:Gi(e,(function(i){i.serverId?t("REVERT_ITEM_PROCESSING",{id:i.id}):i.abortProcessing().then((function(){e.options.instantUpload&&t("REMOVE_ITEM",{query:i.id})}))})),REQUEST_REVERT_ITEM_PROCESSING:Gi(e,(function(n){if(e.options.instantUpload){var o=function(i){i&&t("REVERT_ITEM_PROCESSING",{query:n})},a=i("GET_BEFORE_REMOVE_FILE");if(!a)return o(!0);var r=a(xt(n));return null==r?o(!0):"boolean"==typeof r?o(r):void("function"==typeof r.then&&r.then(o))}t("REVERT_ITEM_PROCESSING",{query:n})})),REVERT_ITEM_PROCESSING:Gi(e,(function(n){n.revert(yi(e.options.server.url,e.options.server.revert),i("GET_FORCE_REVERT")).then((function(){(e.options.instantUpload||function(t){return!Ai(t.file)}(n))&&t("REMOVE_ITEM",{query:n.id})})).catch((function(){}))})),SET_OPTIONS:function(i){var e=i.options,n=Object.keys(e),o=Ni.filter((function(t){return n.includes(t)}));[].concat(dt(o),dt(Object.keys(e).filter((function(t){return!o.includes(t)})))).forEach((function(i){t("SET_"+et(i,"_").toUpperCase(),{value:e[i]})}))}}},Ni=["server"],Bi=function(t){return document.createElement(t)},Fi=function(t,i){var e=t.childNodes[0];e?i!==e.nodeValue&&(e.nodeValue=i):(e=document.createTextNode(i),t.appendChild(e))},Ui=function(t,i,e,n){var o=(n%360-90)*Math.PI/180;return{x:t+e*Math.cos(o),y:i+e*Math.sin(o)}},ji=function(t,i,e,n,o){var a=1;return o>n&&o-n<=.5&&(a=0),n>o&&n-o>=.5&&(a=0),function(t,i,e,n,o,a){var r=Ui(t,i,e,o),s=Ui(t,i,e,n);return["M",r.x,r.y,"A",e,e,0,a,0,s.x,s.y].join(" ")}(t,i,e,360*Math.min(.9999,n),360*Math.min(.9999,o),a)},Hi=O({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function(t){var i=t.root,e=t.props;e.spin=!1,e.progress=0,e.opacity=0;var n=c("svg");i.ref.path=c("path",{"stroke-width":2,"stroke-linecap":"round"}),n.appendChild(i.ref.path),i.ref.svg=n,i.appendChild(n)},write:function(t){var i=t.root,e=t.props;if(0!==e.opacity){e.align&&(i.element.dataset.align=e.align);var n=parseInt(a(i.ref.path,"stroke-width"),10),o=.5*i.rect.element.width,r=0,s=0;e.spin?(r=0,s=.5):(r=0,s=e.progress);var l=ji(o,o,o-n,r,s);a(i.ref.path,"d",l),a(i.ref.path,"stroke-opacity",e.spin||e.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),Vi=O({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(t){var i=t.props;t.root.element.innerHTML=(i.icon||"")+"<span>"+i.label+"</span>",i.isDisabled=!1},write:function(t){var i=t.root,e=t.props,n=e.isDisabled,o=i.query("GET_DISABLED")||0===e.opacity;o&&!n?(e.isDisabled=!0,a(i.element,"disabled","disabled")):!o&&n&&(e.isDisabled=!1,i.element.removeAttribute("disabled"))}}),Yi=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n.labelBytes,a=void 0===o?"bytes":o,r=n.labelKilobytes,s=void 0===r?"KB":r,l=n.labelMegabytes,c=void 0===l?"MB":l,p=n.labelGigabytes,u=void 0===p?"GB":p,h=e*e,d=e*e*e;return(t=Math.round(Math.abs(t)))<e?t+" "+a:t<h?Math.floor(t/e)+" "+s:t<d?Wi(t/h,1,i)+" "+c:Wi(t/d,2,i)+" "+u},Wi=function(t,i,e){return t.toFixed(i).split(".").filter((function(t){return"0"!==t})).join(e)},qi=function(t){var i=t.root,e=t.props;Fi(i.ref.fileSize,Yi(i.query("GET_ITEM_SIZE",e.id),".",i.query("GET_FILE_SIZE_BASE"),i.query("GET_FILE_SIZE_LABELS",i.query))),Fi(i.ref.fileName,i.query("GET_ITEM_NAME",e.id))},Zi=function(t){var i=t.root,e=t.props;Y(i.query("GET_ITEM_SIZE",e.id))?qi({root:i,props:e}):Fi(i.ref.fileSize,i.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},$i=O({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:S({DID_LOAD_ITEM:qi,DID_UPDATE_ITEM_META:qi,DID_THROW_ITEM_LOAD_ERROR:Zi,DID_THROW_ITEM_INVALID:Zi}),didCreateView:function(t){Dt("CREATE_VIEW",Object.assign({},t,{view:t}))},create:function(t){var i=t.root,e=t.props,n=Bi("span");n.className="filepond--file-info-main",a(n,"aria-hidden","true"),i.appendChild(n),i.ref.fileName=n;var o=Bi("span");o.className="filepond--file-info-sub",i.appendChild(o),i.ref.fileSize=o,Fi(o,i.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),Fi(n,i.query("GET_ITEM_NAME",e.id))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Xi=function(t){return Math.round(100*t)},Ki=function(t){var i=t.root,e=t.action,n=null===e.progress?i.query("GET_LABEL_FILE_LOADING"):i.query("GET_LABEL_FILE_LOADING")+" "+Xi(e.progress)+"%";Fi(i.ref.main,n),Fi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))},Qi=function(t){var i=t.root;Fi(i.ref.main,""),Fi(i.ref.sub,"")},Ji=function(t){var i=t.root,e=t.action;Fi(i.ref.main,e.status.main),Fi(i.ref.sub,e.status.sub)},te=O({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:S({DID_LOAD_ITEM:Qi,DID_REVERT_ITEM_PROCESSING:Qi,DID_REQUEST_ITEM_PROCESSING:function(t){var i=t.root;Fi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING")),Fi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function(t){var i=t.root;Fi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_ABORTED")),Fi(i.ref.sub,i.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function(t){var i=t.root;Fi(i.ref.main,i.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),Fi(i.ref.sub,i.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var i=t.root,e=t.action,n=null===e.progress?i.query("GET_LABEL_FILE_PROCESSING"):i.query("GET_LABEL_FILE_PROCESSING")+" "+Xi(e.progress)+"%";Fi(i.ref.main,n),Fi(i.ref.sub,i.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:Ki,DID_THROW_ITEM_LOAD_ERROR:Ji,DID_THROW_ITEM_INVALID:Ji,DID_THROW_ITEM_PROCESSING_ERROR:Ji,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Ji,DID_THROW_ITEM_REMOVE_ERROR:Ji}),didCreateView:function(t){Dt("CREATE_VIEW",Object.assign({},t,{view:t}))},create:function(t){var i=t.root,e=Bi("span");e.className="filepond--file-status-main",i.appendChild(e),i.ref.main=e;var n=Bi("span");n.className="filepond--file-status-sub",i.appendChild(n),i.ref.sub=n,Ki({root:i,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),ie={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},ee=[];n(ie,(function(t){ee.push(t)}));var ne,oe=function(t){if("right"===le(t))return 0;var i=t.ref.buttonRemoveItem.rect.element;return i.hidden?null:i.width+i.left},ae=function(t){return t.ref.buttonAbortItemLoad.rect.element.width},re=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.height/4)},se=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.left/2)},le=function(t){return t.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},ce={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},pe={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:oe},status:{translateX:oe}},ue={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},he={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:oe},status:{translateX:oe,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:oe},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:le},info:{translateX:oe},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:le},buttonRemoveItem:{opacity:1},info:{translateX:oe},status:{opacity:1,translateX:oe}},DID_LOAD_ITEM:pe,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:oe},status:{translateX:oe}},DID_START_ITEM_PROCESSING:ue,DID_REQUEST_ITEM_PROCESSING:ue,DID_UPDATE_ITEM_PROCESS_PROGRESS:ue,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:oe}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:oe},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:pe},de=O({create:function(t){var i=t.root;i.element.innerHTML=i.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),fe=S({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(t){t.root.ref.buttonAbortItemProcessing.label=t.action.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(t){t.root.ref.buttonAbortItemLoad.label=t.action.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(t){t.root.ref.buttonAbortItemRemoval.label=t.action.value},DID_REQUEST_ITEM_PROCESSING:function(t){var i=t.root;i.ref.processProgressIndicator.spin=!0,i.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(t){var i=t.root;i.ref.loadProgressIndicator.spin=!0,i.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(t){var i=t.root;i.ref.processProgressIndicator.spin=!0,i.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(t){var i=t.root,e=t.action;i.ref.loadProgressIndicator.spin=!1,i.ref.loadProgressIndicator.progress=e.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var i=t.root,e=t.action;i.ref.processProgressIndicator.spin=!1,i.ref.processProgressIndicator.progress=e.progress}}),ge=O({create:function(t){var i,e=t.root,o=t.props,a=Object.keys(ie).reduce((function(t,i){return t[i]=Object.assign({},ie[i]),t}),{}),r=o.id,s=e.query("GET_ALLOW_REVERT"),l=e.query("GET_ALLOW_REMOVE"),c=e.query("GET_ALLOW_PROCESS"),p=e.query("GET_INSTANT_UPLOAD"),u=e.query("IS_ASYNC"),h=e.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");u?c&&!s?i=function(t){return!/RevertItemProcessing/.test(t)}:!c&&s?i=function(t){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(t)}:c||s||(i=function(t){return!/Process/.test(t)}):i=function(t){return!/Process/.test(t)};var d=i?ee.filter(i):ee.concat();if(p&&s&&(a.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",a.RevertItemProcessing.icon="GET_ICON_REMOVE"),u&&!s){var f=he.DID_COMPLETE_ITEM_PROCESSING;f.info.translateX=se,f.info.translateY=re,f.status.translateY=re,f.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(u&&!c&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(t){he[t].status.translateY=re})),he.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=ae),h&&s){a.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var g=he.DID_COMPLETE_ITEM_PROCESSING;g.info.translateX=oe,g.status.translateY=re,g.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}l||(a.RemoveItem.disabled=!0),n(a,(function(t,i){var n=e.createChildView(Vi,{label:e.query(i.label),icon:e.query(i.icon),opacity:0});d.includes(t)&&e.appendChildView(n),i.disabled&&(n.element.setAttribute("disabled","disabled"),n.element.setAttribute("hidden","hidden")),n.element.dataset.align=e.query("GET_STYLE_"+i.align),n.element.classList.add(i.className),n.on("click",(function(t){t.stopPropagation(),i.disabled||e.dispatch(i.action,{query:r})})),e.ref["button"+t]=n})),e.ref.processingCompleteIndicator=e.appendChildView(e.createChildView(de)),e.ref.processingCompleteIndicator.element.dataset.align=e.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),e.ref.info=e.appendChildView(e.createChildView($i,{id:r})),e.ref.status=e.appendChildView(e.createChildView(te,{id:r}));var _=e.appendChildView(e.createChildView(Hi,{opacity:0,align:e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));_.element.classList.add("filepond--load-indicator"),e.ref.loadProgressIndicator=_;var m=e.appendChildView(e.createChildView(Hi,{opacity:0,align:e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));m.element.classList.add("filepond--process-indicator"),e.ref.processProgressIndicator=m,e.ref.activeStyles=[]},write:function(t){var i=t.root,e=t.actions;fe({root:i,actions:e,props:t.props});var o=e.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return he[t.type]}));if(o){i.ref.activeStyles=[];var a=he[o.type];n(ce,(function(t,e){var o=i.ref[t];n(e,(function(e,n){i.ref.activeStyles.push({control:o,key:e,value:a[t]&&void 0!==a[t][e]?a[t][e]:n})}))}))}i.ref.activeStyles.forEach((function(t){var e=t.value;t.control[t.key]="function"==typeof e?e(i):e}))},didCreateView:function(t){Dt("CREATE_VIEW",Object.assign({},t,{view:t}))},name:"file"}),_e=O({create:function(t){var i=t.root,e=t.props;i.ref.fileName=Bi("legend"),i.appendChild(i.ref.fileName),i.ref.file=i.appendChildView(i.createChildView(ge,{id:e.id})),i.ref.data=!1},ignoreRect:!0,write:S({DID_LOAD_ITEM:function(t){var i=t.root;Fi(i.ref.fileName,i.query("GET_ITEM_NAME",t.props.id))}}),didCreateView:function(t){Dt("CREATE_VIEW",Object.assign({},t,{view:t}))},tag:"fieldset",name:"file-wrapper"}),me={type:"spring",damping:.6,mass:7},ve=function(t,i,e){var n=O({name:"panel-"+i.name+" filepond--"+e,mixins:i.mixins,ignoreRectUpdate:!0}),o=t.createChildView(n,i.props);t.ref[i.name]=t.appendChildView(o)},be=O({name:"panel",read:function(t){return t.props.heightCurrent=t.root.ref.bottom.translateY},write:function(t){var i=t.root,e=t.props;if(null!==i.ref.scalable&&e.scalable===i.ref.scalable||(i.ref.scalable=!B(e.scalable)||e.scalable,i.element.dataset.scalable=i.ref.scalable),e.height){var n=i.ref.top.rect.element,o=i.ref.bottom.rect.element,a=Math.max(n.height+o.height,e.height);i.ref.center.translateY=n.height,i.ref.center.scaleY=(a-n.height-o.height)/100,i.ref.bottom.translateY=a-o.height}},create:function(t){var i=t.root,e=t.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:me},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:me},styles:["translateY"]}}].forEach((function(t){ve(i,t,e.name)})),i.element.classList.add("filepond--"+e.name),i.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),xe={type:"spring",stiffness:.75,damping:.45,mass:10},we="spring",ye={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},ke=S({DID_UPDATE_PANEL_HEIGHT:function(t){t.root.height=t.action.height}}),Ee=S({DID_GRAB_ITEM:function(t){var i=t.root;t.props.dragOrigin={x:i.translateX,y:i.translateY}},DID_DRAG_ITEM:function(t){t.root.element.dataset.dragState="drag"},DID_DROP_ITEM:function(t){var i=t.root,e=t.props;e.dragOffset=null,e.dragOrigin=null,i.element.dataset.dragState="drop"}},(function(t){var i=t.root,e=t.actions,n=t.props,o=t.shouldOptimize;"drop"===i.element.dataset.dragState&&i.scaleX<=1&&(i.element.dataset.dragState="idle");var a=e.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return ye[t.type]}));a&&a.type!==n.currentState&&(n.currentState=a.type,i.element.dataset.filepondItemState=ye[n.currentState]||"");var r=i.query("GET_ITEM_PANEL_ASPECT_RATIO")||i.query("GET_PANEL_ASPECT_RATIO");r?o||(i.height=i.rect.element.width*r):(ke({root:i,actions:e,props:n}),!i.height&&i.ref.container.rect.element.height>0&&(i.height=i.ref.container.rect.element.height)),o&&(i.ref.panel.height=null),i.ref.panel.height=i.height})),Te=O({create:function(t){var i=t.root,e=t.props;if(i.ref.handleClick=function(){return i.dispatch("DID_ACTIVATE_ITEM",{id:e.id})},i.element.id="filepond--item-"+e.id,i.element.addEventListener("click",i.ref.handleClick),i.ref.container=i.appendChildView(i.createChildView(_e,{id:e.id})),i.ref.panel=i.appendChildView(i.createChildView(be,{name:"item-panel"})),i.ref.panel.height=null,e.markedForRemoval=!1,i.query("GET_ALLOW_REORDER")){i.element.dataset.dragState="idle";i.element.addEventListener("pointerdown",(function(t){if(t.isPrimary){var n=!1,o={x:t.pageX,y:t.pageY};e.dragOrigin={x:i.translateX,y:i.translateY},e.dragCenter={x:t.offsetX,y:t.offsetY};var a=(s=i.query("GET_ACTIVE_ITEMS"),l=s.map((function(t){return t.id})),c=void 0,{setIndex:function(t){c=t},getIndex:function(){return c},getItemIndex:function(t){return l.indexOf(t.id)}});i.dispatch("DID_GRAB_ITEM",{id:e.id,dragState:a});var r=function(t){t.isPrimary&&(t.stopPropagation(),t.preventDefault(),e.dragOffset={x:t.pageX-o.x,y:t.pageY-o.y},e.dragOffset.x*e.dragOffset.x+e.dragOffset.y*e.dragOffset.y>16&&!n&&(n=!0,i.element.removeEventListener("click",i.ref.handleClick)),i.dispatch("DID_DRAG_ITEM",{id:e.id,dragState:a}))};document.addEventListener("pointermove",r),document.addEventListener("pointerup",(function t(s){s.isPrimary&&(document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",t),e.dragOffset={x:s.pageX-o.x,y:s.pageY-o.y},i.dispatch("DID_DROP_ITEM",{id:e.id,dragState:a}),n&&setTimeout((function(){return i.element.addEventListener("click",i.ref.handleClick)}),0))}))}var s,l,c}))}},write:Ee,destroy:function(t){var i=t.root,e=t.props;i.element.removeEventListener("click",i.ref.handleClick),i.dispatch("RELEASE_ITEM",{query:e.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:we,scaleY:we,translateX:xe,translateY:xe,opacity:{type:"tween",duration:150}}}}),Ie=function(t,i){return Math.max(1,Math.floor((t+1)/i))},Ae=function(t,i,e){if(e){var n=i.length,o=null;if(0===n||e.top<i[0].rect.element.top)return-1;var a=i[0].rect.element,r=a.width+(a.marginLeft+a.marginRight),s=Ie(t.rect.element.width,r);if(1===s){for(var l=0;l<n;l++){var c=i[l];if(e.top<c.rect.outer.top+.5*c.rect.element.height)return l}return n}for(var p=a.height+(a.marginTop+a.marginBottom),u=0;u<n;u++){var h=u%s,d=Math.floor(u/s)*p;if(e.top<d+p+a.marginBottom&&e.top>d-a.marginTop){if(e.left<h*r+r)return u;o=u!==n-1?u:null}}return null!==o?o:n}},Me={height:0,width:0,get getHeight(){return this.height},set setHeight(t){0!==this.height&&0!==t||(this.height=t)},get getWidth(){return this.width},set setWidth(t){0!==this.width&&0!==t||(this.width=t)},setDimensions:function(t,i){0!==this.height&&0!==t||(this.height=t),0!==this.width&&0!==i||(this.width=i)}},De=function(t,i,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;t.dragOffset?(t.translateX=null,t.translateY=null,t.translateX=t.dragOrigin.x+t.dragOffset.x,t.translateY=t.dragOrigin.y+t.dragOffset.y,t.scaleX=1.025,t.scaleY=1.025):(t.translateX=i,t.translateY=e,Date.now()>t.spawnDate&&(0===t.opacity&&Re(t,i,e,n,o),t.scaleX=1,t.scaleY=1,t.opacity=1))},Re=function(t,i,e,n,o){t.interactionMethod===pt?(t.translateX=null,t.translateX=i,t.translateY=null,t.translateY=e):t.interactionMethod===st?(t.translateX=null,t.translateX=i-20*n,t.translateY=null,t.translateY=e-10*o,t.scaleX=.8,t.scaleY=.8):t.interactionMethod===lt?(t.translateY=null,t.translateY=e-30):t.interactionMethod===rt&&(t.translateX=null,t.translateX=i-30,t.translateY=null)},Oe=function(t){return t.rect.element.height+.5*t.rect.element.marginBottom+.5*t.rect.element.marginTop},Se=S({DID_ADD_ITEM:function(t){var i=t.root,e=t.action,n=e.id,o=e.index,a=e.interactionMethod;i.ref.addIndex=o;var r=Date.now(),s=r,l=1;if(a!==pt){l=0;var c=i.query("GET_ITEM_INSERT_INTERVAL"),p=r-i.ref.lastItemSpanwDate;s=p<c?r+(c-p):r}i.ref.lastItemSpanwDate=s,i.appendChildView(i.createChildView(Te,{spawnDate:s,id:n,opacity:l,interactionMethod:a}),o)},DID_REMOVE_ITEM:function(t){var i=t.action.id,e=t.root.childViews.find((function(t){return t.id===i}));e&&(e.scaleX=.9,e.scaleY=.9,e.opacity=0,e.markedForRemoval=!0)},DID_DRAG_ITEM:function(t){var i,e=t.root,n=t.action,o=n.id,a=n.dragState,r=e.query("GET_ITEM",{id:o}),s=e.childViews.find((function(t){return t.id===o})),l=e.childViews.length,c=a.getItemIndex(r);if(s){var p={x:s.dragOrigin.x+s.dragOffset.x+s.dragCenter.x,y:s.dragOrigin.y+s.dragOffset.y+s.dragCenter.y},u=Oe(s),h=(i=s).rect.element.width+.5*i.rect.element.marginLeft+.5*i.rect.element.marginRight,d=Math.floor(e.rect.outer.width/h);d>l&&(d=l);var f=Math.floor(l/d+1);Me.setHeight=u*f,Me.setWidth=h*d;var g={y:Math.floor(p.y/u),x:Math.floor(p.x/h),getGridIndex:function(){return p.y>Me.getHeight||p.y<0||p.x>Me.getWidth||p.x<0?c:this.y*d+this.x},getColIndex:function(){for(var t=e.query("GET_ACTIVE_ITEMS"),i=e.childViews.filter((function(t){return t.rect.element.height})),n=t.map((function(t){return i.find((function(i){return i.id===t.id}))})),o=n.findIndex((function(t){return t===s})),a=Oe(s),r=n.length,l=r,c=0,u=0,h=0,d=0;d<r;d++)if(c=Oe(n[d]),p.y<(u=(h=u)+c)){if(o>d){if(p.y<h+a){l=d;break}continue}l=d;break}return l}},_=d>1?g.getGridIndex():g.getColIndex();e.dispatch("MOVE_ITEM",{query:s,index:_});var m=a.getIndex();if(void 0===m||m!==_){if(a.setIndex(_),void 0===m)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:c,target:_})}}}}),Le=O({create:function(t){var i=t.root;a(i.element,"role","list"),i.ref.lastItemSpanwDate=Date.now()},write:function(t){var i=t.root,e=t.props,n=t.shouldOptimize;Se({root:i,props:e,actions:t.actions});var o=e.dragCoordinates,a=i.rect.element.width,r=i.childViews.filter((function(t){return t.rect.element.height})),s=i.query("GET_ACTIVE_ITEMS").map((function(t){return r.find((function(i){return i.id===t.id}))})).filter((function(t){return t})),l=o?Ae(i,s,o):null,c=i.ref.addIndex||null;i.ref.addIndex=null;var p=0,u=0,h=0;if(0!==s.length){var d=s[0].rect.element,f=d.marginTop+d.marginBottom,g=d.width+(d.marginLeft+d.marginRight),_=d.height+f,m=Ie(a,g);if(1===m){var v=0,b=0;s.forEach((function(t,i){if(l){var e=i-l;b=-2===e?.25*-f:-1===e?.75*-f:0===e?.75*f:1===e?.25*f:0}n&&(t.translateX=null,t.translateY=null),t.markedForRemoval||De(t,0,v+b),v+=(t.rect.element.height+f)*(t.markedForRemoval?t.opacity:1)}))}else{var x=0,w=0;s.forEach((function(t,i){i===l&&(p=1),i===c&&(h+=1),t.markedForRemoval&&t.opacity<.5&&(u-=1);var e=i+h+p+u,o=e%m,a=Math.floor(e/m),r=o*g,s=a*_,d=Math.sign(r-x),f=Math.sign(s-w);x=r,w=s,t.markedForRemoval||(n&&(t.translateX=null,t.translateY=null),De(t,r,s,d,f))}))}}},tag:"ul",name:"list",didWriteView:function(t){var i=t.root;i.childViews.filter((function(t){return t.markedForRemoval&&0===t.opacity&&t.resting})).forEach((function(t){t._destroy(),i.removeChildView(t)}))},filterFrameActionsForChild:function(t,i){return i.filter((function(i){return!i.data||!i.data.id||t.id===i.data.id}))},mixins:{apis:["dragCoordinates"]}}),Ce=S({DID_DRAG:function(t){var i=t.root,e=t.props,n=t.action;i.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(e.dragCoordinates={left:n.position.scopeLeft-i.ref.list.rect.element.left,top:n.position.scopeTop-(i.rect.outer.top+i.rect.element.marginTop+i.rect.element.scrollTop)})},DID_END_DRAG:function(t){t.props.dragCoordinates=null}}),Pe=O({create:function(t){var i=t.root,e=t.props;i.ref.list=i.appendChildView(i.createChildView(Le)),e.dragCoordinates=null,e.overflowing=!1},write:function(t){var i=t.root,e=t.props;if(Ce({root:i,props:e,actions:t.actions}),i.ref.list.dragCoordinates=e.dragCoordinates,e.overflowing&&!e.overflow&&(e.overflowing=!1,i.element.dataset.state="",i.height=null),e.overflow){var n=Math.round(e.overflow);n!==i.height&&(e.overflowing=!0,i.element.dataset.state="overflow",i.height=n)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Ge=function(t,i,e){e?a(t,i,arguments.length>3&&void 0!==arguments[3]?arguments[3]:""):t.removeAttribute(i)},ze=function(t){var i=t.root,e=t.action;i.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&Ge(i.element,"accept",!!e.value,e.value?e.value.join(","):"")},Ne=function(t){Ge(t.root.element,"multiple",t.action.value)},Be=function(t){Ge(t.root.element,"webkitdirectory",t.action.value)},Fe=function(t){var i=t.root,e=i.query("GET_DISABLED"),n=i.query("GET_ALLOW_BROWSE");Ge(i.element,"disabled",e||!n)},Ue=function(t){var i=t.root;t.action.value?0===i.query("GET_TOTAL_ITEMS")&&Ge(i.element,"required",!0):Ge(i.element,"required",!1)},je=function(t){var i=t.action;Ge(t.root.element,"capture",!!i.value,!0===i.value?"":i.value)},He=function(t){var i=t.root,e=i.element;i.query("GET_TOTAL_ITEMS")>0?(Ge(e,"required",!1),Ge(e,"name",!1)):(Ge(e,"name",!0,i.query("GET_NAME")),i.query("GET_CHECK_VALIDITY")&&e.setCustomValidity(""),i.query("GET_REQUIRED")&&Ge(e,"required",!0))},Ve=O({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function(t){var i=t.root,e=t.props;i.element.id="filepond--browser-"+e.id,a(i.element,"name",i.query("GET_NAME")),a(i.element,"aria-controls","filepond--assistant-"+e.id),a(i.element,"aria-labelledby","filepond--drop-label-"+e.id),ze({root:i,action:{value:i.query("GET_ACCEPTED_FILE_TYPES")}}),Ne({root:i,action:{value:i.query("GET_ALLOW_MULTIPLE")}}),Be({root:i,action:{value:i.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Fe({root:i}),Ue({root:i,action:{value:i.query("GET_REQUIRED")}}),je({root:i,action:{value:i.query("GET_CAPTURE_METHOD")}}),i.ref.handleChange=function(){if(i.element.value){var t=Array.from(i.element.files).map((function(t){return t._relativePath=t.webkitRelativePath,t}));setTimeout((function(){e.onload(t),function(t){if(t&&""!==t.value){try{t.value=""}catch(t){}if(t.value){var i=Bi("form"),e=t.parentNode,n=t.nextSibling;i.appendChild(t),i.reset(),n?e.insertBefore(t,n):e.appendChild(t)}}}(i.element)}),250)}},i.element.addEventListener("change",i.ref.handleChange)},destroy:function(t){var i=t.root;i.element.removeEventListener("change",i.ref.handleChange)},write:S({DID_LOAD_ITEM:He,DID_REMOVE_ITEM:He,DID_THROW_ITEM_INVALID:function(t){var i=t.root;i.query("GET_CHECK_VALIDITY")&&i.element.setCustomValidity(i.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:Fe,DID_SET_ALLOW_BROWSE:Fe,DID_SET_ALLOW_DIRECTORIES_ONLY:Be,DID_SET_ALLOW_MULTIPLE:Ne,DID_SET_ACCEPTED_FILE_TYPES:ze,DID_SET_CAPTURE_METHOD:je,DID_SET_REQUIRED:Ue})}),Ye=13,We=32,qe=function(t,i){t.innerHTML=i;var e=t.querySelector(".filepond--label-action");return e&&a(e,"tabindex","0"),i},Ze=O({name:"drop-label",ignoreRect:!0,create:function(t){var i=t.root,e=t.props,n=Bi("label");a(n,"for","filepond--browser-"+e.id),a(n,"id","filepond--drop-label-"+e.id),a(n,"aria-hidden","true"),i.ref.handleKeyDown=function(t){(t.keyCode===Ye||t.keyCode===We)&&(t.preventDefault(),i.ref.label.click())},i.ref.handleClick=function(t){t.target===n||n.contains(t.target)||i.ref.label.click()},n.addEventListener("keydown",i.ref.handleKeyDown),i.element.addEventListener("click",i.ref.handleClick),qe(n,e.caption),i.appendChild(n),i.ref.label=n},destroy:function(t){var i=t.root;i.ref.label.addEventListener("keydown",i.ref.handleKeyDown),i.element.removeEventListener("click",i.ref.handleClick)},write:S({DID_SET_LABEL_IDLE:function(t){qe(t.root.ref.label,t.action.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),$e=O({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Xe=S({DID_DRAG:function(t){var i=t.root,e=t.action;i.ref.blob?(i.ref.blob.translateX=e.position.scopeLeft,i.ref.blob.translateY=e.position.scopeTop,i.ref.blob.scaleX=1,i.ref.blob.scaleY=1,i.ref.blob.opacity=1):function(t){var i=t.root;i.ref.blob=i.appendChildView(i.createChildView($e,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:.5*i.rect.element.width,translateY:.5*i.rect.element.height}))}({root:i})},DID_DROP:function(t){var i=t.root;i.ref.blob&&(i.ref.blob.scaleX=2.5,i.ref.blob.scaleY=2.5,i.ref.blob.opacity=0)},DID_END_DRAG:function(t){var i=t.root;i.ref.blob&&(i.ref.blob.opacity=0)}}),Ke=O({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(t){var i=t.root,e=t.actions;Xe({root:i,props:t.props,actions:e});var n=i.ref.blob;0===e.length&&n&&0===n.opacity&&(i.removeChildView(n),i.ref.blob=null)}}),Qe=function(t,i){try{var e=new DataTransfer;i.forEach((function(t){t instanceof File?e.items.add(t):e.items.add(new File([t],t.name,{type:t.type}))})),t.files=e.files}catch(t){return!1}return!0},Je=function(t,i){return t.ref.fields[i]},tn=function(t){t.query("GET_ACTIVE_ITEMS").forEach((function(i){t.ref.fields[i.id]&&t.element.appendChild(t.ref.fields[i.id])}))},en=function(t){return tn(t.root)},nn=S({DID_SET_DISABLED:function(t){var i=t.root;i.element.disabled=i.query("GET_DISABLED")},DID_ADD_ITEM:function(t){var i=t.root,e=t.action,n=!(i.query("GET_ITEM",e.id).origin===kt.LOCAL)&&i.query("SHOULD_UPDATE_FILE_INPUT"),o=Bi("input");o.type=n?"file":"hidden",o.name=i.query("GET_NAME"),o.disabled=i.query("GET_DISABLED"),i.ref.fields[e.id]=o,tn(i)},DID_LOAD_ITEM:function(t){var i=t.root,e=t.action,n=Je(i,e.id);if(n&&(null!==e.serverFileReference&&(n.value=e.serverFileReference),i.query("SHOULD_UPDATE_FILE_INPUT"))){var o=i.query("GET_ITEM",e.id);Qe(n,[o.file])}},DID_REMOVE_ITEM:function(t){var i=t.root,e=t.action,n=Je(i,e.id);n&&(n.parentNode&&n.parentNode.removeChild(n),delete i.ref.fields[e.id])},DID_DEFINE_VALUE:function(t){var i=t.root,e=t.action,n=Je(i,e.id);n&&(null===e.value?n.removeAttribute("value"):n.value=e.value,tn(i))},DID_PREPARE_OUTPUT:function(t){var i=t.root,e=t.action;i.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout((function(){var t=Je(i,e.id);t&&Qe(t,[e.file])}),0)},DID_REORDER_ITEMS:en,DID_SORT_ITEMS:en}),on=O({tag:"fieldset",name:"data",create:function(t){return t.root.ref.fields={}},write:nn,ignoreRect:!0}),an=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],rn=["css","csv","html","txt"],sn={zip:"zip|compressed",epub:"application/epub+zip"},ln=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t=t.toLowerCase(),an.includes(t)?"image/"+("jpg"===t?"jpeg":"svg"===t?"svg+xml":t):rn.includes(t)?"text/"+t:sn[t]||""},cn=function(t){return new Promise((function(i){var e=bn(t);if(e.length&&!pn(t))return i(e);un(t).then(i)}))},pn=function(t){return!!t.files&&t.files.length>0},un=function(t){return new Promise((function(i){var e=(t.items?Array.from(t.items):[]).filter((function(t){return hn(t)})).map((function(t){return dn(t)}));e.length?Promise.all(e).then((function(t){var e=[];t.forEach((function(t){e.push.apply(e,t)})),i(e.filter((function(t){return t})).map((function(t){return t._relativePath||(t._relativePath=t.webkitRelativePath),t})))})).catch(console.error):i(t.files?Array.from(t.files):[])}))},hn=function(t){if(mn(t)){var i=vn(t);if(i)return i.isFile||i.isDirectory}return"file"===t.kind},dn=function(t){return new Promise((function(i,e){_n(t)?fn(vn(t)).then(i).catch(e):i([t.getAsFile()])}))},fn=function(t){return new Promise((function(i,e){var n=[],o=0,a=0,r=function(){0===a&&0===o&&i(n)};!function t(i){o++;var s=i.createReader();!function i(){s.readEntries((function(e){if(0===e.length)return o--,void r();e.forEach((function(i){i.isDirectory?t(i):(a++,i.file((function(t){var e=gn(t);i.fullPath&&(e._relativePath=i.fullPath),n.push(e),a--,r()})))})),i()}),e)}()}(t)}))},gn=function(t){if(t.type.length)return t;var i=t.lastModifiedDate,e=t.name,n=ln($t(t.name));return n.length?((t=t.slice(0,t.size,n)).name=e,t.lastModifiedDate=i,t):t},_n=function(t){return mn(t)&&(vn(t)||{}).isDirectory},mn=function(t){return"webkitGetAsEntry"in t},vn=function(t){return t.webkitGetAsEntry()},bn=function(t){var i=[];try{if((i=wn(t)).length)return i;i=xn(t)}catch(t){}return i},xn=function(t){var i=t.getData("url");return"string"==typeof i&&i.length?[i]:[]},wn=function(t){var i=t.getData("text/html");if("string"==typeof i&&i.length){var e=i.match(/src\s*=\s*"(.+?)"/);if(e)return[e[1]]}return[]},yn=[],kn=function(t){return{pageLeft:t.pageX,pageTop:t.pageY,scopeLeft:t.offsetX||t.layerX,scopeTop:t.offsetY||t.layerY}},En=function(t){var i=yn.find((function(i){return i.element===t}));if(i)return i;var e=Tn(t);return yn.push(e),e},Tn=function(t){var i=[],e={dragenter:Dn,dragover:Rn,dragleave:Sn,drop:On},o={};n(e,(function(e,n){o[e]=n(t,i),t.addEventListener(e,o[e],!1)}));var a={element:t,addListener:function(r){return i.push(r),function(){i.splice(i.indexOf(r),1),0===i.length&&(yn.splice(yn.indexOf(a),1),n(e,(function(i){t.removeEventListener(i,o[i],!1)})))}}};return a},In=function(t,i){var e,n=function(t,i){return"elementFromPoint"in t||(t=document),t.elementFromPoint(i.x,i.y)}("getRootNode"in(e=i)?e.getRootNode():document,{x:t.pageX-window.pageXOffset,y:t.pageY-window.pageYOffset});return n===i||i.contains(n)},An=null,Mn=function(t,i){try{t.dropEffect=i}catch(t){}},Dn=function(t,i){return function(t){t.preventDefault(),An=t.target,i.forEach((function(i){var e=i.onenter;In(t,i.element)&&(i.state="enter",e(kn(t)))}))}},Rn=function(t,i){return function(t){t.preventDefault();var e=t.dataTransfer;cn(e).then((function(n){var o=!1;i.some((function(i){var a=i.filterElement,r=i.element,s=i.onenter,l=i.onexit,c=i.ondrag,p=i.allowdrop;Mn(e,"copy");var u=p(n);if(u)if(In(t,r)){if(o=!0,null===i.state)return i.state="enter",void s(kn(t));if(i.state="over",a&&!u)return void Mn(e,"none");c(kn(t))}else a&&!o&&Mn(e,"none"),i.state&&(i.state=null,l(kn(t)));else Mn(e,"none")}))}))}},On=function(t,i){return function(t){t.preventDefault(),cn(t.dataTransfer).then((function(e){i.forEach((function(i){var n=i.filterElement,o=i.element,a=i.ondrop,r=i.onexit,s=i.allowdrop;if(i.state=null,!n||In(t,o))return s(e)?void a(kn(t),e):r(kn(t))}))}))}},Sn=function(t,i){return function(t){An===t.target&&i.forEach((function(i){var e=i.onexit;i.state=null,e(kn(t))}))}},Ln=function(t,i,e){t.classList.add("filepond--hopper");var n=e.filterItems,o=void 0===n?function(t){return t}:n,a=function(t,i,e){var n=En(i),o={element:t,filterElement:e,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return o.destroy=n.addListener(o),o}(t,e.catchesDropsOnPage?document.documentElement:t,e.requiresDropOnElement),r="",s="";a.allowdrop=function(t){return i(o(t))},a.ondrop=function(t,e){var n=o(e);i(n)?(s="drag-drop",l.onload(n,t)):l.ondragend(t)},a.ondrag=function(t){l.ondrag(t)},a.onenter=function(t){s="drag-over",l.ondragstart(t)},a.onexit=function(t){s="drag-exit",l.ondragend(t)};var l={updateHopperState:function(){r!==s&&(t.dataset.hopperState=s,r=s)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){a.destroy()}};return l},Cn=!1,Pn=[],Gn=function(t){var i=document.activeElement;if(i&&/textarea|input/i.test(i.nodeName)){for(var e=!1,n=i;n!==document.body;){if(n.classList.contains("filepond--root")){e=!0;break}n=n.parentNode}if(!e)return}cn(t.clipboardData).then((function(t){t.length&&Pn.forEach((function(i){return i(t)}))}))},zn=function(){var t=function(t){i.onload(t)},i={destroy:function(){_t(Pn,Pn.indexOf(t)),0===Pn.length&&(document.removeEventListener("paste",Gn),Cn=!1)},onload:function(){}};return function(t){Pn.includes(t)||(Pn.push(t),Cn||(Cn=!0,document.addEventListener("paste",Gn)))}(t),i},Nn=null,Bn=null,Fn=[],Un=function(t,i){t.element.textContent=i},jn=function(t,i,e){var n=t.query("GET_TOTAL_ITEMS");Un(t,e+" "+i+", "+n+" "+t.query(1===n?"GET_LABEL_FILE_COUNT_SINGULAR":"GET_LABEL_FILE_COUNT_PLURAL")),clearTimeout(Bn),Bn=setTimeout((function(){!function(t){t.element.textContent=""}(t)}),1500)},Hn=function(t){return t.element.parentNode.contains(document.activeElement)},Vn=function(t){var i=t.root,e=i.query("GET_ITEM",t.action.id).filename,n=i.query("GET_LABEL_FILE_PROCESSING_ABORTED");Un(i,e+" "+n)},Yn=function(t){var i=t.root,e=t.action,n=i.query("GET_ITEM",e.id);Un(i,e.status.main+" "+n.filename+" "+e.status.sub)},Wn=O({create:function(t){var i=t.root;i.element.id="filepond--assistant-"+t.props.id,a(i.element,"role","status"),a(i.element,"aria-live","polite"),a(i.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:S({DID_LOAD_ITEM:function(t){var i=t.root,e=t.action;if(Hn(i)){i.element.textContent="";var n=i.query("GET_ITEM",e.id);Fn.push(n.filename),clearTimeout(Nn),Nn=setTimeout((function(){jn(i,Fn.join(", "),i.query("GET_LABEL_FILE_ADDED")),Fn.length=0}),750)}},DID_REMOVE_ITEM:function(t){var i=t.root,e=t.action;Hn(i)&&jn(i,e.item.filename,i.query("GET_LABEL_FILE_REMOVED"))},DID_COMPLETE_ITEM_PROCESSING:function(t){var i=t.root,e=i.query("GET_ITEM",t.action.id).filename,n=i.query("GET_LABEL_FILE_PROCESSING_COMPLETE");Un(i,e+" "+n)},DID_ABORT_ITEM_PROCESSING:Vn,DID_REVERT_ITEM_PROCESSING:Vn,DID_THROW_ITEM_REMOVE_ERROR:Yn,DID_THROW_ITEM_LOAD_ERROR:Yn,DID_THROW_ITEM_INVALID:Yn,DID_THROW_ITEM_PROCESSING_ERROR:Yn}),tag:"span",name:"assistant"}),qn=function(t){return t.replace(new RegExp((arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-")+".","g"),(function(t){return t.charAt(1).toUpperCase()}))},Zn=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Date.now(),o=null;return function(){for(var a=arguments.length,r=new Array(a),s=0;s<a;s++)r[s]=arguments[s];clearTimeout(o);var l=Date.now()-n,c=function(){n=Date.now(),t.apply(void 0,r)};l<i?e||(o=setTimeout(c,i-l)):c()}},$n=function(t){return t.preventDefault()},Xn=function(t){var i=t.ref.list.childViews[0].childViews[0];return i?{top:i.rect.element.marginTop,bottom:i.rect.element.marginBottom}:{top:0,bottom:0}},Kn=function(t){var i=0,e=0,n=t.ref.list,o=n.childViews[0],a=o.childViews.filter((function(t){return t.rect.element.height})),r=t.query("GET_ACTIVE_ITEMS").map((function(t){return a.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));if(0===r.length)return{visual:i,bounds:e};var s=o.rect.element.width,l=Ae(o,r,n.dragCoordinates),c=r[0].rect.element,p=c.marginTop+c.marginBottom,u=c.width+(c.marginLeft+c.marginRight),h=c.height+p,d=void 0!==l&&l>=0?1:0,f=r.find((function(t){return t.markedForRemoval&&t.opacity<.45}))?-1:0,g=r.length+d+f,_=Ie(s,u);return 1===_?r.forEach((function(t){var n=t.rect.element.height+p;e+=n,i+=n*t.opacity})):(e=Math.ceil(g/_)*h,i=e),{visual:i,bounds:e}},Qn=function(t){var i=t.ref.measureHeight||null;return{cappedHeight:parseInt(t.style.maxHeight,10)||null,fixedHeight:0===i?null:i}},Jn=function(t,i){var e=t.query("GET_ALLOW_REPLACE"),n=t.query("GET_ALLOW_MULTIPLE"),o=t.query("GET_TOTAL_ITEMS"),a=t.query("GET_MAX_FILES"),r=i.length;return!n&&r>1?(t.dispatch("DID_THROW_MAX_FILES",{source:i,error:pi("warning",0,"Max files")}),!0):!(!n&&e||!(Y(a=n?a:1)&&o+r>a)||(t.dispatch("DID_THROW_MAX_FILES",{source:i,error:pi("warning",0,"Max files")}),0))},to=function(t,i,e){var n=t.childViews[0];return Ae(n,i,{left:e.scopeLeft-n.rect.element.left,top:e.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},io=function(t){var i=t.query("GET_ALLOW_DROP"),e=t.query("GET_DISABLED"),n=i&&!e;if(n&&!t.ref.hopper){var o=Ln(t.element,(function(i){var e=t.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!t.query("GET_DROP_VALIDATION")||i.every((function(i){return Dt("ALLOW_HOPPER_ITEM",i,{query:t.query}).every((function(t){return!0===t}))&&e(i)}))}),{filterItems:function(i){var e=t.query("GET_IGNORED_FILES");return i.filter((function(t){return!Ai(t)||!e.includes(t.name.toLowerCase())}))},catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});o.onload=function(i,e){var n=t.ref.list.childViews[0].childViews.filter((function(t){return t.rect.element.height})),o=t.query("GET_ACTIVE_ITEMS").map((function(t){return n.find((function(i){return i.id===t.id}))})).filter((function(t){return t}));Mt("ADD_ITEMS",i,{dispatch:t.dispatch}).then((function(i){if(Jn(t,i))return!1;t.dispatch("ADD_ITEMS",{items:i,index:to(t.ref.list,o,e),interactionMethod:st})})),t.dispatch("DID_DROP",{position:e}),t.dispatch("DID_END_DRAG",{position:e})},o.ondragstart=function(i){t.dispatch("DID_START_DRAG",{position:i})},o.ondrag=Zn((function(i){t.dispatch("DID_DRAG",{position:i})})),o.ondragend=function(i){t.dispatch("DID_END_DRAG",{position:i})},t.ref.hopper=o,t.ref.drip=t.appendChildView(t.createChildView(Ke))}else!n&&t.ref.hopper&&(t.ref.hopper.destroy(),t.ref.hopper=null,t.removeChildView(t.ref.drip))},eo=function(t,i){var e=t.query("GET_ALLOW_BROWSE"),n=t.query("GET_DISABLED"),o=e&&!n;o&&!t.ref.browser?t.ref.browser=t.appendChildView(t.createChildView(Ve,Object.assign({},i,{onload:function(i){Mt("ADD_ITEMS",i,{dispatch:t.dispatch}).then((function(i){if(Jn(t,i))return!1;t.dispatch("ADD_ITEMS",{items:i,index:-1,interactionMethod:lt})}))}})),0):!o&&t.ref.browser&&(t.removeChildView(t.ref.browser),t.ref.browser=null)},no=function(t){var i=t.query("GET_ALLOW_PASTE"),e=t.query("GET_DISABLED"),n=i&&!e;n&&!t.ref.paster?(t.ref.paster=zn(),t.ref.paster.onload=function(i){Mt("ADD_ITEMS",i,{dispatch:t.dispatch}).then((function(i){if(Jn(t,i))return!1;t.dispatch("ADD_ITEMS",{items:i,index:-1,interactionMethod:ct})}))}):!n&&t.ref.paster&&(t.ref.paster.destroy(),t.ref.paster=null)},oo=S({DID_SET_ALLOW_BROWSE:function(t){eo(t.root,t.props)},DID_SET_ALLOW_DROP:function(t){io(t.root)},DID_SET_ALLOW_PASTE:function(t){no(t.root)},DID_SET_DISABLED:function(t){var i=t.root,e=t.props;io(i),no(i),eo(i,e),i.query("GET_DISABLED")?i.element.dataset.disabled="disabled":i.element.removeAttribute("data-disabled")}}),ao=O({name:"root",read:function(t){var i=t.root;i.ref.measure&&(i.ref.measureHeight=i.ref.measure.offsetHeight)},create:function(t){var i=t.root,e=t.props,n=i.query("GET_ID");n&&(i.element.id=n);var o=i.query("GET_CLASS_NAME");o&&o.split(" ").filter((function(t){return t.length})).forEach((function(t){i.element.classList.add(t)})),i.ref.label=i.appendChildView(i.createChildView(Ze,Object.assign({},e,{translateY:null,caption:i.query("GET_LABEL_IDLE")}))),i.ref.list=i.appendChildView(i.createChildView(Pe,{translateY:null})),i.ref.panel=i.appendChildView(i.createChildView(be,{name:"panel-root"})),i.ref.assistant=i.appendChildView(i.createChildView(Wn,Object.assign({},e))),i.ref.data=i.appendChildView(i.createChildView(on,Object.assign({},e))),i.ref.measure=Bi("div"),i.ref.measure.style.height="100%",i.element.appendChild(i.ref.measure),i.ref.bounds=null,i.query("GET_STYLES").filter((function(t){return!G(t.value)})).map((function(t){i.element.dataset[t.name]=t.value})),i.ref.widthPrevious=null,i.ref.widthUpdated=Zn((function(){i.ref.updateHistory=[],i.dispatch("DID_RESIZE_ROOT")}),250),i.ref.previousAspectRatio=null,i.ref.updateHistory=[];var a=window.matchMedia("(pointer: fine) and (hover: hover)").matches,r="PointerEvent"in window;i.query("GET_ALLOW_REORDER")&&r&&!a&&(i.element.addEventListener("touchmove",$n,{passive:!1}),i.element.addEventListener("gesturestart",$n));var s=i.query("GET_CREDITS");if(2===s.length){var l=document.createElement("a");l.className="filepond--credits",l.setAttribute("aria-hidden","true"),l.href=s[0],l.tabindex=-1,l.target="_blank",l.rel="noopener noreferrer",l.textContent=s[1],i.element.appendChild(l),i.ref.credits=l}},write:function(t){var i=t.root,e=t.actions;if(oo({root:i,props:t.props,actions:e}),e.filter((function(t){return/^DID_SET_STYLE_/.test(t.type)})).filter((function(t){return!G(t.data.value)})).map((function(t){var e=t.data,n=qn(t.type.substring(8).toLowerCase(),"_");i.element.dataset[n]=e.value,i.invalidateLayout()})),!i.rect.element.hidden){i.rect.element.width!==i.ref.widthPrevious&&(i.ref.widthPrevious=i.rect.element.width,i.ref.widthUpdated());var n=i.ref.bounds;n||(n=i.ref.bounds=Qn(i),i.element.removeChild(i.ref.measure),i.ref.measure=null);var o=i.ref,a=o.hopper,r=o.label,s=o.list,l=o.panel;a&&a.updateHopperState();var c=i.query("GET_PANEL_ASPECT_RATIO"),p=i.query("GET_ALLOW_MULTIPLE"),u=i.query("GET_TOTAL_ITEMS"),h=u===(p?i.query("GET_MAX_FILES")||1e6:1),d=e.find((function(t){return"DID_ADD_ITEM"===t.type}));if(h&&d){var f=d.data.interactionMethod;r.opacity=0,p?r.translateY=-40:f===rt?r.translateX=40:r.translateY=f===lt?40:30}else h||(r.opacity=1,r.translateX=0,r.translateY=0);var g=Xn(i),_=Kn(i),m=r.rect.element.height,v=!p||h?0:m,b=h?s.rect.element.marginTop:0,x=0===u?0:s.rect.element.marginBottom,w=v+b+_.visual+x,y=v+b+_.bounds+x;if(s.translateY=Math.max(0,v-s.rect.element.marginTop)-g.top,c){var k=i.rect.element.width,E=k*c;c!==i.ref.previousAspectRatio&&(i.ref.previousAspectRatio=c,i.ref.updateHistory=[]);var T=i.ref.updateHistory;T.push(k);if(T.length>4)for(var I=T.length,A=I-10,M=0,D=I;D>=A;D--)if(T[D]===T[D-2]&&M++,M>=2)return;l.scalable=!1,l.height=E;var R=E-v-(x-g.bottom)-(h?b:0);s.overflow=_.visual>R?R:null,i.height=E}else if(n.fixedHeight){l.scalable=!1;var O=n.fixedHeight-v-(x-g.bottom)-(h?b:0);s.overflow=_.visual>O?O:null}else if(n.cappedHeight){var S=w>=n.cappedHeight,L=Math.min(n.cappedHeight,w);l.scalable=!0,l.height=S?L:L-g.top-g.bottom;var C=L-v-(x-g.bottom)-(h?b:0);s.overflow=w>n.cappedHeight&&_.visual>C?C:null,i.height=Math.min(n.cappedHeight,y-g.top-g.bottom)}else{var P=u>0?g.top+g.bottom:0;l.scalable=!0,l.height=Math.max(m,w-P),i.height=Math.max(m,y-P)}i.ref.credits&&l.heightCurrent&&(i.ref.credits.style.transform="translateY("+l.heightCurrent+"px)")}},destroy:function(t){var i=t.root;i.ref.paster&&i.ref.paster.destroy(),i.ref.hopper&&i.ref.hopper.destroy(),i.element.removeEventListener("touchmove",$n),i.element.removeEventListener("gesturestart",$n)},mixins:{styles:["height"]}}),ro=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=null,n=Ot(),a=e(it(n),[Yt,at(n)],[zi,ot(n)]);a.dispatch("SET_OPTIONS",{options:t});var r=function(){document.hidden||a.dispatch("KICK")};document.addEventListener("visibilitychange",r);var s=null,l=!1,c=!1,p=null,u=null,h=function(){l||(l=!0),clearTimeout(s),s=setTimeout((function(){l=!1,p=null,u=null,c&&(c=!1,a.dispatch("DID_STOP_RESIZE"))}),500)};window.addEventListener("resize",h);var d=ao(a,{id:ut()}),f=!1,g=!1,_={_read:function(){l&&(u=window.innerWidth,p||(p=u),c||u===p||(a.dispatch("DID_START_RESIZE"),c=!0)),g&&f&&(f=null===d.element.offsetParent),f||(d._read(),g=d.rect.element.hidden)},_write:function(t){var i=a.processActionQueue().filter((function(t){return!/^SET_/.test(t.type)}));f&&!i.length||(w(i),f=d._write(t,i,c),wt(a.query("GET_ITEMS")),f&&a.processDispatchQueue())}},m=function(t){return function(i){var e={type:t};if(!i)return e;if(i.hasOwnProperty("error")&&(e.error=i.error?Object.assign({},i.error):null),i.status&&(e.status=Object.assign({},i.status)),i.file&&(e.output=i.file),i.source)e.file=i.source;else if(i.item||i.id){var n=i.item?i.item:a.query("GET_ITEM",i.id);e.file=n?xt(n):null}return i.items&&(e.items=i.items.map(xt)),/progress/.test(t)&&(e.progress=i.progress),i.hasOwnProperty("origin")&&i.hasOwnProperty("target")&&(e.origin=i.origin,e.target=i.target),e}},v={DID_DESTROY:m("destroy"),DID_INIT:m("init"),DID_THROW_MAX_FILES:m("warning"),DID_INIT_ITEM:m("initfile"),DID_START_ITEM_LOAD:m("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:m("addfileprogress"),DID_LOAD_ITEM:m("addfile"),DID_THROW_ITEM_INVALID:[m("error"),m("addfile")],DID_THROW_ITEM_LOAD_ERROR:[m("error"),m("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[m("error"),m("removefile")],DID_PREPARE_OUTPUT:m("preparefile"),DID_START_ITEM_PROCESSING:m("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:m("processfileprogress"),DID_ABORT_ITEM_PROCESSING:m("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:m("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:m("processfiles"),DID_REVERT_ITEM_PROCESSING:m("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[m("error"),m("processfile")],DID_REMOVE_ITEM:m("removefile"),DID_UPDATE_ITEMS:m("updatefiles"),DID_ACTIVATE_ITEM:m("activatefile"),DID_REORDER_ITEMS:m("reorderfiles")},x=function(t){var i=Object.assign({pond:z},t);delete i.type,d.element.dispatchEvent(new CustomEvent("FilePond:"+t.type,{detail:i,bubbles:!0,cancelable:!0,composed:!0}));var e=[];t.hasOwnProperty("error")&&e.push(t.error),t.hasOwnProperty("file")&&e.push(t.file);var n=["type","error","file"];Object.keys(t).filter((function(t){return!n.includes(t)})).forEach((function(i){return e.push(t[i])})),z.fire.apply(z,[t.type].concat(e));var o=a.query("GET_ON"+t.type.toUpperCase());o&&o.apply(void 0,e)},w=function(t){t.length&&t.filter((function(t){return v[t.type]})).forEach((function(t){var i=v[t.type];(Array.isArray(i)?i:[i]).forEach((function(i){"DID_INIT_ITEM"===t.type?x(i(t.data)):setTimeout((function(){x(i(t.data))}),0)}))}))},y=function(t){return a.dispatch("SET_OPTIONS",{options:t})},k=function(t){return a.query("GET_ACTIVE_ITEM",t)},E=function(t){return new Promise((function(i,e){a.dispatch("REQUEST_ITEM_PREPARE",{query:t,success:function(t){i(t)},failure:function(t){e(t)}})}))},T=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,n){M([{source:t,options:i}],{index:i.index}).then((function(t){return e(t&&t[0])})).catch(n)}))},I=function(t){return t.file&&t.id},A=function(t,i){return"object"!=typeof t||I(t)||i||(i=t,t=void 0),a.dispatch("REMOVE_ITEM",Object.assign({},i,{query:t})),null===a.query("GET_ACTIVE_ITEM",t)},M=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return new Promise((function(t,e){var n=[],o={};if(P(i[0]))n.push.apply(n,i[0]),Object.assign(o,i[1]||{});else{var r=i[i.length-1];"object"!=typeof r||r instanceof Blob||Object.assign(o,i.pop()),n.push.apply(n,i)}a.dispatch("ADD_ITEMS",{items:n,index:o.index,interactionMethod:rt,success:t,failure:e})}))},D=function(){return a.query("GET_ACTIVE_ITEMS")},R=function(t){return new Promise((function(i,e){a.dispatch("REQUEST_ITEM_PROCESSING",{query:t,success:function(t){i(t)},failure:function(t){e(t)}})}))},O=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];var n=Array.isArray(i[0])?i[0]:i,o=n.length?n:D();return Promise.all(o.map(E))},S=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];var n=Array.isArray(i[0])?i[0]:i;if(!n.length){var o=D().filter((function(t){return!(t.status===yt.IDLE&&t.origin===kt.LOCAL)&&t.status!==yt.PROCESSING&&t.status!==yt.PROCESSING_COMPLETE&&t.status!==yt.PROCESSING_REVERT_ERROR}));return Promise.all(o.map(R))}return Promise.all(n.map(R))},G=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];var n,o=Array.isArray(i[0])?i[0]:i;"object"==typeof o[o.length-1]?n=o.pop():Array.isArray(i[0])&&(n=i[1]);var a=D();return o.length?o.map((function(t){return b(t)?a[t]?a[t].id:null:t})).filter((function(t){return t})).map((function(t){return A(t,n)})):Promise.all(a.map((function(t){return A(t,n)})))},z=Object.assign({},mt(),{},_,{},nt(a,n),{setOptions:y,addFile:T,addFiles:M,getFile:k,processFile:R,prepareFile:E,removeFile:A,moveFile:function(t,i){return a.dispatch("MOVE_ITEM",{query:t,index:i})},getFiles:D,processFiles:S,removeFiles:G,prepareFiles:O,sort:function(t){return a.dispatch("SORT",{compare:t})},browse:function(){var t=d.element.querySelector("input[type=file]");t&&t.click()},destroy:function(){z.fire("destroy",d.element),a.dispatch("ABORT_ALL"),d._destroy(),window.removeEventListener("resize",h),document.removeEventListener("visibilitychange",r),a.dispatch("DID_DESTROY")},insertBefore:function(t){return L(d.element,t)},insertAfter:function(t){return C(d.element,t)},appendTo:function(t){return t.appendChild(d.element)},replaceElement:function(t){L(d.element,t),t.parentNode.removeChild(t),i=t},restoreElement:function(){i&&(C(i,d.element),d.element.parentNode.removeChild(d.element),i=null)},isAttachedTo:function(t){return d.element===t||i===t},element:{get:function(){return d.element}},status:{get:function(){return a.query("GET_STATUS")}}});return a.dispatch("DID_INIT"),o(z)},so=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i={};return n(Ot(),(function(t,e){i[t]=e[0]})),ro(Object.assign({},i,{},t))},lo=function(t){return qn(t.replace(/^data-/,""))},co=function t(i,e){n(e,(function(e,o){n(i,(function(t,n){var a,r=new RegExp(e);if(r.test(t)&&(delete i[t],!1!==o))if(U(o))i[o]=n;else{var s=o.group;X(o)&&!i[s]&&(i[s]={}),i[s][(a=t.replace(r,""),a.charAt(0).toLowerCase()+a.slice(1))]=n}})),o.mapping&&t(i[o.group],o.mapping)}))},po=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=[];n(t.attributes,(function(i){e.push(t.attributes[i])}));var o=e.filter((function(t){return t.name})).reduce((function(i,e){var n=a(t,e.name);return i[lo(e.name)]=n===e.name||n,i}),{});return co(o,i),o},uo=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};Dt("SET_ATTRIBUTE_TO_OPTION_MAP",e);var n=Object.assign({},i),o=po("FIELDSET"===t.nodeName?t.querySelector("input[type=file]"):t,e);Object.keys(o).forEach((function(t){X(o[t])?(X(n[t])||(n[t]={}),Object.assign(n[t],o[t])):n[t]=o[t]})),n.files=(i.files||[]).concat(Array.from(t.querySelectorAll("input:not([type=file])")).map((function(t){return{source:t.value,options:{type:t.dataset.type}}})));var a=so(n);return t.files&&Array.from(t.files).forEach((function(t){a.addFile(t)})),a.replaceElement(t),a},ho=function(){return i(arguments.length<=0?void 0:arguments[0])?uo.apply(void 0,arguments):so.apply(void 0,arguments)},fo=["fire","_read","_write"],go=function(t){var i={};return vt(t,i,fo),i},_o=function(t,i){return t.replace(/(?:{([a-zA-Z]+)})/g,(function(t,e){return i[e]}))},mo=function(t){var i=new Blob(["(",t.toString(),")()"],{type:"application/javascript"}),e=URL.createObjectURL(i),n=new Worker(e);return{transfer:function(){},post:function(t,i,e){var o=ut();n.onmessage=function(t){t.data.id===o&&i(t.data.message)},n.postMessage({id:o,message:t},e)},terminate:function(){n.terminate(),URL.revokeObjectURL(e)}}},vo=function(t){return new Promise((function(i,e){var n=new Image;n.onload=function(){i(n)},n.onerror=function(t){e(t)},n.src=t}))},bo=function(t,i){var e=t.slice(0,t.size,t.type);return e.lastModifiedDate=t.lastModifiedDate,e.name=i,e},xo=function(t){return bo(t,t.name)},wo=[],yo=function(t){if(!wo.includes(t)){wo.push(t);var i=t({addFilter:Rt,utils:{Type:It,forin:n,isString:U,isFile:Ai,toNaturalFileSize:Yi,replaceInString:_o,getExtensionFromFilename:$t,getFilenameWithoutExtension:Ti,guesstimateMimeType:ln,getFileFromBlob:Jt,getFilenameFromURL:Zt,createRoute:S,createWorker:mo,createView:O,createItemAPI:xt,loadImage:vo,copyFile:xo,renameFile:bo,createBlob:ti,applyFilterChain:Mt,text:Fi,getNumericAspectRatioFromString:Ct},views:{fileActionButton:Vi}});Object.assign(St,i.options)}},ko=(ne=f()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window&&("supports"in(window.CSS||{})||/MSIE|Trident/.test(window.navigator.userAgent)),function(){return ne}),Eo={apps:[]},To=function(){};if(t.Status={},t.FileStatus={},t.FileOrigin={},t.OptionTypes={},t.create=To,t.destroy=To,t.parse=To,t.find=To,t.registerPlugin=To,t.getOptions=To,t.setOptions=To,ko()){!function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,n="__framePainter";if(window[n])return window[n].readers.push(t),void window[n].writers.push(i);window[n]={readers:[t],writers:[i]};var o=window[n],a=1e3/e,r=null,s=null,l=null,c=null,p=function(){document.hidden?(l=function(){return window.setTimeout((function(){return u(performance.now())}),a)},c=function(){return window.clearTimeout(s)}):(l=function(){return window.requestAnimationFrame(u)},c=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){c&&c(),p(),u(performance.now())}));var u=function t(i){s=l(t),r||(r=i);var e=i-r;e<=a||(r=i-e%a,o.readers.forEach((function(t){return t()})),o.writers.forEach((function(t){return t(i)})))};p(),u(performance.now())}((function(){Eo.apps.forEach((function(t){return t._read()}))}),(function(t){Eo.apps.forEach((function(i){return i._write(t)}))}));var Io=function i(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:ko,create:t.create,destroy:t.destroy,parse:t.parse,find:t.find,registerPlugin:t.registerPlugin,setOptions:t.setOptions}})),document.removeEventListener("DOMContentLoaded",i)};"loading"!==document.readyState?setTimeout((function(){return Io()}),0):document.addEventListener("DOMContentLoaded",Io);var Ao=function(){return n(Ot(),(function(i,e){t.OptionTypes[i]=e[1]}))};t.Status=Object.assign({},Gt),t.FileOrigin=Object.assign({},kt),t.FileStatus=Object.assign({},yt),t.OptionTypes={},Ao(),t.create=function(){var i=ho.apply(void 0,arguments);return i.on("destroy",t.destroy),Eo.apps.push(i),go(i)},t.destroy=function(t){var i=Eo.apps.findIndex((function(i){return i.isAttachedTo(t)}));return i>=0&&(Eo.apps.splice(i,1)[0].restoreElement(),!0)},t.parse=function(i){return Array.from(i.querySelectorAll(".filepond")).filter((function(t){return!Eo.apps.find((function(i){return i.isAttachedTo(t)}))})).map((function(i){return t.create(i)}))},t.find=function(t){var i=Eo.apps.find((function(i){return i.isAttachedTo(t)}));return i?go(i):null},t.registerPlugin=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];i.forEach(yo),Ao()},t.getOptions=function(){var t={};return n(Ot(),(function(i,e){t[i]=e[0]})),t},t.setOptions=function(i){return X(i)&&(Eo.apps.forEach((function(t){t.setOptions(i)})),function(t){n(t,(function(t,i){St[t]&&(St[t][0]=J(i,St[t][0],St[t][1]))}))}(i)),t.getOptions()}}t.supported=ko,Object.defineProperty(t,"__esModule",{value:!0})}(i)})),oi=a((function(t){var i;t.exports=(i=function(t){var i=t.addFilter,e=t.utils,n=e.Type,o=e.replaceInString,a=e.toNaturalFileSize;return i("ALLOW_HOPPER_ITEM",(function(t,i){var e=i.query;if(!e("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var n=e("GET_MAX_FILE_SIZE");if(null!==n&&t.size>n)return!1;var o=e("GET_MIN_FILE_SIZE");return!(null!==o&&t.size<o)})),i("LOAD_FILE",(function(t,i){var e=i.query;return new Promise((function(i,n){if(!e("GET_ALLOW_FILE_SIZE_VALIDATION"))return i(t);var r=e("GET_FILE_VALIDATE_SIZE_FILTER");if(r&&!r(t))return i(t);var s=e("GET_MAX_FILE_SIZE");if(null!==s&&t.size>s)n({status:{main:e("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:o(e("GET_LABEL_MAX_FILE_SIZE"),{filesize:a(s,".",e("GET_FILE_SIZE_BASE"),e("GET_FILE_SIZE_LABELS",e))})}});else{var l=e("GET_MIN_FILE_SIZE");if(null!==l&&t.size<l)n({status:{main:e("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:o(e("GET_LABEL_MIN_FILE_SIZE"),{filesize:a(l,".",e("GET_FILE_SIZE_BASE"),e("GET_FILE_SIZE_LABELS",e))})}});else{var c=e("GET_MAX_TOTAL_FILE_SIZE");if(null!==c&&e("GET_ACTIVE_ITEMS").reduce((function(t,i){return t+i.fileSize}),0)>c)return void n({status:{main:e("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:o(e("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:a(c,".",e("GET_FILE_SIZE_BASE"),e("GET_FILE_SIZE_LABELS",e))})}});i(t)}}}))})),{options:{allowFileSizeValidation:[!0,n.BOOLEAN],maxFileSize:[null,n.INT],minFileSize:[null,n.INT],maxTotalFileSize:[null,n.INT],fileValidateSizeFilter:[null,n.FUNCTION],labelMinFileSizeExceeded:["File is too small",n.STRING],labelMinFileSize:["Minimum file size is {filesize}",n.STRING],labelMaxFileSizeExceeded:["File is too large",n.STRING],labelMaxFileSize:["Maximum file size is {filesize}",n.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",n.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",n.STRING]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)})),ai=a((function(t){
|
|
19
|
+
/*!
|
|
20
|
+
* FilePondPluginImageExifOrientation 1.0.11
|
|
21
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
22
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
23
|
+
*/
|
|
24
|
+
t.exports=function(){var t=65496,i=65505,e=1165519206,n=18761,o=274,a=65280,r=function(t,i){return t.getUint16(i,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},s=function(t,i){return t.getUint32(i,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},l="undefined"!=typeof window&&void 0!==window.document,c=void 0,p=l?new Image:{};p.onload=function(){return c=p.naturalWidth>p.naturalHeight},p.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var u=function(l){var p=l.utils,u=p.Type,h=p.isFile;return(0,l.addFilter)("DID_LOAD_ITEM",(function(l,p){var u=p.query;return new Promise((function(p){var d=l.file;if(!(h(d)&&function(t){return/^image\/jpeg/.test(t.type)}(d)&&u("GET_ALLOW_IMAGE_EXIF_ORIENTATION")&&c))return p(l);(function(l){return new Promise((function(c){var p=new FileReader;p.onload=function(l){var p=new DataView(l.target.result);if(r(p,0)===t){for(var u=p.byteLength,h=2;h<u;){var d=r(p,h);if(h+=2,d===i){if(s(p,h+=2)!==e)break;var f=r(p,h+=6)===n;h+=s(p,h+4,f);var g=r(p,h,f);h+=2;for(var _=0;_<g;_++)if(r(p,h+12*_,f)===o)return void c(r(p,h+12*_+8,f))}else{if((d&a)!==a)break;h+=r(p,h)}}c(-1)}else c(-1)},p.readAsArrayBuffer(l.slice(0,65536))}))})(d).then((function(t){l.setMetadata("exif",{orientation:t}),p(l)}))}))})),{options:{allowImageExifOrientation:[!0,u.BOOLEAN]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:u})),u}()}));const ri=s(a((function(t){
|
|
25
|
+
/*!
|
|
26
|
+
* FilePondPluginImagePreview 4.6.11
|
|
27
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
28
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
29
|
+
*/
|
|
30
|
+
t.exports=function(){function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,i){var e=[],n=!0,o=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(n=(r=s.next()).done)&&(e.push(r.value),!i||e.length!==i);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return e}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var i=function(t,i){return o(t.x*i,t.y*i)},e=function(t,i){return o(t.x+i.x,t.y+i.y)},n=function(t,i,e){var n=Math.cos(i),a=Math.sin(i),r=o(t.x-e.x,t.y-e.y);return o(e.x+n*r.x-a*r.y,e.y+a*r.x+n*r.y)},o=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},a=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*e:"number"==typeof t?t*(n?i[n]:Math.min(i.width,i.height)):void 0},r=function(t){return null!=t},s=function(t,i){return Object.keys(i).forEach((function(e){return t.setAttribute(e,i[e])}))},l=function(t,i){var e=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&s(e,i),e},c={contain:"xMidYMid meet",cover:"xMidYMid slice"},p={left:"start",center:"middle",right:"end"},u=function(t){return function(i){return l(t,{id:i.id})}},h={image:function(t){var i=l("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return i.onload=function(){i.setAttribute("opacity",t.opacity||1)},i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),i},rect:u("rect"),ellipse:u("ellipse"),text:u("text"),path:u("path"),line:function(t){var i=l("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),e=l("line");i.appendChild(e);var n=l("path");i.appendChild(n);var o=l("path");return i.appendChild(o),i}},d={rect:function(t){return s(t,Object.assign({},t.rect,t.styles))},ellipse:function(t){return s(t,Object.assign({cx:t.rect.x+.5*t.rect.width,cy:t.rect.y+.5*t.rect.height,rx:.5*t.rect.width,ry:.5*t.rect.height},t.styles))},image:function(t,i){s(t,Object.assign({},t.rect,t.styles,{preserveAspectRatio:c[i.fit]||"none"}))},text:function(t,i,e,n){var o=a(i.fontSize,e,n);s(t,Object.assign({},t.rect,t.styles,{"stroke-width":0,"font-weight":i.fontWeight||"normal","font-size":o,"font-family":i.fontFamily||"sans-serif","text-anchor":p[i.textAlign]||"start"})),t.text!==i.text&&(t.text=i.text,t.textContent=i.text.length?i.text:" ")},path:function(t,i,e,n){var o;s(t,Object.assign({},t.styles,{fill:"none",d:(o=i.points.map((function(t){return{x:a(t.x,e,n,"width"),y:a(t.y,e,n,"height")}})),o.map((function(t,i){return"".concat(0===i?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,r,l,c){s(t,Object.assign({},t.rect,t.styles,{fill:"none"}));var p=t.childNodes[1],u=t.childNodes[2],h=t.rect,d={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(s(t.childNodes[0],{x1:h.x,y1:h.y,x2:d.x,y2:d.y}),r.lineDecoration){p.style.display="none",u.style.display="none";var f=function(t){var i=Math.sqrt(t.x*t.x+t.y*t.y);return 0===i?{x:0,y:0}:o(t.x/i,t.y/i)}({x:d.x-h.x,y:d.y-h.y}),g=a(.05,l,c);if(-1!==r.lineDecoration.indexOf("arrow-begin")){var _=i(f,g),m=e(h,_),v=n(h,2,m),b=n(h,-2,m);s(p,{style:"display:block;",d:"M".concat(v.x,",").concat(v.y," L").concat(h.x,",").concat(h.y," L").concat(b.x,",").concat(b.y)})}if(-1!==r.lineDecoration.indexOf("arrow-end")){var x=i(f,-g),w=e(d,x),y=n(d,2,w),k=n(d,-2,w);s(u,{style:"display:block;",d:"M".concat(y.x,",").concat(y.y," L").concat(d.x,",").concat(d.y," L").concat(k.x,",").concat(k.y)})}}}},f=function(t,i,e,n,o){"path"!==i&&(t.rect=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=a(t.x,i,e,"width")||a(t.left,i,e,"width"),o=a(t.y,i,e,"height")||a(t.top,i,e,"height"),s=a(t.width,i,e,"width"),l=a(t.height,i,e,"height"),c=a(t.right,i,e,"width"),p=a(t.bottom,i,e,"height");return r(o)||(o=r(l)&&r(p)?i.height-l-p:p),r(n)||(n=r(s)&&r(c)?i.width-s-c:c),r(s)||(s=r(n)&&r(c)?i.width-n-c:0),r(l)||(l=r(o)&&r(p)?i.height-o-p:0),{x:n||0,y:o||0,width:s||0,height:l||0}}(e,n,o)),t.styles=function(t,i,e){var n=t.borderStyle||t.lineStyle||"solid",o=t.backgroundColor||t.fontColor||"transparent",r=t.borderColor||t.lineColor||"transparent",s=a(t.borderWidth||t.lineWidth,i,e);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":s||0,"stroke-dasharray":"string"==typeof n?"":n.map((function(t){return a(t,i,e)})).join(","),stroke:r,fill:o,opacity:t.opacity||1}}(e,n,o),d[i](t,e,n,o)},g=["x","y","left","top","right","bottom","width","height"],_=function(i){var e=t(i,2),n=e[0],o=e[1],a=o.points?{}:g.reduce((function(t,i){return t[i]="string"==typeof(e=o[i])&&/%/.test(e)?parseFloat(e)/100:e,t;var e}),{});return[n,Object.assign({zIndex:0},o,a)]},m=function(t,i){return t[1].zIndex>i[1].zIndex?1:t[1].zIndex<i[1].zIndex?-1:0},v=function(i){return i.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(i){var e=i.root,n=i.props;if(n.dirty){var o=n.crop,a=n.resize,r=n.markup,s=n.width,l=n.height,c=o.width,p=o.height;if(a){var u=a.size,d=u&&u.width,g=u&&u.height,v=a.mode;d&&!g&&(g=d),g&&!d&&(d=g);var b=c<d&&p<g;if(!b||b&&a.upscale){var x,w=d/c,y=g/p;"force"===v?(c=d,p=g):("cover"===v?x=Math.max(w,y):"contain"===v&&(x=Math.min(w,y)),c*=x,p*=x)}}var k={width:s,height:l};e.element.setAttribute("width",k.width),e.element.setAttribute("height",k.height);var E=Math.min(s/c,l/p);e.element.innerHTML="";var T=e.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");r.filter(T).map(_).sort(m).forEach((function(i){var n=t(i,2),o=n[0],a=n[1],r=function(t,i){return h[t](i)}(o,a);f(r,o,a,k,E),e.element.appendChild(r)}))}}})},b=function(t,i){return{x:t,y:i}},x=function(t,i){return b(t.x-i.x,t.y-i.y)},w=function(t,i){return Math.sqrt(function(t,i){return function(t,i){return t.x*i.x+t.y*i.y}(x(t,i),x(t,i))}(t,i))},y=function(t,i){var e=t,n=i,o=1.5707963267948966-i,a=Math.sin(1.5707963267948966),r=Math.sin(n),s=Math.sin(o),l=Math.cos(o),c=e/a;return b(l*(c*r),l*(c*s))},k=function(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=t.height/t.width,o=1,a=n;a>i&&(o=(a=i)/n);var r=Math.max(1/o,i/a),s=t.width/(e*r*o);return{width:s,height:s*i}},E=function(t,i,e,n){var o=2*(n.x>.5?1-n.x:n.x)*t.width,a=2*(n.y>.5?1-n.y:n.y)*t.height,r=function(t,i){var e=t.height,n=y(t.width,i),o=y(e,i),a=b(t.x+Math.abs(n.x),t.y-Math.abs(n.y)),r=b(t.x+t.width+Math.abs(o.y),t.y+Math.abs(o.x)),s=b(t.x-Math.abs(o.y),t.y+t.height-Math.abs(o.x));return{width:w(a,r),height:w(a,s)}}(i,e);return Math.max(r.width/o,r.height/a)},T=function(t,i){var e=t.width,n=e*i;return n>t.height&&(e=(n=t.height)/i),{x:.5*(t.width-e),y:.5*(t.height-n),width:e,height:n}},I={type:"spring",stiffness:.5,damping:.45,mass:10},A=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var i=t.props;i.background&&(t.root.element.style.backgroundColor=i.background)},create:function(i){var e=i.root,n=i.props;e.ref.image=e.appendChildView(e.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:I,originY:I,scaleX:I,scaleY:I,translateX:I,translateY:I,rotateZ:I}},create:function(i){var e=i.root,n=i.props;n.width=n.image.width,n.height=n.image.height,e.ref.bitmap=e.appendChildView(e.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){t.root.appendChild(t.props.image)}})}(t),{image:n.image}))},write:function(t){var i=t.props.crop.flip,e=t.root.ref.bitmap;e.scaleX=i.horizontal?-1:1,e.scaleY=i.vertical?-1:1}})}(t),Object.assign({},n))),e.ref.createMarkup=function(){e.ref.markup||(e.ref.markup=e.appendChildView(e.createChildView(v(t),Object.assign({},n))))},e.ref.destroyMarkup=function(){e.ref.markup&&(e.removeChildView(e.ref.markup),e.ref.markup=null)};var o=e.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==o&&(e.element.dataset.transparencyIndicator="grid"===o?o:"color")},write:function(t){var i=t.root,e=t.props,n=t.shouldOptimize,o=e.crop,a=e.markup,r=e.resize,s=e.dirty,l=e.width,c=e.height;i.ref.image.crop=o;var p={x:0,y:0,width:l,height:c,center:{x:.5*l,y:.5*c}},u={width:i.ref.image.width,height:i.ref.image.height},h={x:o.center.x*u.width,y:o.center.y*u.height},d={x:p.center.x-u.width*o.center.x,y:p.center.y-u.height*o.center.y},f=2*Math.PI+o.rotation%(2*Math.PI),g=void 0===o.scaleToFit||o.scaleToFit,_=E(u,T(p,o.aspectRatio||u.height/u.width),f,g?o.center:{x:.5,y:.5}),m=o.zoom*_;a&&a.length?(i.ref.createMarkup(),i.ref.markup.width=l,i.ref.markup.height=c,i.ref.markup.resize=r,i.ref.markup.dirty=s,i.ref.markup.markup=a,i.ref.markup.crop=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=i.zoom,n=i.rotation,o=i.center,a=i.aspectRatio;a||(a=t.height/t.width);var r=k(t,a,e),s=void 0===i.scaleToFit||i.scaleToFit,l=e*E(t,T({x:0,y:0,width:r.width,height:r.height,center:{x:.5*r.width,y:.5*r.height}},a),n,s?o:{x:.5,y:.5});return{widthFloat:r.width/l,heightFloat:r.height/l,width:Math.round(r.width/l),height:Math.round(r.height/l)}}(u,o)):i.ref.markup&&i.ref.destroyMarkup();var v=i.ref.image;if(n)return v.originX=null,v.originY=null,v.translateX=null,v.translateY=null,v.rotateZ=null,v.scaleX=null,void(v.scaleY=null);v.originX=h.x,v.originY=h.y,v.translateX=d.x,v.translateY=d.y,v.rotateZ=f,v.scaleX=m,v.scaleY=m}})},M=0,D=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(i){self.postMessage({id:t.data.id,message:i},[i])}))}},R=function(){self.onmessage=function(t){for(var i=t.data.message.imageData,e=t.data.message.colorMatrix,n=i.data,o=n.length,a=e[0],r=e[1],s=e[2],l=e[3],c=e[4],p=e[5],u=e[6],h=e[7],d=e[8],f=e[9],g=e[10],_=e[11],m=e[12],v=e[13],b=e[14],x=e[15],w=e[16],y=e[17],k=e[18],E=e[19],T=0,I=0,A=0,M=0,D=0;T<o;T+=4)I=n[T]/255,A=n[T+1]/255,M=n[T+2]/255,D=n[T+3]/255,n[T]=Math.max(0,Math.min(255*(I*a+A*r+M*s+D*l+c),255)),n[T+1]=Math.max(0,Math.min(255*(I*p+A*u+M*h+D*d+f),255)),n[T+2]=Math.max(0,Math.min(255*(I*g+A*_+M*m+D*v+b),255)),n[T+3]=Math.max(0,Math.min(255*(I*x+A*w+M*y+D*k+E),255));self.postMessage({id:t.data.id,message:i},[i.data.buffer])}},O={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,i){return[-1,0,0,-1,t,i]},4:function(t,i){return[1,0,0,-1,0,i]},5:function(){return[0,1,1,0,0,0]},6:function(t,i){return[0,1,-1,0,i,0]},7:function(t,i){return[0,-1,-1,0,i,t]},8:function(t){return[0,-1,1,0,0,t]}},S=function(t,i,e,n){i=Math.round(i),e=Math.round(e);var o=document.createElement("canvas");o.width=i,o.height=e;var a=o.getContext("2d");if(n>=5&&n<=8){var r=[e,i];i=r[0],e=r[1]}return function(t,i,e,n){-1!==n&&t.transform.apply(t,O[n](i,e))}(a,i,e,n),a.drawImage(t,0,0,i,e),o},L=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},C=function(t){var i=Math.min(10/t.width,10/t.height),e=document.createElement("canvas"),n=e.getContext("2d"),o=e.width=Math.ceil(t.width*i),a=e.height=Math.ceil(t.height*i);n.drawImage(t,0,0,o,a);var r=null;try{r=n.getImageData(0,0,o,a).data}catch(t){return null}for(var s=r.length,l=0,c=0,p=0,u=0;u<s;u+=4)l+=r[u]*r[u],c+=r[u+1]*r[u+1],p+=r[u+2]*r[u+2];return{r:l=P(l,s),g:c=P(c,s),b:p=P(p,s)}},P=function(t,i){return Math.floor(Math.sqrt(t/(i/4)))},G=function(t){var i=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var i=t.root,e=t.props,n='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var o=new URL(window.location.href.replace(window.location.hash,"")).href;n=n.replace(/url\(\#/g,"url("+o+"#")}M++,i.element.classList.add("filepond--image-preview-overlay-".concat(e.status)),i.element.innerHTML=n.replace(/__UID__/g,M)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),e=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:I,scaleY:I,translateY:I,opacity:{type:"tween",duration:400}}},create:function(i){var e=i.root,n=i.props;e.ref.clip=e.appendChildView(e.createChildView(A(t),{id:n.id,image:n.image,crop:n.crop,markup:n.markup,resize:n.resize,dirty:n.dirty,background:n.background}))},write:function(t){var i=t.root,e=t.props,n=t.shouldOptimize,o=i.ref.clip,a=e.image,r=e.crop,s=e.markup,l=e.resize,c=e.dirty;if(o.crop=r,o.markup=s,o.resize=l,o.dirty=c,o.opacity=n?0:1,!n&&!i.rect.element.hidden){var p=r.aspectRatio||a.height/a.width,u=i.rect.inner.width,h=i.rect.inner.height,d=i.query("GET_IMAGE_PREVIEW_HEIGHT"),f=i.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),g=i.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),_=i.query("GET_PANEL_ASPECT_RATIO"),m=i.query("GET_ALLOW_MULTIPLE");_&&!m&&(d=u*_,p=_);var v=null!==d?d:Math.max(f,Math.min(u*p,g)),b=v/p;b>u&&(v=(b=u)*p),v>h&&(v=h,b=h/p),o.width=b,o.height=v}}})}(t),n=t.utils.createWorker,o=function(t,i,e){return new Promise((function(o){t.ref.imageData||(t.ref.imageData=e.getContext("2d").getImageData(0,0,e.width,e.height));var a=function(t){var i;try{i=new ImageData(t.width,t.height)}catch(e){i=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return i.data.set(new Uint8ClampedArray(t.data)),i}(t.ref.imageData);if(!i||20!==i.length)return e.getContext("2d").putImageData(a,0,0),o();var r=n(R);r.post({imageData:a,colorMatrix:i},(function(t){e.getContext("2d").putImageData(t,0,0),r.terminate(),o()}),[a.data.buffer])}))},a=function(t){var i=t.root,n=t.image,o=t.props.id,a=i.query("GET_ITEM",{id:o});if(a){var r,s,l=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},c=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),p=!1;i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r=a.getMetadata("markup")||[],s=a.getMetadata("resize"),p=!0);var u=i.appendChildView(i.createChildView(e,{id:o,image:n,crop:l,resize:s,markup:r,dirty:p,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),i.childViews.length);i.ref.images.push(u),u.opacity=1,u.scaleX=1,u.scaleY=1,u.translateY=0,setTimeout((function(){i.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)}},r=function(t){var i=t.root;i.ref.overlayShadow.opacity=1,i.ref.overlayError.opacity=0,i.ref.overlaySuccess.opacity=0},s=function(t){var i=t.root;i.ref.overlayShadow.opacity=.25,i.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var e=t.root;e.ref.images=[],e.ref.imageData=null,e.ref.imageViewBin=[],e.ref.overlayShadow=e.appendChildView(e.createChildView(i,{opacity:0,status:"idle"})),e.ref.overlaySuccess=e.appendChildView(e.createChildView(i,{opacity:0,status:"success"})),e.ref.overlayError=e.appendChildView(e.createChildView(i,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var i=t.root,e=i.ref.images[i.ref.images.length-1];e.translateY=0,e.scaleX=1,e.scaleY=1,e.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var i,e,n,o=t.root,a=t.props.id,r=o.query("GET_ITEM",a);if(r){var s=URL.createObjectURL(r.file);i=s,e=function(t,i){o.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:a,width:t,height:i})},(n=new Image).onload=function(){var t=n.naturalWidth,i=n.naturalHeight;n=null,e(t,i)},n.src=i}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var i,e,r=t.root,s=t.props,l=r.query("GET_ITEM",s.id);if(l){var c=URL.createObjectURL(l.file),p=function(){var t;(t=c,new Promise((function(i,e){var n=new Image;n.crossOrigin="Anonymous",n.onload=function(){i(n)},n.onerror=function(t){e(t)},n.src=t}))).then(u)},u=function(t){URL.revokeObjectURL(c);var i=(l.getMetadata("exif")||{}).orientation||-1,e=t.width,n=t.height;if(e&&n){if(i>=5&&i<=8){var p=[n,e];e=p[0],n=p[1]}var u=Math.max(1,.75*window.devicePixelRatio),h=r.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*u,d=n/e,f=r.rect.element.width,g=r.rect.element.height,_=f,m=_*d;d>1?m=(_=Math.min(e,f*h))*d:_=(m=Math.min(n,g*h))/d;var v=S(t,_,m,i),b=function(){var i=r.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?C(data):null;l.setMetadata("color",i,!0),"close"in t&&t.close(),r.ref.overlayShadow.opacity=1,a({root:r,props:s,image:v})},x=l.getMetadata("filter");x?o(r,x,v).then(b):b()}};if(i=l.file,((e=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./))?parseInt(e[1]):null)<=58||!("createImageBitmap"in window)||!L(i))p();else{var h=n(D);h.post({file:l.file},(function(t){h.terminate(),t?u(t):p()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var i,e,n=t.root,r=t.props,s=t.action;if(/crop|filter|markup|resize/.test(s.change.key)&&n.ref.images.length){var l=n.query("GET_ITEM",{id:r.id});if(l)if(/filter/.test(s.change.key))o(n,s.change.value,n.ref.images[n.ref.images.length-1].image);else if(/crop|markup|resize/.test(s.change.key)){var c=l.getMetadata("crop"),p=n.ref.images[n.ref.images.length-1];if(c&&c.aspectRatio&&p.crop&&p.crop.aspectRatio&&Math.abs(c.aspectRatio-p.crop.aspectRatio)>1e-5){var u=function(t){var i=t.root,e=i.ref.images.shift();return e.opacity=0,e.translateY=-15,i.ref.imageViewBin.push(e),e}({root:n});a({root:n,props:r,image:(i=u.image,(e=e||document.createElement("canvas")).width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),e)})}else!function(t){var i=t.root,e=i.query("GET_ITEM",{id:t.props.id});if(e){var n=i.ref.images[i.ref.images.length-1];n.crop=e.getMetadata("crop"),n.background=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),i.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(n.dirty=!0,n.resize=e.getMetadata("resize"),n.markup=e.getMetadata("markup"))}}({root:n,props:r})}}},DID_THROW_ITEM_LOAD_ERROR:s,DID_THROW_ITEM_PROCESSING_ERROR:s,DID_THROW_ITEM_INVALID:s,DID_COMPLETE_ITEM_PROCESSING:function(t){var i=t.root;i.ref.overlayShadow.opacity=.25,i.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:r,DID_REVERT_ITEM_PROCESSING:r},(function(t){var i=t.root,e=i.ref.imageViewBin.filter((function(t){return 0===t.opacity}));i.ref.imageViewBin=i.ref.imageViewBin.filter((function(t){return t.opacity>0})),e.forEach((function(t){return function(t,i){t.removeChildView(i),i.image.width=1,i.image.height=1,i._destroy()}(i,t)})),e.length=0}))})},z=function(t){var i=t.addFilter,e=t.utils,n=e.Type,o=e.createRoute,a=e.isFile,r=G(t);return i("CREATE_VIEW",(function(t){var i=t.view,e=t.query;if((0,t.is)("file")&&e("GET_ALLOW_IMAGE_PREVIEW")){var n=function(t){t.root.ref.shouldRescale=!0};i.registerWriter(o({DID_RESIZE_ROOT:n,DID_STOP_RESIZE:n,DID_LOAD_ITEM:function(t){var n=t.root,o=t.props.id,s=e("GET_ITEM",o);if(s&&a(s.file)&&!s.archived){var l=s.file;if(function(t){return/^image/.test(t.type)}(l)&&e("GET_IMAGE_PREVIEW_FILTER_ITEM")(s)){var c="createImageBitmap"in(window||{}),p=e("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!c&&p&&l.size>p)){n.ref.imagePreview=i.appendChildView(i.createChildView(r,{id:o}));var u=n.query("GET_IMAGE_PREVIEW_HEIGHT");u&&n.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:s.id,height:u});var h=!c&&l.size>e("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");n.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:o},h)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var i=t.root,e=t.action;i.ref.imageWidth=e.width,i.ref.imageHeight=e.height,i.ref.shouldRescale=!0,i.ref.shouldDrawPreview=!0,i.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){"crop"===t.action.change.key&&(t.root.ref.shouldRescale=!0)}},(function(t){var i=t.root,e=t.props;i.ref.imagePreview&&(i.rect.element.hidden||(i.ref.shouldRescale&&(function(t,i){if(t.ref.imagePreview){var e=t.query("GET_ITEM",{id:i.id});if(e){var n=t.query("GET_PANEL_ASPECT_RATIO"),o=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(n||o||a)){var r=t.ref,s=r.imageWidth,l=r.imageHeight;if(s&&l){var c=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),p=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),u=(e.getMetadata("exif")||{}).orientation||-1;if(u>=5&&u<=8){var h=[l,s];s=h[0],l=h[1]}if(!L(e.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var d=2048/s;s*=d,l*=d}var f=l/s,g=(e.getMetadata("crop")||{}).aspectRatio||f,_=Math.max(c,Math.min(l,p)),m=Math.min(t.rect.element.width*g,_);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:e.id,height:m})}}}}}(i,e),i.ref.shouldRescale=!1),i.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){i.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:e.id})}))})),i.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,n.BOOLEAN],imagePreviewFilterItem:[function(){return!0},n.FUNCTION],imagePreviewHeight:[null,n.INT],imagePreviewMinHeight:[44,n.INT],imagePreviewMaxHeight:[256,n.INT],imagePreviewMaxFileSize:[null,n.INT],imagePreviewZoomFactor:[2,n.INT],imagePreviewUpscale:[!1,n.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,n.INT],imagePreviewTransparencyIndicator:[null,n.STRING],imagePreviewCalculateAverageImageColor:[!1,n.BOOLEAN],imagePreviewMarkupShow:[!0,n.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},n.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:z})),z}()})));var si=a((function(t){var i,e;t.exports=(i=function(t){return/^image/.test(t.type)},e=function(t){var e=t.addFilter,n=t.utils,o=n.Type,a=n.createRoute,r=n.createItemAPI,s=void 0===r?function(t){return t}:r,l=t.views.fileActionButton;e("SHOULD_REMOVE_ON_REVERT",(function(t,e){var n=e.item,o=e.query;return new Promise((function(t){var e=n.file;t(!(o("GET_ALLOW_IMAGE_EDIT")&&o("GET_IMAGE_EDIT_ALLOW_EDIT")&&i(e)))}))})),e("DID_LOAD_ITEM",(function(t,e){var n=e.query,o=e.dispatch;return new Promise((function(e,a){if(t.origin>1)e(t);else{var r=t.file;if(n("GET_ALLOW_IMAGE_EDIT")&&n("GET_IMAGE_EDIT_INSTANT_EDIT"))if(i(r)){var s=function(t,i,e){return function(n){c.shift(),n?i(t):e(t),o("KICK"),l()}},l=function(){if(c.length){var t=c[0],i=t.item;o("EDIT_ITEM",{id:i.id,handleEditorResponse:s(i,t.resolve,t.reject)})}};p({item:t,resolve:e,reject:a}),1===c.length&&l()}else e(t);else e(t)}}))})),e("DID_CREATE_ITEM",(function(t,i){var e=i.dispatch;t.extend("edit",(function(){e("EDIT_ITEM",{id:t.id})}))}));var c=[],p=function(t){return c.push(t),t};return e("CREATE_VIEW",(function(t){var e=t.is,n=t.view,o=t.query;if(o("GET_ALLOW_IMAGE_EDIT")){var r=o("GET_ALLOW_IMAGE_PREVIEW");if(e("file-info")&&!r||e("file")&&r){var c=o("GET_IMAGE_EDIT_EDITOR");if(c){c.filepondCallbackBridge||(c.outputData=!0,c.outputFile=!1,c.filepondCallbackBridge={onconfirm:c.onconfirm||function(){},oncancel:c.oncancel||function(){}});n.registerDestroyer((function(t){var i=t.root;i.ref.buttonEditItem&&i.ref.buttonEditItem.off("click",i.ref.handleEdit),i.ref.editButton&&i.ref.editButton.removeEventListener("click",i.ref.handleEdit)}));var p={EDIT_ITEM:function(t){var i=t.root,e=t.props.id,n=t.action.handleEditorResponse;c.cropAspectRatio=i.query("GET_IMAGE_CROP_ASPECT_RATIO")||c.cropAspectRatio,c.outputCanvasBackgroundColor=i.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||c.outputCanvasBackgroundColor;var o=i.query("GET_ITEM",e);if(o){var a=o.file,r=o.getMetadata("crop"),l=o.getMetadata("resize"),p=o.getMetadata("filter")||null,u=o.getMetadata("filters")||null,h=o.getMetadata("colors")||null,d=o.getMetadata("markup")||null,f={crop:r||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},size:l?{upscale:l.upscale,mode:l.mode,width:l.size.width,height:l.size.height}:null,filter:u?u.id||u.matrix:i.query("GET_ALLOW_IMAGE_FILTER")&&i.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!h?p:null,color:h,markup:d};c.onconfirm=function(t){var i=t.data,e=i.crop,a=i.size,r=i.filter,l=i.color,p=i.colorMatrix,u=i.markup,h={};if(e&&(h.crop=e),a){var d=(o.getMetadata("resize")||{}).size,f={width:a.width,height:a.height};f.width&&f.height||!d||(f.width=d.width,f.height=d.height),(f.width||f.height)&&(h.resize={upscale:a.upscale,mode:a.mode,size:f})}u&&(h.markup=u),h.colors=l,h.filters=r,h.filter=p,o.setMetadata(h),c.filepondCallbackBridge.onconfirm(i,s(o)),n&&(c.onclose=function(){n(!0),c.onclose=null})},c.oncancel=function(){c.filepondCallbackBridge.oncancel(s(o)),n&&(c.onclose=function(){n(!1),c.onclose=null})},c.open(a,f)}},DID_LOAD_ITEM:function(t){var e=t.root,a=t.props;if(o("GET_IMAGE_EDIT_ALLOW_EDIT")){var s=a.id,c=o("GET_ITEM",s);if(c&&i(c.file))if(e.ref.handleEdit=function(t){t.stopPropagation(),e.dispatch("EDIT_ITEM",{id:s})},r){var p=n.createChildView(l,{label:"edit",icon:o("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});p.element.classList.add("filepond--action-edit-item"),p.element.dataset.align=o("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),p.on("click",e.ref.handleEdit),e.ref.buttonEditItem=n.appendChildView(p)}else{var u=n.element.querySelector(".filepond--file-info-main"),h=document.createElement("button");h.className="filepond--action-edit-item-alt",h.innerHTML=o("GET_IMAGE_EDIT_ICON_EDIT")+"<span>edit</span>",h.addEventListener("click",e.ref.handleEdit),u.appendChild(h),e.ref.editButton=h}}}};r&&(p.DID_IMAGE_PREVIEW_SHOW=function(t){var i=t.root;i.ref.buttonEditItem&&(i.ref.buttonEditItem.opacity=1)}),n.registerWriter(a(p))}}}})),{options:{allowImageEdit:[!0,o.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",o.STRING],imageEditInstantEdit:[!1,o.BOOLEAN],imageEditAllowEdit:[!0,o.BOOLEAN],imageEditIconEdit:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M8.5 17h1.586l7-7L15.5 8.414l-7 7V17zm-1.707-2.707l8-8a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-8 8A1 1 0 0 1 10.5 19h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707z" fill="currentColor" fill-rule="nonzero"/></svg>',o.STRING],imageEditEditor:[null,o.OBJECT]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e)})),li=a((function(t){var i;t.exports=(i=function(t){var i=t.addFilter,e=t.utils,n=e.Type,o=e.isString,a=e.replaceInString,r=e.guesstimateMimeType,s=e.getExtensionFromFilename,l=e.getFilenameFromURL,c=function(t,i){return t.some((function(t){return/\*$/.test(t)?(e=t,(/^[^/]+/.exec(i)||[]).pop()===e.slice(0,-2)):t===i;var e}))},p=function(t,i,e){if(0===i.length)return!0;var n=function(t){var i="";if(o(t)){var e=l(t),n=s(e);n&&(i=r(n))}else i=t.type;return i}(t);return e?new Promise((function(o,a){e(t,n).then((function(t){c(i,t)?o():a()})).catch(a)})):c(i,n)};return i("SET_ATTRIBUTE_TO_OPTION_MAP",(function(t){return Object.assign(t,{accept:"acceptedFileTypes"})})),i("ALLOW_HOPPER_ITEM",(function(t,i){var e=i.query;return!e("GET_ALLOW_FILE_TYPE_VALIDATION")||p(t,e("GET_ACCEPTED_FILE_TYPES"))})),i("LOAD_FILE",(function(t,i){var e=i.query;return new Promise((function(i,n){if(e("GET_ALLOW_FILE_TYPE_VALIDATION")){var o=e("GET_ACCEPTED_FILE_TYPES"),r=e("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),s=p(t,o,r),l=function(){var t,i=o.map((t=e("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(i){return null!==t[i]&&(t[i]||i)})).filter((function(t){return!1!==t})),r=i.filter((function(t,e){return i.indexOf(t)===e}));n({status:{main:e("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:a(e("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:r.join(", "),allButLastType:r.slice(0,-1).join(", "),lastType:r[i.length-1]})}})};if("boolean"==typeof s)return s?i(t):l();s.then((function(){i(t)})).catch(l)}else i(t)}))})),{options:{allowFileTypeValidation:[!0,n.BOOLEAN],acceptedFileTypes:[[],n.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",n.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",n.STRING],fileValidateTypeLabelExpectedTypesMap:[{},n.OBJECT],fileValidateTypeDetectType:[null,n.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)})),ci=a((function(t){
|
|
31
|
+
/*!
|
|
32
|
+
* FilePondPluginFilePoster 2.5.1
|
|
33
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
34
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
35
|
+
*/
|
|
36
|
+
t.exports=function(){var t={type:"spring",stiffness:.5,damping:.45,mass:10},i=function(t){return-.5*(Math.cos(Math.PI*t)-1)},e=function(t){var i=Math.min(10/t.width,10/t.height),e=document.createElement("canvas"),o=e.getContext("2d"),a=e.width=Math.ceil(t.width*i),r=e.height=Math.ceil(t.height*i);o.drawImage(t,0,0,a,r);var s=null;try{s=o.getImageData(0,0,a,r).data}catch(t){return null}for(var l=s.length,c=0,p=0,u=0,h=0;h<l;h+=4)c+=s[h]*s[h],p+=s[h+1]*s[h+1],u+=s[h+2]*s[h+2];return{r:c=n(c,l),g:p=n(p,l),b:u=n(u,l)}},n=function(t,i){return Math.floor(Math.sqrt(t/(i/4)))},o=function(t,e,n,o,a){t.width=e,t.height=n;var r=t.getContext("2d"),s=.5*e,l=r.createRadialGradient(s,n+110,n-100,s,n+110,n+100);(function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=1-r,l=e.join(","),c=0;c<=a;c++){var p=c/a;t.addColorStop(r+s*p,"rgba(".concat(l,", ").concat(o(p)*n,")"))}})(l,o,a,void 0,8,.4),r.save(),r.translate(.5*-e,0),r.scale(2,1),r.fillStyle=l,r.fillRect(0,0,e,n),r.restore()},a="undefined"!=typeof navigator,r=500,s=200,l=a&&document.createElement("canvas"),c=a&&document.createElement("canvas"),p=a&&document.createElement("canvas"),u=[40,40,40],h=[196,78,71],d=[54,151,99];a&&(o(l,r,s,u,.85),o(c,r,s,h,1),o(p,r,s,d,1));var f=function(i){var n=i.utils.createView({name:"file-poster-overlay",tag:"canvas",ignoreRect:!0,create:function(t){var i,e;(e=t.root.element).width=(i=t.props.template).width,e.height=i.height,e.getContext("2d").drawImage(i,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),a=function(t){var i=t.root;i.ref.overlayShadow.opacity=1,i.ref.overlayError.opacity=0,i.ref.overlaySuccess.opacity=0},f=function(t){var i=t.root;i.ref.overlayShadow.opacity=.25,i.ref.overlayError.opacity=1};return i.utils.createView({name:"file-poster-wrapper",create:function(e){var a=e.root,f=e.props,g=a.query("GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR"),_=a.query("GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR"),m=a.query("GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR");g&&g!==u&&o(l,r,s,u=g,.85),_&&_!==h&&o(c,r,s,h=_,1),m&&m!==d&&o(p,r,s,d=m,1);var v=function(i){return i.utils.createView({name:"file-poster",tag:"div",ignoreRect:!0,create:function(t){var i=t.root;i.ref.image=document.createElement("img"),i.element.appendChild(i.ref.image)},write:i.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){var i=t.root,e=t.props,n=e.id,o=i.query("GET_ITEM",{id:e.id});if(o){var a=o.getMetadata("poster");i.ref.image.src=a,i.dispatch("DID_FILE_POSTER_DRAW",{id:n})}}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:t,scaleY:t,opacity:{type:"tween",duration:750}}}})}(i);a.ref.image=a.appendChildView(a.createChildView(v,{id:f.id,scaleX:1.25,scaleY:1.25,opacity:0})),a.ref.overlayShadow=a.appendChildView(a.createChildView(n,{template:l,opacity:0})),a.ref.overlaySuccess=a.appendChildView(a.createChildView(n,{template:p,opacity:0})),a.ref.overlayError=a.appendChildView(a.createChildView(n,{template:c,opacity:0}))},write:i.utils.createRoute({DID_FILE_POSTER_LOAD:function(t){t.root.ref.overlayShadow.opacity=1},DID_FILE_POSTER_DRAW:function(t){var i=t.root.ref.image;i.scaleX=1,i.scaleY=1,i.opacity=1},DID_FILE_POSTER_CONTAINER_CREATE:function(t){var i,n,o,a=t.root,r=t.props.id,s=a.query("GET_ITEM",r);if(s){var l=s.getMetadata("poster"),c=function(t){var i=a.query("GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR")?e(t):null;s.setMetadata("color",i,!0),a.dispatch("DID_FILE_POSTER_LOAD",{id:r,data:t})};i=l,n=function(t,i){var e,n;a.dispatch("DID_FILE_POSTER_CALCULATE_SIZE",{id:r,width:t,height:i}),(e=l,n=a.query("GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE"),new Promise((function(t,i){var o=new Image;"string"==typeof crossOrigin&&(o.crossOrigin=n),o.onload=function(){t(o)},o.onerror=function(t){i(t)},o.src=e}))).then(c)},(o=new Image).onload=function(){var t=o.naturalWidth,i=o.naturalHeight;o=null,n(t,i)},o.src=i}},DID_THROW_ITEM_LOAD_ERROR:f,DID_THROW_ITEM_PROCESSING_ERROR:f,DID_THROW_ITEM_INVALID:f,DID_COMPLETE_ITEM_PROCESSING:function(t){var i=t.root;i.ref.overlayShadow.opacity=.25,i.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:a,DID_REVERT_ITEM_PROCESSING:a})})},g=function(t){var i=t.addFilter,e=t.utils,n=e.Type,o=e.createRoute,a=f(t);return i("CREATE_VIEW",(function(t){var i=t.view,e=t.query;if((0,t.is)("file")&&e("GET_ALLOW_FILE_POSTER")){var n=function(t,n){var o=n.id,r=e("GET_ITEM",o);r&&r.getMetadata("poster")&&!r.archived&&t.ref.previousPoster!==r.getMetadata("poster")&&(t.ref.previousPoster=r.getMetadata("poster"),e("GET_FILE_POSTER_FILTER_ITEM")(r)&&(t.ref.filePoster&&i.removeChildView(t.ref.filePoster),t.ref.filePoster=i.appendChildView(i.createChildView(a,{id:o})),t.dispatch("DID_FILE_POSTER_CONTAINER_CREATE",{id:o})))},r=function(t){var i=t.root,e=i.query("GET_FILE_POSTER_HEIGHT");if(e)return e;var n=i.query("GET_FILE_POSTER_MIN_HEIGHT"),o=i.query("GET_FILE_POSTER_MAX_HEIGHT");if(n&&i.ref.imageHeight<n)return n;var a=i.rect.element.width*(i.ref.imageHeight/i.ref.imageWidth);return n&&a<n?n:o&&a>o?o:a};i.registerWriter(o({DID_LOAD_ITEM:function(t){n(t.root,t.props)},DID_FILE_POSTER_CALCULATE_SIZE:function(t){var i=t.root,e=t.action;i.ref.filePoster&&(i.ref.imageWidth=e.width,i.ref.imageHeight=e.height,i.ref.shouldUpdatePanelHeight=!0,i.dispatch("KICK"))},DID_UPDATE_ITEM_METADATA:function(t){var i=t.root,e=t.props;/poster/.test(t.action.change.key)&&n(i,e)}},(function(t){var i=t.root;i.ref.filePoster&&(i.rect.element.hidden||i.ref.shouldUpdatePanelHeight&&(i.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:t.props.id,height:r({root:i})}),i.ref.shouldUpdatePanelHeight=!1))})))}})),{options:{allowFilePoster:[!0,n.BOOLEAN],filePosterHeight:[null,n.INT],filePosterMinHeight:[null,n.INT],filePosterMaxHeight:[null,n.INT],filePosterFilterItem:[function(){return!0},n.FUNCTION],filePosterCalculateAverageImageColor:[!1,n.BOOLEAN],filePosterCrossOriginAttributeValue:["Anonymous",n.STRING],filePosterItemOverlayShadowColor:[null,n.ARRAY],filePosterItemOverlayErrorColor:[null,n.ARRAY],filePosterItemOverlaySuccessColor:[null,n.ARRAY]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:g})),g}()}));const pi=class{constructor(i){t(this,i),this.added=o(this,"added",7),this.uploaded=o(this,"uploaded",7),this.removed=o(this,"removed",7),this.profileImage=!1,this.accept="image/png, image/jpeg, image/jpg, image/gif",this.method="POST",this.formData="{}",this.maxFileSize="3MB",this.allowDrop=!0,this.allowBrowse=!0,this.allowReplace=!0,this.allowRevert=!0,this.allowRemove=!0,this.maxFilesCount=null,this.maxParallelUploads=2,this.itemInsertLocation="after",this.itemInsertInterval=75,this.dropOnElement=!0,this.ignoredFiles=[".ds_store","thumbs.db","desktop.ini"],this.chunkSize=5e6,this.chunkRetryDelays=[500,1e3,3e3],this.labelDecimalSeparator=void 0,this.labelThousandsSeparator=void 0,this.iconRemove="<svg>...</svg>",this.iconProcess="<svg>...</svg>",this.iconRetry="<svg>...</svg>",this.iconUndo="<svg>...</svg>",ni.registerPlugin(ri,ai,oi,si,li,ci),!this.url&&this.cartItemId&&(this.url=salla.cart.getUploadImageEndpoint(),this.instantUpload=!0),!this.url&&this.profileImage&&(this.url=salla.url.api("profile/update"),this.instantUpload=!0,this.host.hasAttribute("name")||(this.name="avatar")),this.name||(this.name="file"),salla.lang.onLoaded((()=>{this.host.querySelectorAll(".filepond--drop-label>label").forEach((t=>t.innerHTML=this.getLabel())),this.filepond&&(this.filepond.labelFileTypeNotAllowed=salla.lang.get("common.uploader.invalid_type"),this.filepond.labelMaxFileSizeExceeded=salla.lang.get("common.uploader.too_large"),this.filepond.labelFileSizeNotAvailable=salla.lang.get("common.uploader.size_not_available"),this.filepond.labelFileLoading=salla.lang.get("common.elements.loading"),this.filepond.labelFileLoadError=salla.lang.get("common.uploader.failed_to_load"),this.filepond.labelFileProcessing=salla.lang.get("common.uploader.uploading"),this.filepond.labelFileProcessingComplete=salla.lang.get("common.uploader.upload_completed"),this.filepond.labelFileProcessingAborted=salla.lang.get("common.uploader.upload_cancelled"),this.filepond.labelFileProcessingError=salla.lang.get("common.uploader.error_uploading"),this.filepond.labelTapToCancel=salla.lang.get("common.elements.cancel"),this.filepond.labelTapToRetry=salla.lang.get("common.elements.retry"),this.filepond.labelButtonRemoveItem=salla.lang.get("common.elements.remove"),this.filepond.labelButtonUndoItemProcessing=salla.lang.get("common.elements.undo"),this.filepond.labelButtonProcessItem=salla.lang.get("common.uploader.upload"))}))}addedHandler(t,i){if(this.added.emit({error:t,file:i}),this.host.querySelector(".filepond--root").classList.remove("s-file-upload-has-error"),t||!i.file.type)return void this.host.querySelector(".filepond--root").classList.add("s-file-upload-has-error");let e=new DataTransfer,n=this.getFormDataFileInput();e.items.add(i.file),n.type="file",n.files=e.files,n.dispatchEvent(new window.Event("change",{bubbles:!0}))}uploadedHandler(){let t=this.getFormDataFileInput();return t.type="hidden",t.value=this.value,t.dispatchEvent(new window.Event("change",{bubbles:!0})),this.uploaded.emit(this.value)}removedHandler(t){let i=this.getFormDataFileInput();return i.type="hidden",i.value="",t.getMetadata("id")&&salla.cart.api.deleteImage(t.getMetadata("id")),this.height&&setTimeout((()=>this.host.querySelector(".filepond--root").style.height=this.height),1e3),i.dispatchEvent(new window.Event("change",{bubbles:!0})),this.removed.emit(t)}async setOption(t,i){this.filepond[t]=i}getLabel(){return this.labelIdle||`${salla.lang.get("common.uploader.drag_and_drop")}<span class="filepond--label-action"> ${salla.lang.get("common.uploader.browse")} </span>`}getFileSize(t){let i=new XMLHttpRequest;return i.open("HEAD",t,!1),i.send(null),200===i.status?i.getResponseHeader("content-length"):""}getFormDataFileInput(){return this.host.querySelector(".filepond--data input")}getFiles(){if(!this.value&&!this.files)return[];try{return(this.files?JSON.parse(this.files):this.value.split(",").map((t=>({url:t})))).map((t=>({source:t.id?`${t.id}`:t.url,options:{type:"local",file:{name:t.url.substring(t.url.lastIndexOf("/")+1),size:this.getFileSize(t.url)},metadata:{poster:t.url,name:t.url,id:t.id}}})))}catch(t){salla.log("failed To get files from: "+(this.files||this.value))}return[]}componentWillLoad(){this.labelIdle||(this.labelIdle=this.host.innerHTML,this.host.innerHTML="")}render(){return i(e,{class:{"s-file-upload":!0,"s-file-upload-profile-image":this.profileImage}},i("input",{type:"file",name:this.name,value:this.value,ref:t=>this.fileUploader=t,required:this.required,class:"s-file-upload-wrapper s-file-upload-input",accept:this.accept}))}componentDidLoad(){let t=this.getFiles();this.filepond=ni.create(this.fileUploader,{name:this.payloadName||this.name,files:t,required:this.required,disabled:this.disabled,allowDrop:this.allowDrop,allowBrowse:this.allowBrowse,allowPaste:this.allowPaste,allowMultiple:this.allowMultiple,allowReplace:this.allowReplace,allowRevert:this.allowRevert,allowProcess:this.allowProcess,allowReorder:this.allowReorder,storeAsFile:this.storeAsFile,forceRevert:this.forceRevert,maxFiles:this.maxFilesCount,maxParallelUploads:this.maxParallelUploads,checkValidity:this.checkValidity,itemInsertLocation:this.itemInsertLocation,itemInsertInterval:this.itemInsertInterval,credits:this.credits,dropOnPage:this.dropOnPage,dropOnElement:this.dropOnElement,dropValidation:this.dropValidation,ignoredFiles:this.ignoredFiles,onaddfile:(t,i)=>this.addedHandler(t,i),server:{url:this.url,method:this.method,process:{onload:t=>{let i=JSON.parse(t).data;return this.value=i.filePath||i.url,this.uploadedHandler(),this.value},headers:salla.api.getHeaders(),onerror:t=>{try{let i=JSON.parse(t).error.fields;return i=i[this.payloadName||this.name],i&&i[0]||salla.lang.get("common.errors.error_occurred")}catch(t){return salla.log("FileUpload:: Error",t),salla.lang.get("common.errors.error_occurred")}},ondata:t=>{this.payloadName&&this.payloadName!=this.name&&(t.append(this.payloadName,this.filepond.getFile(0).file),t.delete(this.name)),this.cartItemId&&t.append("cart_item_id",this.cartItemId);try{Object.entries(JSON.parse(this.formData)).forEach((i=>i[1]&&t.append(i[0],i[1])))}catch(t){salla.log("Error to inject formData",t)}return t}}},instantUpload:this.instantUpload,chunkUploads:this.chunkUploads,chunkForce:this.chunkForce,chunkSize:this.chunkSize,chunkRetryDelays:this.chunkRetryDelays,labelDecimalSeparator:this.labelDecimalSeparator,labelThousandsSeparator:this.labelThousandsSeparator,labelIdle:this.getLabel(),acceptedFileTypes:this.accept.replace(/\s+/g,"").split(","),labelFileTypeNotAllowed:salla.lang.get("common.uploader.invalid_type"),fileValidateTypeLabelExpectedTypes:"{allButLastType}, {lastType}",labelMaxFileSizeExceeded:salla.lang.get("common.uploader.too_large"),labelMaxFileSize:"{filesize}",maxFileSize:this.maxFileSize,beforeRemoveFile:t=>new Promise((i=>{this.removedHandler(t),i(!0)}))})}get host(){return n(this)}};pi.style="/*!\n * FilePond 4.30.4\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--assistant{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--browser.filepond--browser{position:absolute;margin:0;padding:0;left:1em;top:1.75em;width:calc(100% - 2em);opacity:0;font-size:0}.filepond--data{position:absolute;width:0;height:0;padding:0;margin:0;border:none;visibility:hidden;pointer-events:none;contain:strict}.filepond--drip{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;opacity:.1;pointer-events:none;border-radius:.5em;background:rgba(0,0,0,.01)}.filepond--drip-blob{-webkit-transform-origin:center center;transform-origin:center center;width:8em;height:8em;margin-left:-4em;margin-top:-4em;background:#292625;border-radius:50%}.filepond--drip-blob,.filepond--drop-label{position:absolute;top:0;left:0;will-change:transform,opacity}.filepond--drop-label{right:0;margin:0;color:#4f4f4f;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--drop-label.filepond--drop-label label{display:block;margin:0;padding:.5em}.filepond--drop-label label{cursor:default;font-size:.875em;font-weight:400;text-align:center;line-height:1.5}.filepond--label-action{text-decoration:underline;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;-webkit-text-decoration-color:#a7a4a4;text-decoration-color:#a7a4a4;cursor:pointer}.filepond--root[data-disabled] .filepond--drop-label label{opacity:.5}.filepond--file-action-button.filepond--file-action-button{font-size:1em;width:1.625em;height:1.625em;font-family:inherit;line-height:inherit;margin:0;padding:0;border:none;outline:none;will-change:transform,opacity}.filepond--file-action-button.filepond--file-action-button span{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file-action-button.filepond--file-action-button svg{width:100%;height:100%}.filepond--file-action-button.filepond--file-action-button:after{position:absolute;left:-.75em;right:-.75em;top:-.75em;bottom:-.75em;content:\"\"}.filepond--file-action-button{cursor:auto;color:#fff;border-radius:50%;background-color:rgba(0,0,0,.5);background-image:none;-webkit-box-shadow:0 0 0 0 hsla(0,0%,100%,0);box-shadow:0 0 0 0 hsla(0,0%,100%,0);-webkit-transition:-webkit-box-shadow .25s ease-in;transition:-webkit-box-shadow .25s ease-in;transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in, -webkit-box-shadow .25s ease-in}.filepond--file-action-button:focus,.filepond--file-action-button:hover{-webkit-box-shadow:0 0 0 .125em hsla(0,0%,100%,.9);box-shadow:0 0 0 .125em hsla(0,0%,100%,.9)}.filepond--file-action-button[disabled]{color:hsla(0,0%,100%,.5);background-color:rgba(0,0,0,.25)}.filepond--file-action-button[hidden]{display:none}.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=center]{margin-left:-.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*=bottom]{margin-bottom:-.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 .25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--file-info{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex:1;flex:1;margin:0 .5em 0 0;min-width:0;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-info *{margin:0}.filepond--file-info .filepond--file-info-main{font-size:.75em;line-height:1.2;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}.filepond--file-info .filepond--file-info-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out;white-space:nowrap}.filepond--file-info .filepond--file-info-sub:empty{display:none}.filepond--file-status{position:static;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;margin:0;min-width:2.25em;text-align:right;will-change:transform,opacity;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--file-status *{margin:0;white-space:nowrap}.filepond--file-status .filepond--file-status-main{font-size:.75em;line-height:1.2}.filepond--file-status .filepond--file-status-sub{font-size:.625em;opacity:.5;-webkit-transition:opacity .25s ease-in-out;transition:opacity .25s ease-in-out}.filepond--file-wrapper.filepond--file-wrapper{border:none;margin:0;padding:0;min-width:0;height:100%}.filepond--file-wrapper.filepond--file-wrapper>legend{position:absolute;overflow:hidden;height:1px;width:1px;padding:0;border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);white-space:nowrap}.filepond--file{position:static;display:-ms-flexbox;display:flex;height:100%;-ms-flex-align:start;align-items:flex-start;padding:.5625em;color:#fff;border-radius:.5em}.filepond--file .filepond--file-status{margin-left:auto;margin-right:2.25em}.filepond--file .filepond--processing-complete-indicator{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.filepond--file .filepond--file-action-button,.filepond--file .filepond--processing-complete-indicator,.filepond--file .filepond--progress-indicator{position:absolute}.filepond--file [data-align*=left]{left:.5625em}.filepond--file [data-align*=right]{right:.5625em}.filepond--file [data-align*=center]{left:calc(50% - .8125em)}.filepond--file [data-align*=bottom]{bottom:1.125em}.filepond--file [data-align=center]{top:calc(50% - .8125em)}.filepond--file .filepond--progress-indicator{margin-top:.1875em}.filepond--file .filepond--progress-indicator[data-align*=right]{margin-right:.1875em}.filepond--file .filepond--progress-indicator[data-align*=left]{margin-left:.1875em}[data-filepond-item-state*=error] .filepond--file-info,[data-filepond-item-state*=invalid] .filepond--file-info,[data-filepond-item-state=cancelled] .filepond--file-info{margin-right:2.25em}[data-filepond-item-state~=processing] .filepond--file-status-sub{opacity:0}[data-filepond-item-state~=processing] .filepond--action-abort-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-error] .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-error] .filepond--action-retry-item-processing~.filepond--file-status .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing svg{-webkit-animation:fall .5s linear .125s both;animation:fall .5s linear .125s both}[data-filepond-item-state=processing-complete] .filepond--file-status-sub{opacity:.5}[data-filepond-item-state=processing-complete] .filepond--file-info-sub,[data-filepond-item-state=processing-complete] .filepond--processing-complete-indicator:not([style*=hidden])~.filepond--file-status .filepond--file-status-sub{opacity:0}[data-filepond-item-state=processing-complete] .filepond--action-revert-item-processing~.filepond--file-info .filepond--file-info-sub{opacity:.5}[data-filepond-item-state*=error] .filepond--file-wrapper,[data-filepond-item-state*=error] .filepond--panel,[data-filepond-item-state*=invalid] .filepond--file-wrapper,[data-filepond-item-state*=invalid] .filepond--panel{-webkit-animation:shake .65s linear both;animation:shake .65s linear both}[data-filepond-item-state*=busy] .filepond--progress-indicator svg{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@keyframes shake{10%,90%{-webkit-transform:translateX(-.0625em);transform:translateX(-.0625em)}20%,80%{-webkit-transform:translateX(.125em);transform:translateX(.125em)}30%,50%,70%{-webkit-transform:translateX(-.25em);transform:translateX(-.25em)}40%,60%{-webkit-transform:translateX(.25em);transform:translateX(.25em)}}@-webkit-keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fall{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}70%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}to{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.filepond--hopper[data-hopper-state=drag-over]>*{pointer-events:none}.filepond--hopper[data-hopper-state=drag-over]:after{content:\"\";position:absolute;left:0;top:0;right:0;bottom:0;z-index:100}.filepond--progress-indicator{z-index:103}.filepond--file-action-button{z-index:102}.filepond--file-status{z-index:101}.filepond--file-info{z-index:100}.filepond--item{position:absolute;top:0;left:0;right:0;z-index:1;padding:0;margin:.25em;will-change:transform,opacity}.filepond--item>.filepond--panel{z-index:-1}.filepond--item>.filepond--panel .filepond--panel-bottom{-webkit-box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25);box-shadow:0 .0625em .125em -.0625em rgba(0,0,0,.25)}.filepond--item>.filepond--file-wrapper,.filepond--item>.filepond--panel{-webkit-transition:opacity .15s ease-out;transition:opacity .15s ease-out}.filepond--item[data-drag-state]{cursor:-webkit-grab;cursor:grab}.filepond--item[data-drag-state]>.filepond--panel{-webkit-transition:-webkit-box-shadow .125s ease-in-out;transition:-webkit-box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out;transition:box-shadow .125s ease-in-out, -webkit-box-shadow .125s ease-in-out;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent}.filepond--item[data-drag-state=drag]{cursor:-webkit-grabbing;cursor:grabbing}.filepond--item[data-drag-state=drag]>.filepond--panel{-webkit-box-shadow:0 .125em .3125em rgba(0,0,0,.325);box-shadow:0 .125em .3125em rgba(0,0,0,.325)}.filepond--item[data-drag-state]:not([data-drag-state=idle]){z-index:2}.filepond--item-panel{background-color:#64605e}[data-filepond-item-state=processing-complete] .filepond--item-panel{background-color:#369763}[data-filepond-item-state*=error] .filepond--item-panel,[data-filepond-item-state*=invalid] .filepond--item-panel{background-color:#c44e47}.filepond--item-panel{border-radius:.5em;-webkit-transition:background-color .25s;transition:background-color .25s}.filepond--list-scroller{position:absolute;top:0;left:0;right:0;margin:0;will-change:transform}.filepond--list-scroller[data-state=overflow] .filepond--list{bottom:0;right:0}.filepond--list-scroller[data-state=overflow]{overflow-y:scroll;overflow-x:hidden;-webkit-overflow-scrolling:touch;-webkit-mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));-webkit-mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent);mask:-webkit-gradient(linear,left top, left bottom,from(#000),to(transparent));mask:linear-gradient(180deg,#000 calc(100% - .5em),transparent)}.filepond--list-scroller::-webkit-scrollbar{background:transparent}.filepond--list-scroller::-webkit-scrollbar:vertical{width:1em}.filepond--list-scroller::-webkit-scrollbar:horizontal{height:0}.filepond--list-scroller::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3);border-radius:99999px;border:.3125em solid transparent;background-clip:content-box}.filepond--list.filepond--list{position:absolute;top:0;margin:0;padding:0;list-style-type:none;will-change:transform}.filepond--list{left:.75em;right:.75em}.filepond--root[data-style-panel-layout~=integrated]{width:100%;height:100%;max-width:none;margin:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root{border-radius:0}.filepond--root[data-style-panel-layout~=circle] .filepond--panel-root>*,.filepond--root[data-style-panel-layout~=integrated] .filepond--panel-root>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{bottom:0;height:auto;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:7}.filepond--root[data-style-panel-layout~=circle] .filepond--item-panel,.filepond--root[data-style-panel-layout~=integrated] .filepond--item-panel{display:none}.filepond--root[data-style-panel-layout~=compact] .filepond--list-scroller,.filepond--root[data-style-panel-layout~=integrated] .filepond--list-scroller{overflow:hidden;height:100%;margin-top:0;margin-bottom:0}.filepond--root[data-style-panel-layout~=compact] .filepond--list,.filepond--root[data-style-panel-layout~=integrated] .filepond--list{left:0;right:0;height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--item,.filepond--root[data-style-panel-layout~=integrated] .filepond--item{margin:0}.filepond--root[data-style-panel-layout~=compact] .filepond--file-wrapper,.filepond--root[data-style-panel-layout~=integrated] .filepond--file-wrapper{height:100%}.filepond--root[data-style-panel-layout~=compact] .filepond--drop-label,.filepond--root[data-style-panel-layout~=integrated] .filepond--drop-label{z-index:7}.filepond--root[data-style-panel-layout~=circle]{border-radius:99999rem;overflow:hidden}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel{border-radius:inherit}.filepond--root[data-style-panel-layout~=circle]>.filepond--panel>*{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--file-info,.filepond--root[data-style-panel-layout~=circle] .filepond--file-status{display:none}.filepond--root[data-style-panel-layout~=circle] .filepond--action-edit-item{opacity:1!important;visibility:visible!important}@media not all and (-webkit-min-device-pixel-ratio:0), not all and (min-resolution:0.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){.filepond--root[data-style-panel-layout~=circle]{will-change:transform}}}.filepond--panel-root{border-radius:.5em;background-color:#f1f0ef}.filepond--panel{position:absolute;left:0;top:0;right:0;margin:0;height:100%!important;pointer-events:none}.filepond-panel:not([data-scalable=false]){height:auto!important}.filepond--panel[data-scalable=false]>div{display:none}.filepond--panel[data-scalable=true]{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;background-color:transparent!important;border:none!important}.filepond--panel-bottom,.filepond--panel-center,.filepond--panel-top{position:absolute;left:0;top:0;right:0;margin:0;padding:0}.filepond--panel-bottom,.filepond--panel-top{height:.5em}.filepond--panel-top{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important;border-bottom:none!important}.filepond--panel-top:after{content:\"\";position:absolute;height:2px;left:0;right:0;bottom:-1px;background-color:inherit}.filepond--panel-bottom,.filepond--panel-center{will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translate3d(0,.5em,0);transform:translate3d(0,.5em,0)}.filepond--panel-bottom{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:none!important}.filepond--panel-bottom:before{content:\"\";position:absolute;height:2px;left:0;right:0;top:-1px;background-color:inherit}.filepond--panel-center{height:100px!important;border-top:none!important;border-bottom:none!important;border-radius:0!important}.filepond--panel-center:not([style]){visibility:hidden}.filepond--progress-indicator{position:static;width:1.25em;height:1.25em;color:#fff;margin:0;pointer-events:none;will-change:transform,opacity}.filepond--progress-indicator svg{width:100%;height:100%;vertical-align:top;transform-box:fill-box}.filepond--progress-indicator path{fill:none;stroke:currentColor}.filepond--list-scroller{z-index:6}.filepond--drop-label{z-index:5}.filepond--drip{z-index:3}.filepond--root>.filepond--panel{z-index:2}.filepond--browser{z-index:1}.filepond--root{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;margin-bottom:1em;font-size:1rem;line-height:normal;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:450;text-align:left;text-rendering:optimizeLegibility;direction:ltr;contain:layout style size}.filepond--root *{-webkit-box-sizing:inherit;box-sizing:inherit;line-height:inherit}.filepond--root :not(text){font-size:inherit}.filepond--root[data-disabled]{pointer-events:none}.filepond--root[data-disabled] .filepond--list-scroller{pointer-events:all}.filepond--root[data-disabled] .filepond--list{pointer-events:none}.filepond--root .filepond--drop-label{min-height:4.75em}.filepond--root .filepond--list-scroller{margin-top:1em;margin-bottom:1em}.filepond--root .filepond--credits{position:absolute;right:0;opacity:.175;line-height:.85;font-size:11px;color:inherit;text-decoration:none;z-index:3;bottom:-14px}.filepond--root .filepond--credits[style]{top:0;bottom:auto;margin-top:14px}/*!\n * FilePondPluginImagePreview 4.6.11\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--image-preview-markup{position:absolute;left:0;top:0}.filepond--image-preview-wrapper{z-index:2}.filepond--image-preview-overlay{display:block;position:absolute;left:0;top:0;width:100%;min-height:5rem;max-height:7rem;margin:0;opacity:0;z-index:2;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filepond--image-preview-overlay svg{width:100%;height:auto;color:inherit;max-height:inherit}.filepond--image-preview-overlay-idle{mix-blend-mode:multiply;color:rgba(40, 40, 40, 0.85)}.filepond--image-preview-overlay-success{mix-blend-mode:normal;color:rgba(54, 151, 99, 1)}.filepond--image-preview-overlay-failure{mix-blend-mode:normal;color:rgba(196, 78, 71, 1)}@supports (-webkit-marquee-repetition: infinite) and\n ((-o-object-fit: fill) or (object-fit: fill)){.filepond--image-preview-overlay-idle{mix-blend-mode:normal}}.filepond--image-preview-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;left:0;top:0;right:0;height:100%;margin:0;border-radius:0.45em;overflow:hidden;background:rgba(0, 0, 0, 0.01)}.filepond--image-preview{position:absolute;left:0;top:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%;width:100%;pointer-events:none;background:#222;will-change:transform, opacity}.filepond--image-clip{position:relative;overflow:hidden;margin:0 auto;}.filepond--image-clip[data-transparency-indicator='grid'] img,.filepond--image-clip[data-transparency-indicator='grid'] canvas{background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");background-size:1.25em 1.25em}.filepond--image-bitmap,.filepond--image-vector{position:absolute;left:0;top:0;will-change:transform}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview-wrapper{border-radius:0}.filepond--root[data-style-panel-layout~='integrated'] .filepond--image-preview{height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-wrapper{border-radius:99999rem}.filepond--root[data-style-panel-layout~='circle'] .filepond--image-preview-overlay{top:auto;bottom:0;-webkit-transform:scaleY(-1);transform:scaleY(-1)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']){margin-bottom:0.325em}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='left']{left:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--file [data-align*='right']{right:calc(50% - 3em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='right']{margin-bottom:calc(0.325em + 0.1875em)}.filepond--root[data-style-panel-layout~='circle'] .filepond--progress-indicator[data-align*='bottom'][data-align*='center']{margin-top:0;margin-bottom:0.1875em;margin-left:0.1875em}/*!\n * FilePondPluginImageEdit 1.6.3\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */.filepond--action-edit-item.filepond--action-edit-item{width:2em;height:2em;padding:0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='center']{margin-left:-0.1875em}.filepond--action-edit-item.filepond--action-edit-item[data-align*='bottom']{margin-bottom:-0.1875em}.filepond--action-edit-item-alt{border:none;line-height:inherit;background:transparent;font-family:inherit;color:inherit;outline:none;padding:0;margin:0 0 0 0.25em;pointer-events:all;position:absolute}.filepond--action-edit-item-alt svg{width:1.3125em;height:1.3125em}.filepond--action-edit-item-alt span{font-size:0;opacity:0}.filepond--root[data-style-panel-layout~='circle'] .filepond--action-edit-item{opacity:1 !important;visibility:visible !important}";const ui='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cancel</title>\n<path d="M17.885 16l7.057-7.057c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-7.057 7.057-7.057-7.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l7.057 7.057-7.057 7.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l7.057-7.057 7.057 7.057c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n',hi='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n',di=class{constructor(i){t(this,i),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale}))}async open(){if(!salla.config.isGuest())return this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getGiftDetails(this.productId))).then((t=>{this.gift=t.data,this.senderName=this.gift.sender_name})).catch((t=>{var i,e,n,o;this.hasError=!0,this.errorMessage=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data)})).finally((()=>this.modal.stopLoading()));salla.event.dispatch("login::open")}async close(){return this.modal.close()}async setWrapperHeight(t=1,i=250,e=0,n=0){let o=document.querySelector(`.gift-step-${t}`);setTimeout((()=>{this.stepsWrapper.style.height=n?`${n}px`:o.offsetHeight+e+"px"}),i)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(t){var i;null===(i=this.textSelect)||void 0===i||i.classList.remove("s-form-has-error");let e=t.target.children[t.target.selectedIndex].getAttribute("data-id"),n="custom"==e;this.showGiftText=n,e?(this.selectedGiftTextOption=e,this.selectedText=n?void 0:t.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new st.timeline).add({targets:this.step1Elems.querySelectorAll(".anime-item"),opacity:[1,0],translateX:[0,50],delay:st.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(".anime-item"),opacity:[0,1],translateX:[-50,0],delay:st.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(".anime-item").forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),this.currentStep=2,void(this.parentClass=`is-current-step-${this.currentStep}`)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(t){t.preventDefault();let i=new st.timeline({autoplay:!1});i.add({targets:this.step2Elems.querySelectorAll(".anime-item"),opacity:[1,0],translateX:[0,-50],delay:st.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(".anime-item"),opacity:[0,1],translateX:[50,0],delay:st.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(".anime-item").forEach((t=>{t.classList.remove("opacity-0"),t.removeAttribute("style")}))}},"-=1200"),i.play(),this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass=`is-current-step-${this.currentStep}`}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(t){var i,e;null===(i=this.uploader)||void 0===i||i.classList.add("has-bg");var n=document.querySelector(".filepond-bg")?document.querySelector(".filepond-bg"):document.createElement("div");n.classList.add("filepond-bg"),n.classList.remove("s-hidden"),n.style.backgroundImage="url('"+t.url+"')",null===(e=this.uploader)||void 0===e||e.querySelector(".filepond--root").appendChild(n),this.uploadedImage=t.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let t=document.querySelector(".filepond-bg");t.removeAttribute("style"),t.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(t){this.selectedText=t.target.value,this.customTextArea.classList.remove("s-form-has-error")}handleSenderName(t){this.senderName=t.target.value}handleReceiverName(t){this.receiverName=t.target.value}handleUploadImage(t){this.uploadedImage=t,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(t){let i=t.detail;this.receiverMobile=i.number,this.receiverCountryCode=i.country_code}handleDateTimePicker(t){this.deliveryDate=t.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){var t;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");let i={text:this.selectedText,sender_name:this.senderName,quantity:1,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:null!==(t=this.uploadedImage)&&void 0!==t?t:this.selectedImage,receiver:{name:this.receiverName,country_code:this.receiverCountryCode,mobile:this.receiverMobile}};return await salla.product.addGiftToCart(this.productId,i,!0).then((t=>{console.log(t),this.modal.close()})).catch((t=>{422==t.response.status?this.errors=t.response.data.error.fields:console.log(t),this.setWrapperHeight(2,150,0)}))}render(){var t,e;return[i("div",null,i("salla-list-tile",{class:"s-gifting-widget"},i("div",{slot:"title"},i("h3",null,this.sectionTitle)),i("div",{slot:"subtitle"},i("div",null,this.sectionSubtitle)),i("div",{slot:"action"},i("salla-button",{class:"s-gifting-widget-action",color:"gray",onClick:()=>this.open()},i("span",{innerHTML:hi})," ",i("span",null,this.sectionBtnText)))),i("salla-modal",{id:"salla-gifting-modal",isLoading:!0,class:"s-gifting-modal",width:"sm",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-gifting-skeleton"},i("div",{class:"s-gifting-modal-header"},i("salla-skeleton",{type:"circle",height:"5rem",width:"5rem"}),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{height:"15px",width:"150px"})))),i("div",{class:"s-gifting-skeleton-content"},i("salla-skeleton",{height:"10px",width:"150px"}),i("salla-skeleton",{height:"230px"}),i("salla-skeleton",{height:"10px",width:"150px"}),i("salla-skeleton",{height:"30px"}),i("salla-skeleton",{height:"40px"})))),i("slot",{name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:hi})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:t=>this.stepsWrapper=t},i("div",{class:"s-gifting-step-one gift-step-1",ref:t=>this.step1Elems=t},i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),i("div",{class:"s-gifting-modal-uploader anime-item",ref:t=>this.uploader=t},i("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:ui}),this.selectImageOrUpload&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:t=>this.handleUploadImage(t.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},null===(t=this.gift)||void 0===t?void 0:t.gift_images.map((t=>i("img",{class:"s-gifting-image s-gifting-clickable",src:t.url,onClick:()=>this.setPreview(t),alt:`${t.id}`}))))):""),i("div",{class:"anime-item"},i("div",{class:"s-form-group s-gifting-selectText",ref:t=>this.textSelect=t},i("label",{htmlFor:"gift-text-selection",class:"s-form-label"},this.selectGiftMessage),i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:t=>this.toggleGiftText(t)},i("option",{"data-id":null,selected:!0},this.selectGiftMessage),null===(e=this.gift)||void 0===e?void 0:e.gift_texts.map((t=>i("option",{"data-id":t.id,value:t.text,key:t.id},t.text))),i("option",{"data-id":"custom"},this.giftCustomText))),i("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:t=>this.customTextArea=t},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:t=>this.handleTextAreaChange(t),rows:4,ref:t=>this.textArea=t,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",ref:t=>this.step2Elems=t},i("div",{class:this.errors&&this.errors.sender_name?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:t=>this.handleSenderName(t),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"text-danger text-xs"},this.errors.sender_name):""),i("div",{class:this.errors&&this.errors["receiver.name"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:t=>this.handleReceiverName(t),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"text-danger text-xs"},this.errors["receiver.name"]):""),i("div",{class:this.errors&&this.errors["receiver.mobile"]?"s-form-group s-form-has-error anime-item opacity-0":"s-form-group anime-item opacity-0"},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:t=>this.handlePhoneInputChange(t)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"text-danger text-xs"},this.errors["receiver.mobile"]):""),i("div",{class:"anime-item opacity-0"},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:"schedule"},i("input",{type:"checkbox",name:"schedule",id:"schedule",onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:t=>this.calendarFormGroup=t},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:t=>this.handleDateTimePicker(t)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:"s-gifting-step-two-footer anime-item opacity-0"},i("a",{href:"#!",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>arrow-left</title>\n<path d="M28 14.667h-20.452l7.996-6.997c0.555-0.485 0.611-1.327 0.125-1.881-0.485-0.553-1.327-0.611-1.881-0.125l-10.667 9.333c-0.011 0.009-0.015 0.024-0.025 0.033-0.096 0.089-0.167 0.199-0.232 0.313-0.025 0.043-0.063 0.076-0.081 0.121-0.073 0.165-0.116 0.345-0.116 0.536s0.043 0.371 0.116 0.535c0.020 0.045 0.057 0.079 0.081 0.121 0.067 0.115 0.136 0.224 0.232 0.313 0.011 0.009 0.015 0.024 0.025 0.033l10.667 9.333c0.253 0.221 0.567 0.331 0.879 0.331 0.371 0 0.74-0.155 1.004-0.455 0.485-0.555 0.429-1.396-0.125-1.881l-7.997-6.997h20.452c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n',onClick:t=>this.goToStep1(t)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{name:"footer"})))]}};di.style=".s-gifting-steps-wrapper{-webkit-transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s;transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;-webkit-appearance:none;-moz-appearance:none;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}",salla.event.setMaxListeners(20);const fi=new class{toggleElementClassIf(t,i,e,n){i=Array.isArray(i)?i:i.split(" "),e=Array.isArray(e)?e:e.split(" ");let o=n(t);return null==t||t.classList.remove(...o?e:i),null==t||t.classList.add(...o?i:e),this}toggleClassIf(t,i,e,n){return document.querySelectorAll(t).forEach((t=>this.toggleElementClassIf(t,i,e,n))),this}isValidEmail(t){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())}filterEmojies(t){return t.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,"")}debounce(t,...i){return this.debounce_||(this.debounce_=Salla.helpers.debounce(((t,...i)=>t(...i)),500)),this.debounce_(t,...i)}},gi=class{constructor(i){t(this,i),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(t=!0){let i=this.status.querySelector(".s-button-text");fi.toggleElementClassIf(i,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}render(){return this.nextPage.length>1?i(e,{class:"s-infinite-scroll-container"},i("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,i=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==i.pageIndex&&i.option({loadOnScroll:!1}),3==i.pageIndex&&i.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return n(this)}};gi.style="";const _i=class{constructor(i){t(this,i),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return i(e,null,i("a",{class:this.generateClass(),href:this.href,target:this.target},i("div",{class:"s-list-tile-item-icon"},i("slot",{name:"icon"})),i("div",{class:"s-list-tile-item-content"},i("div",{class:"s-list-tile-item-title"},i("slot",{name:"title"})),i("div",{class:"s-list-tile-item-subtitle"},i("slot",{name:"subtitle"}))),i("div",{class:"s-list-tile-item-action"},i("slot",{name:"action"}))))}};_i.style="";const mi=class{constructor(i){t(this,i),this.size=32,this.width=2,this.color=void 0,this.bgColor="#e5e7eb"}render(){return i(e,{class:"s-loading-container"},i("svg",{"aria-hidden":"true",style:{width:`${this.size}px`,height:`${this.size}px`,fill:this.color,color:this.bgColor},class:"s-loading",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})))}};mi.style=".s-loading{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;fill:var(--color-primary)}.s-loading-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";const vi=class{constructor(i){var e,n;t(this,i),this.translationLoaded=!1,this.languages=[],this.currencies=[],this.hasError=!1,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),this.languageSlot=(null===(e=this.host.querySelector('[slot="language"]'))||void 0===e?void 0:e.innerHTML)||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span><div class="s-localization-modal-flag flag iti__flag iti__{country_code}"></div></label>',this.currencySlot=(null===(n=this.host.querySelector('[slot="currency"]'))||void 0===n?void 0:n.innerHTML)||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open(),await salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).catch((t=>{var i,e,n,o;console.log(t),this.hasError=!0,this.errorMessage=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data)})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((t=>this.languages=t))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((t=>this.currencies=Object.values(t||{})))}onChangeCurrency(t){this.currency=t.target.value}onChangeLanguage(t){this.language=t.target.value}async submit(){let t;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return t=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>this.language===salla.config.get("user.language_code","ar")||(t=salla.helpers.addParamToUrl("lang",this.language)))).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>t&&(window.location.href=t)))}render(){return i("salla-modal",{isLoading:!0,class:"s-hidden",ref:t=>this.modal=t,width:"xs"},i("div",{slot:"loading"},i("div",{class:"s-localization-modal-skeleton"},i("salla-skeleton",{width:"25%",height:"15px"}),i("div",{class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{width:"25%",height:"15px"}),i("div",{class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>i("div",{class:"s-localization-modal-skeleton-item"},i("div",{class:"s-localization-modal-skeleton-item-flex"},i("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),i("salla-skeleton",{height:"10px",width:"100px"})),i("salla-skeleton",{height:"15px",width:"20px"}))))),i("salla-skeleton",{height:"40px",width:"100%"}))),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"description"},this.errorMessage)):i("div",{class:"s-localization-modal-inner"},this.languages.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.language")),i("div",{class:"s-localization-modal-section-inner"},this.languages.length<6||1==this.currencies.length?this.languages.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==t.iso_code,onChange:()=>this.language=t.iso_code,name:"language",id:"lang-"+t.code.toLowerCase(),value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"language",onChange:t=>this.onChangeLanguage(t)},this.languages.map((t=>i("option",{value:t.code,selected:this.language==t.code},t.name)))))):"",this.currencies.length>1?i("div",{class:"s-localization-modal-section"},i("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.currency")),i("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6||1==this.languages.length?this.currencies.map((t=>i("div",{class:"s-localization-modal-item"},i("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==t.code,onChange:()=>this.currency=t.code,id:"currency-"+t.code,value:t.code}),i("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,t.name).replace(/\{code\}/g,t.code).replace(/\{country_code\}/g,t.country_code)})))):i("select",{class:"s-localization-modal-select",name:"currency",onChange:t=>this.onChangeCurrency(t)},this.currencies.map((t=>i("option",{value:t.code,selected:this.currency==t.code},t.name)))))):"",i("salla-button",{width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#language-slot").forEach((t=>t.replaceWith(t.firstChild)))}get host(){return n(this)}};vi.style=".s-localization-modal-select{background-image:url(\"data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>\")}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;-webkit-box-shadow:0px 0px 1px 0px #888;box-shadow:0px 0px 1px 0px #888;background-image:url(\"https://cdn.salla.network/images/flags.png\");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url(\"https://cdn.salla.network/images/flags@2x.png\")}}.iti__flag.iti__np{background-color:transparent}";const bi='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>mail</title>\n<path d="M28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-12.685l10.54 4.865c0.888 0.409 1.84 0.613 2.793 0.613s1.907-0.204 2.793-0.615l10.54-4.864zM29.333 9.711l-11.657 5.38c-1.065 0.492-2.288 0.492-3.353 0l-11.656-5.38v-3.044c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',xi='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>camera</title>\n<path d="M16 10.667c-4.044 0-7.333 3.289-7.333 7.333s3.289 7.333 7.333 7.333 7.333-3.289 7.333-7.333-3.289-7.333-7.333-7.333zM16 22.667c-2.573 0-4.667-2.093-4.667-4.667s2.093-4.667 4.667-4.667 4.667 2.093 4.667 4.667-2.093 4.667-4.667 4.667zM28 5.333h-3.287l-2.271-3.407c-0.248-0.371-0.664-0.593-1.109-0.593h-10.667c-0.445 0-0.861 0.223-1.109 0.593l-2.271 3.407h-3.287c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.599-1.333 1.333-1.333h4c0.445 0 0.861-0.223 1.109-0.593l2.272-3.407h9.239l2.271 3.407c0.248 0.371 0.664 0.593 1.109 0.593h4c0.735 0 1.333 0.599 1.333 1.333zM25.333 10.66c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327z"></path>\n</svg>\n',wi='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_right</title>\n<path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>\n</svg>\n';var yi;!function(t){t.TEXT="text",t.NUMBER="number",t.PHOTO="photo"}(yi||(yi={}));const ki=class{constructor(i){t(this,i),this.isMobileAllowed=!0,this.isEmailRequired=!1,this.supportWebAuth=!0,this.currentTabName="home",this.regType="phone",this.translationLoaded=!1,this.dragAndDrop=salla.lang.get("common.uploader.drag_and_drop"),this.browseFromFiles=salla.lang.get("common.uploader.browse"),this.customFields=[],this.customFieldsValues={},this.uploadedImage=void 0,this.typing=(t,i=null)=>{const e=t.target.nextElementSibling;t.target.classList.remove("s-has-error"),(null==e?void 0:e.classList.contains("s-login-modal-error-message"))&&(e.innerText=""),i&&"Enter"==t.key&&i()},this.loginBySMS=async(t=null)=>{null==t||t.preventDefault();const{phone:i,countryCode:e}=await this.loginTelInput.getValues();if(await this.loginTelInput.isValid())return this.login(this.smsBtn,{type:"mobile",phone:i,country_code:e}),!1},this.loginByEmail=(t=null)=>{null==t||t.preventDefault(),fi.isValidEmail(this.loginEmail.value)?this.login(this.emailBtn,{type:"email",email:this.loginEmail.value}):this.validateField(this.loginEmail,this.emailErrorMsg)},this.newUser=async()=>{var t;const{phone:i,countryCode:e}="email"==this.regType?await this.regTelInput.getValues():await this.loginTelInput.getValues(),n=this.regEmail.value||(null===(t=this.loginEmail)||void 0===t?void 0:t.value);await this.newUserValidation(),await this.regBtn.load(),await this.regBtn.disable();let o={first_name:this.firstName.value,last_name:this.lastName.value,phone:i||this.loginTelInput.phone,country_code:e,verified_by:this.regType,custom_fields:this.customFieldsValues};n&&(o=Object.assign(Object.assign({},o),{email:n})),this.verifyTab.getCode().then((t=>salla.auth.api.register(Object.assign(Object.assign({},o),{code:t})))).then((()=>salla.auth.canRedirect&&window.location.reload())).catch((t=>{salla.logger.error(t),this.regBtn.stop()&&this.regBtn.enable()}))},this.title=this.host.title||salla.lang.get("blocks.header.login"),this.host.removeAttribute("title"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:salla.lang.get("pages.profile.first_name")}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:salla.lang.get("pages.profile.last_name")}),salla.lang.onLoaded((()=>{this.translationLoaded=!0,this.title=salla.lang.get("blocks.header.login"),this.dragAndDrop=salla.lang.get("common.uploader.drag_and_drop"),this.browseFromFiles=salla.lang.get("common.uploader.browse"),this.updateTranslations()})),salla.event.on("login::open",(t=>this.open(t))),salla.onReady((()=>{this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",this.isEmailAllowed),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",this.isMobileAllowed),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",this.isEmailRequired)}))}onVerified(t){var i,e,n,o;salla.log("verified",t);let a=(null===(i=t.detail)||void 0===i?void 0:i.data.case)||(null===(e=t.detail)||void 0===e?void 0:e.error.case);if(a)return"new_customer"===a?(this.customFields=(null===(o=null===(n=t.detail)||void 0===n?void 0:n.data)||void 0===o?void 0:o.custom_fields)||[],this.showTab(this.registrationTab)):salla.auth.canRedirect()?t.detail.data.redirect_url?window.location.href=t.detail.data.redirect_url:void(this.supportWebAuth?window.location.reload():this.modal.close()):(salla.log("Will not auto redirect or reload, due to `salla.auth.canRedirect()`"),void this.modal.close());salla.log("verified but without case!")}updateTranslations(){var t;this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:salla.lang.get("pages.profile.first_name")}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:salla.lang.get("pages.profile.last_name")}),null===(t=this.modal)||void 0===t||t.setTitle(this.title)}async open(t=null){return this.isEmailAllowed&&this.isMobileAllowed?this.showTab(this.homeTab):this.isEmailAllowed?this.showTab(this.emailTab):this.isMobileAllowed&&this.showTab(this.mobileTab),this.modal.open()}showTab(t,i){var e;return null==i||i.preventDefault(),this.currentTabName=t.getAttribute("data-name"),[this.mobileTab,this.emailTab].includes(t)&&(this.regType=t===this.mobileTab?"phone":"email"),null===(e=this.modal)||void 0===e||e.setTitle("registration"===this.currentTabName?salla.lang.get("common.titles.registration"):this.title),this}login(t,i){t.load().then((()=>t.disable())).then((()=>salla.auth.api.login(i))).then((()=>this.showTab(this.verifyTab))).then((()=>this.verifyTab.open(i))).finally((()=>t.stop()&&t.enable()))}async newUserValidation(){const t="phone"==this.regType,i=this.regEmail.value||"email"==this.regType&&this.loginEmail.value,e=fi.isValidEmail(i),n=this.firstName.value.length>0,o=this.lastName.value.length>0,a=await this.regTelInput.isValid()||t&&await this.loginTelInput.isValid(),r=i&&e||!i&&!this.isEmailRequired;var s=!0;if(this.customFieldsWrapper.childNodes.forEach((t=>{if(this.customFieldsValues[t.id]=t.value,!t.required||this.customFieldsValues[t.id].length)return;s=!1;const i=salla.lang.get("common.errors.field_required",{attribute:t.title});this.validateField(t,i)})),!(r&&a&&n&&o&&s))throw!e&&this.validateField(this.regEmail,this.emailErrorMsg),!n&&this.validateField(this.firstName,this.firstNameErrorMsg),!o&&this.validateField(this.lastName,this.lastNameErrorMsg),"Please insert required fields"}getFilepondPlaceholder(){return`<div class="s-login-modal-filepond-placeholder"><span class="s-login-modal-filepond-placeholder-icon">${xi}</span><p class="s-login-modal-filepond-placeholder-text">${this.dragAndDrop}</p> <span class="filepond--label-action">${this.browseFromFiles}</span></div>`}validateField(t,i){t.classList.add("s-has-error"),t.nextElementSibling.innerText="* "+i}generateTabClasses(t){return{"s-login-modal-tab":"registration"!==t&&"otp"!==t,"s-hidden":this.currentTabName!==t,"s-show":this.currentTabName===t,"s-login-modal-unactive":"registration"!==t&&"otp"!==t&&this.currentTabName!==t,"s-login-modal-active":"registration"!==t&&"otp"!==t&&this.currentTabName===t}}generateRegClasses(t){return{"mb-1.5":!0,"s-hidden":this.regType===t}}render(){return i("salla-modal",{class:"s-login-modal","modal-title":this.title,ref:t=>this.modal=t,width:"xs"},i("span",{slot:"icon",class:"s-login-modal-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user</title>\n<path d="M16 16c4.412 0 8-3.588 8-8s-3.588-8-8-8-8 3.588-8 8 3.588 8 8 8zM16 2.667c2.941 0 5.333 2.392 5.333 5.333s-2.392 5.333-5.333 5.333-5.333-2.392-5.333-5.333 2.392-5.333 5.333-5.333zM16 18.667c-7.476 0-13.333 3.66-13.333 8.333v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-3.019 4.984-5.667 10.667-5.667s10.667 2.648 10.667 5.667v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-4.673-5.857-8.333-13.333-8.333z"></path>\n</svg>\n'}),i("div",{class:"s-login-modal-wrapper"},this.isEmailAllowed&&this.isMobileAllowed?i("div",{class:this.generateTabClasses("home"),"data-name":"home",ref:t=>this.homeTab=t},i("p",{class:"s-login-modal-sub-title"},salla.lang.get("blocks.header.select_login_way")),i("slot",{name:"before-login-type"}),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:t=>this.showTab(this.mobileTab,t)},i("span",{class:"s-login-modal-main-btn-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n'}),i("span",{class:"s-login-modal-main-btn-text"},salla.lang.get("blocks.header.sms")),i("span",{class:"s-login-modal-main-btn-arrow",innerHTML:wi})),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:t=>this.showTab(this.emailTab,t)},i("span",{class:"s-login-modal-main-btn-icon",innerHTML:bi}),i("span",{class:"s-login-modal-main-btn-text"},salla.lang.get("common.elements.email")),i("span",{class:"s-login-modal-main-btn-arrow",innerHTML:wi})),i("slot",{name:"after-login-type"})):"",this.isMobileAllowed?i("div",{class:this.generateTabClasses("login-phone"),"data-name":"login-phone",ref:t=>this.mobileTab=t},i("slot",{name:"before-login-mobile"}),i("form",{onSubmit:t=>this.loginBySMS(t),method:"POST"},i("label",{class:"s-login-modal-label"},salla.lang.get("common.elements.mobile")),i("salla-tel-input",{tabindex:"0",ref:t=>this.loginTelInput=t,onKeyDown:t=>this.typing(t)}),i("salla-button",{class:"s-login-modal-enter-button",type:"submit","loader-position":"center",width:"wide",ref:t=>this.smsBtn=t},salla.lang.get("blocks.header.enter"))),this.isEmailAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.emailTab),class:"s-login-modal-link"},salla.lang.get("blocks.header.login_by_email")):"",i("slot",{name:"after-login-mobile"})):"",this.isEmailAllowed?i("div",{class:this.generateTabClasses("login-email"),"data-name":"login-email",ref:t=>this.emailTab=t},i("slot",{name:"before-login-email"}),i("label",{class:"s-login-modal-label"},salla.lang.get("common.elements.email")),i("form",{onSubmit:()=>this.loginByEmail(event),method:"POST"},i("input",{type:"email",ref:t=>this.loginEmail=t,onKeyDown:t=>this.typing(t),placeholder:"your@email.com",enterkeyhint:"next",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginByEmail(),ref:t=>this.emailBtn=t},salla.lang.get("blocks.header.enter"))),this.isMobileAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.mobileTab),class:"s-login-modal-link"},salla.lang.get("blocks.header.login_by_sms")):"",i("slot",{name:"after-login-email"})):"",i("salla-verify",{display:"inline","support-web-auth":this.supportWebAuth?"true":"false",class:this.generateTabClasses("otp"),"data-name":"otp",ref:t=>this.verifyTab=t,autoReload:!1},i("a",{onClick:()=>this.showTab("phone"==this.regType?this.mobileTab:this.emailTab),class:"s-verify-back",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n',slot:"after-footer",href:"#"})),i("div",{"data-name":"registration",class:this.generateTabClasses("registration"),ref:t=>this.registrationTab=t},i("slot",{name:"before-registration"}),i("div",null,i("label",{class:"s-login-modal-label"},salla.lang.get("blocks.header.your_name")),i("input",{type:"text",class:"s-login-modal-input",ref:t=>this.firstName=t,onKeyDown:t=>this.typing(t,this.newUser),placeholder:salla.lang.get("pages.profile.first_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",null,i("label",{class:"s-login-modal-label"},salla.lang.get("pages.profile.last_name")),i("input",{type:"text",class:"s-login-modal-input",ref:t=>this.lastName=t,onKeyDown:t=>this.typing(t,this.newUser),placeholder:salla.lang.get("pages.profile.last_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",{class:this.generateRegClasses("phone")},i("label",{class:"s-login-modal-label"},salla.lang.get("common.elements.mobile")),i("salla-tel-input",{ref:t=>this.regTelInput=t,onKeyDown:t=>this.typing(t,this.newUser)})),i("div",{class:this.generateRegClasses("email")},i("label",{class:"s-login-modal-label"},salla.lang.get("common.elements.email")),i("input",{type:"email",ref:t=>this.regEmail=t,onKeyDown:t=>this.typing(t,this.newUser),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"})),i("div",{class:"s-login-modal-custom-fields",ref:t=>this.customFieldsWrapper=t},this.customFields.map((t=>[i("label",{class:"s-login-modal-label"},t.label),t.type===yi.PHOTO?i("salla-file-upload",{name:"image","instant-upload":!0,id:`${t.id}`,title:t.label,required:t.required,url:salla.url.get("upload-image"),labelIdle:this.getFilepondPlaceholder()}):i("input",{type:"text",onKeyDown:t=>this.typing(t,this.newUser),onInput:i=>t.type==yi.NUMBER?salla.helpers.inputDigitsOnly(i.target):{},placeholder:t.description,required:t.required,title:t.label,id:`${t.id}`,class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"})]))),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.newUser(),ref:t=>this.regBtn=t},salla.lang.get("blocks.header.register")),i("slot",{name:"after-registration"}))))}get host(){return n(this)}};ki.style="";const Ei='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="30" height="32" viewBox="0 0 30 32">\n<title>star2</title>\n<path d="M29.714 11.839c0 0.321-0.232 0.625-0.464 0.857l-6.482 6.321 1.536 8.929c0.018 0.125 0.018 0.232 0.018 0.357 0 0.464-0.214 0.893-0.732 0.893-0.25 0-0.5-0.089-0.714-0.214l-8.018-4.214-8.018 4.214c-0.232 0.125-0.464 0.214-0.714 0.214-0.518 0-0.75-0.429-0.75-0.893 0-0.125 0.018-0.232 0.036-0.357l1.536-8.929-6.5-6.321c-0.214-0.232-0.446-0.536-0.446-0.857 0-0.536 0.554-0.75 1-0.821l8.964-1.304 4.018-8.125c0.161-0.339 0.464-0.732 0.875-0.732s0.714 0.393 0.875 0.732l4.018 8.125 8.964 1.304c0.429 0.071 1 0.286 1 0.821z"></path>\n</svg>\n',Ti=class{constructor(i){t(this,i),this.loyaltyProgram=void 0,this.buttonLoading=!1,this.selectedItem=void 0,this.askConfirmation=!1,this.is_loggedin=!1,this.hasError=!1,this.prizePoints=void 0,this.customerPoints=void 0,this.prizeTitle=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0}))}setSelectedPrizeItem(t){var i;this.selectedItem=this.selectedItem&&(null===(i=this.selectedItem)||void 0===i?void 0:i.id)==t.id?void 0:t}handleLongText(t){return t.length>150?t.substring(0,150)+"...":t}prizeItem(t){var e;let n={"s-loyalty-prize-item-selected":!!this.selectedItem&&(null===(e=this.selectedItem)||void 0===e?void 0:e.id)==t.id,"s-loyalty-prize-item":!0};return i("div",{onClick:()=>this.setSelectedPrizeItem(t),class:n},i("img",{class:"s-loyalty-prize-item-image",src:t.image,alt:t.name}),i("div",{class:"s-loyalty-prize-item-title"},t.name),i("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(t.description)),i("div",{class:"s-loyalty-prize-item-points"},t.cost_points," ",salla.lang.get("pages.loyalty_program.point"),i("div",{class:"s-loyalty-prize-item-check"},i("div",null))))}getConfirmationModal(){var t,e;return[i("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},i("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),i("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",i("strong",null,null===(t=this.selectedItem)||void 0===t?void 0:t.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",i("strong",null,null===(e=this.selectedItem)||void 0===e?void 0:e.name)," )")),i("div",{class:"s-loyalty-confirmation-actions"},i("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),i("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return i("slot",{name:"points-applied-widget"},i("salla-list-tile",{class:"s-loyalty-after-exchange"},i("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle," - ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),i("div",{slot:"action",class:"s-loyalty-after-exchange-action"},i("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},i("span",{innerHTML:ui})))))}async open(){var t;return this.is_loggedin?(null===(t=this.modal)||void 0===t||t.open(),await salla.loyalty.getProgram().then((t=>this.loyaltyProgram=t.data)).catch((t=>{var i,e,n,o;this.hasError=!0,this.errorMessage=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data)})).finally((()=>{var t;return null===(t=this.modal)||void 0===t?void 0:t.stopLoading()}))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset().then((t=>{var i;this.customerPoints=this.customerPoints||(null===(i=t.data)||void 0===i?void 0:i.customer_points),this.prizePoints=void 0,this.prizeTitle=void 0})).catch((t=>console.log(t)))}async openConfirmation(){return await this.modal.close().then((()=>{var t;return null===(t=this.confirmationModal)||void 0===t?void 0:t.open()})).catch((t=>console.log(t)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((t=>console.log(t)))}async exchangeLoyaltyPoint(){var t;return this.buttonLoading=!0,await salla.loyalty.exchange(null===(t=this.selectedItem)||void 0===t?void 0:t.id).then((t=>{var i,e,n,o;this.prizePoints=null===(e=null===(i=t.data)||void 0===i?void 0:i.prize)||void 0===e?void 0:e.points,this.prizeTitle=null===(o=null===(n=t.data)||void 0===n?void 0:n.prize)||void 0===o?void 0:o.title})).catch((t=>console.log(t))).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[i("slot",{name:"widget"},this.customerPoints?i("salla-list-tile",{class:"s-loyalty-widget"},i("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:Ei}),i("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,i("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),i("salla-modal",{noPadding:!0,width:"sm",ref:t=>this.confirmationModal=t},this.getConfirmationModal()),i("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-loyalty-skeleton"},i("salla-list-tile",{class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon"},i("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),i("div",{slot:"title",class:"s-loyalty-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>i("div",{class:"s-loyalty-prize-item swiper-slide"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-loyalty-prize-item-title"},i("salla-skeleton",{height:"15px",width:"75%"})),i("div",{class:"s-loyalty-prize-item-subtitle"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-loyalty-prize-item-points"},i("salla-skeleton",{height:"15px",width:"100px"}),i("div",{class:"s-loyalty-prize-item-check"},i("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[i("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},i("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),i("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),i("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),i("salla-tabs",null,this.loyaltyProgram.prizes.map((t=>i("salla-tab-header",{slot:"header",name:t.title},i("span",null,t.title)))),this.loyaltyProgram.prizes.map(((t,e)=>i("salla-tab-content",{slot:"content",name:t.title},i("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+e,type:"carousel"},i("div",{slot:"items"},t.items.map((t=>this.prizeItem(t))))))))),i("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""))]}componentDidLoad(){this.is_loggedin=salla.config.isUser()}};Ti.style="";const Ii={light:[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}],dark:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]};class Ai{constructor(t=null,i={}){if(this.apiKey=t,this.options=i,"undefined"==typeof window)throw new Error("google-maps is supported only in browser environment")}load(){return void 0!==this.api?Promise.resolve(this.api):void 0!==this.loader?this.loader:(window[Ai.CALLBACK_NAME]=()=>{if(this.api=window.google,void 0===this.resolve)throw new Error("Should not happen");this.resolve(this.api)},window.gm_authFailure=()=>{if(void 0===this.reject)throw new Error("Should not happen");this.reject(new Error("google-maps: authentication error"))},this.loader=new Promise(((t,i)=>{this.resolve=t,this.reject=i;const e=document.createElement("script");e.src=this.createUrl(),e.async=!0,e.onerror=t=>i(t),document.head.appendChild(e)})))}createUrl(){const t=[`callback=${Ai.CALLBACK_NAME}`];this.apiKey&&t.push(`key=${this.apiKey}`);for(let i in this.options)if(this.options.hasOwnProperty(i)){let e=this.options[i];"version"===i&&(i="v"),"libraries"===i&&(e=e.join(",")),t.push(`${i}=${e}`)}return`https://maps.googleapis.com/maps/api/js?${t.join("&")}`}}Ai.CALLBACK_NAME="_dk_google_maps_loader_cb";const Mi=class{constructor(i){t(this,i),this.selected=o(this,"selected",7),this.mapClicked=o(this,"mapClicked",7),this.currentLocationChanged=o(this,"currentLocationChanged",7),this.defaultLat=21.419421,this.defaultLng=39.82553,this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit"),this.searchInputValue=null,this.geolocationError=!1,this.name="location",this.required=!1,this.readonly=!1,this.searchable=!1,this.modalTitle=this.modalActivityTitle,this.zoom=10,this.theme="light",salla.lang.onLoaded((()=>{this.modalActivityTitle=salla.lang.get("pages.checkout.select_your_address_from_map"),this.confirmButtonTitle=salla.lang.get("pages.checkout.confirm_address"),this.locateButtonTitle=salla.lang.get("pages.cart.detect_location"),this.locateButtonEdit=salla.lang.get("common.elements.edit")})),this.apiKey="AIzaSyBPhPJ4KG13ywvmeAovLRnbi7WzlsdcWKs"}formatAddress(t){return t.length>25?t.substring(0,25)+"...":t}getPositionAddress(t){this.searchable&&(new google.maps.Geocoder).geocode({location:t},((t,i)=>{i===google.maps.GeocoderStatus.OK&&(this.searchInputValue=t[0].formatted_address,this.searchInput.value=t[0].formatted_address)}))}initGoogleMaps(t,i){new Ai(this.apiKey,t).load().then((t=>{if(this.map=new t.maps.Map(i,{center:this.lat||this.lng?{lat:this.lat,lng:this.lng}:{lat:this.defaultLat,lng:this.defaultLng},zoom:this.zoom,zoomControl:!0,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,disableDefaultUI:!1}),this.map.setOptions({styles:"light"===this.theme?Ii.light:Ii.dark}),this.marker=new t.maps.Marker({position:this.map.getCenter(),map:this.map,icon:{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="36" height="36" rx="18" fill="#5CD5C4"/>\n<path d="M18 10C17.0104 10 16.1458 10.1771 15.4062 10.5312C14.6562 10.8854 14.026 11.3542 13.5156 11.9375C13.0156 12.5104 12.6406 13.1667 12.3906 13.9062C12.1302 14.6458 12 15.401 12 16.1719C12 16.8906 12.2604 17.7656 12.7812 18.7969C13.3021 19.8281 13.8854 20.8333 14.5312 21.8125C15.1875 22.7812 15.8073 23.6406 16.3906 24.3906C16.9844 25.1302 17.349 25.5885 17.4844 25.7656C17.5469 25.8385 17.625 25.8958 17.7188 25.9375C17.8125 25.9792 17.9062 26 18 26C18.1042 26 18.1979 25.9792 18.2812 25.9375C18.375 25.8958 18.4531 25.8385 18.5156 25.7656C18.651 25.5885 19.0156 25.1302 19.6094 24.3906C20.1927 23.6406 20.8073 22.7812 21.4531 21.8125C22.1094 20.8333 22.6979 19.8281 23.2188 18.7969C23.7396 17.7656 24 16.8906 24 16.1719C24 15.401 23.8698 14.6458 23.6094 13.9062C23.3594 13.1667 22.9792 12.5104 22.4688 11.9375C21.9688 11.3542 21.3438 10.8854 20.5938 10.5312C19.8542 10.1771 18.9896 10 18 10ZM18 24.2812C17.5833 23.75 17.1094 23.1198 16.5781 22.3906C16.0365 21.651 15.526 20.901 15.0469 20.1406C14.5677 19.3698 14.1615 18.6302 13.8281 17.9219C13.4948 17.2135 13.3281 16.6302 13.3281 16.1719C13.3281 15.5885 13.4219 15.0052 13.6094 14.4219C13.7969 13.849 14.0781 13.3333 14.4531 12.875C14.8385 12.4167 15.3281 12.0469 15.9219 11.7656C16.5052 11.474 17.1979 11.3281 18 11.3281C18.8021 11.3281 19.4948 11.474 20.0781 11.7656C20.6719 12.0469 21.1562 12.4167 21.5312 12.875C21.9167 13.3333 22.2031 13.849 22.3906 14.4219C22.5781 15.0052 22.6719 15.5885 22.6719 16.1719C22.6719 16.6302 22.5052 17.2135 22.1719 17.9219C21.8385 18.6302 21.4323 19.3698 20.9531 20.1406C20.474 20.901 19.9688 21.651 19.4375 22.3906C18.8958 23.1198 18.4167 23.75 18 24.2812ZM18 13.3281C17.2604 13.3281 16.6302 13.5885 16.1094 14.1094C15.5885 14.6302 15.3281 15.2604 15.3281 16C15.3281 16.7396 15.5885 17.3698 16.1094 17.8906C16.6302 18.4115 17.2604 18.6719 18 18.6719C18.7396 18.6719 19.3698 18.4115 19.8906 17.8906C20.4115 17.3698 20.6719 16.7396 20.6719 16C20.6719 15.2604 20.4115 14.6302 19.8906 14.1094C19.3698 13.5885 18.7396 13.3281 18 13.3281ZM18 17.3281C17.6354 17.3281 17.3229 17.1979 17.0625 16.9375C16.8021 16.6771 16.6719 16.3646 16.6719 16C16.6719 15.6354 16.8021 15.3229 17.0625 15.0625C17.3229 14.8021 17.6354 14.6719 18 14.6719C18.3646 14.6719 18.6771 14.8021 18.9375 15.0625C19.1979 15.3229 19.3281 15.6354 19.3281 16C19.3281 16.3646 19.1979 16.6771 18.9375 16.9375C18.6771 17.1979 18.3646 17.3281 18 17.3281Z" fill="white"/>\n</svg>\n'),scaledSize:new t.maps.Size(30,30)}}),this.searchable){const i=new t.maps.places.SearchBox(this.searchInput);t.maps.event.addListener(i,"places_changed",(()=>{const t=i.getPlaces();t.length>0&&this.map&&(this.map.setCenter(t[0].geometry.location),this.lat=t[0].geometry.location.lat(),this.lng=t[0].geometry.location.lng(),this.marker.setPosition(t[0].geometry.location),this.searchInputValue=t[0].formatted_address)}))}t.maps.event.addListener(this.map,"click",(t=>{this.readonly||(this.searchInputValue=null,this.marker.setPosition(t.latLng),this.lat=t.latLng.lat(),this.lng=t.latLng.lng(),this.getPositionAddress(t.latLng),this.mapClicked.emit({lat:t.latLng.lat(),lng:t.latLng.lng(),address:this.searchInputValue?this.searchInputValue:null}))})),this.lat==this.defaultLat&&this.lng==this.defaultLng&&(this.getCurrentLocation(),this.geolocationError&&(this.map.setCenter({lat:this.lat,lng:this.lng}),this.marker.setPosition({lat:this.lat,lng:this.lng})))}))}getCurrentLocation(){navigator.geolocation&&this.map?navigator.geolocation.getCurrentPosition((t=>{const i={center:new google.maps.LatLng(t.coords.latitude,t.coords.longitude),zoom:15};this.map.setOptions(i),this.marker.setPosition(i.center),this.getPositionAddress(i.center),this.currentLocationChanged.emit({lat:t.coords.latitude,lng:t.coords.longitude,address:this.searchInputValue?this.searchInputValue:null})}),this.handleLocationError.bind(this)):(salla.log("Geolocation is not supported by this browser."),this.geolocationError=!0)}handleLocationError(t){switch(this.geolocationError=!0,t.code){case t.PERMISSION_DENIED:salla.log("User denied the request for Geolocation.");break;case t.POSITION_UNAVAILABLE:salla.log("Location information is unavailable.");break;case t.TIMEOUT:salla.log("The request to get user location timed out.");break;case t.UNKNOWN_ERROR:salla.log("An unknown error occurred.")}}async open(){var t,i;return this.map||this.initGoogleMaps({libraries:this.searchable?["places","search"]:[],language:salla.config.get("user.language_code")||(null===(t=document.querySelector("meta[charset='UTF-8']"))||void 0===t?void 0:t.getAttribute("lang"))||"ar"},this.mapElement),null===(i=this.locationModal)||void 0===i?void 0:i.open()}getLocationModal(){return i("div",null,i("div",{class:"s-map-modal-title"},this.modalTitle),i("div",{class:"s-map-modal-body"},i("div",{class:"s-map-element",ref:t=>this.mapElement=t}),this.readonly?"":[this.searchable&&i("div",{class:"s-map-search-wrapper"},i("input",{class:"s-map-search-input",ref:t=>this.searchInput=t})),i("salla-button",{class:"s-map-my-location-button",onClick:()=>{this.getCurrentLocation()},shape:"icon",color:"primary"},i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>location-target</title>\n<path d="M16 9.333c-3.676 0-6.667 2.991-6.667 6.667s2.991 6.667 6.667 6.667 6.667-2.991 6.667-6.667-2.991-6.667-6.667-6.667zM16 20c-2.205 0-4-1.795-4-4s1.795-4 4-4 4 1.795 4 4-1.795 4-4 4zM30.667 14.667h-1.401c-0.627-6.289-5.643-11.305-11.932-11.932v-1.401c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.401c-6.289 0.627-11.305 5.643-11.932 11.932h-1.401c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.401c0.628 6.289 5.643 11.305 11.932 11.932v1.401c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-1.401c6.289-0.628 11.305-5.643 11.932-11.932h1.401c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM16 26.667c-5.881 0-10.667-4.785-10.667-10.667s4.785-10.667 10.667-10.667 10.667 4.785 10.667 10.667-4.785 10.667-10.667 10.667z"></path>\n</svg>\n'})),i("salla-button",{class:"s-map-submit-button",color:"primary",width:"wide",onClick:()=>{let t={lat:this.lat,lng:this.lng,address:this.searchInputValue?this.searchInputValue:null};this.mapInput.value=`${t.lat}, ${t.lng}`,salla.event.emit("salla-map::selected",t),this.selected.emit(t),this.mapInput.dispatchEvent(new window.Event("change",{bubbles:!0})),this.locationModal.close()}},this.confirmButtonTitle)]))}render(){return i(e,{class:"s-map-wrapper"},i("salla-modal",{class:"s-map-modal-wrapper",noPadding:!0,ref:t=>{this.locationModal=t}},this.getLocationModal()),i("slot",{name:"button"},i("salla-button",{onClick:()=>{this.open()},color:"primary",class:"s-map-location-button"},i("span",{class:"s-map-location-icon",innerHTML:this.searchInputValue?'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>edit</title>\n<path d="M30.583 1.417c-1.828-1.829-5.019-1.829-6.847 0l-13.396 13.396c-0.161 0.161-0.279 0.361-0.341 0.581l-1.949 6.911c-0.131 0.464 0 0.964 0.341 1.305 0.253 0.252 0.593 0.389 0.943 0.389 0.121 0 0.243-0.016 0.361-0.051l6.911-1.949c0.22-0.061 0.419-0.179 0.581-0.34l10.455-10.453s0 0 0 0l2.941-2.941c1.887-1.888 1.887-4.96 0-6.848zM15.547 19.528l-4.284 1.208 1.208-4.284 9.265-9.265 3.076 3.076zM28.696 6.38l-1.999 1.999-3.076-3.076 1.999-1.999c0.849-0.848 2.227-0.848 3.076 0 0.848 0.848 0.848 2.227 0 3.076zM24 20c-0.737 0-1.333 0.597-1.333 1.333v4c0 2.205-1.795 4-4 4h-12c-2.205 0-4-1.795-4-4v-12c0-2.205 1.795-4 4-4h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-4c-3.676 0-6.667 2.991-6.667 6.667v12c0 3.676 2.991 6.667 6.667 6.667h12c3.676 0 6.667-2.991 6.667-6.667v-4c0-0.736-0.596-1.333-1.333-1.333z"></path>\n</svg>\n':'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>location</title>\n<path d="M16.001 0c-7.879 0-12.001 6.204-12.001 12.333 0 5.813 9.853 17.833 10.976 19.185 0.253 0.305 0.629 0.481 1.025 0.481s0.772-0.176 1.027-0.481c1.121-1.352 10.972-13.372 10.972-19.185 0-6.129-4.121-12.333-11.999-12.333zM16.001 28.549c-3.32-4.184-9.335-12.527-9.335-16.216 0-4.656 2.92-9.667 9.335-9.667 6.412 0 9.332 5.011 9.332 9.667 0 3.689-6.013 12.032-9.332 16.216zM16 6.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16 14.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}),this.searchInputValue?i("div",null,this.locateButtonEdit," | ",this.formatAddress(this.searchInputValue)):this.locateButtonTitle)),i("input",{type:"hidden",name:this.name,required:this.required,value:`${this.lat}, ${this.lng}`,ref:t=>this.mapInput=t}))}get host(){return n(this)}};Mi.style="";const Di='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check-circle2</title>\n<path d="M29.333 14.133c-0.8 0-1.333 0.533-1.333 1.333v1.2c0 6.667-5.333 12-12 12 0 0 0 0 0 0-6.667 0-12-5.333-12-12s5.333-12 12-12c0 0 0 0 0 0 1.733 0 3.333 0.4 4.933 1.067 0.667 0.267 1.467 0 1.733-0.667s0-1.467-0.667-1.733c-1.867-0.8-3.867-1.333-6-1.333 0 0 0 0 0 0-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667c0 0 0 0 0 0 8.133 0 14.667-6.533 14.667-14.667v-1.2c0-0.8-0.533-1.333-1.333-1.333zM12.933 14.4c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l4 4c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l13.333-13.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-12.4 12.4-3.067-3.067z"></path>\n</svg>\n',Ri=class{constructor(i){t(this,i),this.modalVisibilityChanged=o(this,"modalVisibilityChanged",7),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.hasSkeleton=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.centered=!1,this.iconStyle=void 0,salla.event.on("modal::open",(t=>t==this.host.id&&this.open())),salla.event.on("modal::close",(t=>t==this.host.id&&this.close())),this.modalTitle=this.host.getAttribute("modal-title")}handleVisible(t){if(!t)return this.modalVisibilityChanged.emit(!1),void this.toggleModal(!1);this.modalVisibilityChanged.emit(!0),this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0)))}handleKeyUp(t){"KeyUp"===t.key&&this.closeModal()}async open(){return this.host.setAttribute("visible",""),this.host}async close(){return this.host.removeAttribute("visible"),this.host}async setTitle(t){return this.modalTitle=t,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}toggleModal(t){const i=this.host.querySelector(".s-modal-body");fi.toggleElementClassIf(i,"s-modal-entering","s-modal-leaving",(()=>t)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>t)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>t)),t||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":!this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}getWidth(){return this.isLoading?this.hasSkeleton?"md":"xs":this.width}render(){return this.host.id=this.host.id||"salla-modal",this.isLoading?i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog",onKeyUp:t=>this.handleKeyUp(t)},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal()}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},""),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("slot",{name:"loading"},i("salla-loading",null)),i("div",{class:"s-hidden"},i("slot",null))))):i(e,{class:"salla-modal s-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},i("div",{class:"s-modal-overlay",ref:t=>this.overlay=t,onClick:()=>this.closeModal()}),i("div",{class:"s-modal-wrapper"},i("span",{class:"s-modal-spacer s-modal-align-"+this.position},""),i("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.getWidth()+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},i("div",{class:{"s-modal-header":!0,"s-modal-is-center":this.centered}},this.isClosable?i("button",{class:"s-modal-close",onClick:()=>this.closeModal(),type:"button"},i("span",{innerHTML:ui})):"",this.modalTitle||this.subTitle?i("div",{class:"s-modal-header-inner"},i("slot",{name:"icon"},this.iconStyle?i("div",{class:this.iconBlockClasses(),innerHTML:"error"==this.iconStyle?'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>alert-engine</title>\n<path d="M16 18.673c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM2.667 16c0-3.092 1.083-6.105 3.047-8.484 0.469-0.568 0.389-1.408-0.179-1.877-0.568-0.468-1.408-0.388-1.877 0.179-2.359 2.857-3.657 6.473-3.657 10.183s1.299 7.325 3.657 10.183c0.264 0.319 0.645 0.484 1.029 0.484 0.299 0 0.6-0.1 0.848-0.305 0.568-0.469 0.648-1.309 0.179-1.877-1.964-2.379-3.047-5.392-3.047-8.484zM16 10.667c-0.736 0-1.333 0.597-1.333 1.333v4c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-0.736-0.597-1.333-1.333-1.333zM16 5.333c-5.881 0-10.667 4.785-10.667 10.667s4.785 10.667 10.667 10.667 10.667-4.785 10.667-10.667-4.785-10.667-10.667-10.667zM16 24c-4.412 0-8-3.588-8-8s3.588-8 8-8 8 3.588 8 8-3.588 8-8 8zM28.343 5.817c-0.469-0.567-1.307-0.647-1.877-0.179-0.568 0.469-0.648 1.309-0.179 1.877 1.964 2.379 3.047 5.392 3.047 8.484s-1.083 6.105-3.047 8.484c-0.469 0.568-0.389 1.408 0.179 1.877 0.249 0.205 0.549 0.305 0.848 0.305 0.384 0 0.765-0.165 1.028-0.484 2.36-2.857 3.659-6.473 3.659-10.183s-1.299-7.325-3.657-10.183z"></path>\n</svg>\n':Di}):""),i("div",{class:"s-modal-header-content"},this.modalTitle?i("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.modalTitle}):"",this.subTitle?i("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}):"")):""),i("slot",null),i("slot",{name:"footer"}))))}componentDidLoad(){document.body.append(this.host)}get host(){return n(this)}static get watchers(){return{visible:["handleVisible"]}}};Ri.style="@media screen and (max-width: 470px){.modal-is-open{position:fixed}}";const Oi=class{constructor(i){var e,n;t(this,i),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=(null===(e=this.host.querySelector('[slot="category"]'))||void 0===e?void 0:e.innerHTML)||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',this.productSlot=(null===(n=this.host.querySelector('[slot="product"]'))||void 0===n?void 0:n.innerHTML)||this.defaultProductSlot(),salla.event.on("offer-modal::open",(t=>this.open(t))),salla.product.event.onOfferExisted((t=>{salla.storage.get("remember-offer-"+t.id)?salla.log("User selected to don't show this offer again."):this.open(t.product_id)}))}async open(t){return this.productID=t,this.hasError=!1,this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.offers(t))).then((t=>this.showOffer(t.data[0]))).catch((t=>{var i,e,n,o;this.hasError=!0,this.errorMessage=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data)})).finally((()=>setTimeout((()=>this.modal.stopLoading()),1e3)))}async showOffer(t){this.offer=t,this.offer_name=t.name,this.offer_message=t.message,this.modal.setTitle(this.offer_name)}rememberMe(t){salla.storage.set("remember-offer-"+this.offer.id,t.target.checked)}addToCart(t){salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,t))).then((()=>this.modal.close()))}getOfferContent(){var t,e,n,o,a,r,s,l;return this.offer.get.discounts_table?i("div",{class:"s-offer-modal-discount-table"},i("table",null,i("tbody",null,null===(t=this.offer.get.discounts_table)||void 0===t?void 0:t.map((t=>i("tr",null,i("td",null,t.text),i("td",{class:"s-offer-modal-discount-table-cell"},i("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(t.quantity)},this.addToCartLabel)))))))):(null===(e=this.offer.get.products)||void 0===e?void 0:e.length)?i("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":(null===(n=this.offer.get.products)||void 0===n?void 0:n.length)<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":(null===(o=this.offer.get.products)||void 0===o?void 0:o.length)<=2?"false":"true"},i("div",{slot:"items"},null===(a=this.offer.get.products)||void 0===a?void 0:a.map((t=>i("div",{class:{"s-offer-modal-product":!0,"s-offer-modal-slider-item":!0,"s-offer-modal-not-available":!t.is_available},id:"product_"+t.id,innerHTML:this.productSlot.replace(/\{name\}/g,t.name).replace(/\{url\}/g,t.url).replace(/\{image\}/g,t.thumbnail).replace(/\{price\}/g,t.has_special_price?'<span class="s-offer-modal-product-sale-price">'+salla.money(t.price)+'</span><span class="s-offer-modal-product-old-price">'+salla.money(t.regular_price)+"</span>":salla.money(t.price))},i("div",{class:"s-offer-modal-btn-wrap"},i("salla-button",{width:"wide",fill:"outline","data-id":t.id,disabled:!t.is_available,"loader-position":"center",onClick:this.addItem},t.is_available?salla.lang.get("pages.cart.add_to_cart"):salla.lang.get("pages.products.out_of_stock")))))))):(null===(r=this.offer.get.categories)||void 0===r?void 0:r.length)?i("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":(null===(s=this.offer.get.categories)||void 0===s?void 0:s.length)<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":(null===(l=this.offer.get.categories)||void 0===l?void 0:l.length)<=2?"false":"true"},i("div",{slot:"items"},this.offer.get.categories.map((t=>i("a",{href:t.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag</title>\n<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n').replace(/\{name\}/g,t.name).replace(/\{url\}/g,t.urls.customer)}))))):void 0}addItem(){return this.load(),salla.cart.api.quickAdd(this.dataset.id).finally((()=>this.stop()))}defaultProductSlot(){return'<a href={url} class="s-offer-modal-product-image-wrap"><img class="s-offer-modal-product-image" src="{image}" /></a><div class="s-offer-modal-product-info"> <a href={url} class="s-offer-modal-product-name">{name}</a> <div class="s-offer-modal-product-price">{price}</div></div>'}render(){return i("salla-modal",{"has-skeleton":!0,"sub-title":this.offer_message,ref:t=>this.modal=t,isLoading:!0},i("div",{slot:"loading"},i("div",{class:"s-offer-modal-skeleton"},i("div",{class:"s-offer-modal-skeleton-header"},i("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{height:"15px",width:"50%"}),i("salla-skeleton",{height:"10px",width:"30%"})),i("div",{class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>i("div",{class:"s-offer-modal-skeleton-item"},i("salla-skeleton",{height:"9rem"}),i("div",{class:"s-offer-modal-skeleton-item-title"},i("salla-skeleton",{height:"15px",width:"100%"})),i("div",{class:"s-offer-modal-skeleton-item-subtitle"},i("salla-skeleton",{height:"9px",width:"50%"}),i("div",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>cart2</title>\n<path d="M6.845 5.333l-1.905-5.333h-3.607c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333v0h1.727l5.72 16.012c0.569 1.56 2.039 2.654 3.765 2.655h12.133c0.001 0 0.002 0 0.003 0 1.825 0 3.364-1.222 3.845-2.892l0.007-0.028 3.161-13.080zM25.96 17.716c-0.167 0.554-0.672 0.951-1.27 0.951-0.002 0-0.005 0-0.007-0h-12.133c-0.575-0-1.065-0.364-1.252-0.875l-0.003-0.009-3.497-9.783h20.508zM13.333 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM13.333 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0zM24 24c-2.209 0-4 1.791-4 4s1.791 4 4 4c2.209 0 4-1.791 4-4v0c0-2.209-1.791-4-4-4v0zM24 29.333c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333c0.736 0 1.333 0.597 1.333 1.333v0c0 0.736-0.597 1.333-1.333 1.333v0z"></path>\n</svg>\n'})))))),i("div",{class:"s-offer-modal-skeleton-footer"},i("salla-skeleton",{height:"15px",width:"50%"}),i("salla-skeleton",{height:"15px",width:"30%"})))),this.hasError||null===this.offer?i("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?i("span",{slot:"description"},this.errorMessage):""):[i("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>special-discount</title>\n<path d="M20.667 19.333c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM11.333 12.673c0.737 0 1.333-0.603 1.333-1.34s-0.596-1.333-1.333-1.333-1.333 0.596-1.333 1.333v0.013c0 0.736 0.596 1.327 1.333 1.327zM30.307 16l0.947-4.244c0.107-0.473-0.055-0.969-0.417-1.291l-3.259-2.876-1.732-3.987c-0.193-0.444-0.612-0.749-1.095-0.796l-4.327-0.417-3.748-2.204c-0.416-0.248-0.933-0.248-1.353 0l-3.744 2.204-4.329 0.417c-0.483 0.047-0.901 0.352-1.095 0.796l-1.732 3.987-3.259 2.877c-0.363 0.321-0.525 0.816-0.417 1.289l0.947 4.244-0.947 4.244c-0.107 0.473 0.055 0.969 0.417 1.291l3.259 2.876 1.732 3.987c0.193 0.444 0.612 0.749 1.095 0.796l4.325 0.416 3.749 2.207c0.208 0.123 0.441 0.184 0.676 0.184s0.468-0.061 0.676-0.185l3.747-2.205 4.328-0.416c0.483-0.045 0.903-0.351 1.095-0.796l1.732-3.985 3.259-2.877c0.363-0.321 0.525-0.816 0.417-1.291zM28.48 20.056l-2.892 2.552c-0.145 0.131-0.261 0.291-0.34 0.469l-1.536 3.536-3.84 0.369c-0.195 0.019-0.381 0.080-0.551 0.179l-3.321 1.959-3.324-1.959c-0.168-0.099-0.356-0.16-0.549-0.179l-3.839-0.369-1.536-3.537c-0.077-0.18-0.195-0.339-0.34-0.469l-2.892-2.551 0.84-3.765c0.043-0.192 0.043-0.389 0-0.581l-0.84-3.765 2.892-2.551c0.145-0.131 0.263-0.289 0.34-0.469l1.536-3.539 3.84-0.369c0.195-0.019 0.381-0.080 0.549-0.179l3.323-1.957 3.325 1.957c0.167 0.099 0.355 0.16 0.548 0.179l3.839 0.369 1.536 3.539c0.077 0.18 0.195 0.339 0.34 0.469l2.892 2.551-0.84 3.765c-0.043 0.192-0.043 0.389 0 0.581zM20.391 9.724l-10.667 10.667c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l10.667-10.667c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0z"></path>\n</svg>\n'}),this.getOfferContent(),i("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?i("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",i("label",{class:"s-offer-modal-remember-label"},i("input",{type:"checkbox",onChange:t=>this.rememberMe(t),class:"s-offer-modal-remember-input"})," ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return n(this)}};Oi.style="";const Si=class{constructor(i){t(this,i),this.translationLoaded=!1,this.icon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return i(e,{class:this.alignmentClass()},i("div",{class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),i("div",{class:"s-placeholder-title"},i("slot",{name:"title"},i("span",null,salla.lang.get("common.elements.no_options")))),i("div",{class:"s-placeholder-description"},i("slot",{name:"description"},i("span",null,salla.lang.get("common.errors.empty_results")))))}};Si.style="";const Li='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>bell-ring</title>\n<path d="M2.667 13.333v-4c0-2.592 0.748-5.107 2.161-7.271 0.404-0.616 0.231-1.443-0.387-1.845-0.616-0.401-1.443-0.228-1.845 0.388-1.699 2.599-2.596 5.617-2.596 8.728v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333zM25.333 15.647v-6.313c0-5.147-4.188-9.333-9.333-9.333s-9.333 4.187-9.333 9.333v6.312l-5.157 9.027c-0.236 0.413-0.235 0.92 0.004 1.331 0.239 0.412 0.679 0.664 1.153 0.664h8c0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333h8c0.475 0 0.915-0.252 1.153-0.664 0.239-0.411 0.24-0.917 0.004-1.331zM16 29.333c-1.471 0-2.667-1.196-2.667-2.667h5.333c0 1.472-1.196 2.667-2.667 2.667zM4.965 24l4.193-7.339c0.113-0.2 0.175-0.429 0.175-0.661v-6.667c0-3.676 2.991-6.667 6.667-6.667s6.667 2.991 6.667 6.667v6.667c0 0.232 0.061 0.46 0.176 0.661l4.192 7.339zM29.403 0.603c-0.403-0.616-1.232-0.789-1.845-0.387-0.617 0.403-0.791 1.229-0.387 1.845 1.415 2.165 2.163 4.68 2.163 7.272v4c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-4c0-3.112-0.899-6.132-2.597-8.731z"></path>\n</svg>\n',Ci=class{constructor(i){t(this,i),this.isUser=salla.config.isUser(),this.translationLoaded=!1,this.productId=salla.config.get("page.id"),this.isSubscribed=!1,this.submit=async()=>{if(this.isUser)return salla.api.product.availabilitySubscribe(this.productId).then((()=>this.isSubscribed=!0));let t={id:this.productId};if(this.channels_.includes("sms")){let{phone:i,countryCode:e}=await this.mobileInput.getValues();t.country_code=e,t.phone=i}return this.channels_.includes("email")&&""!==this.email.value&&(t.email=this.email.value),await this.validateform(),this.btn.load().then((()=>this.btn.disable())).then((()=>salla.api.product.availabilitySubscribe(t))).then((()=>{this.isSubscribed=!0,salla.storage.set(`product-${this.productId}-subscribed`,!0)})).then((()=>this.btn.stop())).then((()=>this.modal.close())).catch((()=>this.btn.stop()&&this.btn.enable()))},this.typing=(t,i)=>{const e=t.target.nextElementSibling;t.target.classList.remove("s-has-error"),(null==e?void 0:e.classList.contains("s-product-availability-error-msg"))&&(e.innerText=""),"Enter"==t.key&&i()},salla.lang.onLoaded((()=>{var t;this.translationLoaded=!0,this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),null===(t=this.modal)||void 0===t||t.setTitle(this.title_)})),this.isUser||(this.channelsWatcher(this.channels),this.title_=this.host.title||salla.lang.get("pages.products.notify_availability_title"),this.host.removeAttribute("title"),this.isVisitorSubscribed=salla.storage.get(`product-${this.productId}-subscribed`))}channelsWatcher(t){this.channels_=t?t.split(","):[]}async validateform(){try{if(this.channels_.includes("email")){const t=fi.isValidEmail(this.email.value);if(t)return;!t&&this.validateField(this.email,salla.lang.get("common.elements.email_is_valid"))}if(this.channels_.includes("sms")&&await this.mobileInput.isValid())return}catch(t){throw"Please insert required fields"}}validateField(t,i){t.classList.add("s-has-error"),t.nextElementSibling.innerText="* "+i}render(){return i(e,{class:"s-product-availability-wrap"},this.isSubscribed||this.isVisitorSubscribed?i("div",{class:"s-product-availability-subscribed"},i("span",{innerHTML:Li,class:"s-product-availability-subs-icon"})," ",salla.lang.get("pages.products.notify_availability_success")):i("salla-button",{width:"wide",onClick:()=>this.isUser?this.submit():this.modal.open()},salla.lang.get("pages.products.notify_availability")),this.isUser||this.isSubscribed||this.isVisitorSubscribed?"":this.renderModal())}renderModal(){return i("salla-modal",{ref:t=>this.modal=t,"modal-title":this.title_,subTitle:salla.lang.get("pages.products.notify_availability_subtitle"),width:"sm"},i("span",{slot:"icon",class:"s-product-availability-header-icon",innerHTML:Li}),i("div",{class:"s-product-availability-body"},this.channels_.includes("email")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.email")),i("input",{class:"s-product-availability-input",onKeyDown:t=>this.typing(t,this.submit),placeholder:salla.lang.get("common.elements.email_placeholder")||"your@email.com",ref:t=>this.email=t,type:"email"}),i("span",{class:"s-product-availability-error-msg"})]:"",this.channels_.includes("sms")?[i("label",{class:"s-product-availability-label"},salla.lang.get("common.elements.mobile")),i("salla-tel-input",{ref:t=>this.mobileInput=t,onKeyDown:t=>this.typing(t,this.submit)})]:""),i("div",{slot:"footer",class:"s-product-availability-footer"},i("salla-button",{class:"modal-cancel-btn",width:"wide",color:"light",fill:"outline",onClick:()=>this.modal.close()},salla.lang.get("common.elements.cancel")),i("salla-button",{class:"submit-btn","loader-position":"center",width:"wide",ref:t=>this.btn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.submit"))))}get host(){return n(this)}static get watchers(){return{channels:["channelsWatcher"]}}};var Pi,Gi;Ci.style="",function(t){t.COLOR="color",t.DATE="date",t.DATETIME="datetime",t.DONATION="donation",t.IMAGE="image",t.MULTIPLE_OPTIONS="multiple-options",t.NUMBER="number",t.SINGLE_OPTION="single-option",t.SPLITTER="splitter",t.TEXT="text",t.TEXTAREA="textarea",t.THUMBNAIL="thumbnail",t.TIME="time",t.RADIO="radio",t.CHECKBOX="checkbox",t.MAP="map",t.FILE="file",t.COLOR_PICKER="color_picker"}(Pi||(Pi={})),function(t){t.Sar="SAR"}(Gi||(Gi={}));const zi=class{constructor(i){if(t(this,i),this.colorSelected=o(this,"colorSelected",7),this.thumbnailSelected=o(this,"thumbnailSelected",7),this.singleSelectOptionSelected=o(this,"singleSelectOptionSelected",7),this.donationMoneyEntered=o(this,"donationMoneyEntered",7),this.textOptionEntered=o(this,"textOptionEntered",7),this.textareaOptionEntered=o(this,"textareaOptionEntered",7),this.numberOptionEntered=o(this,"numberOptionEntered",7),this.itemsSelected=o(this,"itemsSelected",7),this.dateTimeSelected=o(this,"dateTimeSelected",7),this.dateSelected=o(this,"dateSelected",7),this.timeSelected=o(this,"timeSelected",7),this.colorPicked=o(this,"colorPicked",7),this.locationSelected=o(this,"locationSelected",7),this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/msword",exl:"application/vnd.ms-excel",txt:"text/plain"},this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.productId=salla.config.get("page.id"),salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock"),this.donationAmount=salla.lang.get("pages.products.donation_amount")})),this.options)try{return void(this.optionsData=JSON.parse(this.options))}catch(t){salla.log("Bad json passed via options prop")}Array.isArray(this.optionsData)&&(salla.log("Options is not an array[] ---\x3e ",this.optionsData),this.optionsData=[]),this.productId&&!salla.url.is_page("cart")&&salla.api.product.getDetails(this.productId,["options"]).then((t=>this.optionsData=t.data.options))}handleMultiSelectFieldInput(){var t=this.multipleOptionDom.querySelectorAll('input[type="checkbox"]:checked'),i=[];for(let e of t)i.push(e.value);this.itemsSelected.emit(i)}getLatLng(t,i){return t?t.split(",")["lat"==i?0:1]:""}getDisplayForType(t){return this[`${t.type}Option`]?this[`${t.type}Option`](t):t.type===Pi.COLOR_PICKER?this.colorPickerOption(t):t.type===Pi.MULTIPLE_OPTIONS?this.multipleOptions(t):t.type===Pi.SINGLE_OPTION?this.singleOption(t):(salla.log(`Couldn't find options type(${t.type})😢`),"")}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}componentWillLoad(){return salla.api.cart.getCurrentCartId()}render(){if(0!=this.optionsData.length)return i(e,{class:"s-product-options-wrapper"},i("salla-conditional-fields",null,this.optionsData.map((t=>i("div",Object.assign({class:"s-product-options-option-container"+(t.visibility_condition?" hidden":""),"data-option-id":t.id},this.getOptionShownWhen(t)),"splitter"==t.name?this.splitterOption():i("div",{class:"s-product-options-option"},i("label",{htmlFor:"options["+t.id+"]",class:"s-product-options-option-label"},i("b",null,t.name,t.required&&i("span",null," * ")," "),i("small",null,t.placeholder)),i("div",{class:"s-product-options-option-content"},this.getDisplayForType(t))))))))}donationOption(t){return i("div",{class:"s-product-options-donation-wrapper"},i("input",{type:"text",id:"donating-amount",name:"donating_amount",class:"s-form-control",value:t.value,placeholder:t.placeholder,onInput:t=>salla.helpers.inputDigitsOnly(t.target),onBlur:t=>this.donationMoneyEntered.emit(t)}),i("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))}selectThumbnail(t,i){this.thumbnailSelected.emit(t)}fileUploader(t,e=null){return i("salla-file-upload",Object.assign({},e||{},{"payload-name":"file",value:t.value,"instant-upload":!0,name:`options[${t.id}]`,height:"120px",url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},class:{"s-product-options-image-input":!0,required:t.required}}),i("div",{class:"s-product-options-filepond-placeholder"},i("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:e.accept&&e.accept.split(",").every((t=>t.includes("image")))?xi:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n'}),i("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),i("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){let i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return i.length?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return i("input",{type:"text",value:t.value,class:"s-form-control",required:t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:t=>this.numberOptionEntered.emit(t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return i("div",{class:"s-product-options-splitter"})}textOption(t){return i("div",{class:"s-product-options-text"},i("input",{type:"text",value:t.value,class:"s-form-control",required:t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInput:t=>this.textOptionEntered.emit(t)}))}textareaOption(t){return i("div",{class:"s-product-options-textarea"},i("div",{class:"mt-1"},i("textarea",{rows:4,value:t.value,class:"s-form-control",required:t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInput:t=>this.textareaOptionEntered.emit(t)})))}mapOption(t){return i("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:!0,required:t.required,onSelected:t=>this.locationSelected.emit(t)})}colorPickerOption(t){return i("salla-color-picker",{onSubmitted:t=>this.colorPicked.emit(t),name:`options[${t.id}]`,required:t.required,color:t.value||"#5dd5c4"})}timeOption(t){return i("salla-datetime-picker",{noCalendar:!0,enableTime:!0,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onPicked:t=>this.timeSelected.emit(t)})}dateOption(t){return i("div",{class:"s-product-options-date-element"},i("salla-datetime-picker",{value:t.value,placeholder:t.name,required:t.required,name:`options[${t.id}]`,onPicked:t=>this.dateSelected.emit(t)}))}datetimeOption(t){return i("div",{class:"s-product-options-datetime-element"},i("salla-datetime-picker",{enableTime:!0,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onPicked:t=>this.dateTimeSelected.emit(t)}))}getOptionDetailName(t,i=!0){return t.name+(i&&t.is_out?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price)})`:"")}singleOption(t){return i("div",null,i("select",{name:`options[${t.id}]`,required:t.required,class:"s-form-control"},i("option",{value:""},t.placeholder),null==t?void 0:t.details.map((t=>i("option",{value:t.id,disabled:t.is_out,selected:t.is_selected,onChange:t=>this.singleSelectOptionSelected.emit(t)},this.getOptionDetailName(t))))))}multipleOptions(t){return i("div",{ref:t=>this.multipleOptionDom=t,class:{"s-product-options-multiple-options-wrapper":!0,required:t.required}},null==t?void 0:t.details.map((e=>i("div",null,i("input",{type:"checkbox",value:e.id,disabled:e.is_out,checked:e.is_selected,name:`options[${t.id}][]`,id:`field-${t.id}-${e.id}`,onChange:()=>this.handleMultiSelectFieldInput(),"aria-describedby":`options[${t.id}]-description`}),i("label",{htmlFor:`field-${t.id}-${e.id}`},this.getOptionDetailName(e))))))}colorOption(t){return i("fieldset",{class:"s-product-options-colors-wrapper"},null==t?void 0:t.details.map((e=>i("div",null,i("input",{type:"radio",value:e.id,disabled:e.is_out,required:t.required,checked:e.is_selected,name:`options[${t.id}]`,id:`color-${this.productId}-${t.id}-${e.id}`,onChange:t=>this.colorSelected.emit(t)}),i("label",{htmlFor:`color-${this.productId}-${t.id}-${e.id}`},i("span",{style:{"background-color":e.color}}),i("p",null,this.getOptionDetailName(e)))))))}thumbnailOption(t){return i("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((e=>i("div",null,i("input",{type:"radio",value:e.id,"data-itemid":e.id,disabled:e.is_out,required:t.required,checked:e.is_selected,name:`options[${t.id}]`,"data-img-id":e.option_value,id:`option_${this.productId}-${t.id}_${e.id}`,onChange:t=>this.selectThumbnail(t,e.option_value)}),i("label",{htmlFor:`option_${this.productId}-${t.id}_${e.id}`,"data-img-id":e.option_value,class:"go-to-slide"},i("img",{"data-src":e.image,src:e.image,title:e.name,alt:e.name}),i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>check</title>\n<path d="M27.521 6.976c-0.569-0.472-1.407-0.393-1.879 0.171l-12.567 15.080-7.003-4.668c-0.615-0.411-1.441-0.244-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l8 5.333c0.227 0.149 0.484 0.223 0.739 0.223 0.384 0 0.763-0.165 1.027-0.48l13.333-16c0.471-0.565 0.393-1.407-0.171-1.877z"></path>\n</svg>\n',class:"s-product-options-thumbnails-icon"})),i("p",null,this.getOptionDetailName(e,!1)," "),e.is_out?[i("small",{class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),i("div",{class:"s-product-options-thumbnails-badge-overlay"})]:""))))}get host(){return n(this)}};zi.style="";const Ni=class{constructor(i){t(this,i),this.hasError=!1,salla.event.on("size-guide::open",(t=>this.open(t))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(t){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(t))).then((t=>{this.guides=t.data})).catch((t=>{var i,e,n,o;console.log(t),this.hasError=!0,this.placeholder_description=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data)})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return i("salla-placeholder",{alignment:"center",iconSize:"xl"},i("div",{slot:"title"},this.placeholder_title),i("div",{slot:"description"},this.placeholder_description))}render(){return i("salla-modal",{class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:t=>this.modal=t},i("span",{slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),i("div",{slot:"loading"},i("div",{class:"s-product-size-guide-skeleton"},i("salla-skeleton",{height:"15px",width:"25%"}),i("div",{class:"s-product-size-guide-skeleton-header"},i("salla-skeleton",{height:"40px"}),i("salla-skeleton",{height:"40px"}),i("salla-skeleton",{height:"40px"}),i("salla-skeleton",{height:"40px"})),i("div",{class:"s-product-size-guide-skeleton-content"},i("salla-skeleton",{height:"15px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"75%"}),i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"10px",width:"75%"}),i("salla-skeleton",{height:"10px",width:"100%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"60%"}),i("salla-skeleton",{height:"10px",width:"45%"}),i("salla-skeleton",{height:"10px",width:"30%"})))),i("slot",{name:"header"}),!this.hasError&&this.guides?[i("salla-tabs",null,this.guides.map((t=>i("salla-tab-header",{slot:"header",name:t.name},i("span",null,t.name)))),this.guides.map((t=>i("salla-tab-content",{slot:"content",name:t.name},i("div",{innerHTML:t.description})))))]:this.showPlaceholder(),i("slot",{name:"footer"}))}get host(){return n(this)}};Ni.style="";const Bi=class{constructor(i){t(this,i),this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.didLoaded=!1,this.quantity=1}watchPropHandler(){this.didLoaded&&fi.debounce((()=>salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0})))}componentWillLoad(){this.quantity=parseInt(this.host.getAttribute("value"))||1,this.hasIncrementSlot=!!this.host.querySelector('[slot="increment-button"]'),this.hasDecrementSlot=!!this.host.querySelector('[slot="decrement-button"]')}componentDidLoad(){this.didLoaded=!0,this.textInput.addEventListener("input",(t=>salla.helpers.inputDigitsOnly(t.target)))}getInputAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","value","min","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}async decrease(){return this.setValue(this.quantity-1)}async increase(){return this.setValue(Number(this.quantity)+1)}async setValue(t){let i=parseInt(this.host.getAttribute("max"));return i&&t>i&&(t=i),t<=1&&(t=1),this.quantity=t,this.host}render(){return i(e,{class:"s-quantity-input"},i("div",{class:"s-quantity-input-container"},i("button",{onClick:()=>this.increase(),class:"s-quantity-input-increase-button s-quantity-input-button",type:"button"},this.hasIncrementSlot?"":i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>add</title>\n<path d="M26.667 14.667h-9.333v-9.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v9.333h-9.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h9.333v9.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-9.333h9.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),i("slot",{name:"increment-button"})),i("input",Object.assign({class:"s-quantity-input-input"},this.getInputAttributes(),{ref:t=>this.textInput=t,onInput:t=>this.setValue(t.target.value),min:"1",value:this.quantity})),i("button",{class:"s-quantity-input-decrease-button s-quantity-input-button",onClick:()=>this.decrease(),type:"button"},this.hasDecrementSlot?"":i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>minus</title>\n<path d="M26.667 14.667h-21.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h21.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n'}),i("slot",{name:"decrement-button"}))))}get host(){return n(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};Bi.style="";const Fi=class{constructor(i){t(this,i),this.quickOrderSubmited=o(this,"quickOrderSubmited",7),this.quickOrderTitle="ليش تنتظر؟",this.subTitle="احصل على المنتج مباشرة الآن",this.payButtonTitle="اطلب المنتج",this.confirmPayButtonTitle="اشتر الآن",this.agreementText=salla.lang.get("pages.checkout.show_full_agreement"),this.isEmailRequired=!1,this.quickOrderStyle="default",this.isAvailable=!1,this.oneClick=!1,this.expanded=!1,this.isTermsRequired=!1,this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.submitSucess=!1,this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name"),this.termsChecked=!1,this.productId=this.productId||salla.config.get("page.id"),salla.lang.onLoaded((()=>{this.placeHolderEmail=salla.lang.get("common.elements.email"),this.emailOptional=salla.lang.get("common.elements.optional"),this.agreementShowText=salla.lang.get("pages.checkout.show_full_agreement"),this.agreementModalHead=salla.lang.get("pages.checkout.full_agreement"),this.userNameLabel=salla.lang.get("pages.products.your_name")}))}getBtnColor(){return"default"===this.quickOrderStyle?"light":"primary"}async setWrapperHeight(){let t=this.host.querySelector(".s-quick-order-expandable");setTimeout((()=>{t.style.maxHeight=t.style.maxHeight||this.oneClick?null:t.scrollHeight+"px"}),50)}getDarkOrLight(){return"default"===this.quickOrderStyle&&salla.config.get("theme.color.is_dark")?"dark":"light"}getStyleColor(){return{gray:"#f3f3f3",white:"#ffffff",default:salla.config.get("theme.color.primary")}[this.quickOrderStyle]||"#f3f3f3"}async submit(t,i=!1){return t.preventDefault(),i&&!this.oneClick?(this.expanded=!this.expanded,void this.setWrapperHeight()):this.getPayload().then((t=>salla.api.cart.createQuickOrder(t))).then((()=>{this.quickOrderSubmited.emit(),this.submitSucess=!0})).catch((t=>t&&console.error(t)))}async getPayload(){var t,i,e,n,o,a;return this.oneClick?{product_ids:[this.productId],agreement:!0}:{product_ids:[this.productId],email:null===(t=this.emailInput)||void 0===t?void 0:t.value,phone:Number(null===(e=await(null===(i=this.phoneInput)||void 0===i?void 0:i.getValues()))||void 0===e?void 0:e.phone),country_code:(null===(o=await(null===(n=this.phoneInput)||void 0===n?void 0:n.getValues()))||void 0===o?void 0:o.countryCode)||this.countryCode,name:null===(a=this.nameInput)||void 0===a?void 0:a.value,agreement:this.termsChecked}}formatAgreementText(t,i=150){return t?t.length<=i?t:(new DOMParser).parseFromString(t,"text/html").documentElement.innerText.substring(0,i)+"...":""}render(){if(this.isAvailable)return this.submitSucess?i(e,{class:"s-quick-order"},i("div",{class:"s-quick-order-confirm"},i("i",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>party-horn</title>\n<path fill="currentColor" d="M5.333 4.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM11.333 10c0.341 0 0.683-0.131 0.943-0.391 1.541-1.54 2.391-3.589 2.391-5.771v-2.505c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.505c0 1.468-0.572 2.848-1.609 3.885-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391zM18.667 9.993c0.319 0 0.639-0.115 0.895-0.345 0.383-0.347 0.684-0.325 1.497-0.22 0.923 0.124 2.319 0.307 3.636-0.887 1.293-1.172 1.303-2.54 1.308-3.539 0.005-0.887 0.043-1.228 0.432-1.581 0.361-0.327 0.621-0.335 1.493-0.216 0.923 0.12 2.317 0.307 3.635-0.884 0.545-0.495 0.587-1.337 0.093-1.883-0.493-0.547-1.336-0.589-1.884-0.093-0.361 0.325-0.621 0.333-1.493 0.216-0.921-0.119-2.317-0.305-3.635 0.884-1.293 1.173-1.303 2.541-1.308 3.54-0.005 0.885-0.043 1.227-0.432 1.58-0.383 0.348-0.683 0.327-1.497 0.22-0.924-0.124-2.32-0.305-3.636 0.887-0.545 0.495-0.587 1.339-0.092 1.884 0.264 0.291 0.625 0.437 0.988 0.437zM18.667 16.013c0.736 0 1.333-0.596 1.333-1.333v-0.013c0-0.737-0.597-1.327-1.333-1.327s-1.333 0.603-1.333 1.34 0.597 1.333 1.333 1.333zM30.667 17.333h-2.505c-2.179 0-4.228 0.849-5.771 2.391-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.603 0.391 0.944 0.391s0.683-0.131 0.943-0.391c1.023-1.023 2.439-1.609 3.884-1.609h2.505c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM30.667 10.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM29.333 26.66c-0.736 0-1.333 0.603-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM7.456 11.057c-0.327-0.327-0.799-0.46-1.249-0.356-0.449 0.107-0.812 0.439-0.959 0.876l-5.036 15.113c-0.487 1.457-0.113 3.037 0.973 4.125 0.772 0.771 1.792 1.183 2.84 1.183 0.428 0 0.861-0.068 1.284-0.209l15.112-5.037c0.439-0.145 0.769-0.508 0.876-0.959 0.107-0.449-0.028-0.921-0.355-1.249zM4.467 29.259c-0.503 0.163-1.023 0.043-1.395-0.329-0.373-0.373-0.497-0.896-0.329-1.396l4.355-13.065 10.436 10.435z"></path>\n</svg>\n'}),i("span",null,this.thanksMessage))):i(e,{class:`s-quick-order s-quick-order-${this.getDarkOrLight()}`},i("div",{class:`s-quick-order-container s-quick-order-${this.quickOrderStyle}`,style:{backgroundColor:this.getStyleColor()}},i("div",{class:"s-quick-order-button-cont"},i("div",null,i("h3",null,this.quickOrderTitle),i("p",null,this.subTitle)),i("salla-button",{class:this.expanded?"s-quick-order-btn-close":"",onClick:t=>this.submit(t,!0),color:this.getBtnColor()},this.oneClick?this.confirmPayButtonTitle:this.expanded?i("i",{innerHTML:ui}):this.confirmPayButtonTitle)),i("form",{onSubmit:t=>this.submit(t),class:"s-quick-order-expandable "+(this.expanded?"s-quick-order-shown":"")},Salla.config.isGuest()&&[i("div",{class:"s-form-group"},i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>portrait</title>\n<path d="M24 1.333h-16c-3.676 0-6.667 2.991-6.667 6.667v16c0 3.028 2.041 5.561 4.811 6.371 0.004 0.001 0.008 0.003 0.012 0.004 0.591 0.172 1.2 0.292 1.844 0.292h16c0.644 0 1.253-0.12 1.843-0.292 0.004-0.001 0.008-0.003 0.012-0.004 2.771-0.809 4.812-3.343 4.812-6.371v-16c0-3.676-2.991-6.667-6.667-6.667zM8.012 28c0.121-1.915 3.363-4 7.988-4s7.868 2.085 7.988 4zM28 24c0 1.24-0.579 2.335-1.467 3.069-0.768-3.288-5.112-5.736-10.533-5.736s-9.765 2.448-10.533 5.736c-0.888-0.735-1.467-1.829-1.467-3.069v-16c0-2.205 1.795-4 4-4h16c2.205 0 4 1.795 4 4zM16 6.667c-3.308 0-6 2.692-6 6s2.692 6 6 6 6-2.692 6-6-2.692-6-6-6zM16 16c-1.839 0-3.333-1.495-3.333-3.333s1.495-3.333 3.333-3.333 3.333 1.495 3.333 3.333-1.495 3.333-3.333 3.333z"></path>\n</svg>\n'}),i("input",{type:"text",required:!0,class:"s-form-control",placeholder:this.userNameLabel,ref:t=>this.nameInput=t})),i("div",{class:"s-quick-order-flex-input"},i("div",{class:"s-form-group"},i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone-x</title>\n<path d="M24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.597 1.333-1.333 1.333h-16c-0.736 0-1.333-0.597-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h4c0 1.471 1.196 2.667 2.667 2.667h2.667c1.471 0 2.667-1.196 2.667-2.667h4c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n'}),i("salla-tel-input",{ref:t=>this.phoneInput=t})),i("div",{class:"s-form-group"},i("span",{innerHTML:bi}),i("input",{type:"email",class:"s-form-control",required:this.isEmailRequired,placeholder:this.placeHolderEmail+" "+(this.isEmailRequired?"":this.emailOptional),ref:t=>this.emailInput=t})))],this.isTermsRequired&&i("label",{htmlFor:"terms",class:"s-quick-order-terms"},i("input",{type:"checkbox",required:!0,name:"terms",id:"terms",ref:t=>this.termsInput=t,onChange:()=>this.termsChecked=this.termsInput.checked,class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",i("div",{innerHTML:this.formatAgreementText(this.agreementText,150)},this.agreementText.length>150&&i("salla-button",{shape:"link",onClick:()=>this.agreementModal.open()},this.agreementShowText))," ")),i("salla-button",{type:"submit",color:this.getBtnColor(),width:"wide"},this.payButtonTitle)),i("salla-modal",{"modal-title":this.agreementModalHead,ref:t=>this.agreementModal=t},i("article",{innerHTML:this.agreementText}))))}componentWillLoad(){return salla.api.withoutNotifier((()=>salla.api.cart.getQuickOrderSettings().then((t=>{var i,e;this.isAvailable=!0,this.quickOrderTitle=t.data.title,this.subTitle=t.data.sub_title,this.payButtonTitle=t.data.order_now_button,this.isEmailRequired=t.data.is_email_required,this.isTermsRequired=t.data.show_agreement,this.agreementText=t.data.agreement,this.confirmPayButtonTitle=t.data.confirm_button,this.thanksMessage=t.data.thanks_message,this.quickOrderStyle=t.data.style,this.user=salla.config.get("user")||salla.storage.get("user")||{},this.countryCode=(null===(i=this.user)||void 0===i?void 0:i.country_code)||this.countryCode,this.isEmailRequired=!(null===(e=this.user)||void 0===e?void 0:e.email)&&this.isEmailRequired,this.oneClick=!(this.isTermsRequired||this.isEmailRequired)&&null!==this.user}))))}get host(){return n(this)}};Fi.style="";const Ui='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>star</title>\n<path d="M31.819 12.077c-0.367-0.883-1.209-1.411-2.259-1.411h-8.437l-2.681-8.871c-0.347-1.075-1.329-1.796-2.443-1.796s-2.096 0.721-2.447 1.805l-2.788 8.861h-8.275c-1.076 0-1.939 0.533-2.308 1.427-0.375 0.904-0.159 2.012 0.525 2.693 0.044 0.044 0.092 0.085 0.141 0.124l6.811 5.101-2.773 8.567c-0.344 1.063 0.019 2.228 0.899 2.899 0.459 0.351 1.001 0.527 1.544 0.527 0.528 0 1.056-0.165 1.511-0.499l7.159-5.267 7.161 5.268c0.896 0.659 2.168 0.645 3.051-0.028 0.884-0.671 1.245-1.836 0.901-2.9l-2.773-8.567 6.811-5.101c0.051-0.037 0.099-0.080 0.143-0.124 0.687-0.687 0.904-1.8 0.528-2.709zM21.976 18.448c-0.456 0.343-0.644 0.936-0.469 1.477l3.044 9.293-7.763-5.711c-0.235-0.173-0.513-0.259-0.791-0.259s-0.556 0.085-0.791 0.259l-7.713 5.676 2.997-9.257c0.175-0.541-0.013-1.136-0.469-1.477l-6.829-5.116h8.551c0.583 0 1.097-0.377 1.272-0.933l2.981-9.479 2.861 9.465c0.169 0.561 0.688 0.947 1.276 0.947h8.672z"></path>\n</svg>\n',ji=class{constructor(i){t(this,i),this.hasError=!1,this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.orderId=salla.config.get("page.id"),this.translationLoaded=!1,salla.event.on("rating::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async open(){return this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId))).then((t=>this.order=t.data)))).then((()=>this.modal.setTitle(salla.lang.get("pages.rating.rate_order")+' <span class="unicode">(#'+this.order.id+")</span>"))).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((t=>t)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((t=>{var i,e,n,o;this.hasError=!0,this.errorMessage=(null===(n=null===(e=null===(i=t.response)||void 0===i?void 0:i.data)||void 0===e?void 0:e.error)||void 0===n?void 0:n.message)||(null===(o=t.response)||void 0===o?void 0:o.data),this.modal.stopLoading()}))}async close(){return this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(t=null){var i,e;this.currentTab=t||this.steps[this.currentIndex],fi.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!=this.currentIndex&&(fi.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>fi.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));let n=null===(i=this.steps[this.currentIndex+1])||void 0===i?void 0:i.dataset.type;null===(e=this.nextBtn)||void 0===e||e.setText(n?salla.lang.get("pages.rating.rate")+" "+salla.lang.get("pages.rating."+n):salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>{var t,i;return null===(t=this.body)||void 0===t?void 0:t.setAttribute("style","height:"+(null===(i=this.currentTab)||void 0===i?void 0:i.offsetHeight)+"px")}))}previousTab(){this.currentIndex>0&&this.currentIndex--,fi.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>fi.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&this.showThankYou(),this.modal.isClosable=!1}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(t=null,i=null){if(!t&&"products"==this.currentTab.dataset.type)return this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));let e=(t=t||this.currentTab).querySelector(".rating_hidden_input").value,n=t.querySelector(".s-rating-modal-comment"),o=t.querySelector(".s-rating-modal-validation-msg");if(e&&n.value&&n.value.length>3)return n.classList.remove("s-has-error"),void(o.innerHTML="");throw i=i||t.dataset.type,fi.toggleElementClassIf(n,"save","s-has-error",(t=>t.value.length>3)),o.innerHTML=e?salla.lang.get("common.errors.not_less_than_chars",{chars:4})+" "+n.getAttribute("placeholder"):salla.lang.get(`pages.rating.rate_${i}_stars`).replace(" (:item)","")}sendFeedback(){let t={};if(this.currentTab.querySelectorAll("[name]").forEach((i=>{let e=salla.helpers.inputData(i.name,i.value,t);t[e.name]=e.value})),0!=Object.keys(t).length)return t.order_id=this.orderId,t.type=this.currentTab.dataset.type,this.submitted.push(this.currentIndex),salla.rating.api[this.currentTab.dataset.type](t)}showThankYou(){let t=10,i=setInterval((()=>{this.thanksTime.innerHTML="00:0"+t--,t>0||(clearInterval(i),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}render(){var t;return i(e,{class:"s-rating-modal"},i("salla-modal",{isLoading:!0,width:"md",ref:t=>this.modal=t},i("div",{slot:"loading"},i("div",{class:"s-rating-modal-skeleton"},i("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),i("salla-skeleton",{height:"15px",width:"60%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((()=>i("div",{innerHTML:Ui})))),i("salla-skeleton",{height:"100px",width:"100%"}),i("div",{class:"s-rating-modal-skeleton-footer"},i("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[i("div",{class:"s-rating-modal-wrapper",ref:t=>this.body=t},(null===(t=this.order)||void 0===t?void 0:t.testimonials_enabled)?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),i("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?i("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((t,e)=>i("div",{class:"rating-outer-form s-rating-modal-product","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},i("div",{class:"s-rating-modal-product-img-wrap"},i("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),i("div",{class:"s-rating-modal-product-details"},i("h3",{class:"s-rating-modal-product-title"}," ",t.product.name),i("div",{class:"s-rating-modal-stars-product"},i("salla-rating-stars",{size:"small",name:`products[${e}][rating]`})),i("input",{type:"hidden",name:`products[${e}][product_id]`,value:t.product.id}),i("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${e}][comment]`,class:"s-rating-modal-comment"}),i("small",{class:"s-rating-modal-validation-msg"})))))):"",this.order.shipping_enabled?i("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},i("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?i("div",{class:"s-rating-modal-rounded-icon"},i("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):i("span",{class:"s-rating-modal-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>shipping-fast</title>\n<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}),i("div",{class:"s-rating-modal-title"}," ",salla.lang.get("pages.rating.rate_shipping")+" "+this.order.shipping.company.name),i("div",{class:"s-rating-modal-stars-company"},i("salla-rating-stars",{size:"large"})),i("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),i("small",{class:"s-rating-modal-validation-msg"})):"",i("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>this.thanksTab=t},i("span",{class:"s-rating-modal-icon",innerHTML:Di}),i("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),i("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),i("time",{class:"s-rating-modal-thanks-time",ref:t=>this.thanksTime=t}))),i("div",{class:"s-rating-modal-footer"},i("button",{ref:t=>this.backBtn=t,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?i("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((()=>i("li",{class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",i("salla-button",{"loader-position":"center",ref:t=>this.nextBtn=t,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:i("salla-placeholder",{alignment:"center"})))}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return n(this)}};ji.style="";const Hi=class{constructor(i){t(this,i),this.name="rating",this.size="medium"}initiateRating(){this.host.addEventListener("click",(()=>{if(!this.startsElem)return;let t=this.startsElem.querySelectorAll(".s-rating-stars-hovered"),i=t[t.length-1];if(!i)return;let e=i.getAttribute("data-star");this.startsElem.querySelector(".rating_hidden_input").value=e,this.startsElem.querySelectorAll(".s-rating-stars-btn-star").forEach(((t,i)=>fi.toggleElementClassIf(t,"s-rating-stars-selected","s-rating-stars-unselected",(()=>i<parseInt(e))))),this.startsElem.querySelectorAll("[aria-pressed]").forEach((t=>t.removeAttribute("aria-pressed"))),i.setAttribute("aria-pressed","true")}))}highlightSelectedStars(){var t,i;let e="s-rating-stars-hovered",n=null===(t=this.startsElem)||void 0===t?void 0:t.querySelectorAll(".s-rating-stars-btn-star");null==n||n.forEach(((t,i)=>{t.addEventListener("mouseover",(()=>{for(let t=0;t<=i;t++)n[t].classList.add(e)})),t.addEventListener("mouseout",(()=>t.classList.remove(e)))})),null===(i=this.startsElem)||void 0===i||i.addEventListener("mouseout",(()=>n.forEach((t=>t.classList.remove(e)))))}createStars(t){let e=[];for(let n=0;n<5;n++)e.push(i("span",{class:{"s-rating-stars-btn-star":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":n<t},innerHTML:Ei}));return e}render(){var t;return(null===(t=this.host.closest(".swiper-slide"))||void 0===t?void 0:t.classList.contains("swiper-slide-duplicate"))?"":i(e,null,this.value||0==this.value?i("div",{class:"s-rating-stars-wrapper"}," ",this.createStars(this.value)," "):i("div",{class:"s-rating-stars-element",ref:t=>this.startsElem=t},i("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((t=>i("button",{class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":t},i("span",{innerHTML:Ei}))))))}componentDidLoad(){this.initiateRating(),this.highlightSelectedStars()}get host(){return n(this)}};Hi.style="";const Vi='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>search</title>\n<path d="M30.276 28.391l-7.576-7.576c1.644-2.053 2.633-4.652 2.633-7.481 0-6.616-5.384-12-12-12s-12 5.384-12 12 5.384 12 12 12c2.829 0 5.428-0.989 7.481-2.633l7.576 7.576c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM13.333 22.667c-5.147 0-9.333-4.187-9.333-9.333s4.187-9.333 9.333-9.333 9.333 4.187 9.333 9.333-4.187 9.333-9.333 9.333z"></path>\n</svg>\n';var Yi;!function(t){t.DEFAULT="default",t.AVAILABILITY="availability"}(Yi||(Yi={}));const Wi=class{constructor(i){t(this,i),this.loadedScopes={[Yi.DEFAULT]:null,[Yi.AVAILABILITY]:null},this.translationLoaded=!1,this.mode=Yi.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.loading=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{var t;return(null===(t=this.originalScopesList)||void 0===t?void 0:t.length)<2?"":this.mode===Yi.DEFAULT?salla.lang.get("blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:t=null,product_id:i=null})=>{this.open(t,i)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async close(){var t;return await(null===(t=this.modal)||void 0===t?void 0:t.close())}async open(t=Yi.DEFAULT,i=null){return this.hasError=!1,this.mode=[Yi.AVAILABILITY,Yi.DEFAULT].includes(t)?t:Yi.DEFAULT,this.loading=!this.loadedScopes[this.mode],this.setScopeValues([]),salla.log("SallaScope:: opened"),this.modal.open(),this.loading?await salla.api.withoutNotifier((()=>t==Yi.AVAILABILITY?salla.scope.getProductAvailability(i):salla.scope.get())).then((i=>{if(t==Yi.AVAILABILITY)return this.setScopeValues(this.loadedScopes[Yi.AVAILABILITY]=i.data);this.setScopeValues(this.loadedScopes[this.mode]=i.data.scopes)})).catch((t=>{console.log(t),this.hasError=!0})).finally((()=>{this.modal.stopLoading(),this.loading=!1})):(this.setScopeValues(this.loadedScopes[this.mode]),this.modal.stopLoading())}async handleSubmit(){let t={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(t).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id});var t=new URL(window.location.href);t.searchParams.set("scope",this.current_scope.id),window.location.href=t.toString(),window.location.replace(t.toString())})).catch((t=>console.log(t))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(t){this.scopes=t,this.originalScopesList=t,1==(null==t?void 0:t.length)?(this.current_scope=t[0],this.selected_scope=t[0]):(this.current_scope=null==t?void 0:t.find((t=>t.selected)),this.selected_scope=null==t?void 0:t.find((t=>t.selected)))}handleSearchFieldTyping(t){let i=t.target.value.toLocaleLowerCase();this.scopes=i?this.originalScopesList.filter((t=>t.name.toLowerCase().includes(i))):this.originalScopesList}handleScopeSelection(t){var i;this.current_scope=null===(i=this.scopes)||void 0===i?void 0:i.find((i=>i.id==t.target.value))}placeholderContent(){return i("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},i("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),i("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){var t;return[i("div",{class:"s-scopes-container s-scrollbar"},null===(t=this.scopes)||void 0===t?void 0:t.map((t=>i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("input",{id:`${this.selection} + '_scope_' + ${t.id}`,name:"lang",type:"radio",value:t.id,onChange:t=>this.handleScopeSelection(t),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==t.id}),i("label",{htmlFor:`${this.selection} + '_scope_' + ${t.id}`,class:"s-scopes-label s-scopes-clickable"},i("span",null,t.name)))))),this.footerContent()]}availabilityContent(){var t;return i("div",{class:"s-scopes-container"},null===(t=this.scopes)||void 0===t?void 0:t.map((t=>{var e,n,o,a,r,s;return i("div",{class:"s-scopes-input-wrap","data-selection":this.selection},i("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===Yi.DEFAULT}},i("span",null,t.name)),i("h2",{style:{color:null===(n=null===(e=t)||void 0===e?void 0:e.availability)||void 0===n?void 0:n.color},class:`s-scopes-${null===(a=null===(o=t)||void 0===o?void 0:o.availability)||void 0===a?void 0:a.key}`},null===(s=null===(r=t)||void 0===r?void 0:r.availability)||void 0===s?void 0:s.label))})))}footerContent(){return i("div",{class:"s-scopes-footer"},i("slot",{name:"footer"},i("salla-button",{ref:t=>this.changeBtn=t,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}render(){var t,n,o,a;return i(e,null,i("salla-modal",{ref:t=>this.modal=t,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:this.loading,"has-skeleton":!0},this.loading?i("div",{slot:"loading"},i("div",{class:"s-scopes-skeleton"},i("salla-list-tile",{class:"s-scopes-header"},i("div",{slot:"icon",class:"s-scopes-header-icon"},i("salla-skeleton",{type:"circle"})),i("div",{slot:"title",class:"s-scopes-header-title mb-5"},i("salla-skeleton",{height:"15px",width:"50%"})),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},i("salla-skeleton",{height:"10px"}),i("salla-skeleton",{height:"10px",width:"75%"}))),i("div",{class:"s-scopes-skeleton-search"},i("salla-skeleton",{height:"10px",width:"50%"}),i("salla-skeleton",{height:"30px",width:"100%"})),i("div",{class:"s-scopes-skeleton-scopes"},i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"}),i("salla-skeleton",{height:"10px",width:"30%"}),i("salla-skeleton",{height:"10px",width:"25%"})),i("div",{class:"s-scopes-skeleton-btn"},i("salla-skeleton",{height:"40px",width:"100%"})))):[i("salla-list-tile",{class:(null===(t=this.originalScopesList)||void 0===t?void 0:t.length)?"s-scopes-header block":"s-hidden"},i("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),i("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),i("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),i("div",{class:"s-scopes-wrap"},!!(null===(n=this.originalScopesList)||void 0===n?void 0:n.length)&&i("h4",{class:"s-scopes-title"},this.getFormTitle()),(null===(o=this.originalScopesList)||void 0===o?void 0:o.length)>this.searchDisplayLimit?i("div",{class:"s-scopes-search-wrapper"},i("div",{class:"s-scopes-search-icon",innerHTML:Vi}),i("input",{type:"text",class:"s-scopes-search-input",onInput:t=>this.handleSearchFieldTyping(t),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||(null===(a=this.scopes)||void 0===a?void 0:a.length)<2?this.placeholderContent():this.mode===Yi.DEFAULT?this.defaultContent():this.availabilityContent())]))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};Wi.style=".s-scopes-availability-content{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.s-scopes-placeholder{-ms-flex:0 0 85%;flex:0 0 85%}";const qi=class{constructor(i){var e;t(this,i),this.inputValue="",this.translationLoaded=!1,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.inline=!1,this.oval=!1,this.height=60,this.productSlot=(null===(e=this.host.querySelector('[slot="product"]'))||void 0===e?void 0:e.innerHTML)||this.getDefaultProductSlot(),salla.event.on("search::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),salla.event.on("modalClosed",(()=>this.onModalClose()))}async open(){this.inline||await this.modal.open().then((()=>setTimeout((()=>this.searchInput.focus()),300)))}onModalClose(){this.searchInput.value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}handleKeyDown(t){var i;"Enter"===t.key&&(null===(i=this.search_term)||void 0===i?void 0:i.length)&&(window.location.href=salla.url.get("search?q="+encodeURI(this.search_term)))}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div></div>'}debounceSearch(t){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=t.target.value}),500)}handleSearch(t){this.inputValue=t,t.length>1?this.search(t):(this.results=void 0,this.afterSearching())}search(t){this.noResults.style.display="none",this.loading=!0,salla.product.search(t).then((t=>this.results=t)).catch((t=>"Query is same as previous one!"!==t?this.results=void 0:null)).finally((()=>this.afterSearching(!1)))}afterSearching(t=!0){var i;this.noResults.style.display=t||(null===(i=this.results)||void 0===i?void 0:i.data.length)>0?"none":"block",fi.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>{var t;return null===(t=this.results)||void 0===t?void 0:t.data.length})),this.loading=!1,salla.product.api.previousQuery="",this.inputValue.length<3&&this.container.classList.remove("s-search-no-results")}render(){var t;const e=i("div",{class:{"s-search-container":!0,"s-search-inline":this.inline},ref:t=>this.container=t},i("input",{type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder"),onInput:t=>this.debounceSearch(t),onKeyDown:t=>this.handleKeyDown(t),ref:t=>this.searchInput=t,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),i("span",{class:"s-search-icon-wrap"},i("span",{class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"></i>':Vi})),i("div",{class:"s-search-results"},null===(t=this.results)||void 0===t?void 0:t.data.map((t=>i("a",{href:t.url,class:{"s-search-product":!0,"s-search-product-not-available":!t.is_available},innerHTML:this.productSlot.replace(/\{name\}/g,t.name).replace(/\{price\}/g,salla.money(t.price)).replace(/\{regular_price\}/g,t.has_special_price?salla.money(t.regular_price):"").replace(/\{image\}/g,t.thumbnail)}))),i("p",{ref:t=>this.noResults=t,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options"))));return this.inline?i("div",{class:"s-search-modal"},e):i("salla-modal",{position:"top",class:"s-search-modal",ref:t=>this.modal=t},e)}componentDidLoad(){this.afterSearching()}get host(){return n(this)}static get watchers(){return{search_term:["handleSearch"]}}};qi.style="";const Zi=class{constructor(i){t(this,i),this.type="normal",this.width="100%",this.height="100%"}render(){return i(e,{class:"s-skeleton-wrapper",style:{width:this.width,height:this.height}},i("div",{class:{"s-skeleton-item":!0,"s-skeleton-item-circular":"circle"==this.type}}," "))}};Zi.style=":host{display:block}";const $i='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>keyboard_arrow_left</title>\n<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>\n</svg>\n',Xi=class{constructor(i){t(this,i),this.slideChange=o(this,"slideChange",7),this.reachBeginning=o(this,"reachBeginning",7),this.reachEnd=o(this,"reachEnd",7),this.slideChangeTransitionEnd=o(this,"slideChangeTransitionEnd",7),this.slideChangeTransitionStart=o(this,"slideChangeTransitionStart",7),this.slideNextTransitionEnd=o(this,"slideNextTransitionEnd",7),this.slideNextTransitionStart=o(this,"slideNextTransitionStart",7),this.slidePrevTransitionEnd=o(this,"slidePrevTransitionEnd",7),this.slidePrevTransitionStart=o(this,"slidePrevTransitionStart",7),this.sliderMove=o(this,"sliderMove",7),this.touchSliderEnd=o(this,"touchSliderEnd",7),this.touchSliderMove=o(this,"touchSliderMove",7),this.touchSliderStart=o(this,"touchSliderStart",7),this.sliderTransitionEnd=o(this,"sliderTransitionEnd",7),this.sliderTransitionStart=o(this,"sliderTransitionStart",7),this.blockTitle="",this.blockSubtitle="",this.displayAllUrl="",this.arrowsCentered=!1,this.verticalThumbs=!1,this.vertical=!1,this.autoHeight=!1,this.showControls=!0,this.controlsOuter=!1,this.showThumbsControls=!0,this.autoPlay=!1,this.slidesPerView="auto",this.pagination=!1,this.centered=!1,this.loop=!1,this.type="",this.sliderConfig={},this.thumbsConfig={},this.currentIndex=void 0,this.isEnd=!1,this.isBeginning=!0,this.isRTL="rtl"===document.documentElement.dir,this.hasThumbSlot=!1,this.pre_defined_config={carousel:{speed:300,slidesPerView:"auto",spaceBetween:0},fullwidth:{speed:750,parallax:!0},fullscreen:{speed:1e3,parallax:!0,direction:"vertical",followFinger:!1,touchReleaseOnEdges:!0,lazy:!0,mousewheel:{}},testimonials:{draggable:!0,slidesPerView:1,breakpoints:{1024:{slidesPerView:2}}},blog:{parallax:!0,speed:800,loop:!0,slidesPerView:1,centeredSlides:!0,spaceBetween:30,breakpoints:{320:{spaceBetween:10},768:{spaceBetween:15},980:{paceBetween:30}}},thumbs:{slidesPerView:1,spaceBetween:30}}}async slideTo(t,i,e){return this.slider.slideTo(t,i,e)}async slideNext(t,i){var e;null===(e=this.slider)||void 0===e||e.slideNext(t,i)}async slidePrev(t,i){var e;null===(e=this.slider)||void 0===e||e.slidePrev(t,i)}async slideToLoop(t,i,e){this.slider.slideToLoop(t,i,e)}async slideNextLoop(t,i){this.slider.slideNextLoop(t,i)}async slidePrevLoop(t,i){this.slider.slidePrevLoop(t,i)}async slideReset(t,i){this.slider.slideReset(t,i)}async slideToClosest(t,i){this.slider.slideToClosest(t,i)}async update(){this.slider.update()}async updateAutoHeight(t){this.slider.updateAutoHeight(t)}async updateSlides(){this.slider.updateSlides()}async updateProgress(){this.slider.updateProgress()}async updateSlidesClasses(){this.slider.updateSlidesClasses()}async getSlides(){var t;return await(null===(t=this.slider)||void 0===t?void 0:t.slides)}componentWillLoad(){return salla.lang.onLoaded((()=>{this.displayAllTitle=salla.lang.get("blocks.home.display_all")})),this.hasThumbSlot=!!this.host.querySelector('[slot="thumbs"]'),new Promise(((t,i)=>{if("undefined"!=typeof Swiper)return t(!0);if(document.getElementById("swiper-script")){let i=setInterval((()=>{"undefined"!=typeof Swiper&&(clearInterval(i),t(!0))}),5)}else this.swiperScript=document.createElement("script"),this.swiperScript.onload=()=>{t(!0),salla.event.emit("swiper::loaded")},this.swiperScript.onerror=t=>{salla.logger.warn("failed load swiper bundle",t),i(!0)},this.swiperScript.src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js",this.swiperScript.setAttribute("id","swiper-script"),document.body.appendChild(this.swiperScript)}))}getSwiperConfig(){let t={loop:this.loop,autoplay:"fullwidth"==this.type&&this.autoPlay?{delay:5e3}:this.autoPlay,centeredSlides:this.centered,slidesPerView:this.slidesPerView,autoHeight:this.autoHeight,lazy:!0,on:{afterInit:t=>this.loop&&t.slides.map((t=>{var i;null===(i=document.lazyLoadInstance)||void 0===i||i.update(),t.classList.contains("swiper-slide-duplicate")&&t.querySelectorAll("img.lazy:not(.loaded)").forEach((t=>t.classList.add("loaded")))}))},pagination:!!this.pagination&&{el:this.host.id?`#${this.host.id} .swiper-pagination`:"",clickable:!0},navigation:!!this.showControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-prev`:""},breakpoints:{768:{direction:this.vertical?"vertical":"horizontal"}}};if(this.pre_defined_config.fullscreen.mousewheel={releaseOnEdges:!(this.host.querySelectorAll(".swiper-slide").length>1)},t=Object.assign(Object.assign({},t),this.pre_defined_config[this.type]||{}),"thumbs"==this.type){for(const t of this.thumbsSliderWrapper.children)t.classList.add("swiper-slide");this.thumbsSlider=new Swiper(this.thumbsSliderContainer,{freeMode:!1,watchSlidesProgress:!0,slidesPerView:4,spaceBetween:10,watchOverflow:!0,watchSlidesVisibility:!0,breakpoints:{768:{direction:this.verticalThumbs?"vertical":"horizontal",spaceBetween:16}},navigation:!!this.showThumbsControls&&{nextEl:this.host.id?`#${this.host.id} .s-slider-thumbs-next`:"",prevEl:this.host.id?`#${this.host.id} .s-slider-thumbs-prev`:""}}),t.thumbs={swiper:this.thumbsSlider}}return t=Object.assign(Object.assign({},t),this.sliderConfig),t}initSlider(){for(const t of this.sliderWrapper.children)t.classList.add("swiper-slide");this.slider=new Swiper(this.sliderContainer,this.getSwiperConfig()),this.slider.on("slideChange",(t=>{this.isBeginning=t.isBeginning,this.isEnd=t.isEnd,this.slideChange.emit(t)})),this.slider.on("reachBeginning",(t=>this.reachBeginning.emit(t))),this.slider.on("reachEnd",(t=>this.reachEnd.emit(t))),this.slider.on("slideChangeTransitionEnd",(t=>{if("fullscreen"==this.type){const i=t.activeIndex;t.params.mousewheel.releaseOnEdges=0===i||i===t.slides.length-1}this.slideChangeTransitionEnd.emit(t)})),this.slider.on("slideChangeTransitionStart",(t=>this.slideChangeTransitionStart.emit(t))),this.slider.on("slideNextTransitionEnd",(t=>this.slideNextTransitionEnd.emit(t))),this.slider.on("slideNextTransitionStart",(t=>this.slideNextTransitionStart.emit(t))),this.slider.on("slidePrevTransitionEnd",(t=>this.slidePrevTransitionEnd.emit(t))),this.slider.on("slidePrevTransitionStart",(t=>this.slidePrevTransitionStart.emit(t))),this.slider.on("sliderMove",(t=>this.sliderMove.emit(t))),this.slider.on("touchEnd",(t=>this.touchSliderEnd.emit(t))),this.slider.on("touchMove",(t=>this.touchSliderMove.emit(t))),this.slider.on("touchStart",(t=>this.touchSliderStart.emit(t))),this.slider.on("transitionEnd",(t=>this.sliderTransitionEnd.emit(t))),this.slider.on("transitionStart",(t=>this.sliderTransitionStart.emit(t)))}render(){let t=this.type?this.type+"-slider ":"";return t+=this.controlsOuter?" s-slider-controls-outer ":"",t+=""==this.blockTitle?" s-slider-has-notitle s-slider-v-centered ":"",t+=this.verticalThumbs?" s-slider-vertical ":" s-slider-horizontal ",t+=this.arrowsCentered?" s-slider-v-centered ":"",i(e,{class:"s-slider-wrapper "+t},this.blockTitle||this.showControls?i("div",{class:"s-slider-block__title"},this.blockTitle?i("div",{class:"s-slider-block__title-right"},i("h2",null,this.blockTitle),this.blockSubtitle?i("p",{innerHTML:this.blockSubtitle}):""):"",i("div",{class:"s-slider-block__title-left"},this.displayAllUrl?i("a",{href:this.displayAllUrl,class:"s-slider-block__display-all"},this.displayAllTitle):"",this.showControls?i("div",{class:"s-slider-block__title-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:this.isRTL?wi:$i})),i("button",{"aria-label":"Next Slide",class:"s-slider-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:this.isRTL?$i:wi}))):"")):"",i("div",{class:"swiper s-slider-container",ref:t=>this.sliderContainer=t,dir:this.vertical?"ltr":this.isRTL?"rtl":"ltr"},i("slot",null),i("div",{class:"swiper-wrapper s-slider-swiper-wrapper",ref:t=>this.sliderWrapper=t},i("slot",{name:"items"})),this.pagination?i("div",{class:"swiper-pagination"}):""),"thumbs"==this.type&&this.hasThumbSlot?i("div",{class:"s-slider-thumbs"},i("div",{class:"swiper s-slider-thumbs-container",dir:this.verticalThumbs?"ltr":this.isRTL?"rtl":"ltr",ref:t=>this.thumbsSliderContainer=t},i("div",{class:"s-slider-swiper-wrapper swiper-wrapper",ref:t=>this.thumbsSliderWrapper=t},i("slot",{name:"thumbs"})),this.showThumbsControls?i("div",{class:"s-slider-thumbs-nav",dir:"rtl"},i("button",{"aria-label":"Previous Slide",class:"s-slider-thumbs-prev s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:this.isRTL?wi:$i})),i("button",{"aria-label":"Next Slide",class:"s-slider-thumbs-next s-slider-nav-arrow"},i("span",{class:"s-slider-button-icon",innerHTML:this.isRTL?$i:wi}))):"")):"")}componentDidLoad(){let t=this.sliderWrapper.querySelector('div[slot="items"]');if(t&&t.replaceWith(...t.children),"thumbs"==this.type&&this.hasThumbSlot){let t=this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');t&&t.replaceWith(...t.children)}"undefined"==typeof Swiper?salla.event.once("swiper::loaded",(()=>this.initSlider())):this.initSlider()}get host(){return n(this)}};var Ki;Xi.style='@font-face{font-family:"swiper-icons";src:url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA") format("woff");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-pointer-events.swiper-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-backface-hidden .swiper-slide{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:"";-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:9999;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-start:var(--swiper-centered-offset-before);margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-before:var(--swiper-centered-offset-before);margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center}:root{}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:300ms opacity;transition:300ms opacity;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0px, -50%, 0);transform:translate3d(0px, -50%, 0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:200ms top, 200ms -webkit-transform;transition:200ms top, 200ms -webkit-transform;transition:200ms transform, 200ms top;transition:200ms transform, 200ms top, 200ms -webkit-transform}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms left, 200ms -webkit-transform;transition:200ms left, 200ms -webkit-transform;transition:200ms transform, 200ms left;transition:200ms transform, 200ms left, 200ms -webkit-transform}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms right, 200ms -webkit-transform;transition:200ms right, 200ms -webkit-transform;transition:200ms transform, 200ms right;transition:200ms transform, 200ms right, 200ms -webkit-transform}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{--swiper-navigation-size:44px;}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - var(--swiper-navigation-size) / 2);z-index:10;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none !important}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}.swiper-button-lock{display:none}',function(t){t.FACEBOOK="facebook",t.TWITTER="twitter",t.WHATSAPP="whatsapp",t.EMAIL="email",t.COPY_LINK="copy_link"}(Ki||(Ki={}));const Qi=class{constructor(i){t(this,i),this.opened=!1,this.allPlatforms=[Ki.WHATSAPP,Ki.FACEBOOK,Ki.TWITTER,Ki.EMAIL,Ki.COPY_LINK],this.platformIcons=[{icon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp</title>\n<path d="M16 32c-0.008 0-0.018 0-0.028 0-3.1 0-5.993-0.887-8.439-2.421l0.066 0.039-7.2 2.3 2.336-6.964c-1.713-2.492-2.736-5.575-2.736-8.897 0-0.020 0-0.040 0-0.060v0.003c0.009-8.833 7.167-15.991 15.999-16h0.001c8.837 0 16 7.163 16 16s-7.163 16-16 16v0zM7.906 27.424l0.4 0.264c2.169 1.449 4.837 2.312 7.707 2.312 7.732 0 14-6.268 14-14s-6.268-14-14-14c-0.004 0-0.009 0-0.013 0h0.001c-7.729 0.008-13.992 6.271-14 13.999v0.001c-0 0.010-0 0.021-0 0.032 0 3.072 1 5.909 2.693 8.206l-0.027-0.038 0.304 0.416-1.4 4.2zM20.716 24.958c-1.684-0.131-3.237-0.574-4.641-1.271l0.073 0.033c-3.098-1.456-5.634-3.668-7.438-6.405l-0.042-0.067c-1.102-1.357-1.819-3.067-1.962-4.938l-0.002-0.030c-0.001-0.036-0.001-0.078-0.001-0.12 0-1.575 0.66-2.995 1.719-4l0.002-0.002c0.547-0.52 1.289-0.839 2.105-0.839 0.033 0 0.066 0.001 0.099 0.002l-0.005-0c0.2 0 0.378 0 0.542 0.018 0.016-0.001 0.035-0.001 0.054-0.001 0.815 0 1.502 0.549 1.711 1.298l0.003 0.012 0.324 0.782c0.376 0.906 0.858 2.068 0.942 2.244 0.144 0.251 0.23 0.552 0.23 0.873 0 0.286-0.068 0.557-0.188 0.797l0.005-0.010c-0.149 0.307-0.332 0.57-0.55 0.802l0.002-0.002c-0.148 0.168-0.248 0.274-0.346 0.378s-0.172 0.18-0.26 0.284c0.575 0.92 1.237 1.713 1.992 2.406l0.008 0.008c0.829 0.758 1.802 1.373 2.872 1.8l0.064 0.022c0.369-0.266 0.672-0.6 0.896-0.985l0.008-0.015 0.174-0.232c0.328-0.484 0.875-0.798 1.495-0.798 0.249 0 0.487 0.051 0.703 0.142l-0.012-0.004c0.492 0.168 2.922 1.372 2.946 1.384l0.228 0.11c0.415 0.149 0.758 0.417 0.996 0.763l0.004 0.007c0.107 0.349 0.169 0.75 0.169 1.166 0 0.591-0.125 1.153-0.349 1.661l0.010-0.026c-0.702 1.368-1.983 2.353-3.511 2.637l-0.031 0.005c-0.309 0.071-0.663 0.112-1.028 0.112-0.004 0-0.007 0-0.011 0h0.001zM10.632 9.318c-0.028-0.002-0.062-0.004-0.095-0.004-0.245 0-0.472 0.076-0.659 0.206l0.004-0.002c-0.726 0.651-1.18 1.591-1.18 2.638 0 0.044 0.001 0.087 0.002 0.13l-0-0.006c0.122 1.404 0.662 2.662 1.495 3.671l-0.009-0.011 0.12 0.168c1.627 2.491 3.865 4.46 6.504 5.723l0.096 0.041c3.136 1.288 3.916 1.124 4.426 1.014 0.87-0.159 1.601-0.656 2.067-1.347l0.007-0.011c0.12-0.316 0.204-0.682 0.237-1.063l0.001-0.015-0.040-0.018-0.256-0.124c-0.8-0.4-2.46-1.2-2.734-1.292l-0.058 0.184c-0.346 0.501-0.684 0.934-1.045 1.347l0.015-0.017c-0.344 0.349-0.821 0.565-1.349 0.565-0.28 0-0.546-0.061-0.785-0.17l0.012 0.005c-1.403-0.547-2.609-1.301-3.646-2.239l0.010 0.009c-0.975-0.891-1.81-1.912-2.486-3.039l-0.034-0.061c-0.152-0.244-0.242-0.54-0.242-0.857 0-0.463 0.191-0.88 0.499-1.178l0-0c0.13-0.162 0.264-0.302 0.4-0.444l0.236-0.256c0.091-0.096 0.177-0.201 0.254-0.311l0.006-0.009c-0.158-0.36-0.622-1.472-0.988-2.352l-0.322-0.772-0.038-0.086c-0.188-0.010-0.302-0.016-0.426-0.016zM12.462 12.442v0.012z"></path>\n</svg>\n',name:Ki.WHATSAPP},{icon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>facebook</title>\n<path d="M19 32h-6c-0.552 0-1-0.448-1-1v0-13h-3c-0.552 0-1-0.448-1-1v0-5c0-0.552 0.448-1 1-1v0h3v-4c0-3.866 3.134-7 7-7v0h4c0.552 0 1 0.448 1 1v0 5c0 0.552-0.448 1-1 1v0h-2c-0.552 0-1 0.448-1 1v0 3h5c0.552 0 1 0.448 1 1 0 0.134-0.026 0.262-0.074 0.379l0.002-0.007-2 5c-0.152 0.371-0.51 0.628-0.928 0.628h-3v13c0 0.552-0.448 1-1 1v0zM14 30h4v-13c0-0.552 0.448-1 1-1v0h3.324l1.2-3h-4.524c-0.552 0-1-0.448-1-1v0-4c0-1.657 1.343-3 3-3v0h1v-3h-3c-2.761 0-5 2.239-5 5v0 5c0 0.552-0.448 1-1 1v0h-3v3h3c0.552 0 1 0.448 1 1v0z"></path>\n</svg>\n',name:Ki.FACEBOOK},{icon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>twitter</title>\n<path d="M10.436 30c-0.012 0-0.026 0-0.041 0-3.691 0-7.129-1.088-10.009-2.961l0.071 0.043c-0.279-0.181-0.46-0.49-0.46-0.842 0-0.123 0.022-0.24 0.063-0.349l-0.002 0.007c0.148-0.387 0.516-0.657 0.948-0.657 0.042 0 0.083 0.003 0.123 0.007l-0.005-0c0.399 0.049 0.86 0.077 1.328 0.077 1.836 0 3.57-0.432 5.108-1.199l-0.066 0.030c-1.941-0.823-3.42-2.412-4.079-4.377l-0.015-0.051c-0.033-0.095-0.053-0.205-0.053-0.32 0-0.255 0.096-0.488 0.253-0.665l-0.001 0.001 0.062-0.062c-1.511-1.323-2.46-3.254-2.462-5.408v-0c0-0 0-0.001 0-0.001 0-0.374 0.194-0.703 0.488-0.89l0.004-0.003c0.115-0.070 0.25-0.121 0.393-0.145l0.007-0.001c-0.534-0.978-0.848-2.141-0.848-3.379 0-1.329 0.362-2.574 0.994-3.641l-0.018 0.033c0.176-0.301 0.498-0.501 0.866-0.501 0.312 0 0.591 0.143 0.774 0.367l0.001 0.002c2.627 3.213 6.397 5.405 10.682 5.953l0.082 0.009c0-0.098 0-0.2 0-0.302 0-0.001 0-0.002 0-0.002 0-3.949 3.201-7.15 7.15-7.15 1.852 0 3.54 0.704 4.81 1.86l-0.006-0.005c1.165-0.288 2.19-0.719 3.127-1.282l-0.051 0.028c0.146-0.088 0.323-0.141 0.512-0.141 0.552 0 1 0.448 1 1 0 0.109-0.017 0.214-0.050 0.312l0.002-0.007c-0.151 0.464-0.324 0.861-0.531 1.237l0.019-0.037c0.117-0.052 0.253-0.082 0.396-0.082 0.552 0 1 0.448 1 1 0 0.208-0.064 0.401-0.172 0.561l0.002-0.004c-0.812 1.212-1.772 2.247-2.87 3.114l-0.028 0.022c0 0.1 0 0.2 0 0.306 0 0.051 0.001 0.111 0.001 0.171 0 10.12-8.204 18.324-18.324 18.324-0.062 0-0.124-0-0.186-0.001l0.009 0zM5 27.084c1.616 0.58 3.481 0.916 5.424 0.916 0.004 0 0.008 0 0.013 0h-0.001c0.048 0 0.104 0.001 0.161 0.001 9.027 0 16.344-7.317 16.344-16.344 0-0.055-0-0.11-0.001-0.165l0 0.008c0-0.256 0-0.502-0.022-0.746-0.001-0.014-0.001-0.031-0.001-0.049 0-0.335 0.165-0.632 0.418-0.813l0.003-0.002q0.312-0.222 0.6-0.466l-0.364 0.052c-0.038 0.005-0.082 0.008-0.126 0.008-0.552 0-1-0.448-1-1 0-0.363 0.193-0.68 0.482-0.856l0.004-0.003q0.222-0.134 0.428-0.286c-0.3 0.082-0.6 0.154-0.912 0.214-0.059 0.012-0.127 0.020-0.197 0.020-0.286 0-0.544-0.12-0.727-0.313l-0-0c-0.943-1.007-2.28-1.634-3.764-1.634-2.845 0-5.152 2.307-5.152 5.152 0 0.001 0 0.002 0 0.002v-0c-0 0.020-0 0.043-0 0.066 0 0.395 0.043 0.781 0.125 1.151l-0.007-0.035c0.017 0.069 0.027 0.148 0.027 0.23 0 0.242-0.086 0.463-0.228 0.636l0.001-0.002c-0.177 0.219-0.445 0.358-0.746 0.358-0.024 0-0.047-0.001-0.071-0.003l0.003 0c-4.85-0.253-9.167-2.342-12.31-5.577l-0.004-0.005c-0.098 0.376-0.155 0.808-0.155 1.253 0 1.778 0.902 3.345 2.272 4.27l0.018 0.012c0.27 0.182 0.446 0.487 0.446 0.832 0 0.552-0.448 1-1 1-0.008 0-0.015-0-0.023-0l0.001 0c-0.548-0.010-1.074-0.082-1.577-0.21l0.047 0.010c0.554 1.812 2.029 3.181 3.866 3.574l0.034 0.006c0.458 0.097 0.797 0.499 0.797 0.979 0 0.456-0.305 0.841-0.722 0.961l-0.007 0.002c-0.412 0.117-0.89 0.198-1.383 0.225l-0.017 0.001c0.926 1.304 2.415 2.156 4.105 2.2l0.007 0c0.546 0.009 0.984 0.453 0.984 1 0 0.319-0.15 0.603-0.382 0.787l-0.002 0.002c-1.596 1.249-3.522 2.154-5.625 2.568l-0.085 0.014z"></path>\n</svg>\n',name:Ki.TWITTER},{icon:bi,name:Ki.EMAIL},{icon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>link</title>\n<path d="M19.247 23.019l-4.189 4.189c-2.831 2.831-7.435 2.831-10.265 0-1.371-1.372-2.125-3.193-2.125-5.132s0.755-3.761 2.125-5.133l4.189-4.191c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-4.189 4.191c-1.875 1.875-2.907 4.367-2.907 7.019s1.032 5.143 2.907 7.017 4.368 2.907 7.019 2.907 5.143-1.032 7.017-2.908l4.189-4.189c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.52-1.885 0.001zM22.276 9.724c-0.521-0.521-1.364-0.521-1.885 0l-10.667 10.667c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l10.667-10.667c0.521-0.521 0.521-1.364 0-1.885zM29.093 2.908c-1.875-1.876-4.368-2.908-7.019-2.908s-5.143 1.032-7.017 2.908l-4.189 4.188c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l4.189-4.189c2.831-2.831 7.435-2.831 10.265 0 1.371 1.372 2.125 3.193 2.125 5.132s-0.755 3.761-2.125 5.133l-4.189 4.191c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l4.189-4.191c1.875-1.875 2.907-4.367 2.907-7.019s-1.032-5.143-2.907-7.016z"></path>\n</svg>\n',name:Ki.COPY_LINK}],this.convertedPlatforms=[],this.url="",this.urlName="",this.platforms="facebook,twitter,whatsapp,email,copy_link"}componentWillLoad(){let t=this;if(document.getElementById("a2a-script"))return;const i=document.createElement("script");i.src="https://static.addtoany.com/menu/page.js",i.setAttribute("id","a2a-script"),i.async=!0,i.onload=function(){window.a2a_config=window.a2a_config||{},window.a2a_config.linkurl=t.url?t.url:window.location.href,window.a2a_config.linkname=t.urlName?t.urlName:document.title,window.a2a_config.locale=salla.config.get("user.language_code",salla.lang.getLocale())},document.body.appendChild(i)}async open(){this.opened=!this.opened,this.opened?this.shareMenu.classList.add("opened"):this.shareMenu.classList.remove("opened"),(new st.timeline).add({targets:this.shareMenu,translateY:[-50,0],opacity:[0,1],duration:300,podding:"0",easing:"easeInOutSine"}).add({targets:this.platformItem,translateZ:0,translateY:[-30,0],scaleY:[0,1],opacity:[0,1],duration:1200,delay:st.stagger(100)},"-=200")}render(){return i("div",{class:"s-social-share-wrapper"},i("slot",{name:"widget"},i("salla-button",{"aria-label":"Share",onClick:()=>this.open(),class:"s-social-share-btn",shape:"icon",fill:"outline",color:"light"},i("span",{innerHTML:this.opened?ui:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>share-alt</title>\n<path d="M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM26.667 29.333c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}))),i("ul",{ref:t=>this.shareMenu=t,class:"s-social-share-list a2a_kit share"},this.platforms.split(",").map((t=>i("li",{ref:t=>this.platformItem=t},i("a",{class:`a2a_button_${t}`,"aria-label":`Share Via ${t}`},this.platformIcons.map((e=>{if(e.name===t)return i("span",{class:"s-social-share-icon",innerHTML:e.icon})}))))))))}};Qi.style="";const Ji=class{constructor(i){t(this,i),this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}render(){return i("div",{class:{"s-tabs-content":!0,"s-tabs-content-selected":this.isSelected}},i("slot",null))}};Ji.style="";const te=class{constructor(i){t(this,i),this.tabSelected=o(this,"tabSelected",7),this.id=Math.random().toString(36).slice(2,10),this.activeClass=void 0,this.height=void 0,this.centered=!1,this.isSelected=!1}async getChild(){return{selected:this.selected.bind(this),unselect:this.unselect.bind(this),name:this.name,id:this.id}}unselect(){this.isSelected=!1}selected(){this.isSelected=!0}onClick(){this.getChild().then((t=>{this.tabSelected.emit(t)}))}render(){return[i("div",{class:{"s-tabs-header-item":!0,"s-tabs-bg-normal":!0,"s-tabs-active":this.isSelected},onClick:this.onClick.bind(this)},i("slot",null))]}};te.style="";const ie=class{constructor(i){t(this,i),this.backgroundColor=void 0,this.vertical=!1}componentWillLoad(){this.createGroup().then((()=>{const[t]=this.tabGroup;this.selectGroup(t)}))}onSelectedTab(t){const i=this.tabGroup.find((i=>i.header.id===t.detail.id));this.selectGroup(i)}async createGroup(){const t=Array.from(this.host.querySelectorAll("salla-tab-header"));this.tabsHeader=await Promise.all(t.map((t=>t.getChild())));const i=Array.from(this.host.querySelectorAll("salla-tab-content"));this.tabsContent=await Promise.all(i.map((t=>t.getChild()))),this.tabGroup=this.tabsHeader.map((t=>{const i=this.tabsContent.find((i=>i.name===t.name));return{header:t,content:i}}))}selectGroup(t){this.tabGroup.map((t=>{t.header.unselect(),t.content.unselect()})),t.header.selected(),t.content.selected()}render(){return[i("div",{class:"s-tabs"},i("div",{class:"s-tabs-header"},i("slot",{name:"header"})),i("div",{class:"s-tabs-content-wrapper"},i("slot",{name:"content"})))]}get host(){return n(this)}};ie.style=".s-tabs-header{-ms-overflow-style:none;scrollbar-width:none;}.s-tabs-header::-webkit-scrollbar{display:none}";var ee=a((function(t){var i;i=function(t){return function(){for(var i=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["North Macedonia (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1,["5288","5289"]],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<i.length;e++){var n=i[e];i[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function o(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a={getInstance:function(t){var i=t.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[i]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=a);var r=0,s={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},l=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],c=function(t,i){for(var e=Object.keys(t),n=0;n<e.length;n++)i(e[n],t[e[n]])},p=function(t){c(window.intlTelInputGlobals.instances,(function(i){window.intlTelInputGlobals.instances[i][t]()}))},u=function(){function e(t,i){var n=this;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=r++,this.telInput=t,this.activeItem=null,this.highlightedItem=null;var o=i||{};this.options={},c(s,(function(t,i){n.options[t]=o.hasOwnProperty(t)?o[t]:i})),this.hadInitialPlaceholder=Boolean(t.getAttribute("placeholder"))}var n,a;return n=e,(a=[{key:"_init",value:function(){var t=this;if(this.options.nationalMode&&(this.options.autoHideDialCode=!1),this.options.separateDialCode&&(this.options.autoHideDialCode=this.options.nationalMode=!1),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(document.body.classList.add("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer=document.body)),"undefined"!=typeof Promise){var i=new Promise((function(i,e){t.resolveAutoCountryPromise=i,t.rejectAutoCountryPromise=e})),e=new Promise((function(i,e){t.resolveUtilsScriptPromise=i,t.rejectUtilsScriptPromise=e}));this.promise=Promise.all([i,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(i,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var o=0;o<this.countryCodes[e].length;o++)if(this.countryCodes[e][o]===i)return;this.countryCodes[e][n!==t?n:this.countryCodes[e].length]=i}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var t=this.options.onlyCountries.map((function(t){return t.toLowerCase()}));this.countries=i.filter((function(i){return t.indexOf(i.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(t){return t.toLowerCase()}));this.countries=i.filter((function(t){return-1===e.indexOf(t.iso2)}))}else this.countries=i}},{key:"_translateCountriesByLocale",value:function(){for(var t=0;t<this.countries.length;t++){var i=this.countries[t].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(i)&&(this.countries[t].name=this.options.localizedCountries[i])}}},{key:"_countryNameSort",value:function(t,i){return t.name.localeCompare(i.name)}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var t=0;t<this.countries.length;t++){var i=this.countries[t];this.dialCodes[i.dialCode]||(this.dialCodes[i.dialCode]=!0),this._addCountryCode(i.iso2,i.dialCode,i.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var o=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],s=1;s<r.length;s++){var l=n.dialCode+r.substr(0,s);this._addCountryCode(o,l),this._addCountryCode(n.iso2,l)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var t=0;t<this.options.preferredCountries.length;t++){var i=this.options.preferredCountries[t].toLowerCase(),e=this._getCountryData(i,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(t,i,e){var n=document.createElement(t);return i&&c(i,(function(t,i){return n.setAttribute(t,i)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var t="iti";this.options.allowDropdown&&(t+=" iti--allow-dropdown"),this.options.separateDialCode&&(t+=" iti--separate-dial-code"),this.options.customContainer&&(t+=" ",t+=this.options.customContainer);var i=this._createEl("div",{class:t});if(this.telInput.parentNode.insertBefore(i,this.telInput),this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},i),i.appendChild(this.telInput),this.selectedFlag=this._createEl("div",{class:"iti__selected-flag",role:"combobox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false"},this.flagsContainer),this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag),this.options.separateDialCode&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),this.options.allowDropdown&&(this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.countryList=this._createEl("ul",{class:"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider",role:"separator","aria-disabled":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),this.options.dropdownContainer?(this.dropdown=this._createEl("div",{class:"iti iti--container"}),this.dropdown.appendChild(this.countryList)):this.flagsContainer.appendChild(this.countryList)),this.options.hiddenInput){var e=this.options.hiddenInput,n=this.telInput.getAttribute("name");if(n){var o=n.lastIndexOf("[");-1!==o&&(e="".concat(n.substr(0,o),"[").concat(e,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:e}),i.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(t,i,e){for(var n="",o=0;o<t.length;o++){var a=t[o],r=e?"-preferred":"";n+="<li class='iti__country ".concat(i,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(a.iso2).concat(r,"' role='option' data-dial-code='").concat(a.dialCode,"' data-country-code='").concat(a.iso2,"' aria-selected='false'>"),n+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(a.iso2,"'></div></div>"),n+="<span class='iti__country-name'>".concat(a.name,"</span>"),n+="<span class='iti__dial-code'>+".concat(a.dialCode,"</span>"),n+="</li>"}this.countryList.insertAdjacentHTML("beforeend",n)}},{key:"_setInitialState",value:function(){var t=this.telInput.getAttribute("value"),i=this.telInput.value,e=!t||"+"!==t.charAt(0)||i&&"+"===i.charAt(0)?i:t,n=this._getDialCode(e),o=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,s=a.nationalMode,l=a.autoHideDialCode,c=a.separateDialCode;n&&!o?this._updateFlagFromNumber(e):"auto"!==r&&(r?this._setFlag(r.toLowerCase()):n&&o?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),e||s||l||c||(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var t=this;this._handleHiddenInputSubmit=function(){t.hiddenInput.value=t.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var t=this.telInput;t&&"LABEL"!==t.tagName;)t=t.parentNode;return t}},{key:"_initDropdownListeners",value:function(){var t=this;this._handleLabelClick=function(i){t.countryList.classList.contains("iti__hide")?t.telInput.focus():i.preventDefault()};var i=this._getClosestLabel();i&&i.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!t.countryList.classList.contains("iti__hide")||t.telInput.disabled||t.telInput.readOnly||t._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(i){t.countryList.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(i.key)&&(i.preventDefault(),i.stopPropagation(),t._showDropdown()),"Tab"===i.key&&t._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var t=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(t.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(t){window.intlTelInputGlobals.autoCountry=t.toLowerCase(),setTimeout((function(){return p("handleAutoCountry")}))}),(function(){return p("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var t=this;this._handleKeyupEvent=function(){t._updateFlagFromNumber(t.telInput.value)&&t._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(t._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(t){var i=this.telInput.getAttribute("maxlength");return i&&t.length>i?t.substr(0,i):t}},{key:"_initBlurListeners",value:function(){var t=this;this._handleSubmitOrBlurEvent=function(){t._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var t=this._getNumeric(this.telInput.value);t&&this.selectedCountryData.dialCode!==t||(this.telInput.value="")}}},{key:"_getNumeric",value:function(t){return t.replace(/\D/g,"")}},{key:"_trigger",value:function(t){var i=document.createEvent("Event");i.initEvent(t,!0,!0),this.telInput.dispatchEvent(i)}},{key:"_showDropdown",value:function(){this.countryList.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(t,i,e){e&&!t.classList.contains(i)?t.classList.add(i):!e&&t.classList.contains(i)&&t.classList.remove(i)}},{key:"_setDropdownPosition",value:function(){var t=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.isMobile){var i=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=i.top+e,o=this.countryList.offsetHeight,a=n+this.telInput.offsetHeight+o<e+window.innerHeight,r=n-o>e;this._toggleClass(this.countryList,"iti__country-list--dropup",!a&&r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(!a&&r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(i.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return t._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(t){for(var i=t;i&&i!==this.countryList&&!i.classList.contains("iti__country");)i=i.parentNode;return i===this.countryList?null:i}},{key:"_bindDropdownListeners",value:function(){var t=this;this._handleMouseoverCountryList=function(i){var e=t._getClosestListItem(i.target);e&&t._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(i){var e=t._getClosestListItem(i.target);e&&t._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var i=!0;this._handleClickOffToClose=function(){i||t._closeDropdown(),i=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;this._handleKeydownOnDropdown=function(i){i.preventDefault(),"ArrowUp"===i.key||"Up"===i.key||"ArrowDown"===i.key||"Down"===i.key?t._handleUpDownKey(i.key):"Enter"===i.key?t._handleEnterKey():"Escape"===i.key?t._closeDropdown():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(i.key)&&(n&&clearTimeout(n),e+=i.key.toLowerCase(),t._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown)}},{key:"_handleUpDownKey",value:function(t){var i="ArrowUp"===t||"Up"===t?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;i&&(i.classList.contains("iti__divider")&&(i="ArrowUp"===t||"Up"===t?i.previousElementSibling:i.nextElementSibling),this._highlightListItem(i,!0))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(t){for(var i=0;i<this.countries.length;i++)if(this._startsWith(this.countries[i].name,t)){var e=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(this.countries[i].iso2));this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(t,i){return t.substr(0,i.length).toLowerCase()===i}},{key:"_updateValFromNumber",value:function(t){var i=t;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=!this.options.separateDialCode&&(this.options.nationalMode||"+"!==i.charAt(0)),n=intlTelInputUtils.numberFormat;i=intlTelInputUtils.formatNumber(i,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}i=this._beforeSetNumber(i),this.telInput.value=i}},{key:"_updateFlagFromNumber",value:function(t){var i=t,e=this.selectedCountryData.dialCode;i&&this.options.nationalMode&&"1"===e&&"+"!==i.charAt(0)&&("1"!==i.charAt(0)&&(i="1".concat(i)),i="+".concat(i)),this.options.separateDialCode&&e&&"+"!==i.charAt(0)&&(i="+".concat(e).concat(i));var n=this._getDialCode(i,!0),o=this._getNumeric(i),a=null;if(n){var r=this.countryCodes[this._getNumeric(n)],s=-1!==r.indexOf(this.selectedCountryData.iso2)&&o.length<=n.length-1;if(!("1"===e&&this._isRegionlessNanp(o)||s))for(var l=0;l<r.length;l++)if(r[l]){a=r[l];break}}else"+"===i.charAt(0)&&o.length?a="":i&&"+"!==i||(a=this.defaultCountry);return null!==a&&this._setFlag(a)}},{key:"_isRegionlessNanp",value:function(t){var i=this._getNumeric(t);if("1"===i.charAt(0)){var e=i.substr(1,3);return-1!==l.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(t,i){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=t,this.highlightedItem.classList.add("iti__highlight"),i&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(t,e,n){for(var o=e?i:this.countries,a=0;a<o.length;a++)if(o[a].iso2===t)return o[a];if(n)return null;throw new Error("No country data for '".concat(t,"'"))}},{key:"_setFlag",value:function(t){var i=this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=t?this._getCountryData(t,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(t));var e=t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):"Unknown";if(this.selectedFlag.setAttribute("title",e),this.options.separateDialCode){var n=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=n;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),this.options.allowDropdown){var a=this.activeItem;if(a&&(a.classList.remove("iti__active"),a.setAttribute("aria-selected","false")),t){var r=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(t,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(t));r.setAttribute("aria-selected","true"),r.classList.add("iti__active"),this.activeItem=r,this.selectedFlag.setAttribute("aria-activedescendant",r.getAttribute("id"))}}return i.iso2!==t}},{key:"_getHiddenSelectedFlagWidth",value:function(){var t=this.telInput.parentNode.cloneNode();t.style.visibility="hidden",document.body.appendChild(t);var i=this.flagsContainer.cloneNode();t.appendChild(i);var e=this.selectedFlag.cloneNode(!0);i.appendChild(e);var n=e.offsetWidth;return t.parentNode.removeChild(t),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var t=intlTelInputUtils.numberType[this.options.placeholderNumberType],i=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,t):"";i=this._beforeSetNumber(i),"function"==typeof this.options.customPlaceholder&&(i=this.options.customPlaceholder(i,this.selectedCountryData)),this.telInput.setAttribute("placeholder",i)}}},{key:"_selectListItem",value:function(t){var i=this._setFlag(t.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(t.getAttribute("data-dial-code"),!0),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),i&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.countryList.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.isMobile||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(t,i){var e=this.countryList,n=window.pageYOffset||document.documentElement.scrollTop,o=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+o,s=t.offsetHeight,l=t.getBoundingClientRect().top+n,c=l+s,p=l-a+e.scrollTop,u=o/2-s/2;l<a?(i&&(p-=u),e.scrollTop=p):c>r&&(i&&(p+=u),e.scrollTop=p-(o-s))}},{key:"_updateDialCode",value:function(t,i){var e,n=this.telInput.value,o="+".concat(t);if("+"===n.charAt(0)){var a=this._getDialCode(n);e=a?n.replace(a,o):o}else{if(this.options.nationalMode||this.options.separateDialCode)return;if(n)e=o+n;else{if(!i&&this.options.autoHideDialCode)return;e=o}}this.telInput.value=e}},{key:"_getDialCode",value:function(t,i){var e="";if("+"===t.charAt(0))for(var n="",o=0;o<t.length;o++){var a=t.charAt(o);if(!isNaN(parseInt(a,10))){if(n+=a,i)this.countryCodes[n]&&(e=t.substr(0,o+1));else if(this.dialCodes[n]){e=t.substr(0,o+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var t=this.telInput.value.trim(),i=this.selectedCountryData.dialCode,e=this._getNumeric(t);return(this.options.separateDialCode&&"+"!==t.charAt(0)&&i&&e?"+".concat(i):"")+t}},{key:"_beforeSetNumber",value:function(t){var i=t;if(this.options.separateDialCode){var e=this._getDialCode(i);e&&(e="+".concat(this.selectedCountryData.dialCode),i=i.substr(" "===i[e.length]||"-"===i[e.length]?e.length+1:e.length))}return this._cap(i)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var t=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var i=this._getClosestLabel();i&&i.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&t&&t.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoHideDialCode&&(t&&t.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(t){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),i,t)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),t)}return-99}},{key:"isValidNumber",value:function(){var t=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(t,this.options.nationalMode?this.selectedCountryData.iso2:""):null}},{key:"setCountry",value:function(t){var i=t.toLowerCase();this.selectedFlagInner.classList.contains("iti__".concat(i))||(this._setFlag(i),this._updateDialCode(this.selectedCountryData.dialCode,!1),this._triggerCountryChange())}},{key:"setNumber",value:function(t){var i=this._updateFlagFromNumber(t);this._updateValFromNumber(t),i&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(t){this.options.placeholderNumberType=t,this._updatePlaceholder()}}])&&o(n.prototype,a),e}();a.getCountryData=function(){return i};var h=function(t,i,e){var n=document.createElement("script");n.onload=function(){p("handleUtils"),i&&i()},n.onerror=function(){p("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=t,document.body.appendChild(n)};return a.loadUtils=function(t){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(i,e){return h(t,i,e)}));h(t)}return null},a.defaults=s,a.version="17.0.18",function(t,i){var e=new u(t,i);return e._init(),t.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},t.exports?t.exports=i():window.intlTelInput=i()}));const ne=class{constructor(i){t(this,i),this.phoneEntered=o(this,"phoneEntered",7),this.name="phone",this.countryCode=salla.config.get("user.country_code","SA")||"SA",this.countryCodeLabel=salla.lang.get("common.country_code"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber],salla.lang.onLoaded((()=>{this.mobileLabel=salla.lang.get("common.elements.mobile"),this.countryCodeLabel=salla.lang.get("common.elements.country_code"),this.invalidNumber=salla.lang.get("common.errors.invalid_value",{attribute:this.mobileLabel}),this.invalidCountryCode=salla.lang.get("common.errors.invalid_value",{attribute:this.countryCodeLabel}),this.tooShort=salla.lang.get("common.errors.too_short",{attribute:this.mobileLabel}),this.tooLong=salla.lang.get("common.errors.too_long",{attribute:this.mobileLabel}),this.mobileRequired=salla.lang.get("common.errors.field_required",{attribute:this.mobileLabel}),this.errorMap=[this.invalidNumber,this.invalidCountryCode,this.tooShort,this.tooLong,this.invalidNumber]}))}async getValues(){return{[this.name]:this.phone=this.phoneInput.value,countryCode:this.countryCode=this.countryCodeInput.value}}async isValid(){if(this.reset(),this.iti.isValidNumber())return!0;if(!this.phoneInput.value.trim())return this.phoneInput.classList.add("s-has-error"),void(this.errorMsg.innerText=this.mobileRequired||"The mobile is required");this.phoneInput.classList.add("s-has-error");let t=this.iti.getValidationError();return this.errorMsg.innerText=this.errorMap[t]||"",salla.logger.info("Phone number ("+this.countryCode+" - "+this.phone+") is not valid, error code "+t),!1}initTelInput(){salla.helpers.inputDigitsOnly(this.phoneInput),this.iti=ee(this.phoneInput,{initialCountry:this.countryCode||"sa",preferredCountries:["sa","ae","kw","bh","qa","iq","om","ye","eg","jo","sy","ps","sd","lb","dz","tn","ma","ly"],formatOnDisplay:!1,separateDialCode:!0,autoPlaceholder:"aggressive",utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/utils.min.js"}),this.phoneInput.addEventListener("countrychange",(()=>{let t=this.iti.getSelectedCountryData().iso2.toUpperCase();this.countryCodeInput.value=t,this.countryCode=t,this.phoneEntered.emit({number:this.phone,country_code:t})})),this.phoneInput.addEventListener("input",(t=>{salla.helpers.inputDigitsOnly(t.target),this.reset(),this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}))}reset(){this.phoneInput.classList.remove("s-has-error"),this.errorMsg.innerHTML=""}handleCountryInput(t){this.phone&&this.phoneEntered.emit({number:t.target.value,country_code:this.countryCode})}render(){return i(e,{class:"s-tel-input"},i("input",{type:"tel",name:this.name,value:this.phone,onChange:t=>this.handleCountryInput(t),ref:t=>this.phoneInput=t,enterkeyhint:"next",autocomplete:"tel",class:"s-tel-input-control tel-input s-ltr"}),i("span",{class:"s-tel-input-error-msg",ref:t=>this.errorMsg=t}),i("input",{type:"hidden",name:"country_code",value:this.countryCode,ref:t=>this.countryCodeInput=t,class:"country_code"}))}componentDidLoad(){this.initTelInput()}get host(){return n(this)}};ne.style='.iti{width:100%;position:relative;display:inline-block}.iti *{-webkit-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box}.iti__hide{display:none}.iti__v-hide{visibility:hidden}.iti input,.iti input[type=text],.iti input[type=tel]{position:relative;z-index:0;direction:ltr !important;margin-top:0 !important;margin-bottom:0 !important;padding-left:95px !important;padding-right:15px !important;margin-left:0 !important}.iti__flag-container{width:100%;position:absolute;top:0;bottom:0;left:0;padding:1px}.iti__selected-flag{width:80px;z-index:1;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%;float:left;padding:0 15px;-webkit-box-shadow:none !important;box-shadow:none !important;outline:none !important}.ltr .iti__selected-flag{-ms-flex-pack:end;justify-content:flex-end}.iti__selected-flag:before{content:"";display:block;width:1px;height:70%;background:#eee;position:absolute;top:15%;right:0}.iti__selected-flag .iti__flag{display:none}.iti__arrow{width:15px;height:15px;line-height:15px;position:absolute;left:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.iti__arrow:after{content:url("data:image/svg+xml,<svg version=\'1.1\' xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 32 32\'><title>keyboard_arrow_down</title><path d=\'M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z\'></path></svg>");font-size:16px;color:#999;opacity:0.65}.iti__arrow--up:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.iti__country-list{width:100%;max-height:160px;position:absolute;top:100%;left:0;z-index:2;list-style:none;margin:0;padding:0;margin:5px 0 0 0;border-radius:5px;-webkit-box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05);box-shadow:0px 2px 4px 2px rgba(0, 0, 0, 0.05);border:1px solid #f5f7f9;background-color:white;white-space:nowrap;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.iti__country-list::-webkit-scrollbar{width:4px}.dark .iti__country-list{background-color:#52525b;border-color:#52525b}.iti__country-list li{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-direction:row;flex-direction:row;padding:8px 10px;-webkit-transition:background-color 0.3s;transition:background-color 0.3s}.iti__country-list li span{font-size:12px}.iti__country-list li:hover,.iti__country-list li.highlighted{background-color:rgba(0, 0, 0, 0.05)}.iti__country-list--dropup{bottom:100%;top:unset;margin:0 0 5px 0}@media (max-width: 500px){.iti__country-list{white-space:normal}}.iti__flag-box{display:inline-block;width:20px;margin:0 0 0 5px}.iti__divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #eee}.iti__country{padding:5px 10px;outline:none}.iti__dial-code{font-family:Arial;color:#999;unicode-bidi:-moz-plaintext;unicode-bidi:plaintext;letter-spacing:1px}.iti__country.iti__highlight{background-color:rgba(0, 0, 0, 0.05)}.iti__flag-box,.iti__country-name,.iti__dial-code{vertical-align:middle}.iti__country-name{-ms-flex:auto;flex:auto;margin:0;padding:0 10px;white-space:normal;line-height:1.3}.iti--allow-dropdown .iti__flag-container,.iti--separate-dial-code .iti__flag-container{left:0}.iti--allow-dropdown .iti__flag-container:hover{cursor:pointer}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover{cursor:default}.iti--allow-dropdown input[disabled]+.iti__flag-container:hover .iti__selected-flag,.iti--allow-dropdown input[readonly]+.iti__flag-container:hover .iti__selected-flag{background-color:transparent}.iti--separate-dial-code .iti__selected-dial-code{unicode-bidi:-moz-plaintext;unicode-bidi:plaintext;direction:ltr;letter-spacing:1px;font-family:"Arial", serif;font-size:13px}.iti--container{position:absolute;top:-1000px;z-index:1060;padding:1px}.iti--container:hover{cursor:pointer}.iti-mobile .iti--container{inset:0;margin:20px;width:calc(100% - 40px);position:fixed;z-index:9999}.iti-mobile .iti__country-list{max-height:100%;width:100%;inset:0}.iti-mobile .iti__country{padding:10px 10px;line-height:1.5em}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;-webkit-box-shadow:0px 0px 1px 0px #888;box-shadow:0px 0px 1px 0px #888;background-image:url("https://cdn.salla.network/images/flags.png");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url("https://cdn.salla.network/images/flags@2x.png")}}.iti__flag.iti__np{background-color:transparent}';const oe=class{constructor(i){var e;t(this,i),this.items={notifications:Li,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:c,wishlist:Ui,profile:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n'},this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png"),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,salla.lang.onLoaded((()=>{this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.hello=salla.lang.get("pages.checkout.hello"),this.rating=salla.lang.get("common.titles.rating"),this.logout=salla.lang.get("blocks.header.logout")})),this.host.hasAttribute("with-rating")&&(this.items.rating=Ei),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n',this.triggerSlot=(null===(e=this.host.querySelector('[slot="trigger"]'))||void 0===e?void 0:e.innerHTML)||'<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',salla.config.isGuest()||(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)&&this.fetchFreshProfile()}fetchFreshProfile(){salla.profile.api.info().then((t=>{this.badges.pending_orders=salla.helpers.number(t.data.pending_orders||0),this.badges.notifications=salla.helpers.number(t.data.notifications||0),this.hasBadges=Number(t.data.pending_orders)>0||Number(t.data.notifications)>0,this.first_name=t.data.first_name,this.last_name=t.data.last_name,this.avatar=t.data.avatar||salla.url.cdn("images/avatar.png")}))}async open(t){this.opened=!this.opened,t.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(t,i){"logout"===i[0]&&(t.preventDefault(),salla.auth.logout())}getTheHeader(){return i("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:t=>this.open(t),innerHTML:this.triggerSlot.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,Et)})}getMenuItem(t,e){return i("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":e+1==Object.entries(this.items).length}},i("a",{href:salla.url.get(t[0]),onClick:i=>this.menuItemClicked(i,t)},i("i",{innerHTML:t[1]}," "),i("span",{class:"s-user-menu-dropdown-item-title"},this[t[0]]),["٠","0",void 0].includes(this.badges[t[0]])?"":i("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[t[0]])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return i(e,null,this.inline?i("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i)))):i("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),i("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},i("div",{class:"s-user-menu-dropdown",onClick:t=>t.stopPropagation()},this.showHeader?i("div",{class:"s-user-menu-dropdown-header"},i("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),i("div",{class:"s-user-menu-dropdown-header-content"},i("span",null,this.hello),i("p",null,this.first_name," ",this.last_name)),i("button",{class:"s-user-menu-dropdown-header-close",innerHTML:ui,onClick:()=>this.opened=!1})):"",i("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((t,i)=>this.getMenuItem(t,i))))))))}componentDidLoad(){var t;null===(t=document.lazyLoadInstance)||void 0===t||t.update(this.host.querySelectorAll(".lazy"))}get host(){return n(this)}};oe.style="";const ae='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-off</title>\n<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>\n</svg>\n',re=class{constructor(i){t(this,i),this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.sorryForLeavingText=salla.lang.get("pages.profile.warning_for_deactivate"),this.warningText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account"),this.buttonLoading=!1,this.isNotifiable=!1,salla.lang.onLoaded((()=>{this.deactivateAccount=salla.lang.get("pages.profile.deactivate_account"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.deactivateDesc=salla.lang.get("pages.profile.deactivate_account_description"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description"),this.warningText=salla.lang.get("pages.profile.warning_for_deactivate"),this.sorryForLeavingText=salla.lang.get("pages.profile.sorry_for_leaving"),this.keepAccount=salla.lang.get("pages.profile.keep_account")}))}toggleNotification(t){salla.profile.updateSettings({is_notifiable:t.target.checked})}capitalizeText(t){return t.charAt(0).toUpperCase()+t.slice(1)}openDeactivateModal(){this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount)),this.confirmationModal.open()}async deleteAccount(){await salla.profile.delete().finally((()=>this.confirmationModal.close()))}render(){return i(e,{class:"s-user-settings-wrapper"},i("div",{class:"s-user-settings-section"},i("salla-list-tile",null,i("div",{slot:"icon",class:"s-user-settings-section-icon"},i("span",{innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),i("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),i("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),i("div",{slot:"action",class:"s-user-settings-section-action"},i("label",{class:"s-toggle"},i("input",{class:"s-toggle-input",checked:this.isNotifiable,onChange:t=>this.toggleNotification(t),type:"checkbox"}),i("div",{class:"s-toggle-switcher"}))))),i("div",{class:"s-user-settings-section s-user-settings-section-deactivate-user"},i("salla-list-tile",null,i("div",{slot:"icon",class:"s-user-settings-section-icon"},i("span",{innerHTML:ae})),i("div",{slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deactivateAccount)),i("div",{slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.deactivateDesc)),i("div",{slot:"action",class:"s-user-settings-section-action"},i("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeactivateModal()},this.capitalizeText(this.deactivateAccount))))),i("salla-modal",{width:"sm",subTitle:this.capitalizeText(this.sorryForLeavingText),ref:t=>this.confirmationModal=t},i("span",{slot:"icon",class:"s-user-settings-confirmation-icon",innerHTML:ae}),i("div",{class:"s-user-settings-confirmation"},i("div",{class:"s-user-settings-confirmation-warning"},this.capitalizeText(this.warningText)),i("div",{class:"s-user-settings-confirmation-actions"},i("salla-button",{width:"wide",onClick:()=>this.confirmationModal.close()},this.capitalizeText(this.keepAccount)),i("salla-button",{fill:"outline",loading:this.buttonLoading,width:"wide",onClick:()=>this.deleteAccount()},this.capitalizeText(this.deactivateAccount))))))}};re.style="";const se=class{constructor(i){t(this,i),this.verified=o(this,"verified",7),this.translationLoaded=!1,this.display="modal",this.type="mobile",this.autoReload=!0,this.supportWebAuth=!0,this.resendAfter=30,this.isProfileVerify=!1,salla.lang.onLoaded((()=>{var t;this.translationLoaded=!0,this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type),null===(t=this.modal)||void 0===t||t.setTitle(this.title)})),"inline"!=this.display?(salla.event.on("profile::verification",(t=>{var i;this.isProfileVerify=!0,this.open(t),this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type),null===(i=this.modal)||void 0===i||i.setTitle(this.title)})),salla.event.on("modalClosed",(()=>{this.resendAfter=0,this.timer.innerHTML="30 : 00"}))):this.modal={open:()=>"",close:()=>"",setTitle:()=>""}}handleKeyUp(t){var i,e,n,o;if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(t.key))return;let a=t.keyCode||t.charCode;t.target.value?(null===(i=t.target.nextElementSibling)||void 0===i||i.focus(),null===(e=t.target.nextElementSibling)||void 0===e||e.select()):[8,46].includes(a)&&(null===(n=t.target.previousElementSibling)||void 0===n||n.focus(),null===(o=t.target.previousElementSibling)||void 0===o||o.select()),this.toggleOTPSubmit()}handlePaste(t){let i=salla.helpers.number(t.clipboardData.getData("text")).replace(/[^0-9.]/g,"").replace("..",".");this.otpInputs.forEach(((t,e)=>t.value=i[e]||"")),this.toggleOTPSubmit(),setTimeout((()=>this.otpInputs[3].focus()),100)}async getCode(){return this.code.value}async open(t){var i;this.data=t,this.data.type=this.data.type||this.type,this.type=this.data.type,this.resendTimer(),this.otpInputs=this.body.querySelectorAll(".s-verify-input"),this.reset(),"modal"==this.display&&(null===(i=this.modal)||void 0===i||i.setTitle(this.title)),this.modal.open(),setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let t=[];if(this.otpInputs.forEach((i=>i.value&&t.push(i.value))),this.code.value=t.join(""),4===t.length)return this.btn.disable(),void this.btn.click();this.btn.enable()}reset(){this.otpInputs.forEach((t=>t.value="")),this.code.value="",this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block",this.resend.style.display="none",this.resendAfter=30;let t=setInterval((()=>{this.resendAfter<=0?(clearInterval(t),this.resend.style.display="block",this.resendMessage.style.display="none"):(this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`,this.resendAfter--)}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((t=>t.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4)return this.otpInputs[this.code.value.length].focus(),void salla.log("Trying to submit without 4 digits!");let t=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(t):salla.auth.verify(t,this.supportWebAuth))).then((t=>this.verified.emit(t))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((t=>{salla.logger.error(t),this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return"inline"==this.display?i(e,null,this.myBody()):i("salla-modal",{width:"xs",class:"s-verify",ref:t=>this.modal=t,"modal-title":this.title},i("span",{slot:"icon",innerHTML:"mobile"==this.type?'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n':bi}),this.myBody())}myBody(){return i("div",{class:"s-verify-body",ref:t=>this.body=t},i("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),i("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:t=>this.code=t}),i("div",{class:"s-verify-codes",dir:"ltr"},[1,2,3,4].map((()=>i("input",{type:"tel",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",class:"s-verify-input",onInput:t=>salla.helpers.inputDigitsOnly(t.target),onPaste:t=>this.handlePaste(t),onKeyUp:t=>this.handleKeyUp(t),required:!0})))),i("div",{slot:"footer",class:"s-verify-footer"},i("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:!0,onClick:()=>this.submit(),ref:t=>this.btn=t},salla.lang.get("pages.profile.verify")),i("p",{class:"s-verify-resend-message",ref:t=>this.resendMessage=t},salla.lang.get("blocks.header.resend_after"),i("b",{class:"s-verify-timer",ref:t=>this.timer=t})),i("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:t=>this.resend=t},salla.lang.get("blocks.comments.submit"))),i("slot",{name:"after-footer"}))}get host(){return n(this)}};se.style="salla-verify{display:block}";export{l as salla_button,pt as salla_cart_summary,Tt as salla_color_picker,It as salla_comment_form,At as salla_conditional_fields,ei as salla_datetime_picker,pi as salla_file_upload,di as salla_gifting,gi as salla_infinite_scroll,_i as salla_list_tile,mi as salla_loading,vi as salla_localization_modal,ki as salla_login_modal,Ti as salla_loyalty,Mi as salla_map,Ri as salla_modal,Oi as salla_offer_modal,Si as salla_placeholder,Ci as salla_product_availability,zi as salla_product_options,Ni as salla_product_size_guide,Bi as salla_quantity_input,Fi as salla_quick_order,ji as salla_rating_modal,Hi as salla_rating_stars,Wi as salla_scopes,qi as salla_search,Zi as salla_skeleton,Xi as salla_slider,Qi as salla_social_share,Ji as salla_tab_content,te as salla_tab_header,ie as salla_tabs,ne as salla_tel_input,oe as salla_user_menu,re as salla_user_settings,se as salla_verify}
|