1import{_ as Ue,a3 as or,e as p,D as We,f as v,i as a,A as kt,k as V,Z as Ts,j as je,u as He,F as fe,m as ee,t as B,T as at,b as Oe,z as Be,q as Fe,p as Ge,g as ar,l as Ae,s as on,C as an,E as Dt,M as Mn,v as Cs,K as es,P as lr,I as ur,U as xn,G as nn,y as cr}from"./Timer-BATgTYq_.js";const dr={mixins:[or],props:{show_after_seconds:{type:Number,default:15},modal_name:{type:String,default:""},expire_time:{type:Number,default:null}},data(){return{is_visible:!1,cookieKey:this.modal_name}},methods:{close(){this.is_visible=!1},shouldShowMessage(){return!this.getCookie("consent_level",!0)||/bot|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex/i.test(navigator.userAgent)?!1:!this.getCookie("shown")&&!this.getCookie("clicked")}},mounted(){setTimeout(()=>{this.shouldShowMessage()==!0&&(this.is_visible=!0,this.saveCookie("shown",1,this.expire_time||360*60*60*1e3))},this.show_after_seconds*1e3)}},hr={key:0,class:"modal modal-bg modal-register-seller",tabindex:"-1",style:{display:"block"}},fr={class:"modal-dialog modal-md"},pr={class:"modal-content relative"},mr={key:0,class:"modal-header"},vr={key:1,class:"modal-header-image"};function gr(n,t,r,k,l,f){return p(),We(Ts,{to:"body"},[l.is_visible?(p(),v("div",hr,[a("div",fr,[a("div",pr,[a("button",{type:"button",class:"modal-close-button","aria-label":"Sulje",onClick:t[0]||(t[0]=h=>f.close())},[...t[1]||(t[1]=[a("span",{"aria-hidden":"true"},[a("i",{class:"fa fa-times"})],-1)])]),n.$slots.header?(p(),v("div",mr,[kt(n.$slots,"header")])):V("",!0),n.$slots.header_image?(p(),v("div",vr,[kt(n.$slots,"header_image")])):V("",!0),kt(n.$slots,"body")])])])):V("",!0)])}const Qu=Ue(dr,[["render",gr]]);const mt=n=>typeof n=="string";const Yt=n=>n&&n!==null&&n instanceof Element&&"nodeType"in n;const br=function(n){if(!(n&&n instanceof Element&&n.offsetParent))return!1;let t=!1,r=!1;if(n.scrollWidth>n.clientWidth){const k=window.getComputedStyle(n).overflowX,l=k.indexOf("hidden")!==-1,f=k.indexOf("clip")!==-1,h=k.indexOf("visible")!==-1;t=!l&&!f&&!h}if(n.scrollHeight>n.clientHeight){const k=window.getComputedStyle(n).overflowY,l=k.indexOf("hidden")!==-1,f=k.indexOf("clip")!==-1,h=k.indexOf("visible")!==-1;r=!l&&!f&&!h}return t||r},sn=function(n,t=void 0){return!n||n===document.body||t&&n===t?null:br(n)?n:sn(n.parentElement,t)};const $t=function(n){var t=new DOMParser().parseFromString(n,"text/html").body;if(t.childElementCount>1){for(var r=document.createElement("div");t.firstChild;)r.appendChild(t.firstChild);return r}let k=t.firstChild;return!k||k instanceof HTMLElement?k:((r=document.createElement("div")).appendChild(k),r)};const qe=function(n=0,t=0,r=0){return Math.max(Math.min(t,r),n)};const Ye=n=>typeof n=="object"&&n!==null&&n.constructor===Object&&Object.prototype.toString.call(n)==="[object Object]";function ts(n){return Ye(n)||Array.isArray(n)}function Ln(n,t){const r=Object.keys(n),k=Object.keys(t);return r.length===k.length&&r.every(l=>{const f=n[l],h=t[l];return typeof f=="function"?`${f}`==`${h}`:ts(f)&&ts(h)?Ln(f,h):f===h})}const Es=function(n){for(const t of ln)t.getState()===ze.Running&&t.tick(Tn?n-Tn:0);Tn=n,wt=window.requestAnimationFrame(Es)};var ze,ot,_t;(function(n){n[n.Initializing=0]="Initializing",n[n.Running=1]="Running",n[n.Paused=2]="Paused",n[n.Completed=3]="Completed",n[n.Destroyed=4]="Destroyed"})(ze||(ze={})),(function(n){n[n.Spring=0]="Spring",n[n.Ease=1]="Ease"})(ot||(ot={})),(function(n){n[n.Loop=0]="Loop",n[n.Reverse=1]="Reverse"})(_t||(_t={}));const ln=new Set;let wt=null,Tn=0;function Bt(){let n=ze.Initializing,t=ot.Ease,r=0,k=0,l=Bt.Easings.Linear,f=500,h=0,L=0,A=0,w=0,T=1/0,U=.01,b=.01,d=!1,E={},H=null,I={},D={},O={},g=0,M=0,P=_t.Loop,Y=Bt.Easings.Linear;const $=new Map;function te(K,...le){for(const ue of $.get(K)||[])ue(...le)}function oe(K){return k=0,K?H=setTimeout(()=>{re()},K):re(),J}function re(){n=ze.Running,te("start",I,D)}function _e(){if(n=ze.Completed,O={},te("end",I),n===ze.Completed)if(r<g){if(r++,P===_t.Reverse){const K=Object.assign({},E);E=Object.assign({},D),D=K}oe(M)}else r=0;return J}const J={getState:function(){return n},easing:function(K){return l=K,t=ot.Ease,O={},J},duration:function(K){return f=K,J},spring:function(K={}){t=ot.Spring;const le={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0},{velocity:ue,mass:z,tension:ke,friction:Pe,restDelta:de,restSpeed:j,maxSpeed:ne,clamp:Q}=Object.assign(Object.assign({},le),K);
1return h=ue,L=z,A=ke,w=Pe,b=de,U=j,T=ne,d=Q,O={},J},isRunning:function(){return n===ze.Running},isSpring:function(){return t===ot.Spring},from:function(K){return I=Object.assign({},K),J},to:function(K){return D=K,J},repeat:function(K,le=0,ue=_t.Loop,z){return g=K,M=le,P=ue,Y=z||l,J},on:function(K,le){var ue,z;return ue=K,z=le,$.set(ue,[...$.get(ue)||[],z]),J},off:function(K,le){var ue,z;return ue=K,z=le,$.has(ue)&&$.set(ue,$.get(ue).filter(ke=>ke!==z)),J},start:function(K){return Ln(I,D)||(n=ze.Initializing,E=Object.assign({},I),ln.add(this),wt||(wt=window.requestAnimationFrame(Es)),oe(K)),J},pause:function(){return H&&(clearTimeout(H),H=null),n===ze.Running&&(n=ze.Paused,te("pause",I)),J},end:_e,tick:function(K){K>50&&(K=50),k+=K;let le=0,ue=!1;if(n!==ze.Running)return J;if(t===ot.Ease){le=qe(0,k/f,1),ue=le===1;const ke=P===_t.Reverse?Y:l;for(const Pe in I)I[Pe]=E[Pe]+(D[Pe]-E[Pe])*ke(le)}if(t===ot.Spring){const ke=.001*K;let Pe=0;for(const de in I){const j=D[de];let ne=I[de];if(typeof j!="number"||isNaN(j)||typeof ne!="number"||isNaN(ne))continue;if(Math.abs(j-ne)<=b){I[de]=j,O[de]=0;continue}O[de]||(typeof h=="object"&&typeof h[de]=="number"?O[de]=h[de]:O[de]=typeof h=="number"?h:0);let Q=O[de];Q=qe(-1*Math.abs(T),Q,Math.abs(T));const G=Q*L*w;Q+=((ne>j?-1:1)*(Math.abs(j-ne)*A)-G)/L*ke,ne+=Q*ke;const we=I[de]>j?ne<j:ne>j;let Le=Math.abs(Q)<U&&Math.abs(j-ne)<=b;d&&we&&(Le=!0),Le?(ne=j,Q=0):Pe++,I[de]=ne,O[de]=Q}ue=!Pe}const z=Object.assign({},D);return te("step",I,E,D,le),ue&&n===ze.Running&&Ln(D,z)&&(n=ze.Completed,_e()),J},getStartValues:function(){return E},getCurrentValues:function(){return I},getCurrentVelocities:function(){return O},getEndValues:function(){return D},destroy:function(){n=ze.Destroyed,H&&(clearTimeout(H),H=null),E=I=D={},ln.delete(this)}};return J}Bt.destroy=()=>{for(const n of ln)n.destroy();wt&&(cancelAnimationFrame(wt),wt=null)},Bt.Easings={Linear:function(n){return n},EaseIn:function(n){return n===0?0:Math.pow(2,10*n-10)},EaseOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},EaseInOut:function(n){return n===0?0:n===1?1:n<.5?Math.pow(2,20*n-10)/2:(2-Math.pow(2,-20*n+10))/2}};function rn(n){return typeof TouchEvent<"u"&&n instanceof TouchEvent}function On(n,t){const r=[],k=rn(n)?n[t]:n instanceof MouseEvent&&(t==="changedTouches"||n.type!=="mouseup")?[n]:[];for(const l of k)r.push({x:l.clientX,y:l.clientY,ts:Date.now()});return r}function ns(n){return On(n,"touches")}function ss(n){return On(n,"targetTouches")}function yr(n){return On(n,"changedTouches")}function ft(n){const t=n[0],r=n[1]||t;return{x:(t.x+r.x)/2,y:(t.y+r.y)/2,ts:r.ts}}function Jt(n){const t=n[0],r=n[1]||n[0];return t&&r?-1*Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)):0}const is=n=>{n.cancelable&&n.preventDefault()},it={passive:!1},_r={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]};let Zt=!1,Ft=!0;const As=(n,t)=>{let r,k,l,f,h,L=Object.assign(Object.assign({},_r),t),A=[],w=[],T=[],U=!1,b=!1,d=!1,E=!1,H=0,I=0,D=0,O=0,g=0,M=0,P=0,Y=0,$=0,te=[];const oe=new Map;function re(j){const ne=Jt(w),Q=Jt(T),G=ne&&Q?ne/Q:0,we=Math.abs(P)>Math.abs(Y)?P:Y,Le={srcEvent:r,isPanRecognized:U,isSwipeRecognized:b,firstTouch:A,previousTouch:T,currentTouch:w,deltaX:D,deltaY:O,offsetX:g,offsetY:M,velocityX:P,velocityY:Y,velocity:we,angle:$,axis:l,scale:G,center:k};for(const $e of oe.get(j)||[])$e(Le)}function _e(j){const ne=j.target,Q=j.composedPath()[0],G=L.ignore.join(","),we=Le=>Le&&Le instanceof HTMLElement&&(Le.matches(G)||Le.closest(G));if(we(ne)||we(Q))return!1}function J(j){const ne=Date.now();if(te=te.filter(Q=>!Q.ts||Q.ts>ne-100),j&&te.push(j),P=0,Y=0,te.length>3){const Q=te[0],G=te[te.length-1];if(Q&&G){const we=G.x-Q.x,Le=G.y-Q.y,$e=Q.ts&&G.ts?G.ts-Q.ts:0;$e>0&&(P=Math.abs(we)>3?we/($e/30):0,Y=Math.abs(Le)>3?Le/($e/30):0)}}}function K(j){if(_e(j)===!1)return;if(typeof MouseEvent<"u"&&j instanceof MouseEvent){if(Zt)return}else Zt=!0;if(typeof MouseEvent<"u"&&j instanceof MouseEvent){if(!j.buttons||j.button!==0)return;is(j)}j instanceof MouseEvent&&(window.addEventListener("mousemove",le),window.addEventListener("mouseup",ue)),window.addEventListener("blur",z),r=j,w=ss(j),A=[...w],T=[],I=w.length,k=ft(w),I===1&&(U=!1,b=!1,d=!1),I&&J(ft(w));const ne=Date.now(),Q=ne-(H||ne);E=Q>0&&Q<=250&&I===1,H=ne,clearTimeout(f),re("start")}function le(j){var ne;if(!A.length||j.defaultPrevented||_e(j)===!1)return;r=j,T=[...w],w=ns(j);const Q=ft(T),G=ft(ns(j));if(J(G),I=w.length,k=G,T.length===w.length?(D=G.x-Q.x,O=G.y-Q.y):(D=0,O=0),A.length){const we=ft(A);g=G.x-we.x,M=G.y-we.y}if(w.length>1){const we=Jt(w),Le=Jt(T);Math.abs(we-Le)>
1=.1&&(d=!0,re("pinch"))}U||(U=Math.abs(g)>=L.panThreshold||Math.abs(M)>=L.panThreshold,U&&(Ft=!1,clearTimeout(h),h=void 0,$=Math.abs(180*Math.atan2(M,g)/Math.PI),l=$>45&&$<135?"y":"x",A=[...w],T=[...w],g=0,M=0,D=0,O=0,(ne=window.getSelection())===null||ne===void 0||ne.removeAllRanges(),re("panstart"))),U&&(D||O)&&re("pan"),re("move")}function ue(j){if(r=j,!A.length)return;const ne=ss(j),Q=yr(j);if(I=ne.length,k=ft(Q),Q.length&&J(ft(Q)),T=[...w],w=[...ne],A=[...ne],I>0)re("end"),U=!1,b=!1,te=[];else{const G=L.swipeThreshold;(Math.abs(P)>G||Math.abs(Y)>G)&&(b=!0),U&&re("panend"),b&&re("swipe"),U||b||d||(re("tap"),E?re("doubleTap"):f=setTimeout(function(){re("singleTap")},250)),re("end"),ke()}}function z(){clearTimeout(f),ke(),U&&re("panend"),re("end")}function ke(){Zt=!1,U=!1,b=!1,E=!1,I=0,te=[],w=[],T=[],A=[],D=0,O=0,g=0,M=0,P=0,Y=0,$=0,l=void 0,window.removeEventListener("mousemove",le),window.removeEventListener("mouseup",ue),window.removeEventListener("blur",z),Ft||h||(h=setTimeout(()=>{Ft=!0,h=void 0},100))}function Pe(j){const ne=j.target;Zt=!1,ne&&!j.defaultPrevented&&(Ft||(is(j),j.stopPropagation()))}const de={init:function(){return n&&(n.addEventListener("click",Pe,it),n.addEventListener("mousedown",K,it),n.addEventListener("touchstart",K,it),n.addEventListener("touchmove",le,it),n.addEventListener("touchend",ue),n.addEventListener("touchcancel",ue)),de},on:function(j,ne){return(function(Q,G){oe.set(Q,[...oe.get(Q)||[],G])})(j,ne),de},off:function(j,ne){return oe.has(j)&&oe.set(j,oe.get(j).filter(Q=>Q!==ne)),de},isPointerDown:()=>I>0,destroy:function(){clearTimeout(f),clearTimeout(h),h=void 0,n&&(n.removeEventListener("click",Pe,it),n.removeEventListener("mousedown",K,it),n.removeEventListener("touchstart",K,it),n.removeEventListener("touchmove",le,it),n.removeEventListener("touchend",ue),n.removeEventListener("touchcancel",ue)),n=null,ke()}};return de};As.isClickAllowed=()=>Ft;const kr={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset",TOGGLE_FS:"Toggle fullscreen"};const ae=(n,t="")=>{n&&n.classList&&t.split(" ").forEach(r=>{r&&n.classList.add(r)})};const Ke=(n,t="")=>{n&&n.classList&&t.split(" ").forEach(r=>{r&&n.classList.remove(r)})};const rt=(n,t="",r)=>{n&&n.classList&&t.split(" ").forEach(k=>{k&&n.classList.toggle(k,r||!1)})};var un,rs;(function(n){n.Reset="reset",n.Zoom="zoom",n.ZoomIn="zoomIn",n.ZoomOut="zoomOut",n.ZoomTo="zoomTo",n.ToggleCover="toggleCover",n.ToggleFull="toggleFull",n.ToggleMax="toggleMax",n.IterateZoom="iterateZoom",n.Pan="pan",n.Swipe="swipe",n.Move="move",n.MoveLeft="moveLeft",n.MoveRight="moveRight",n.MoveUp="moveUp",n.MoveDown="moveDown",n.RotateCCW="rotateCCW",n.RotateCW="rotateCW",n.FlipX="flipX",n.FlipY="flipY",n.ToggleFS="toggleFS"})(un||(un={})),(function(n){n.Cover="cover",n.Full="full",n.Max="max"})(rs||(rs={}));un.ToggleFull,un.Zoom;const Cn=(n,t)=>{let r=[];return n.childNodes.forEach(k=>{k.nodeType!==Node.ELEMENT_NODE||t&&!k.matches(t)||r.push(k)}),r};const Ht=(n,...t)=>{const r=t.length;for(let k=0;k<r;k++){const l=t[k]||{};Object.entries(l).forEach(([f,h])=>{const L=Array.isArray(h)?[]:{};n[f]||Object.assign(n,{[f]:L}),Ye(h)?Object.assign(n[f],Ht(n[f],h)):Array.isArray(h)?Object.assign(n,{[f]:[...h]}):Object.assign(n,{[f]:h})})}return n};const os=function(n=0,t=0,r=0,k=0,l=0,f=!1){const h=(n-t)/(r-t)*(l-k)+k;return f?k<l?qe(k,h,l):qe(l,h,k):h};const jn=Object.assign(Object.assign({},kr),{ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"});const pt=n=>{n.cancelable&&n.preventDefault()},Nt={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!0,infinite:!0,initialPage:0,l10n:jn,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1};let as,En,ls=0;const cn=(n,t={},r={})=>{ls++;let k,l,f,h,L,A=0,w=Object.assign({},Nt),T=Object.assign({},Nt),U={},b=null,d=null,E=0,H=0,I=0,D=!1,O=!1,g=!1,M="height",P=0,Y=!0,$=0,te=0,oe=0,re=0,_e="*",J=[],K=[];const le=new Set;let ue=[],z=[],ke=0,Pe=0,de=0;function j(c,...m){let y=T[c];return y&&y instanceof Function?y(ve,...m):y}function ne(c,m=[]){const y=j("l10n")||{};c=String(c).replace(/\{\{(\w+)\}\}/g,(_,F)=>y[F]||_);for(let _=0;_<m.length;_++)c=c.split(m[_][0]).join(m[_][1]);return c=c.replace(/\{\{(.*?)\}\}/g,(_,F)=>F)}const Q=new Map;function G(c,...m){const y=[...Q.get(c)||[]];T.on&&y.push(T.on[c]);for(const _ of y)_&&_ instanceof Function&&_(ve,...m);c==="click"&&ut(m[0]),c!=="*"&&G("*",c,...m)}function we(){var c,m;const y=Ht({},Nt,w);let _="";const F=w.breakpoints||{};for(const[C,S]of Object.entries(F))window.matchMedia(C).matches&&(_+=C,Ht(y,S));if(L===void 0||_!==L){if(L=_,A!==0){let C=(m=(c=z[$])===null||c===void 0?void 0:c.slides[0])===null||m===void 0?void 0:m.index;C===void 0&&(C=T.initialSlide),y.initialSlide=C,y.slides=[];for(const S of J)S.isVirtual&&y.slides.push(S)}yt(),T=y,j("enabled")!==!1&&(A=0,G("init"),(function(){for(const[C,S]of Object.entries(Object.assign(Object.assign({},r),T.plugins||{})))if(C&&!U[C]&&S instanceof Function){const R=S();R.init(ve,cn),U[C]=R}G("initPlugins")})(),(function(){if(!b)return;const C=j("classes")||{};ae(b,C.container);const S=j("style");if(S&&Ye(S))for(const[R,q]of Object.entries(S))b.style.setProperty(R,q);d=Array.from(b.querySelectorAll(`.${C.viewport}`)).filter(R=>R.closest(`.${C.container}`)===b).pop()||null,d||(d=document.createElement("div"),ae(d,C.viewport),d.append(...Cn(b,`.${C.slide}`)),b.insertAdjacentElement("afterbegin",d)),b.carousel=ve,G("initLayout")})(),(function(){if(!d)return;const C=j("classes")||{};J=[],[...Cn(d,`.${C.slide}
1`)].forEach(S=>{if(S.parentElement){const R=Tt(Object.assign({el:S,isVirtual:!1},S.dataset||{}));G("createSlide",R),J.push(R)}}),zt();for(const S of J)G("addSlide",S);Qe(j("slides"));for(const S of J){const R=S.el;R?.parentElement===d&&(ae(R,T.classes.slide),ae(R,S.class),bt(S),G("attachSlideEl",S))}G("initSlides")})(),et(),A=1,ae(b,(j("classes")||{}).isEnabled||""),Ve(),Te(),l=Bt().on("start",()=>{k&&k.isPointerDown()||(lt(),Ve())}).on("step",C=>{const S=P;P=C.pos,P!==S&&(Y=!1,Ve())}).on("end",C=>{k?.isPointerDown()||(P=C.pos,l&&!D&&(P<oe||P>re)?l.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:P}).to({pos:qe(oe,P,re)}).start():Y||(Y=!0,G("settle")))}),$e(),(function(){if(!b||!d)return;b.addEventListener("click",Pt),document.addEventListener("mousemove",Le),En||(En=function(S){var R,q;const W=(q=(R=S.target)===null||R===void 0?void 0:R.dataset)===null||q===void 0?void 0:q.carouselTarget;if(W){const Z=document.getElementById(`${W.split("#").pop()}`),ce=Z?.carousel;ce?.emit("click",S)}},document.addEventListener("click",En));const C=d.getBoundingClientRect();if(ke=C.height,Pe=C.width,!f){let S=null;f=new ResizeObserver(()=>{S||(S=requestAnimationFrame(()=>{(function(){if(A!==1||!d)return;const R=z.length,q=d.getBoundingClientRect(),W=q.height,Z=q.width;R>1&&(g&&Math.abs(W-ke)<.5||!g&&Math.abs(Z-Pe)<.5)||(et(),$e(),ke=W,Pe=Z,g&&!ke||!g&&!Pe||b&&d&&(R===z.length&&k?.isPointerDown()||(j("dragFree")&&(D||P>oe&&P<re)?(lt(),Ve()):tt($,{transition:!1}))))})(),S=null}))}),f.observe(d)}})(),G("ready"))}}function Le(c){as=c}function $e(){j("gestures")===!1?k&&(k.destroy(),k=void 0):k||(function(){const c=j("gestures");!k&&c!==!1&&d&&(k=As(d,c).on("start",m=>{var y,_;if(!l||j("gestures",m)===!1)return;const{srcEvent:F}=m;g&&rn(F)&&!sn(F.target)&&pt(F),l.pause(),l.getCurrentVelocities().pos=0;const C=(y=z[$])===null||y===void 0?void 0:y.slides[0],S=C?.el;C&&le.has(C.index)&&S&&(P=C.offset||0,P+=((function(R){const q=window.getComputedStyle(R),W=new DOMMatrixReadOnly(q.transform);return{width:W.m41||0,height:W.m42||0}})(S)[M]||0)*(O&&!g?1:-1)),Et(),D||(P<oe||P>re)&&l.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:((_=l.getCurrentVelocities())===null||_===void 0?void 0:_.pos)||0,restDelta:1,restSpeed:1}).from({pos:P}).to({pos:qe(oe,P,re)}).start()}).on("move",m=>{var y,_;if(j("gestures",m)===!1)return;const{srcEvent:F,axis:C,deltaX:S,deltaY:R}=m;if(rn(F)&&((y=F.touches)===null||y===void 0?void 0:y.length)>1)return;const q=F.target,W=sn(q),Z=W?W.scrollHeight>W.clientHeight?"y":"x":void 0;if(W&&W!==d&&(!C||C===Z))return;if(!C)return pt(F),F.stopPropagation(),void F.stopImmediatePropagation();if(C==="y"&&!g||C==="x"&&g||(pt(F),F.stopPropagation(),!l))return;const ce=O&&!g?1:-1,be=g?R:S;let ye=l?.isRunning()?l.getEndValues().pos:P,Se=1;D||(ye<=oe&&be*ce<0?(Se=Math.max(.01,1-(Math.abs(1/Ne()*Math.abs(ye-oe))||0)),Se*=.2):ye>=re&&be*ce>0&&(Se=Math.max(.01,1-(Math.abs(1/Ne()*Math.abs(ye-re))||0)),Se*=.2)),ye+=be*Se*ce,l.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:((_=l.getCurrentVelocities())===null||_===void 0?void 0:_.pos)||0,restDelta:1,restSpeed:1}).from({pos:P}).to({pos:ye}).start()}).on("panstart",m=>{j("gestures",m)!==!1&&m?.axis===(g?"y":"x")&&ae(d,"is-dragging")}).on("panend",m=>{j("gestures",m)!==!1&&Ke(d,"is-dragging")}).on("end",m=>{var y,_;if(j("gestures",m)===!1)return;const{srcEvent:F,axis:C,velocityX:S,velocityY:R,currentTouch:q}=m;if(q.length>0||!l)return;const W=F.target,Z=sn(W),ce=Z?Z.scrollHeight>Z.clientHeight?"y":"x":void 0,be=Z&&(!C||C===ce);g&&rn(F)&&!C&&Pt(F);const ye=z.length,Se=j("dragFree");if(!ye)return;let xe=be?0:j("vertical")?R:S;C!==(g?"y":"x")&&(xe=0);let Ie=l?.isRunning()?l.getEndValues().pos:P;const Me=O&&!g?1:-1;if(be||(Ie+=xe*(Se?5:1)*Me),!D&&(xe*Me<=0&&Ie<oe||xe*Me>=0&&Ie>re)){let Ce=0;return Math.abs(xe)>0&&(Ce=2*Math.abs(xe),Ce=Math.min(.3*Ne(),Ce)),Ie=qe(oe+-1*Ce,Ie,re+Ce),void l.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*xe,restDelta:1,restSpeed:1}).from({pos:P}).to({pos:Ie}).start()}if(Se||!((y=U.Autoscroll)===null||y===void 0)&&y.isEnabled())return void(Math.abs(xe)>10?l.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*xe,restDelta:1,restSpeed:1}).from({pos:P}).to({pos:Ie}).start():l.isRunning()||Y||(Y=!0,G("settle")));if(!Se&&!(!((_=U.Autoscroll)===null||_===void 0)&&_.isEnabled())&&(!m.offsetX&&!m.offsetY||C==="y"&&!g||C==="x"&&g))return void tt($,{transition:"tween"});let pe=St(Ie);Math.abs(xe)>10&&pe===$&&(pe+=xe>0?O&&!g?1:-1:O&&!g?-1:1),tt(pe,{transition:"tween",tween:{velocity:-1*xe}})}).init())})(),rt(d,"is-draggable",!!k&&z.length>0)}function vt(c="*"){var m;const y=[];for(const _ of J)(c==="*"||_.class&&_.class.includes(c)||_.el&&(!((m
1=_.el)===null||m===void 0)&&m.classList.contains(c)))&&y.push(_);h=void 0,_e=c,K=[...y]}function lt(){if(!l)return;const c=St(l?.isRunning()?l.getEndValues().pos:P);c!==$&&(h=$,$=c,bt(),Te(),Re(),G("change",$,h))}function Te(){var c,m;if(!b)return;for(const S of b.querySelectorAll("[data-carousel-index]"))S.innerHTML=$+"";for(const S of b.querySelectorAll("[data-carousel-page]"))S.innerHTML=$+1+"";for(const S of b.querySelectorAll("[data-carousel-pages]"))S.innerHTML=z.length+"";const y=j("classes")||{},_=Array.from(b.querySelectorAll("[data-carousel-go-to]")).filter(S=>S.closest(`.${y.container}`)===b);for(const S of _)parseInt(((c=S.dataset)===null||c===void 0?void 0:c.carouselGoTo)||"-1",10)===$?S.setAttribute("aria-current","true"):S.removeAttribute("aria-current");for(const S of b.querySelectorAll("[data-carousel-go-prev]"))S.toggleAttribute("aria-disabled",!Ot()),Ot()?S.removeAttribute("tabindex"):S.setAttribute("tabindex","-1");for(const S of b.querySelectorAll("[data-carousel-go-next]"))S.toggleAttribute("aria-disabled",!jt()),jt()?S.removeAttribute("tabindex"):S.setAttribute("tabindex","-1");let F=!1;const C=(m=z[$])===null||m===void 0?void 0:m.slides[0];C&&(C.downloadSrc||C.type==="image"&&C.src)&&(F=!0);for(const S of b.querySelectorAll("[data-carousel-download]"))S.toggleAttribute("aria-disabled",!F)}function Re(c){var m;c||(c=(m=z[$])===null||m===void 0?void 0:m.slides[0]);const y=c?.el;if(y)for(const _ of y.querySelectorAll("[data-slide-index]"))_.innerHTML=c.index+1+""}function St(c){var m,y,_;if(!z.length)return 0;const F=Xe();let C=c;D?C-=Math.floor((c-((m=z[0])===null||m===void 0?void 0:m.pos))/F)*F||0:C=qe((y=z[0])===null||y===void 0?void 0:y.pos,c,(_=z[z.length-1])===null||_===void 0?void 0:_.pos);const S=new Map;let R=0;for(const W of z){const Z=Math.abs(W.pos-C),ce=Math.abs(W.pos-C-F),be=Math.abs(W.pos-C+F),ye=Math.min(Z,ce,be);S.set(R,ye),R++}const q=S.size>0?[...S.entries()].reduce((W,Z)=>Z[1]<W[1]?Z:W):[$,0];return parseInt(q[0])}function xt(){return de}function Ne(){return E}function Xe(c=!0){return K.length?K.reduce((m,y)=>m+y.dim,0)+(K.length-(D&&c?0:1))*de:0}function Vt(c){const m=Xe(),y=Ne();if(!m||!d||!y)return[];const _=[];c=c===void 0?P:c,D&&(c-=Math.floor(c/m)*m||0);let F=0;for(let C of K){const S=(R=0)=>{_.indexOf(C)>-1||(C.pos=F-c+R||0,C.offset+R>c-C.dim-H+.51&&C.offset+R<c+y+I-.51&&_.push(C))};C.offset=F,D&&(S(m),S(-1*m)),S(),F+=C.dim+de}return _}function Qe(c,m){const y=[];for(const _ of Array.isArray(c)?c:[c]){const F=Tt(Object.assign(Object.assign({},_),{isVirtual:!0}));F.el||(F.el=document.createElement("div")),G("createSlide",F),y.push(F)}J.splice(m===void 0?J.length:m,0,...y),zt();for(const _ of y)G("addSlide",_),fn(_);return vt(_e),y}function Tt(c){return(mt(c)||c instanceof HTMLElement)&&(c={html:c}),Object.assign({index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:""},c)}function fn(c){let m=c.el;if(!c||!m)return;const y=c.html?c.html instanceof HTMLElement?c.html:$t(c.html):void 0;y&&(ae(y,"f-html"),c.htmlEl=y,ae(m,"has-html"),m.append(y),G("contentReady",c))}function gt(c){if(!d||!c)return;let m=c.el;if(m){if(m.setAttribute("index",c.index+""),m.parentElement!==d){let y;ae(m,T.classes.slide),ae(m,c.class),bt(c);for(const _ of J)if(_.index>c.index){y=_.el;break}d.insertBefore(m,y&&d.contains(y)?y:null),G("attachSlideEl",c)}return Re(c),m}}function Ct(c){const m=c?.el;m&&(m.remove(),Je(m),G("detachSlideEl",c))}function zt(){for(let c=0;c<J.length;c++){const m=J[c],y=m.el;y&&(m.index!==c&&Je(y),y.setAttribute("index",`${c}`)),m.index=c}}function et(){var c,m,y,_,F;if(!b||!d)return;O=j("rtl"),g=j("vertical"),M=g?"height":"width";const C=j("classes");if(rt(b,C.isLTR,!O),rt(b,C.isRTL,O),rt(b,C.isHorizontal,!g),rt(b,C.isVertical,g),rt(b,C.hasAdaptiveHeight,j("adaptiveHeight")),E=0,H=0,I=0,de=0,d){d.childElementCount||(d.style.display="grid");const R=d.getBoundingClientRect();E=d.getBoundingClientRect()[M]||0;const q=window.getComputedStyle(d);de=parseFloat(q.getPropertyValue("--f-carousel-gap"))||0,q.getPropertyValue("overflow-"+(g?"y":"x"))==="visible"&&(H=Math.abs(R[g?"top":"left"]),I=Math.abs(window[g?"innerHe
1ight":"innerWidth"]-R[g?"bottom":"right"])),d.style.display=""}if(!E)return;const S=(function(){let R=0;if(d){let q=document.createElement("div");q.style.display="block",ae(q,T.classes.slide),d.appendChild(q),R=q.getBoundingClientRect()[M],q.remove(),q=void 0}return R})();for(const R of K){const q=R.el;let W=0;if(!R.isVirtual&&q&&Yt(q)){let Z=!1;q.parentElement&&q.parentElement===d||(d.appendChild(q),Z=!0),W=q.getBoundingClientRect()[M],Z&&((c=q.parentElement)===null||c===void 0||c.removeChild(q))}else W=S;R.dim=W}if(D=!1,j("infinite")){D=!0;const R=Xe();let q=E+H+I;for(let W=0;W<K.length;W++){const Z=((m=K[W])===null||m===void 0?void 0:m.dim)+de;if(R-Z<q&&R-Z-q<Z){D=!1;break}}}(function(){var R;if(!b)return;const q=Ne(),W=Xe(!1);let Z=j("slidesPerPage");Z=Z==="auto"?1/0:parseFloat(Z+""),z=[];let ce=0,be=0;for(const pe of K)(!z.length||ce+pe.dim-q>.05||be>=Z)&&(z.push({index:z.length,slides:[],dim:0,offset:0,pos:0}),ce=0,be=0),(R=z[z.length-1])===null||R===void 0||R.slides.push(pe),ce+=pe.dim+de,be++;const ye=j("center"),Se=j("fill");let xe=0;for(const pe of z){pe.dim=(pe.slides.length-1)*de;for(const Ce of pe.slides)pe.dim+=Ce.dim;pe.offset=xe,pe.pos=xe,ye!==!1&&(pe.pos-=.5*(q-pe.dim)),Se&&!D&&W>q&&(pe.pos=qe(0,pe.pos,W-q)),xe+=pe.dim+de}const Ie=[];let Me;for(const pe of z){const Ce=Object.assign({},pe);Me&&Math.abs(Ce.pos-Me.pos)<.1?(Me.dim+=Ce.dim,Me.slides=[...Me.slides,...Ce.slides]):(Me=Ce,Ce.index=Ie.length,Ie.push(Ce))}z=Ie,$=qe(0,$,z.length-1)})(),oe=((y=z[0])===null||y===void 0?void 0:y.pos)||0,re=((_=z[z.length-1])===null||_===void 0?void 0:_.pos)||0,A===0?(function(){var R;h=void 0,$=j("initialPage");const q=j("initialSlide")||void 0;q!==void 0&&($=ve.getPageIndex(q)||0),$=qe(0,$,z.length-1),P=((R=z[$])===null||R===void 0?void 0:R.pos)||0,te=P})():te=((F=z[$||0])===null||F===void 0?void 0:F.pos)||0,G("refresh"),Te()}function Je(c){if(!c||!Yt(c))return;const m=parseInt(c.getAttribute("index")||"-1");let y="";for(const F of Array.from(c.classList)){const C=F.match(/^f-(\w+)(Out|In)$/);C&&C[1]&&(y=C[1]+"")}if(!c||!y)return;const _=[`f-${y}Out`,`f-${y}In`,"to-prev","to-next","from-prev","from-next"];c.removeEventListener("animationend",At),Ke(c,_.join(" ")),le.delete(m)}function Et(){if(!d)return;const c=le.size>0;for(const m of K)Je(m.el);le.clear(),c&&Ve()}function At(c){var m;((m=c.animationName)===null||m===void 0?void 0:m.substring(0,2))==="f-"&&(Je(c.target),le.size||(Ke(b,"in-transition"),!Y&&Math.abs(ve.getPosition(!0)-te)<.5&&(Y=!0,G("settle"))),Ve())}function Pt(c){ut(c),G("click",c)}function ut(c){var m;if(c.defaultPrevented)return;const y=c.composedPath()[0];if(y.closest("[data-carousel-go-prev]"))return pt(c),void ve.prev();if(y.closest("[data-carousel-go-next]"))return pt(c),void ve.next();const _=y.closest("[data-carousel-go-to]");if(_)return pt(c),void ve.goTo(parseFloat(_.dataset.carouselGoTo||"")||0);if(y.closest("[data-carousel-download]")){pt(c);const F=(m=z[$])===null||m===void 0?void 0:m.slides[0];if(F&&(F.downloadSrc||F.type==="image"&&F.src)){const C=F.downloadFilename,S=document.createElement("a"),R=F.downloadSrc||F.src||"";S.href=R,S.target="_blank",S.download=C||R,S.click()}return}}function Lt(c){var m;const y=c.el;y&&((m=y.querySelector(".f-spinner"))===null||m===void 0||m.remove())}function ge(c){var m;const y=c.el;y&&((m=y.querySelector(".f-html.is-error"))===null||m===void 0||m.remove(),Ke(y,"has-error"))}function bt(c){var m;c||(c=(m=z[$])===null||m===void 0?void 0:m.slides[0]);const y=c?.el;if(!y)return;let _=j("formatCaption",c);_===void 0&&(_=c.caption),_=_||"";const F=j("captionEl");if(F&&F instanceof HTMLElement){if(c.index!==$)return;if(mt(_)&&(F.innerHTML=ne(_+"")),_ instanceof HTMLElement){if(_.parentElement===F)return;F.innerHTML="",_.parentElement&&(_=_.cloneNode(!0)),F.append(_)}return}if(!_)return;let C=c.captionEl||y.querySelector(".f-caption");!C&&_ instanceof HTMLElement&&_.classList.contains("f-caption")&&(C=_),C||(C=document.createElement("div"),ae(C,"f-caption"),mt(_)?C.innerHTML=ne(_+""):_ instanceof HTMLElement&&(_.parentElement&&(_=_.cloneNode(!0)),C.append(_)));const S=`f-caption-${ls}_${c.index}`;C.setAttribute("id",S),C.dataset.selectable="true",ae(y,"has-caption"),y.setAttribute("aria-labelledby",S),c.captionEl=C,y.insertAdjacentElement("beforeend",C)}function tt(c,m={}){var y,_;let{transition:F,tween:C}=Object.assign({transition:T.transition,tween:T.tween},m||{});if(!b||!l)return;const S=z.length;if(!S||(function(W,Z){var ce,be,ye;if(!(b&&E&&l&&Z&&mt(Z)&&Z!=="tween"))return!1;for(const pn of ue)if(E-pn.dim>.5)return!1;if(H>.5||I>.5)return;const Se=z.length;let xe=W>$?1:-1;W=D?(W%Se+Se)%Se:qe(0,W,Se-1),O&&(xe*=-1);const Ie=(ce=z[$])===null||ce===void 0?void 0:ce.slides[0],Me=Ie?.index,pe=(be=z[W])===null||be===void 0?void 0:be.slides[0],Ce=pe?.index,qt=(ye=z[W])===null||ye===void 0?void 0:ye.pos;if(Ce===void 0||Me===void 0||Me===Ce||P===qt||Math.abs(E-(pe?.dim||0))>1)return!1;Y=!1,l.pause(),Et(),ae(b,"in-transition"),P=te=qt;const nt=gt(Ie),st=gt(pe);return lt(),nt&&(le.add(Me),nt.style.transform="",nt.addEventListener("animationend",At),Ke(nt,T.classes.isSelected),nt.inert=!1,ae(nt,`f-${Z}Out to-${xe>0?"next":"prev"}`)),st&&(le.add(Ce),st.style.transform="",st.addEventListener("animationend",At),ae(st,T.classes.isSelected),st.inert=!1,ae(st,`f-${Z}In from-${xe>0?"prev":"next"}`)),Ve(),!0})(c,F))return;c=D?(c%S+S)%S:qe(0,c,S-1),te=((y=z[c||0])===null||y===void 0?void 0:y.pos)||0;const q=l.isRunning()?l.getEndValues().pos:P;if(Math.abs(te-q)<1)return P=te,$!==c&&(bt(),h=$,$=c,Te(),Re(),G("change",$,h)),Ve(),void(Y||(Y=!0,G("settle")));if(l.pause(),Et(),D){const W=Xe(),Z=Math.floor((q-((_=z[0])===null||_===void 0?void 0:_.pos))/W)||0,ce=te+Z*W;te=[ce+W,ce,ce-W].reduce(function(be,ye){return Math.abs(ye-q)<Math.abs(be-q)?ye:be})}F!==!1&&Ye(C)?l.spring(Ht({},T.tween,C)).from({pos:P}).to({pos:te}).start():(P=te,lt(),Ve(),Y||(Y=!0,G("settle")))}function Mt(c){var m;let y=P;if(D&&c!==!0){const _=Xe();y-=(Math.floor((P-((m=z[0])===null||m===void 0?void 0:m.pos)||0)/_)||0)*_}return y}function Ve(){var c;if(!b||!d)return;ue=Vt();const m=new Set,y=[],_=z[$],F=T.setTransform;let C;for(const S of K){const R=le.has(S.index),q=ue.indexOf(S)>-1,W=((c=_?.slides)===null||c===void 0?void 0:c.indexOf(S))>-1;if(S.isVirtual&&!R&&!q)continue;let Z=gt(S);if(Z&&(y.push(S),W&&m.add(Z),j("adaptiveHeight")&&W)){const ce=(Z.lastElementChild||Z).getBoundingClientRect().height;C=C==null?ce:Math.max(C,ce)}}d&&C&&(d.style.height=`${C}px`),[...Cn(d,`.${T.classes.slide}
1`)].forEach(S=>{rt(S,T.classes.isSelected,m.has(S));const R=J[parseInt(S.getAttribute("index")||"-1")];if(!R)return S.remove(),void Je(S);const q=le.has(R.index),W=ue.indexOf(R)>-1;if(R.isVirtual&&!q&&!W)return void Ct(R);if(S.inert=!W,F===!1)return;let Z=R.pos?Math.round(1e4*R.pos)/1e4:0,ce=0,be=0,ye=0,Se=0;q||(ce=g?0:O?-1*Z:Z,be=g?Z:0,ye=os(ce,0,R.dim,0,100),Se=os(be,0,R.dim,0,100)),F instanceof Function&&!q?F(ve,R,{x:ce,y:be,xPercent:ye,yPercent:Se}):S.style.transform=ce||be?`translate3d(${ye}%, ${Se}%,0)`:""}),G("render",y)}function yt(){b?.removeEventListener("click",Pt),document.removeEventListener("mousemove",Le),le.clear(),f?.disconnect(),f=void 0;for(const c of J){let m=c.el;m&&Yt(m)&&(c.state=void 0,Lt(c),ge(c),c.isVirtual?(Ct(c),c.el=void 0):(Je(m),m.style.transform="",d&&!d.contains(m)&&d.appendChild(m)))}for(const c of Object.values(U))c?.destroy();U={},k?.destroy(),k=void 0,l?.destroy(),l=void 0;for(const[c,m]of Object.entries(T.classes||{}))c!=="container"&&Ke(b,m);Ke(d,"is-draggable")}function Ot(){return D||$>0}function jt(){return D||$<z.length-1}const ve={add:function(c,m){var y;let _=P;const F=$,C=Xe(),S=l?.isRunning()?l.getEndValues().pos:P,R=C&&Math.floor((S-(((y=z[0])===null||y===void 0?void 0:y.pos)||0))/C)||0;return Qe(c,m),vt(_e),et(),l&&C&&(F===$&&(_-=R*C),_===te?P=te:l.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:_}).to({pos:te}).start()),Ve(),ve},canGoPrev:Ot,canGoNext:jt,destroy:function(){return G("destroy"),window.removeEventListener("resize",we),yt(),Q.clear(),b=null,z=[],J=[],T=Object.assign({},Nt),U={},K=[],L=void 0,_e="*",A=2,ve},emit:G,filter:function(c="*"){return vt(c),et(),P=qe(oe,P,re),Ve(),G("filter",c),ve},getContainer:function(){return b},getGapDim:xt,getGestures:function(){return k},getLastMouseMove:function(){return as},getOption:function(c){return j(c)},getOptions:function(){return T},getPage:function(){return z[$]},getPageIndex:function(c){if(c!==void 0){for(const m of z||[])for(const y of m.slides)if(y.index===c)return m.index;return-1}return $},getPageIndexFromPosition:St,getPageProgress:function(c,m){var y;c===void 0&&(c=$);const _=z[c];if(!_)return c>$?-1:1;const F=Xe(),C=xt();let S=_.pos,R=Mt();if(D&&m!==!0){const q=Math.floor((R-((y=z[0])===null||y===void 0?void 0:y.pos))/F)||0;R-=q*F,S=[S+F,S,S-F].reduce(function(W,Z){return Math.abs(Z-R)<Math.abs(W-R)?Z:W})}return(R-S)/(_.dim+C)||0},getPageVisibility:function(c){var m;c===void 0&&(c=$);const y=z[c];if(!y)return c>$?-1:1;const _=Mt(),F=Ne();let C=y.pos;if(D){const S=Xe(),R=C+(Math.floor((_-((m=z[0])===null||m===void 0?void 0:m.pos))/S)||0)*S;C=[R+S,R,R-S].reduce(function(q,W){return Math.abs(W-_)<Math.abs(q-_)?W:q})}return C>_&&C+y.dim<_+F?1:C<_?(C+y.dim-_)/y.dim||0:C+y.dim>_+F&&(_+F-C)/y.dim||0},getPages:function(){return z},getPlugins:function(){return U},getPosition:Mt,getSlides:function(){return J},getState:function(){return A},getTotalSlideDim:Xe,getTween:function(){return l},getViewport:function(){return d},getViewportDim:Ne,getVisibleSlides:function(c){return c===void 0?ue:Vt(c)},goTo:tt,hasNavigated:function(){return h!==void 0},hideError:ge,hideLoading:Lt,init:function(){if(!n||!Yt(n))throw new Error("No Element found");return A!==0&&(yt(),A=0),b=n,w=t,window.removeEventListener("resize",we),w.breakpoints&&window.addEventListener("resize",we),we(),ve},isInfinite:function(){return D},isInTransition:function(){return le.size>0},isRTL:function(){return O},isSettled:function(){return Y},isVertical:function(){return g},localize:ne,next:function(c={}){return tt($+1,c),ve},off:function(c,m){for(const y of c instanceof Array?c:[c])Q.has(y)&&Q.set(y,Q.get(y).filter(_=>_!==m));return ve},on:function(c,m){for(const y of c instanceof Array?c:[c])Q.set(y,[...Q.get(y)||[],m]);return ve},prev:function(c={}){return tt($-1,c),ve},reInit:function(c={},m){return yt(),A=0,L=void 0,_e="*",t=c,w=c,Ye(m)&&(r=m),we(),ve},remove:function(c){c===void 0&&(c=J.length-1);const m=J[c];return m&&(G("removeSlide",m),m.el&&(Je(m.el),m.el.remove(),m.el=void 0),J.splice(c,1),vt(_e),et(),P=qe(oe,P,re),Ve()),ve},setPosition:function(c){P=c,lt(),Ve()},showError:function(c,m){if(A===1){Lt(c),ge(c);const y=c.el;if(y){const _=document.createElement("div");ae(_,"f-html"),ae(_,"is-error"),_.innerHTML=ne(m||"<p>{{ERROR}}</p>"),c.htmlEl=_,ae(y,"has-html has-error"),y.insertAdjacentElement("afterbegin",_),G("contentReady",c)}}return ve},showLoading:function(c){const m=c.el,y=m?.querySelector(".f-spinner");if(!m||y)return ve;const _=j("spinnerTpl"),F=$t(_);return F&&(ae(F,"f-spinner"),m.insertAdjacentElement("beforeend",F)),ve},version:"6.1.14"};return ve};cn.l10n={en_EN:jn},cn.getDefaults=()=>Nt;const us={showLoading:!0,preload:1},Qt="is-lazyloading",cs="is-lazyloaded",ds="has-lazyerror",wr=()=>{let n;function t(){const l=n?.getOptions().Lazyload;return Ye(l)?Object.assign(Object.assign({},us),l):us}function r(l){var f;const h=l.el;if(!h)return;const L=t(),A="[data-lazy-src],[data-lazy-srcset],[data-lazy-bg]",w=Array.from(h.querySelectorAll(A));h.matches(A)&&w.push(h);for(const T of w){const U=T.dataset.lazySrc,b=T.dataset.lazySrcset,d=T.dataset.lazySizes,E=T.dataset.lazyBg,H=(T instanceof HTMLImageElement||T instanceof HTMLSourceElement)&&(U||b),I=!!E;
1if(!H&&!I)continue;const D=U||b||E;if(D){if(H){const O=(f=T.parentElement)===null||f===void 0?void 0:f.classList.contains("f-panzoom__wrapper");L.showLoading&&n?.showLoading(l),T.addEventListener("load",()=>{n?.hideLoading(l),Ke(T,ds),T instanceof HTMLImageElement?T.decode().finally(()=>{Ke(T,Qt),ae(T,cs)}).catch(()=>{}):(Ke(T,Qt),ae(T,cs)),O||n==null||n.emit("lazyLoad:loaded",l,T,D)}),T.addEventListener("error",()=>{n?.hideLoading(l),Ke(T,Qt),ae(T,ds),O||n==null||n.emit("lazyLoad:error",l,T,D)}),T.classList.add("f-lazyload"),T.classList.add(Qt),O||n==null||n.emit("lazyLoad:load",l,T,D),U&&(T.src=U),b&&(T.srcset=b),d&&(T.sizes=d)}else I&&(T.style.backgroundImage=`url('${E}')`);delete T.dataset.lazySrc,delete T.dataset.lazySrcset,delete T.dataset.lazySizes,delete T.dataset.lazyBg}}}function k(){if(!n)return;const l=[...n.getVisibleSlides()],f=t().preload;if(f>0){const h=n.getPosition(),L=n.getViewportDim();l.push(...n.getVisibleSlides(h+L*f),...n.getVisibleSlides(h-L*f))}for(const h of l)r(h)}return{init:function(l){n=l,n.on("render",k)},destroy:function(){n?.off("render",k),n=void 0}}};const hs='<svg width="24" height="24" viewBox="0 0 24 24" tabindex="-1">',fs="</svg>",ps={prevTpl:hs+'<path d="M15 3l-9 9 9 9"></path>'+fs,nextTpl:hs+'<path d="M9 3l9 9-9 9"></path>'+fs},Sr=()=>{let n,t,r;function k(h){const L=(function(){const T=n?.getOptions().Arrows;return Ye(T)?Object.assign(Object.assign({},ps),T):ps})(),A=`<button data-carousel-go-${h} tabindex="0" class="f-button is-arrow is-${h}" title="{{${h.toUpperCase()}}}">`+L[`${h}Tpl`]+"</button>",w=$t(n.localize(A))||void 0;return w&&ae(w,L[`${h}Class`]),w}function l(){var h;t?.remove(),t=void 0,r?.remove(),r=void 0,(h=n?.getContainer())===null||h===void 0||h.classList.remove("has-arrows")}function f(){n&&n.getOptions().Arrows!==!1&&n.getPages().length>1?((function(){if(!n)return;const h=n.getViewport();h&&(t||(t=k("prev"),t&&h.insertAdjacentElement("beforebegin",t)),r||(r=k("next"),r&&h.insertAdjacentElement("afterend",r)),rt(n.getContainer(),"has-arrows",!0))})(),n&&(t?.toggleAttribute("aria-disabled",!n.canGoPrev()),r?.toggleAttribute("aria-disabled",!n.canGoNext()))):l()}return{init:function(h){n=h.on(["change","refresh"],f)},destroy:function(){l(),n?.off(["change","refresh"],f),n=void 0}}};const Ps='<circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/>',An='<g><line x1="11" y1="8" x2="11" y2="14"></line></g>'+Ps,ms={moveLeft:["moveLeft","MOVE_LEFT",'<path d="M5 12h14M5 12l6 6M5 12l6-6"/>'],moveRight:["moveRight","MOVE_RIGHT",'<path d="M5 12h14M13 18l6-6M13 6l6 6"/>'],moveUp:["moveUp","MOVE_UP",'<path d="M12 5v14M18 11l-6-6M6 11l6-6"/>'],moveDown:["moveDown","MOVE_DOWN",'<path d="M12 5v14M18 13l-6 6M6 13l6 6"/>'],zoomOut:["zoomOut","ZOOM_OUT",Ps],zoomIn:["zoomIn","ZOOM_IN",An],toggleFull:["toggleFull","TOGGLE_FULL",An],iterateZoom:["iterateZoom","ITERATE_ZOOM",An],toggle1to1:["toggleFull","TOGGLE_FULL",'<path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/>'],rotateCCW:["rotateCCW","ROTATE_CCW",'<path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/>'],rotateCW:["rotateCW","ROTATE_CW",'<path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/>'],flipX:["flipX","FLIP_X",'<path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/>'],flipY:["flipY","FLIP_Y",'<path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/>'],reset:["reset","RESET",'<path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'],toggleFS:["toggleFS","TOGGLE_FS",'<g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g>']},Rn={};for(const n of Object.keys(ms)){const t=ms[n];Rn[n]={tpl:`<button data-panzoom-action="${t[0]}" class="f-button" title="{{${t[1]}}}"><svg>${t[2]}</svg></button>`}}
1var vs;(function(n){n.Left="left",n.middle="middle",n.right="right"})(vs||(vs={}));const gs=Object.assign({counter:{tpl:'<div class="f-counter"><span data-carousel-page></span>/<span data-carousel-pages></span></div>'},download:{tpl:'<button data-carousel-download class="f-button" title="{{DOWNLOAD}}"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></button>'},autoplay:{tpl:'<button data-autoplay-action="toggle" class="f-button" title="{{TOGGLE_AUTOPLAY}}"><svg><g><path d="M5 3.5 19 12 5 20.5Z"/></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},thumbs:{tpl:'<button data-thumbs-action="toggle" class="f-button" title="{{TOGGLE_THUMBS}}"><svg><rect width="18" height="14" x="3" y="3" rx="2"/><path d="M4 21h1M9 21h1M14 21h1M19 21h1"/></svg></button>'}},Rn),bs={absolute:!1,display:{left:[],middle:["zoomIn","zoomOut","toggle1to1","rotateCCW","rotateCW","flipX","flipY","reset"],right:[]},enabled:"auto",items:{}},xr=()=>{let n,t;function r(l){const f=n?.getOptions().Toolbar;let h=(Ye(f)?Object.assign(Object.assign({},bs),f):bs)[l];return h&&typeof h=="function"&&n?h(n):h}function k(){var l;if(!n||t||n?.getOptions().Toolbar===!1)return;const f=n.getContainer();if(!f)return;let h=r("enabled");if(!h)return;const L=r("absolute"),A=n.getSlides().length>1;let w=!1,T=!1;for(const I of n.getSlides())I.panzoomRef&&(w=!0),(I.downloadSrc||I.type==="image"&&I.src)&&(T=!0);const U=((l=n.getPlugins().Thumbs)===null||l===void 0?void 0:l.isEnabled())||!1,b=A&&n.getPlugins().Autoplay||!1,d=n.getPlugins().Fullscreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled);if(h==="auto"&&(h=w),!h)return;t=f.querySelector(".f-carousel__toolbar")||void 0,t||(t=document.createElement("div"),ae(t,"f-carousel__toolbar"));const E=r("display"),H=Ht({},gs,r("items"));for(const I of["left","middle","right"]){const D=E[I]||[],O=document.createElement("div");ae(O,`f-carousel__toolbar__column is-${I}`);for(const g of D){let M;if(mt(g)){if(g==="counter"&&!A||g==="autoplay"&&!b||Rn[g]&&!w||g==="fullscreen"&&!d||g==="thumbs"&&!U||g==="download"&&!T)continue;M=H[g]}if(Ye(g)&&(M=g),M&&M.tpl){let P=n.localize(M.tpl);P=P.split("<svg>").join('<svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24">');const Y=$t(P);Y&&(typeof M.click=="function"&&n&&Y.addEventListener("click",$=>{$.preventDefault(),$.stopPropagation(),typeof M.click=="function"&&n&&M.click(n,$)}),O.append(Y))}}t.append(O)}if(t.childElementCount){if(L&&ae(t,"is-absolute"),!t.parentElement){const I=r("parentEl");I?I.insertAdjacentElement("afterbegin",t):f.insertAdjacentElement("afterbegin",t)}f.contains(t)&&(ae(f,"has-toolbar"),L&&ae(f,"has-absolute-toolbar"))}}return{init:function(l){n=l,n?.on("initSlides",k)},destroy:function(){n?.off("initSlides",k),Ke(n?.getContainer(),"has-toolbar has-absolute-toolbar"),t?.remove(),t=void 0},add:function(l,f){gs[l]=f},isEnabled:function(){return!!t}}};const ys=(n,t={})=>
1{const r=new URL(n),k=new URLSearchParams(r.search),l=new URLSearchParams;for(const[L,A]of[...k,...Object.entries(t)]){let w=A+"";if(L==="t"){let T=w.match(/((\d*)m)?(\d*)s?/);T&&l.set("start",60*parseInt(T[2]||"0")+parseInt(T[3]||"0")+"")}else l.set(L,w)}let f=l+"",h=n.match(/#t=((.*)?\d+s)/);return h&&(f+=`#t=${h[1]}`),f},_s={autoplay:!1,html5videoTpl:`<video class="f-html5video" playsinline controls controlsList="nodownload" poster="{{poster}}"> 2 <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"no",referrerPolicy:"strict-origin-when-cross-origin",credentialless:""},vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},Tr=()=>{let n,t=!1;function r(){const b=n?.getOptions().Video;return Ye(b)?Object.assign(Object.assign({},_s),b):_s}function k(){var b;return(b=n?.getPage())===null||b===void 0?void 0:b.slides[0]}const l=b=>{var d;try{let E=JSON.parse(b.data);if(b.origin==="https://player.vimeo.com"){if(E.event==="ready")for(let H of Array.from(((d=n?.getContainer())===null||d===void 0?void 0:d.getElementsByClassName("f-iframe"))||[]))H instanceof HTMLIFrameElement&&H.contentWindow===b.source&&(H.dataset.ready="true")}else if(b.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&E.event==="onReady"){const H=document.getElementById(E.id);H&&(H.dataset.ready="true")}}catch{}};function f(b,d){const E=d.src;if(!mt(E))return;let H=d.type;if(!H||H==="html5video"){const I=E.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i);I&&(H="html5video",d.html5videoFormat=d.html5videoFormat||"video/"+(I[1]==="ogv"?"ogg":I[1]))}if(!H||H==="youtube"){const I=E.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i);if(I){const D=Object.assign(Object.assign({},r().youtube),d.youtube||{}),O=`www.youtube${D.nocookie?"-nocookie":""}.com`,g=ys(E,D),M=encodeURIComponent(I[2]);d.videoId=M,d.src=`https://${O}/embed/${M}?${g}`,d.thumb=d.thumb||`https://i.ytimg.com/vi/${M}/mqdefault.jpg`,H="youtube"}}if(!H||H==="vimeo"){const I=E.match(/^.+vimeo.com\/(?:\/)?(video\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/);if(I){const D=Object.assign(Object.assign({},r().vimeo),d.vimeo||{}),O=ys(E,D),g=encodeURIComponent(I[2]),M=I[5]||"";d.videoId=g,d.src=`https://player.vimeo.com/video/${g}?${M?`h=${M}${O?"&":""}`:""}${O}`,H="vimeo"}}d.type=H}function h(b,d){d.type==="html5video"&&(function(E){const H=E.el,I=E.src;if(!n||!H||!I)return;const D=E.html5videoTpl||r().html5videoTpl,O=E.html5videoFormat||r().html5videoFormat;if(!D)return;const g=E.poster||(E.thumb&&mt(E.thumb)?E.thumb:""),M=$t(D.replace(/\{\{src\}\}/gi,I+"").replace(/\{\{format\}\}/gi,O||"").replace(/\{\{poster\}\}/gi,g+""));if(!M)return;const P=document.createElement("div");ae(P,"f-html"),P.append(M),E.contentEl=M,E.htmlEl=P,ae(H,`has-${E.type}`),H.prepend(P),T(E),n.emit("contentReady",E)})(d),d.type!=="youtube"&&d.type!=="vimeo"||(function(E){const H=E.el,I=E.src;if(!n||!H||!I)return;const D=document.createElement("iframe");ae(D,"f-iframe"),D.setAttribute("id",`f-iframe_${E.videoId}`);for(const[g,M]of Object.entries(r().iframeAttr||{}))D.setAttribute(g,M);E.type==="youtube"&&(D.onload=()=>{var g;n?.getState()===1&&((g=D.contentWindow)===null||g===void 0||g.postMessage(JSON.stringify({event:"listening",id:D.getAttribute("id")}),"*"))}),D.onerror=()=>{n?.showError(E,"{{IFRAME_ERROR}}")};const O=document.createElement("div");ae(O,"f-html"),O.append(D),E.contentEl=D,E.htmlEl=O,ae(H,`has-html has-iframe has-${E.type}`),D.src=`${E.src}`,H.prepend(O),T(E),n.emit("contentReady",E)})(d)}function L(b,d){var E,H;d.type!=="html5video"&&d.type!=="youtube"&&d.type!=="vimeo"||((E=d.contentEl)===null||E===void 0||E.remove(),d.contentEl=void 0,(H=d.htmlEl)===null||H===void 0||H.remove(),d.htmlEl=void 0),d.poller&&clearTimeout(d.poller)}function A(){t=!1}function w(){if(t)return;t=!0;const b=k();(b&&b.autoplay!==void 0?b.autoplay:r().autoplay)&&((function(){var d;const E=k(),H=E?.el;if(H&&E?.type==="html5video")try{const D=H.querySelector("video");if(D){const O=D.play();O!==void 0&&O.then(()=>{}).catch(g=>{D.muted=!0,D.play()})}}catch{}const I=E?.htmlEl;I instanceof HTMLIFrameElement&&((d=I.contentWindow)===null||d===void 0||d.postMessage('{"event":"command","func":"stopVideo","args":""}',"*"))})(),(function(){const d=k(),E=d?.type;if(!d?.el||E!=="youtube"&&E!=="vimeo")return;const H=()=>
2{if(d.contentEl&&d.contentEl instanceof HTMLIFrameElement&&d.contentEl.contentWindow){let I;if(d.contentEl.dataset.ready==="true")return I=d.type==="youtube"?{event:"command",func:"playVideo"}:{method:"play",value:"true"},I&&d.contentEl.contentWindow.postMessage(JSON.stringify(I),"*"),void(d.poller=void 0);d.type==="youtube"&&(I={event:"listening",id:d.contentEl.getAttribute("id")},d.contentEl.contentWindow.postMessage(JSON.stringify(I),"*"))}d.poller=setTimeout(H,250)};H()})())}function T(b){const d=b?.htmlEl;if(b&&d&&(b.type==="html5video"||b.type==="youtube"||b.type==="vimeo")){if(d.style.aspectRatio="",d.style.width="",d.style.height="",d.style.maxWidth="",d.style.maxHeight="",b.width){let E=`${b.width}`;E.match(/^\d+$/)&&(E+="px"),d.style.maxWidth=`${E}`}if(b.height){let E=`${b.height}`;E.match(/^\d+$/)&&(E+="px"),d.style.maxHeight=`${E}`}if(b.aspectRatio){const E=b.aspectRatio.split("/"),H=parseFloat(E[0].trim()),I=E[1]?parseFloat(E[1].trim()):0,D=H&&I?H/I:H;d.offsetHeight;const O=d.getBoundingClientRect(),g=D<(O.width||1)/(O.height||1);d.style.aspectRatio=`${b.aspectRatio}`,d.style.width=g?"auto":"",d.style.height=g?"":"auto"}}}function U(){T(k())}return{init:function(b){n=b,n.on("addSlide",f),n.on("attachSlideEl",h),n.on("detachSlideEl",L),n.on("ready",w),n.on("change",A),n.on("settle",w),n.on("refresh",U),window.addEventListener("message",l)},destroy:function(){n?.off("addSlide",f),n?.off("attachSlideEl",h),n?.off("detachSlideEl",L),n?.off("ready",w),n?.off("change",A),n?.off("settle",w),n?.off("refresh",U),window.removeEventListener("message",l),n=void 0}}};Object.assign(Object.assign({},jn),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ELEMENT_NOT_FOUND:"HTML Element Not Found",IFRAME_ERROR:"Error Loading Page",NO_CAPTION:"No Caption",TOGGLE_SIDEBAR:"Toggle sidebar"});const Cr='<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg tabindex="-1" width="24" height="24" viewBox="0 0 24 24"><path d="M19.286 4.714 4.714 19.286M4.714 4.714l14.572 14.572" /></svg></button>';xr().add("close",{tpl:Cr});var ks;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Closing=2]="Closing",n[n.Destroyed=3]="Destroyed"})(ks||(ks={}));const Er={emits:["not-auth","changed"],props:{auctionId:{type:Number,required:!0},isFavoriteText:{type:String,required:!1},notFavoriteText:{type:String,required:!1}},data(){return{favoriteAction:null}},methods:{addToFavorite(n){if(this.favoriteBusy)return;const t=n&&n.currentTarget?n.currentTarget:null;this.favoriteAction=this.isFavorite?"remove":"add",this.$root.toggleFavorite(this.auctionId,t).then(()=>{this.$emit("changed",this.auctionId)}).catch(r=>{r.response&&r.response.status===401&&this.$emit("not-auth"),r.response&&r.response.status===422&&r.response.data&&r.response.data.message&&this.$root.store.setMessageAction(r.response.data.message,"warning",4e3)}).finally(()=>{this.favoriteAction=null})}},computed:{isFavorite(){return this.$root.isFavorite(this.auctionId)},favoriteBusy(){return this.$root.isFavoriteRequestInFlight(this.auctionId)},accessibleName(){return this.isFavorite?this.isFavoriteText||"Poista seurannasta":this.notFavoriteText||"Lisää seurantaan"},favoriteActionText(){return this.favoriteAction==="remove"?this.isFavoriteText:this.favoriteAction==="add"?this.notFavoriteText:this.isFavorite?this.isFavoriteText:this.notFavoriteText},favoriteTransitionKey(){return this.favoriteBusy?`busy-${this.favoriteAction||"toggle"}`:this.isFavorite?"is-favorite":"not-favorite"}}},Ar=["disabled","aria-label"];function Pr(n,t,r,k,l,f){return p(),v("button",{onClick:t[0]||(t[0]=h=>f.addToFavorite(h)),disabled:f.favoriteBusy,type:"button","aria-label":f.accessibleName},[je(at,{name:"fade",mode:"out-in"},{default:He(()=>[(p(),v("span",{key:f.favoriteTransitionKey},[f.favoriteBusy?(p(),v(fe,{key:0},[t[1]||(t[1]=a("i",{class:"fa fa-spinner fa-spin fa-fw","aria-hidden":"true"},null,-1)),ee(" "+B(f.favoriteActionText),1)],64)):f.isFavorite?(p(),v(fe,{key:1},[t[2]||(t[2]=a("i",{class:"fa fa-star fa-fw","aria-hidden":"true"},null,-1)),ee(" "+B(r.isFavoriteText),1)],64)):(p(),v(fe,{key:2},[t[3]||(t[3]=a("i",{class:"far fa-star fa-fw","aria-hidden":"true"},null,-1)),ee(" "+B(r.notFavoriteText),1)],64))]))]),_:1})],8,Ar)}const Lr=Ue(Er,[["render",Pr]]),Mr={props:{auction:Object,varmat_kaupat_label_class:{type:String,default:""}},methods:{notAuth(){this.$root.store.setMessageAction('<a href="/login">Kirjaudu sisään</a> lisätäksesi kohteen seurantaan.',"warning",4e3)}},components:{AddToFavorites:Lr}},Or={class:"flex justify-between w-full flex-wrap gap-2 absolute top-0 mt-n1"},jr={class:"z-1"},Rr={key:0,class:"label buy-now-label more-info"},Ir={key:2,class:"label label-default"},Fr={class:"z-1"};function Nr(n,t,r,k,l,f){const h=Oe("AddToFavorites");return p(),v("div",Or,[a("div",jr,[r.auction.is_buy_now?(p(),v("span",Rr,[...t[1]||(t[1]=[ee("Osta heti ",-1),a("span",{class:"more-info-contents on-top only-hover hidden-xxs"}," Osta heti -ilmoitus. ",-1)])])):r.auction.is_sold_to_highest_bidder?(p(),v("span",{key:1,class:Be(["label varmat-kaupat-label more-info",r.varmat_kaupat_label_class])},[...t[2]||(t[2]=[ee("Varmat kaupat ",-1),a("span",{class:"more-info-contents on-top only-hover hidden-xxs"},[ee(" Korkein tarjous hyväksytään automaattisesti "),a("br"),ee(" heti huutokaupan päättyessä. ")],-1)])],2)):V("",!0),r.auction.is_bankruptcy_estate_auction?(p(),v("span",Ir,"Konkurssipesä")):V("",!0)]),a("div",Fr,[je(h,{class:"btn btn-default add-to-favorites-btn mt-3 mr-2","auction-id":r.auction.id,onNotAuth:t[0]||(t[0]=L=>
2f.notAuth())},null,8,["auction-id"])])])}const Ls=Ue(Mr,[["render",Nr]]),Dr={emits:["close"],props:{images:{type:Array,default:()=>[]},auctionTitle:{type:String,default:""},activeIndex:{type:Number,default:0}},data(){return{historyPushed:!1,closingViaHistory:!1}},mounted(){document.addEventListener("keydown",this.handleKeydown),window.addEventListener("popstate",this.handlePopstate),document.body.style.overflow="hidden",history.pushState({gallery:!0},""),this.historyPushed=!0,this.activeIndex&&this.scrollToActiveImage()},beforeUnmount(){document.removeEventListener("keydown",this.handleKeydown),window.removeEventListener("popstate",this.handlePopstate),document.body.style.overflow="",this.historyPushed&&!this.closingViaHistory&&history.back()},methods:{close(){this.$emit("close")},handleKeydown(n){n.key==="Escape"&&this.close()},handlePopstate(){this.closingViaHistory=!0,this.historyPushed=!1,this.close()},scrollToActiveImage(){const n=this.$el.querySelector(`li:nth-child(${this.activeIndex+1})`);n&&n.scrollIntoView({behavior:"instant"})}}},Hr={class:"gallery-bg mb-5"},$r={class:"gallery-container px-4 pb-4"},Br={class:"py-4"},Ur={key:0,class:"text-primary hidden-xs"},Vr={class:"list-unstyled"},zr=["src"];function qr(n,t,r,k,l,f){return p(),v("div",Hr,[a("button",{title:"Close (Esc)",onClick:t[0]||(t[0]=(...h)=>f.close&&f.close(...h)),class:"btn btn-default gallery-close"},[...t[1]||(t[1]=[a("i",{class:"fa fa-times"},null,-1)])]),a("div",$r,[a("h4",Br,[t[2]||(t[2]=ee(" Kohteen ",-1)),r.auctionTitle?(p(),v("span",Ur,B(r.auctionTitle),1)):V("",!0),t[3]||(t[3]=ee(" kuvat ",-1))]),a("ol",Vr,[(p(!0),v(fe,null,Fe(r.images,(h,L)=>(p(),v("li",{class:"relative mb-4",key:L},[a("figure",null,[a("img",{class:"gallery-image",src:h.zoom_image_url},null,8,zr),a("figcaption",null," Kuva "+B(L+1+"/"+r.images.length),1)])]))),128))])])])}const Ms=Ue(Dr,[["render",qr]]),Wr={props:{images:{type:Array,default:()=>[]},video:{type:Object,default:()=>{}},auction:{type:Object,default:()=>{}}},data(){return{activeIndex:0,openGallery:!1,isDragging:!1,dragStartX:0,dragThreshold:10,carousel:null}},mounted(){this.carousel=cn(this.$refs.carousel,{initialSlide:0,slidesPerPage:1,infinite:!0,gap:0,transition:"slide",on:{change:(n,t)=>{this.activeIndex=t}},Arrows:this.items.length>1?{prevTpl:'<i class="fa fa-chevron-left" aria-hidden="true"></i>',nextTpl:'<i class="fa fa-chevron-right" aria-hidden="true"></i>'}:!1,Video:{autoplay:!1},Lazyload:{preload:3}},{Arrows:Sr,Video:Tr,Lazyload:wr}).init()},beforeUnmount(){this.carousel&&this.carousel.destroy()},computed:{hasVideo(){return!!(this.video&&this.video.link)},items(){let n=this.images.map(t=>({type:"image",src:t.gallery_image_url}));return this.hasVideo&&n.splice(1,0,{type:"video",src:this.video.link,provider:this.video.provider}),n}},methods:{onDragStart(n){this.isDragging=!1,this.dragStartX=n.type.includes("touch")?n.touches[0].clientX:n.clientX},onDragMove(n){const t=n.type.includes("touch")?n.touches[0].clientX:n.clientX;Math.abs(t-this.dragStartX)>this.dragThreshold&&(this.isDragging=!0)},onDragEnd(){setTimeout(()=>{this.isDragging=!1},50)},onImageClick(){this.isDragging||(this.openGallery=!0)},goToVideo(){this.hasVideo&&this.carousel&&this.carousel.goTo(1)}},components:{AuctionImageLabels:Ls,Gallery:Ms}},Xr={class:"f-carousel auction-image-carousel",ref:"carousel",role:"region","aria-label":"Huutokaupan kuvakaruselli"},Gr={class:"f-carousel__viewport"},Kr=["data-src","data-type"],Yr={class:"relative"},Jr=["data-lazy-src","alt"],Zr={key:0,class:"images-count"};function Qr(n,t,r,k,l,f){const h=Oe("AuctionImageLabels"),L=Oe("gallery");return p(),v("div",null,[a("div",Xr,[a("div",Gr,[(p(!0),v(fe,null,Fe(f.items,(A,w)=>(p(),v("div",{class:"f-carousel__slide",key:w,"data-src":A.type==="video"?A.src:null,"data-type":A.type==="video"?A.provider:null,onMousedown:t[1]||(t[1]=T=>f.onDragStart(T)),onMousemove:t[2]||(t[2]=T=>f.onDragMove(T)),onMouseup:t[3]||(t[3]=T=>f.onDragEnd()),onTouchstart:t[4]||(t[4]=T=>
2f.onDragStart(T)),onTouchmove:t[5]||(t[5]=T=>f.onDragMove(T)),onTouchend:t[6]||(t[6]=T=>f.onDragEnd())},[a("div",Yr,[A.type=="image"?(p(),v("img",{key:0,"data-lazy-src":A.src,alt:"Kohteen kuva "+(w+1),onClick:t[0]||(t[0]=Ge(T=>f.onImageClick(),["prevent"]))},null,8,Jr)):V("",!0)])],40,Kr))),128))]),je(h,{auction:r.auction,class:"auction-image-labels"},null,8,["auction"]),je(at,{name:"fade"},{default:He(()=>[f.hasVideo&&l.activeIndex!==1?(p(),v("button",{key:0,class:"has-video",type:"button",onClick:t[7]||(t[7]=A=>f.goToVideo())}," Video ")):V("",!0)]),_:1}),f.items.length>1?(p(),v("div",Zr,[a("span",null,B(l.activeIndex+1),1),t[9]||(t[9]=ee(" / ",-1)),a("span",null,B(f.items.length),1)])):V("",!0)],512),je(at,{name:"fade"},{default:He(()=>[l.openGallery?(p(),We(L,{key:0,ref:"gallery",images:r.images,activeIndex:l.activeIndex,auctionTitle:r.auction.title,onClose:t[8]||(t[8]=A=>l.openGallery=!1)},null,8,["images","activeIndex","auctionTitle"])):V("",!0)]),_:1})])}const ec=Ue(Wr,[["render",Qr]]);class In{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(t,r){return this.listen(".client-"+t,r)}notification(t){return this.listen(this.notificationCreatedEvent,t)}stopListeningForNotification(t){return this.stopListening(this.notificationCreatedEvent,t)}stopListeningForWhisper(t,r){return this.stopListening(".client-"+t,r)}}class Os{constructor(t){this.namespace=t}format(t){return[".","\\"].includes(t.charAt(0))?t.substring(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}setNamespace(t){this.namespace=t}}function eo(n){try{return Reflect.construct(String,[],n),!0}catch{return!1}}class Fn extends In{constructor(t,r,k){super(),this.name=r,this.pusher=t,this.options=k,this.eventFormatter=new Os(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(t,r){return this.on(this.eventFormatter.format(t),r),this}listenToAll(t){return this.subscription.bind_global((r,k)=>{if(r.startsWith("pusher:"))return;let l=String(this.options.namespace??"").replace(/\./g,"\\"),f=r.startsWith(l)?r.substring(l.length+1):"."+r;t(f,k)}),this}stopListening(t,r){return r?this.subscription.unbind(this.eventFormatter.format(t),r):this.subscription.unbind(this.eventFormatter.format(t)),this}stopListeningToAll(t){return t?this.subscription.unbind_global(t):this.subscription.unbind_global(),this}subscribed(t){return this.on("pusher:subscription_succeeded",()=>{t()}),this}error(t){return this.on("pusher:subscription_error",r=>{t(r)}),this}on(t,r){return this.subscription.bind(t,r),this}}class js extends Fn{whisper(t,r){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,r),this}}class to extends Fn{whisper(t,r){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,r),this}}class no extends js{here(t){return this.on("pusher:subscription_succeeded",r=>{t(Object.keys(r.members).map(k=>r.members[k]))}),this}joining(t){return this.on("pusher:member_added",r=>{t(r.info)}),this}whisper(t,r){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,r),this}leaving(t){return this.on("pusher:member_removed",r=>{t(r.info)}),this}}class Rs extends In{constructor(t,r,k){super(),this.events={},this.listeners={},this.name=r,this.socket=t,this.options=k,this.eventFormatter=new Os(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}listen(t,r){return this.on(this.eventFormatter.format(t),r),this}stopListening(t,r){return this.unbindEvent(this.eventFormatter.format(t),r),this}subscribed(t){return this.on("connect",r=>{t(r)}),this}error(t){return this}on(t,r){return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=(k,l)=>{this.name===k&&this.listeners[t]&&this.listeners[t].forEach(f=>f(l))},this.socket.on(t,this.events[t])),this.listeners[t].push(r),this}
2unbind(){Object.keys(this.events).forEach(t=>{this.unbindEvent(t)})}unbindEvent(t,r){this.listeners[t]=this.listeners[t]||[],r&&(this.listeners[t]=this.listeners[t].filter(k=>k!==r)),(!r||this.listeners[t].length===0)&&(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}class Is extends Rs{whisper(t,r){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:r}),this}}class so extends Is{here(t){return this.on("presence:subscribed",r=>{t(r.map(k=>k.user_info))}),this}joining(t){return this.on("presence:joining",r=>t(r.user_info)),this}whisper(t,r){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:r}),this}leaving(t){return this.on("presence:leaving",r=>t(r.user_info)),this}}class dn extends In{subscribe(){}unsubscribe(){}listen(t,r){return this}listenToAll(t){return this}stopListening(t,r){return this}subscribed(t){return this}error(t){return this}on(t,r){return this}}class Fs extends dn{whisper(t,r){return this}}class io extends dn{whisper(t,r){return this}}class ro extends Fs{here(t){return this}joining(t){return this}whisper(t,r){return this}leaving(t){return this}}const hn=class hn{constructor(t){this.setOptions(t),this.connect()}setOptions(t){this.options={...hn._defaultOptions,...t,broadcaster:t.broadcaster};let r=this.csrfToken();r&&(this.options.auth.headers["X-CSRF-TOKEN"]=r,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=r),r=this.options.bearerToken,r&&(this.options.auth.headers.Authorization="Bearer "+r,this.options.userAuthentication.headers.Authorization="Bearer "+r)}csrfToken(){return typeof window<"u"&&window.Laravel?.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??null:null}};hn._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Ut=hn;class en extends Ut{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(t,r,k){return this.channel(t).listen(r,k)}channel(t){return this.channels[t]||(this.channels[t]=new Fn(this.pusher,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new js(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}encryptedPrivateChannel(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new to(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new no(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"private-encrypted-"+t,"presence-"+t].forEach(r=>{this.leaveChannel(r)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const t=this.pusher.connection.state;switch(t){case"connected":case"connecting":return t;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(t){const r=()=>{t(this.connectionStatus())},k=["state_change","connected","disconnected"];return k.forEach(l=>{this.pusher.connection.bind(l,r)}),()=>{k.forEach(l=>{this.pusher.connection.unbind(l,r)})}}disconnect(){this.pusher.disconnect()}}class oo extends Ut{constructor(){super(...arguments),this.channels={}}connect(){const t=this.getSocketIO();this.socket=t(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>
2{Object.values(this.channels).forEach(r=>{r.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(t,r,k){return this.channel(t).listen(r,k)}channel(t){return this.channels[t]||(this.channels[t]=new Rs(this.socket,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new Is(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new so(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"presence-"+t].forEach(r=>{this.leaveChannel(r)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(t){const r=()=>{t(this.connectionStatus())},k=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return k.forEach(l=>{this.socket.on(l,r)}),()=>{k.forEach(l=>{this.socket.off(l,r)})}}disconnect(){this.socket.disconnect()}}class ws extends Ut{constructor(){super(...arguments),this.channels={}}connect(){}listen(t,r,k){return new dn}channel(t){return new dn}privateChannel(t){return new Fs}encryptedPrivateChannel(t){return new io}presenceChannel(t){return new ro}leave(t){}leaveChannel(t){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(t){return()=>{}}disconnect(){}}class ao{constructor(t){this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(t){return this.connector.channel(t)}connect(){if(this.options.broadcaster==="reverb")this.connector=new en({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new en(this.options);else if(this.options.broadcaster==="ably")this.connector=new en({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new oo(this.options);else if(this.options.broadcaster==="null")this.connector=new ws(this.options);else if(typeof this.options.broadcaster=="function"&&eo(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(t){return this.connector.presenceChannel(t)}leave(t){this.connector.leave(t)}leaveChannel(t){this.connector.leaveChannel(t)}leaveAllChannels(){for(const t in this.connector.channels)this.leaveChannel(t)}listen(t,r,k){return this.connector.listen(t,r,k)}private(t){return this.connector.privateChannel(t)}encryptedPrivate(t){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(t);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(t){return t instanceof en||t instanceof ws}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&Vue?.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((t,r)=>{this.socketId()&&t.headers.set("X-Socket-ID",this.socketId()),r()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(t=>(this.socketId()&&(t.headers["X-Socket-Id"]=this.socketId()),t))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((t,r,k)=>{this.socketId()&&k.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",t
2=>{t.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var Pn={exports:{}};var Ss;function lo(){return Ss||(Ss=1,(function(n,t){(function(k,l){n.exports=l()})(self,()=>(()=>{var r={594(h,L){var A=this&&this.__extends||(function(){var O=function(g,M){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,Y){P.__proto__=Y}||function(P,Y){for(var $ in Y)Y.hasOwnProperty($)&&(P[$]=Y[$])},O(g,M)};return function(g,M){O(g,M);function P(){this.constructor=g}g.prototype=M===null?Object.create(M):(P.prototype=M.prototype,new P)}})();Object.defineProperty(L,"__esModule",{value:!0});var w=256,T=(function(){function O(g){g===void 0&&(g="="),this._paddingCharacter=g}return O.prototype.encodedLength=function(g){return this._paddingCharacter?(g+2)/3*4|0:(g*8+5)/6|0},O.prototype.encode=function(g){for(var M="",P=0;P<g.length-2;P+=3){var Y=g[P]<<16|g[P+1]<<8|g[P+2];M+=this._encodeByte(Y>>>18&63),M+=this._encodeByte(Y>>>12&63),M+=this._encodeByte(Y>>>6&63),M+=this._encodeByte(Y>>>0&63)}var $=g.length-P;if($>0){var Y=g[P]<<16|($===2?g[P+1]<<8:0);M+=this._encodeByte(Y>>>18&63),M+=this._encodeByte(Y>>>12&63),$===2?M+=this._encodeByte(Y>>>6&63):M+=this._paddingCharacter||"",M+=this._paddingCharacter||""}return M},O.prototype.maxDecodedLength=function(g){return this._paddingCharacter?g/4*3|0:(g*6+7)/8|0},O.prototype.decodedLength=function(g){return this.maxDecodedLength(g.length-this._getPaddingLength(g))},O.prototype.decode=function(g){if(g.length===0)return new Uint8Array(0);for(var M=this._getPaddingLength(g),P=g.length-M,Y=new Uint8Array(this.maxDecodedLength(P)),$=0,te=0,oe=0,re=0,_e=0,J=0,K=0;te<P-4;te+=4)re=this._decodeChar(g.charCodeAt(te+0)),_e=this._decodeChar(g.charCodeAt(te+1)),J=this._decodeChar(g.charCodeAt(te+2)),K=this._decodeChar(g.charCodeAt(te+3)),Y[$++]=re<<2|_e>>>4,Y[$++]=_e<<4|J>>>2,Y[$++]=J<<6|K,oe|=re&w,oe|=_e&w,oe|=J&w,oe|=K&w;if(te<P-1&&(re=this._decodeChar(g.charCodeAt(te)),_e=this._decodeChar(g.charCodeAt(te+1)),Y[$++]=re<<2|_e>>>4,oe|=re&w,oe|=_e&w),te<P-2&&(J=this._decodeChar(g.charCodeAt(te+2)),Y[$++]=_e<<4|J>>>2,oe|=J&w),te<P-3&&(K=this._decodeChar(g.charCodeAt(te+3)),Y[$++]=J<<6|K,oe|=K&w),oe!==0)throw new Error("Base64Coder: incorrect characters for decoding");return Y},O.prototype._encodeByte=function(g){var M=g;return M+=65,M+=25-g>>>8&6,M+=51-g>>>8&-75,M+=61-g>>>8&-15,M+=62-g>>>8&3,String.fromCharCode(M)},O.prototype._decodeChar=function(g){var M=w;return M+=(42-g&g-44)>>>8&-w+g-43+62,M+=(46-g&g-48)>>>8&-w+g-47+63,M+=(47-g&g-58)>>>8&-w+g-48+52,M+=(64-g&g-91)>>>8&-w+g-65+0,M+=(96-g&g-123)>>>8&-w+g-97+26,M},O.prototype._getPaddingLength=function(g){var M=0;if(this._paddingCharacter){for(var P=g.length-1;P>=0&&g[P]===this._paddingCharacter;P--)M++;if(g.length<4||M>2)throw new Error("Base64Coder: incorrect padding")}return M},O})();L.Coder=T;var U=new T;function b(O){return U.encode(O)}L.encode=b;function d(O){return U.decode(O)}L.decode=d;var E=(function(O){A(g,O);function g(){return O!==null&&O.apply(this,arguments)||this}return g.prototype._encodeByte=function(M){var P=M;return P+=65,P+=25-M>>>8&6,P+=51-M>>>8&-75,P+=61-M>>>8&-13,P+=62-M>>>8&49,String.fromCharCode(P)},g.prototype._decodeChar=function(M){var P=w;return P+=(44-M&M-46)>>>8&-w+M-45+62,P+=(94-M&M-96)>>>8&-w+M-95+63,P+=(47-M&M-58)>>>8&-w+M-48+52,P+=(64-M&M-91)>>>8&-w+M-65+0,P+=(96-M&M-123)>>>8&-w+M-97+26,P},g})(T);L.URLSafeCoder=E;var H=new E;function I(O){return H.encode(O)}L.encodeURLSafe=I;function D(O){return H.decode(O)}L.decodeURLSafe=D,L.encodedLength=function(O){return U.encodedLength(O)},L.maxDecodedLength=function(O){return U.maxDecodedLength(O)},L.decodedLength=function(O){return U.decodedLength(O)}},978(h,L){var A="utf8: invalid source encoding";function w(T){for(var U=[],b=0;b<T.length;b++){var d=T[b];if(d&128){var E=void 0;if(d<224){if(b>=T.length)throw new Error(A);var H=T[++b];if((H&192)!==128)throw new Error(A);d=(d&31)<<6|H&63,E=128}else if(d<240){if(b>=T.length-1)throw new Error(A);var H=T[++b],I=T[++b];if((H&192)!==128||(I&192)!==128)throw new Error(A);d=(d&15)<<12|(H&63)<<6|I&63,E=2048}else if(d<248){if(b>=T.length-2)throw new Error(A);var H=T[++b],I=T[++b],D=T[++b];if((H&192)!==128||(I&192)!==128||(D&192)!==128)throw new Error(A);d=(d&15)<<18|(H&63)<<12|(I&63)<<6|D&63,E=65536}else throw new Error(A);if(d<E||d>=55296&&d<=57343)throw new Error(A);if(d>
2=65536){if(d>1114111)throw new Error(A);d-=65536,U.push(String.fromCharCode(55296|d>>10)),d=56320|d&1023}}U.push(String.fromCharCode(d))}return U.join("")}L.D4=w},721(h,L,A){h.exports=A(207).default},207(h,L,A){A.d(L,{default:()=>Gt});class w{constructor(e,s){this.lastId=0,this.prefix=e,this.name=s}create(e){this.lastId++;var s=this.lastId,o=this.prefix+s,u=this.name+"["+s+"]",x=!1,N=function(){x||(e.apply(null,arguments),x=!0)};return this[s]=N,{number:s,id:o,name:u,callback:N}}remove(e){delete this[e.number]}}var T=new w("_pusher_script_","Pusher.ScriptReceivers"),U={VERSION:"8.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};const b=U;class d{constructor(e){this.options=e,this.receivers=e.receivers||T,this.loading={}}load(e,s,o){var u=this;if(u.loading[e]&&u.loading[e].length>0)u.loading[e].push(o);else{u.loading[e]=[o];var x=ie.createScriptRequest(u.getPath(e,s)),N=u.receivers.create(function(X){if(u.receivers.remove(N),u.loading[e]){var se=u.loading[e];delete u.loading[e];for(var he=function(Ee){Ee||x.cleanup()},me=0;me<se.length;me++)se[me](X,he)}});x.send(N)}}getRoot(e){var s,o=ie.getDocument().location.protocol;return e&&e.useTLS||o==="https:"?s=this.options.cdn_https:s=this.options.cdn_http,s.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,s){return this.getRoot(s)+"/"+e+this.options.suffix+".js"}}var E=new w("_pusher_dependencies","Pusher.DependenciesReceivers"),H=new d({cdn_http:b.cdn_http,cdn_https:b.cdn_https,version:b.VERSION,suffix:b.dependency_suffix,receivers:E});const I={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},O={buildLogSuffix:function(i){const e="See:",s=I.urls[i];if(!s)return"";let o;return s.fullUrl?o=s.fullUrl:s.path&&(o=I.baseUrl+s.path),o?`${e} ${o}`:""}};var g;(function(i){i.UserAuthentication="user-authentication",i.ChannelAuthorization="channel-authorization"})(g||(g={}));class M extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class Y extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class $ extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class te extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class oe extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class re extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class _e extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class J extends Error{constructor(e,s){super(s),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}const le=function(i,e,s,o,u){const x=ie.createXHR();x.open("POST",s.endpoint,!0),x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var N in s.headers)x.setRequestHeader(N,s.headers[N]);if(s.headersProvider!=null){let X=s.headersProvider();for(var N in X)x.setRequestHeader(N,X[N])}return x.onreadystatechange=function(){if(x.readyState===4)if(x.status===200){let X,se=!1;try{X=JSON.parse(x.responseText),se=!0}catch{u(new J(200,`JSON returned from ${o.toString()}
2 endpoint was invalid, yet status code was 200. Data was: ${x.responseText}`),null)}se&&u(null,X)}else{let X="";switch(o){case g.UserAuthentication:X=O.buildLogSuffix("authenticationEndpoint");break;case g.ChannelAuthorization:X=`Clients must be authorized to join private or presence channels. ${O.buildLogSuffix("authorizationEndpoint")}`;break}u(new J(x.status,`Unable to retrieve auth string from ${o.toString()} endpoint - received status: ${x.status} from ${s.endpoint}. ${X}`),null)}},x.send(e),x};function ue(i){return ne(de(i))}var z=String.fromCharCode,ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe=function(i){var e=i.charCodeAt(0);return e<128?i:e<2048?z(192|e>>>6)+z(128|e&63):z(224|e>>>12&15)+z(128|e>>>6&63)+z(128|e&63)},de=function(i){return i.replace(/[^\x00-\x7F]/g,Pe)},j=function(i){var e=[0,2,1][i.length%3],s=i.charCodeAt(0)<<16|(i.length>1?i.charCodeAt(1):0)<<8|(i.length>2?i.charCodeAt(2):0),o=[ke.charAt(s>>>18),ke.charAt(s>>>12&63),e>=2?"=":ke.charAt(s>>>6&63),e>=1?"=":ke.charAt(s&63)];return o.join("")},ne=typeof window<"u"&&window.btoa||function(i){return i.replace(/[\s\S]{1,3}/g,j)};class Q{constructor(e,s,o,u){this.clear=s,this.timer=e(()=>{this.timer&&(this.timer=u(this.timer))},o)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const G=Q;function we(i){window.clearTimeout(i)}function Le(i){window.clearInterval(i)}class $e extends G{constructor(e,s){super(setTimeout,we,e,function(o){return s(),null})}}class vt extends G{constructor(e,s){super(setInterval,Le,e,function(o){return s(),o})}}var lt={now(){return Date.now?Date.now():new Date().valueOf()},defer(i){return new $e(0,i)},method(i,...e){var s=Array.prototype.slice.call(arguments,1);return function(o){return o[i].apply(o,s.concat(arguments))}}};const Te=lt;function Re(i,...e){for(var s=0;s<e.length;s++){var o=e[s];for(var u in o)u==="__proto__"||u==="constructor"||u==="prototype"||(o[u]&&o[u].constructor&&o[u].constructor===Object?i[u]=Re(i[u]||{},o[u]):i[u]=o[u])}return i}function St(){for(var i=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?i.push(arguments[e]):i.push(ut(arguments[e]));return i.join(" : ")}function xt(i,e){var s=Array.prototype.indexOf;if(i===null)return-1;if(s&&i.indexOf===s)return i.indexOf(e);for(var o=0,u=i.length;o<u;o++)if(i[o]===e)return o;return-1}function Ne(i,e){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e(i[s],s,i)}function Xe(i){var e=[];return Ne(i,function(s,o){e.push(o)}),e}function Vt(i){var e=[];return Ne(i,function(s){e.push(s)}),e}function Qe(i,e,s){for(var o=0;o<i.length;o++)e.call(s||window,i[o],o,i)}function Tt(i,e){for(var s=[],o=0;o<i.length;o++)s.push(e(i[o],o,i,s));return s}function fn(i,e){var s={};return Ne(i,function(o,u){s[u]=e(o)}),s}function gt(i,e){e=e||function(u){return!!u};for(var s=[],o=0;o<i.length;o++)e(i[o],o,i,s)&&s.push(i[o]);return s}function Ct(i,e){var s={};return Ne(i,function(o,u){(e&&e(o,u,i,s)||o)&&(s[u]=o)}),s}function zt(i){var e=[];return Ne(i,function(s,o){e.push([o,s])}),e}function et(i,e){for(var s=0;s<i.length;s++)if(e(i[s],s,i))return!0;return!1}function Je(i,e){for(var s=0;s<i.length;s++)if(!e(i[s],s,i))return!1;return!0}function Et(i){return fn(i,function(e){return e===null?"":(typeof e=="object"&&(e=ut(e)),encodeURIComponent(ue(e.toString())))})}function At(i){var e=Ct(i,function(o){return o!==void 0}),s=Tt(zt(Et(e)),Te.method("join","=")).join("&");return s}function Pt(i){var e=[],s=[];return(function o(u,x){var N,X,se;switch(typeof u){case"object":if(!u)return null;for(N=0;N<e.length;N+=1)if(e[N]===u)return{$ref:s[N]};if(e.push(u),s.push(x),Object.prototype.toString.apply(u)==="[object Array]")for(se=[],N=0;N<u.length;N+=1)se[N]=o(u[N],x+"["+N+"]");else{se={};for(X in u)Object.prototype.hasOwnProperty.call(u,X)&&(se[X]=o(u[X],x+"["+JSON.stringify(X)+"]"))}return se;case"number":case"string":case"boolean":return u}})(i,"$")}function ut(i){try{return JSON.stringify(i)}catch{return JSON.stringify(Pt(i))}}class Lt{constructor(){this.globalLog=e=>{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}
2log(e,...s){var o=St.apply(this,arguments);Gt.log?Gt.log(o):Gt.logToConsole&&e.bind(this)(o)}}const ge=new Lt;var bt=function(i,e,s,o,u){(s.headers!==void 0||s.headersProvider!=null)&&ge.warn(`To send headers with the ${o.toString()} request, you must use AJAX, rather than JSONP.`);var x=i.nextAuthCallbackID.toString();i.nextAuthCallbackID++;var N=i.getDocument(),X=N.createElement("script");i.auth_callbacks[x]=function(me){u(null,me)};var se="Pusher.auth_callbacks['"+x+"']";X.src=s.endpoint+"?callback="+encodeURIComponent(se)+"&"+e;var he=N.getElementsByTagName("head")[0]||N.documentElement;he.insertBefore(X,he.firstChild)};const tt=bt;class Mt{constructor(e){this.src=e}send(e){var s=this,o="Error loading "+s.src;s.script=document.createElement("script"),s.script.id=e.id,s.script.src=s.src,s.script.type="text/javascript",s.script.charset="UTF-8",s.script.addEventListener?(s.script.onerror=function(){e.callback(o)},s.script.onload=function(){e.callback(null)}):s.script.onreadystatechange=function(){(s.script.readyState==="loaded"||s.script.readyState==="complete")&&e.callback(null)},s.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(s.errorScript=document.createElement("script"),s.errorScript.id=e.id+"_error",s.errorScript.text=e.name+"('"+o+"');",s.script.async=s.errorScript.async=!1):s.script.async=!0;var u=document.getElementsByTagName("head")[0];u.insertBefore(s.script,u.firstChild),s.errorScript&&u.insertBefore(s.errorScript,s.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Ve{constructor(e,s){this.url=e,this.data=s}send(e){if(!this.request){var s=At(this.data),o=this.url+"/"+e.number+"?"+s;this.request=ie.createScriptRequest(o),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var yt=function(i,e){return function(s,o){var u="http"+(e?"s":"")+"://",x=u+(i.host||i.options.host)+i.options.path,N=ie.createJSONPRequest(x,s),X=ie.ScriptReceivers.create(function(se,he){T.remove(X),N.cleanup(),he&&he.host&&(i.host=he.host),o&&o(se,he)});N.send(X)}},Ot={name:"jsonp",getAgent:yt};const jt=Ot;function ve(i,e,s){var o=i+(e.useTLS?"s":""),u=e.useTLS?e.hostTLS:e.hostNonTLS;return o+"://"+u+s}function c(i,e){var s="/app/"+i,o="?protocol="+b.PROTOCOL+"&client=js&version="+b.VERSION+(e?"&"+e:"");return s+o}var m={getInitial:function(i,e){var s=(e.httpPath||"")+c(i,"flash=false");return ve("ws",e,s)}},y={getInitial:function(i,e){var s=(e.httpPath||"/pusher")+c(i);return ve("http",e,s)}},_={getInitial:function(i,e){return ve("http",e,e.httpPath||"/pusher")},getPath:function(i,e){return c(i)}};class F{constructor(){this._callbacks={}}get(e){return this._callbacks[C(e)]}add(e,s,o){var u=C(e);this._callbacks[u]=this._callbacks[u]||[],this._callbacks[u].push({fn:s,context:o})}remove(e,s,o){if(!e&&!s&&!o){this._callbacks={};return}var u=e?[C(e)]:Xe(this._callbacks);s||o?this.removeCallback(u,s,o):this.removeAllCallbacks(u)}removeCallback(e,s,o){Qe(e,function(u){this._callbacks[u]=gt(this._callbacks[u]||[],function(x){return s&&s!==x.fn||o&&o!==x.context}),this._callbacks[u].length===0&&delete this._callbacks[u]},this)}removeAllCallbacks(e){Qe(e,function(s){delete this._callbacks[s]},this)}}function C(i){return"_"+i}class S{constructor(e){this.callbacks=new F,this.global_callbacks=[],this.failThrough=e}bind(e,s,o){return this.callbacks.add(e,s,o),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,s,o){return this.callbacks.remove(e,s,o),this}unbind_global(e){return e?(this.global_callbacks=gt(this.global_callbacks||[],s=>s!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,s,o){for(var u=0;u<this.global_callbacks.length;u++)this.global_callbacks[u](e,s);var x=this.callbacks.get(e),N=[];if(o?N.push(s,o):s&&N.push(s),x&&x.length>0)for(var u=0;u<x.length;u++)x[u].fn.apply(x[u].context||window,N);else this.failThrough&&this.failThrough(e,s);return this}}class R extends S{constructor(e,s,o,u,x){super(),this.initialize=ie.transportConnectionInitializer,this.hooks=e,this.name=s,this.priority=o,this.key=u,this.options=x,this.state="new",this.timeline=x.timeline,this.activityTimeout=x.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var e=this.hooks.urls.getInitial(this.key,this.options);
2try{this.socket=this.hooks.getSocket(e,this.options)}catch(s){return Te.defer(()=>{this.onError(s),this.changeState("closed")}),!1}return this.bindListeners(),ge.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?(Te.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,s){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:s})),this.emit(e,s)}buildTimelineMessage(e){return Re({cid:this.id},e)}}class q{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,s,o,u){return new R(this.hooks,e,s,o,u)}}var W=new q({urls:m,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!ie.getWebSocketAPI()},isSupported:function(){return!!ie.getWebSocketAPI()},getSocket:function(i){return ie.createWebSocket(i)}}),Z={urls:y,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},ce=Re({getSocket:function(i){return ie.HTTPFactory.createStreamingSocket(i)}},Z),be=Re({getSocket:function(i){return ie.HTTPFactory.createPollingSocket(i)}},Z),ye={isSupported:function(){return ie.isXHRSupported()}},Se=new q(Re({},ce,ye)),xe=new q(Re({},be,ye)),Ie={ws:W,xhr_streaming:Se,xhr_polling:xe};const Me=Ie;var pe=new q({file:"sockjs",urls:_,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(i,e){return new window.SockJS(i,null,{js_path:H.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(i,e){i.send(JSON.stringify({path:e}))}}),Ce={isSupported:function(i){var e=ie.isXDRSupported(i.useTLS);return e}},qt=new q(Re({},ce,Ce)),nt=new q(Re({},be,Ce));Me.xdr_streaming=qt,Me.xdr_polling=nt,Me.sockjs=pe;const st=Me;class pn extends S{constructor(){super();var e=this;typeof window<"u"&&window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Ds=new pn;class Hs{constructor(e,s,o){this.manager=e,this.transport=s,this.minPingDelay=o.minPingDelay,this.maxPingDelay=o.maxPingDelay,this.pingDelay=void 0}createConnection(e,s,o,u){u=Re({},u,{activityTimeout:this.pingDelay});var x=this.transport.createConnection(e,s,o,u),N=null,X=function(){x.unbind("open",X),x.bind("closed",se),N=Te.now()},se=he=>{if(x.unbind("closed",se),he.code===1002||he.code===1003)this.manager.reportDeath();else if(!he.wasClean&&N){var me=Te.now()-N;me<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(me/2,this.minPingDelay))}};return x.bind("open",X),x}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Nn={decodeMessage:function(i){try{var e=JSON.parse(i.data),s=e.data;if(typeof s=="string")try{s=JSON.parse(e.data)}catch{}var o={event:e.event,channel:e.channel,data:s};return e.user_id&&(o.user_id=e.user_id),o}catch(u){throw{type:"MessageParseError",error:u,data:i.data}}},encodeMessage:function(i){return JSON.stringify(i)},processHandshake:function(i){var e=Nn.decodeMessage(i);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";
2return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(i){return i.code<4e3?i.code>=1002&&i.code<=1004?"backoff":null:i.code===4e3?"tls_only":i.code<4100?"refused":i.code<4200?"backoff":i.code<4300?"retry":"refused"},getCloseError:function(i){return i.code!==1e3&&i.code!==1001?{type:"PusherError",data:{code:i.code,message:i.reason||i.message}}:null}},ct=Nn;class $s extends S{constructor(e,s){super(),this.id=e,this.transport=s,this.activityTimeout=s.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,s,o){var u={event:e,data:s};return o&&(u.channel=o),ge.debug("Event sent",u),this.send(ct.encodeMessage(u))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:o=>{var u;try{u=ct.decodeMessage(o)}catch(x){this.emit("error",{type:"MessageParseError",error:x,data:o.data})}if(u!==void 0){switch(ge.debug("Event recd",u),u.event){case"pusher:error":this.emit
2("error",{type:"PusherError",data:u.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",u)}},activity:()=>{this.emit("activity")},error:o=>{this.emit("error",o)},closed:o=>{s(),o&&o.code&&this.handleCloseEvent(o),this.transport=null,this.emit("closed")}},s=()=>{Ne(e,(o,u)=>{this.transport.unbind(u,o)})};Ne(e,(o,u)=>{this.transport.bind(u,o)})}handleCloseEvent(e){var s=ct.getCloseAction(e),o=ct.getCloseError(e);o&&this.emit("error",o),s&&this.emit(s,{action:s,error:o})}}class Bs{constructor(e,s){this.transport=e,this.callback=s,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var s;try{s=ct.processHandshake(e)}catch(o){this.finish("error",{error:o}),this.transport.close();return}s.action==="connected"?this.finish("connected",{connection:new $s(s.id,this.transport),activityTimeout:s.activityTimeout}):(this.finish(s.action,{error:s.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var s=ct.getCloseAction(e)||"backoff",o=ct.getCloseError(e);this.finish(s,{error:o})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,s){this.callback(Re({transport:this.transport,action:e},s))}}class Us{constructor(e,s){this.timeline=e,this.options=s||{}}send(e,s){this.timeline.isEmpty()||this.timeline.send(ie.TimelineTransport.getAgent(this,e),s)}}class mn extends S{constructor(e,s){super(function(o,u){ge.debug("No callbacks on "+e+" for "+o)}),this.name=e,this.pusher=s,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,s){return s(null,{auth:""})}trigger(e,s){if(e.indexOf("client-")!==0)throw new M("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var o=O.buildLogSuffix("triggeringClientEvents");ge.warn(`Client event triggered before channel 'subscription_succeeded' event . ${o}`)}return this.pusher.send_event(e,s,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var s=e.event,o=e.data;if(s==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(s==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(s.indexOf("pusher_internal:")!==0){var u={};this.emit(s,o,u)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,s)=>{e?(this.subscriptionPending=!1,ge.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof J?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:s.auth,channel_data:s.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class vn extends mn{authorize(e,s){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},s)}}class Vs{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){Ne(this.members,(s,o)=>{e(this.get(o))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var s=this.get(e.user_id);return s&&(delete this.members[e.user_id],this.count--),s}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}
2var zs=function(i,e,s,o){function u(x){return x instanceof s?x:new s(function(N){N(x)})}return new(s||(s=Promise))(function(x,N){function X(me){try{he(o.next(me))}catch(Ee){N(Ee)}}function se(me){try{he(o.throw(me))}catch(Ee){N(Ee)}}function he(me){me.done?x(me.value):u(me.value).then(X,se)}he((o=o.apply(i,e||[])).next())})};class qs extends vn{constructor(e,s){super(e,s),this.members=new Vs}authorize(e,s){super.authorize(e,(o,u)=>zs(this,void 0,void 0,function*(){if(!o)if(u=u,u.channel_data!=null){var x=JSON.parse(u.channel_data);this.members.setMyID(x.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let N=O.buildLogSuffix("authorizationEndpoint");ge.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${N}, or the user should be signed in.`),s("Invalid auth response");return}s(o,u)}))}handleEvent(e){var s=e.event;if(s.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var o=e.data,u={};e.user_id&&(u.user_id=e.user_id),this.emit(s,o,u)}}handleInternalEvent(e){var s=e.event,o=e.data;switch(s){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var u=this.members.addMember(o);this.emit("pusher:member_added",u);break;case"pusher_internal:member_removed":var x=this.members.removeMember(o);x&&this.emit("pusher:member_removed",x);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ws=A(978),gn=A(594);class Xs extends vn{constructor(e,s,o){super(e,s),this.key=null,this.nacl=o}authorize(e,s){super.authorize(e,(o,u)=>{if(o){s(o,u);return}let x=u.shared_secret;if(!x){s(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,gn.decode)(x),delete u.shared_secret,s(null,u)})}trigger(e,s){throw new oe("Client events are not currently supported for encrypted channels")}handleEvent(e){var s=e.event,o=e.data;if(s.indexOf("pusher_internal:")===0||s.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(s,o)}handleEncryptedEvent(e,s){if(!this.key){ge.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!s.ciphertext||!s.nonce){ge.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+s);return}let o=(0,gn.decode)(s.ciphertext);if(o.length<this.nacl.secretbox.overheadLength){ge.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${o.length}`);return}let u=(0,gn.decode)(s.nonce);if(u.length<this.nacl.secretbox.nonceLength){ge.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${u.length}`);return}let x=this.nacl.secretbox.open(o,u,this.key);if(x===null){ge.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(N,X)=>{if(N){ge.error(`Failed to make a request to the authEndpoint: ${X}. Unable to fetch new key, so dropping encrypted event`);return}if(x=this.nacl.secretbox.open(o,u,this.key),x===null){ge.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(x))});return}this.emit(e,this.getDataToEmit(x))}getDataToEmit(e){let s=(0,Ws.D4)(e);try{return JSON.parse(s)}catch{return s}}}class Gs extends S{constructor(e,s){super(),this.state="initialized",this.connection=null,this.key=e,this.options=s,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var o=ie.getNetwork();o.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),o.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(e){this.key=e,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,s,o){return this.connection?this.connection.send_event(e,s,o):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(s,o)=>{s?this.runner=this.strategy.connect(0,e):o.action==="error"?(this.emit
2("error",{type:"HandshakeError",error:o.error}),this.timeline.error({handshakeError:o.error})):(this.abortConnecting(),this.handshakeCallbacks[o.action](o))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new $e(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new $e(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new $e(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new $e(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return Re({},e,{message:s=>{this.resetActivityCheck(),this.emit("message",s)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:s=>{this.emit("error",s)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return Re({},e,{connected:s=>{this.activityTimeout=Math.min(this.options.activityTimeout,s.activityTimeout,s.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(s.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=s=>o=>{o.error&&this.emit("error",{type:"WebSocketError",error:o.error}),s(o)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var s in this.connectionCallbacks)this.connection.bind(s,this.connectionCallbacks[s]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var s=this.connection;return this.connection=null,s}}updateState(e,s){var o=this.state;if(this.state=e,o!==e){var u=e;u==="connected"&&(u+=" with new socket ID "+s.socket_id),ge.debug("State changed",o+" -> "+u),this.timeline.info({state:e,params:s}),this.emit("state_change",{previous:o,current:e}),this.emit(e,s)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Ks{constructor(){this.channels={}}add(e,s){return this.channels[e]||(this.channels[e]=Ys(e,s)),this.channels[e]}all(){return Vt(this.channels)}find(e){return this.channels[e]}remove(e){var s=this.channels[e];return delete this.channels[e],s}disconnect(){Ne(this.channels,function(e){e.disconnect()})}}function Ys(i,e){if(i.indexOf("private-encrypted-")===0){if(e.config.nacl)return Ze.createEncryptedChannel(i,e,e.config.nacl);let s="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",o=O.buildLogSuffix("encryptedChannelSupport");throw new oe(`${s}. ${o}`)}else{if(i.indexOf("private-")===0)return Ze.createPrivateChannel(i,e);if(i.indexOf("presence-")===0)return Ze.createPresenceChannel(i,e);if(i.indexOf("#")===0)throw new P('Cannot create a channel with name "'+i+'".');return Ze.createChannel(i,e)}}var Js={createChannels(){return new Ks},createConnectionManager(i,e){return new Gs(i,e)},createChannel(i,e){return new mn(i,e)},createPrivateChannel(i,e){return new vn(i,e)},createPresenceChannel(i,e){return new qs(i,e)}
2,createEncryptedChannel(i,e,s){return new Xs(i,e,s)},createTimelineSender(i,e){return new Us(i,e)},createHandshake(i,e){return new Bs(i,e)},createAssistantToTheTransportManager(i,e,s){return new Hs(i,e,s)}};const Ze=Js;class Dn{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return Ze.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class dt{constructor(e,s){this.strategies=e,this.loop=!!s.loop,this.failFast=!!s.failFast,this.timeout=s.timeout,this.timeoutLimit=s.timeoutLimit}isSupported(){return et(this.strategies,Te.method("isSupported"))}connect(e,s){var o=this.strategies,u=0,x=this.timeout,N=null,X=(se,he)=>{he?s(null,he):(u=u+1,this.loop&&(u=u%o.length),u<o.length?(x&&(x=x*2,this.timeoutLimit&&(x=Math.min(x,this.timeoutLimit))),N=this.tryStrategy(o[u],e,{timeout:x,failFast:this.failFast},X)):s(!0))};return N=this.tryStrategy(o[u],e,{timeout:x,failFast:this.failFast},X),{abort:function(){N.abort()},forceMinPriority:function(se){e=se,N&&N.forceMinPriority(se)}}}tryStrategy(e,s,o,u){var x=null,N=null;return o.timeout>0&&(x=new $e(o.timeout,function(){N.abort(),u(!0)})),N=e.connect(s,function(X,se){X&&x&&x.isRunning()&&!o.failFast||(x&&x.ensureAborted(),u(X,se))}),{abort:function(){x&&x.ensureAborted(),N.abort()},forceMinPriority:function(X){N.forceMinPriority(X)}}}}class bn{constructor(e){this.strategies=e}isSupported(){return et(this.strategies,Te.method("isSupported"))}connect(e,s){return Zs(this.strategies,e,function(o,u){return function(x,N){if(u[o].error=x,x){Qs(u)&&s(!0);return}Qe(u,function(X){X.forceMinPriority(N.transport.priority)}),s(null,N)}})}}function Zs(i,e,s){var o=Tt(i,function(u,x,N,X){return u.connect(e,s(x,X))});return{abort:function(){Qe(o,ei)},forceMinPriority:function(u){Qe(o,function(x){x.forceMinPriority(u)})}}}function Qs(i){return Je(i,function(e){return!!e.error})}function ei(i){!i.error&&!i.aborted&&(i.abort(),i.aborted=!0)}class ti{constructor(e,s,o){this.strategy=e,this.transports=s,this.ttl=o.ttl||18e5,this.usingTLS=o.useTLS,this.timeline=o.timeline}isSupported(){return this.strategy.isSupported()}connect(e,s){var o=this.usingTLS,u=ni(o),x=u&&u.cacheSkipCount?u.cacheSkipCount:0,N=[this.strategy];if(u&&u.timestamp+this.ttl>=Te.now()){var X=this.transports[u.transport];X&&(["ws","wss"].includes(u.transport)||x>3?(this.timeline.info({cached:!0,transport:u.transport,latency:u.latency}),N.push(new dt([X],{timeout:u.latency*2+1e3,failFast:!0}))):x++)}var se=Te.now(),he=N.pop().connect(e,function me(Ee,Kt){Ee?(Hn(o),N.length>0?(se=Te.now(),he=N.pop().connect(e,me)):s(Ee)):(si(o,Kt.transport.name,Te.now()-se,x),s(null,Kt))});return{abort:function(){he.abort()},forceMinPriority:function(me){e=me,he&&he.forceMinPriority(me)}}}}function yn(i){return"pusherTransport"+(i?"TLS":"NonTLS")}function ni(i){var e=ie.getLocalStorage();if(e)try{var s=e[yn(i)];if(s)return JSON.parse(s)}catch{Hn(i)}return null}function si(i,e,s,o){var u=ie.getLocalStorage();if(u)try{u[yn(i)]=ut({timestamp:Te.now(),transport:e,latency:s,cacheSkipCount:o})}catch{}}function Hn(i){var e=ie.getLocalStorage();if(e)try{delete e[yn(i)]}catch{}}class Wt{constructor(e,{delay:s}){this.strategy=e,this.options={delay:s}}isSupported(){return this.strategy.isSupported()}connect(e,s){var o=this.strategy,u,x=new $e(this.options.delay,function(){u=o.connect(e,s)});return{abort:function(){x.ensureAborted(),u&&u.abort()},forceMinPriority:function(N){e=N,u&&u.forceMinPriority(N)}}}}class Rt{constructor(e,s,o){this.test=e,this.trueBranch=s,this.falseBranch=o}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,s){var o=this.test()?this.trueBranch:this.falseBranch;return o.connect(e,s)}}class ii{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,s){var o=this.strategy.connect(e,function(u,x){x&&o.abort(),s(u,x)});return o}}function It(i){return function(){return i.isSupported()}}
2var ri=function(i,e,s){var o={};function u(Zn,nr,sr,ir,rr){var Qn=s(i,Zn,nr,sr,ir,rr);return o[Zn]=Qn,Qn}var x=Object.assign({},e,{hostNonTLS:i.wsHost+":"+i.wsPort,hostTLS:i.wsHost+":"+i.wssPort,httpPath:i.wsPath}),N=Object.assign({},x,{useTLS:!0}),X=Object.assign({},e,{hostNonTLS:i.httpHost+":"+i.httpPort,hostTLS:i.httpHost+":"+i.httpsPort,httpPath:i.httpPath}),se={loop:!0,timeout:15e3,timeoutLimit:6e4},he=new Dn({minPingDelay:1e4,maxPingDelay:i.activityTimeout}),me=new Dn({lives:2,minPingDelay:1e4,maxPingDelay:i.activityTimeout}),Ee=u("ws","ws",3,x,he),Kt=u("wss","ws",3,N,he),Ji=u("sockjs","sockjs",1,X),Wn=u("xhr_streaming","xhr_streaming",1,X,me),Zi=u("xdr_streaming","xdr_streaming",1,X,me),Xn=u("xhr_polling","xhr_polling",1,X),Qi=u("xdr_polling","xdr_polling",1,X),Gn=new dt([Ee],se),er=new dt([Kt],se),tr=new dt([Ji],se),Kn=new dt([new Rt(It(Wn),Wn,Zi)],se),Yn=new dt([new Rt(It(Xn),Xn,Qi)],se),Jn=new dt([new Rt(It(Kn),new bn([Kn,new Wt(Yn,{delay:4e3})]),Yn)],se),wn=new Rt(It(Jn),Jn,tr),Sn;return e.useTLS?Sn=new bn([Gn,new Wt(wn,{delay:2e3})]):Sn=new bn([Gn,new Wt(er,{delay:2e3}),new Wt(wn,{delay:5e3})]),new ti(new ii(new Rt(It(Ee),Sn,wn)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})};const oi=ri;function ai(){var i=this;i.timeline.info(i.buildTimelineMessage({transport:i.name+(i.options.useTLS?"s":"")})),i.hooks.isInitialized()?i.changeState("initialized"):i.hooks.file?(i.changeState("initializing"),H.load(i.hooks.file,{useTLS:i.options.useTLS},function(e,s){i.hooks.isInitialized()?(i.changeState("initialized"),s(!0)):(e&&i.onError(e),i.onClose(),s(!1))})):i.onClose()}var li={getRequest:function(i){var e=new window.XDomainRequest;return e.ontimeout=function(){i.emit("error",new Y),i.close()},e.onerror=function(s){i.emit("error",s),i.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&i.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&i.onChunk(200,e.responseText),i.emit("finished",200),i.close()},e},abortRequest:function(i){i.ontimeout=i.onerror=i.onprogress=i.onload=null,i.abort()}};const ui=li,ci=256*1024;class di extends S{constructor(e,s,o){super(),this.hooks=e,this.method=s,this.url=o}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},ie.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(ie.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,s){for(;;){var o=this.advanceBuffer(s);if(o)this.emit("chunk",{status:e,data:o});else break}this.isBufferTooLong(s)&&this.emit("buffer_too_long")}advanceBuffer(e){var s=e.slice(this.position),o=s.indexOf(` 3`);return o!==-1?(this.position+=o+1,s.slice(0,o)):null}isBufferTooLong(e){return this.position===e.length&&e.length>ci}}var _n;(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.OPEN=1]="OPEN",i[i.CLOSED=3]="CLOSED"})(_n||(_n={}));const ht=_n;var hi=1;class fi{constructor(e,s){this.hooks=e,this.session=Bn(1e3)+"/"+gi(8),this.location=pi(s),this.readyState=ht.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,s){this.onClose(e,s,!0)}sendRaw(e){if(this.readyState===ht.OPEN)try{return ie.createSocketRequest("POST",$n(mi(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,s,o){this.closeStream(),this.readyState=ht.CLOSED,this.onclose&&this.onclose({code:e,reason:s,wasClean:o})}onChunk(e){if(e.status===200){this.readyState===ht.OPEN&&this.onActivity();var s,o=e.data.slice(0,1);switch(o){case"o":s=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(s);break;case"a":s=JSON.parse(e.data.slice(1)||"[]");for(var u=0;u<s.length;u++)this.onEvent(s[u]);break;case"m":s=JSON.parse(e.data.slice(1)||"null"),this.onEvent(s);break;case"h":this.hooks.onHeartbeat(this);break;case"c":s=JSON.parse(e.data.slice(1)||"[]"),this.onClose(s[0],s[1],!0);break}}}onOpen(e){this.readyState===ht.CONNECTING?(e&&e.hostname&&(this.location.base=vi(this.location.base,e.hostname)),this.readyState=ht.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===ht.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}
3onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=ie.createSocketRequest("POST",$n(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",e=>{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){Te.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function pi(i){var e=/([^\?]*)\/*(\??.*)/.exec(i);return{base:e[1],queryString:e[2]}}function mi(i,e){return i.base+"/"+e+"/xhr_send"}function $n(i){var e=i.indexOf("?")===-1?"?":"&";return i+e+"t="+ +new Date+"&n="+hi++}function vi(i,e){var s=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(i);return s[1]+e+s[3]}function Bn(i){return ie.randomInt(i)}function gi(i){for(var e=[],s=0;s<i;s++)e.push(Bn(32).toString(32));return e.join("")}const bi=fi;var yi={getReceiveURL:function(i,e){return i.base+"/"+e+"/xhr_streaming"+i.queryString},onHeartbeat:function(i){i.sendRaw("[]")},sendHeartbeat:function(i){i.sendRaw("[]")},onFinished:function(i,e){i.onClose(1006,"Connection interrupted ("+e+")",!1)}};const _i=yi;var ki={getReceiveURL:function(i,e){return i.base+"/"+e+"/xhr"+i.queryString},onHeartbeat:function(){},sendHeartbeat:function(i){i.sendRaw("[]")},onFinished:function(i,e){e===200?i.reconnect():i.onClose(1006,"Connection interrupted ("+e+")",!1)}};const wi=ki;var Si={getRequest:function(i){var e=ie.getXHRAPI(),s=new e;return s.onreadystatechange=s.onprogress=function(){switch(s.readyState){case 3:s.responseText&&s.responseText.length>0&&i.onChunk(s.status,s.responseText);break;case 4:s.responseText&&s.responseText.length>0&&i.onChunk(s.status,s.responseText),i.emit("finished",s.status),i.close();break}},s},abortRequest:function(i){i.onreadystatechange=null,i.abort()}};const xi=Si;var Ti={createStreamingSocket(i){return this.createSocket(_i,i)},createPollingSocket(i){return this.createSocket(wi,i)},createSocket(i,e){return new bi(i,e)},createXHR(i,e){return this.createRequest(xi,i,e)},createRequest(i,e,s){return new di(i,e,s)}};const Un=Ti;Un.createXDR=function(i,e){return this.createRequest(ui,i,e)};var Ci={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:T,DependenciesReceivers:E,getDefaultStrategy:oi,Transports:st,transportConnectionInitializer:ai,HTTPFactory:Un,TimelineTransport:jt,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(i){if(typeof window<"u"){window.Pusher=i;var e=()=>{this.onDocumentBody(i.ready)};window.JSON?e():H.load("json2",{},e)}},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:le,jsonp:tt}},onDocumentBody(i){document.body?i():setTimeout(()=>{this.onDocumentBody(i)},0)},createJSONPRequest(i,e){return new Ve(i,e)},createScriptRequest(i){return new Mt(i)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var i=this.getXHRAPI();return new i},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Ds},createWebSocket(i){var e=this.getWebSocketAPI();return new e(i)},createSocketRequest(i,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(i,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(i,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var i=this.getXHRAPI();return!!i&&new i().withCredentials!==void 0},isXDRSupported(i){var e=i?"https:":"http:",s=this.getProtocol();return!!window.XDomainRequest&&s===e},addUnloadListener(i){window.addEventListener!==void 0?window.addEventListener("pagehide",i,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",i)},removeUnloadListener(i){window.addEventListener!==void 0?window.removeEventListener("pagehide",i,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",i)},randomInt(i){const e=window.crypto||window.msCrypto,s=Math.floor(Math.pow(2,32)/i)*i;let o;do o=e.getRandomValues(new Uint32Array(1))[0];while(o>=s);return o%i}};const ie=Ci;var kn;(function(i){i[i.ERROR=3]="ERROR",i[i.INFO=6]="INFO",i[i.DEBUG=7]="DEBUG"})(kn||(kn={}));const Xt=kn;class Ei{constructor(e,s,o){this.key=e,this.session=s,this.events=[],this.options=o||{},this.sent=0,this.uniqueID=0}log(e,s){e<=this.options.level&&(this.events.push(Re({},s,{timestamp:Te.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(Xt.ERROR,e)}info(e){this.log(Xt.INFO,e)}debug(e){this.log(Xt.DEBUG,e)}isEmpty(){return this.events.length===0}
3send(e,s){var o=Re({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(o,(u,x)=>{u||this.sent++,s&&s(u,x)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Ai{constructor(e,s,o,u){this.name=e,this.priority=s,this.transport=o,this.options=u||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,s){if(this.isSupported()){if(this.priority<e)return Vn(new $,s)}else return Vn(new _e,s);var o=!1,u=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),x=null,N=function(){u.unbind("initialized",N),u.connect()},X=function(){x=Ze.createHandshake(u,function(Ee){o=!0,me(),s(null,Ee)})},se=function(Ee){me(),s(Ee)},he=function(){me();var Ee;Ee=ut(u),s(new te(Ee))},me=function(){u.unbind("initialized",N),u.unbind("open",X),u.unbind("error",se),u.unbind("closed",he)};return u.bind("initialized",N),u.bind("open",X),u.bind("error",se),u.bind("closed",he),u.initialize(),{abort:()=>{o||(me(),x?x.close():u.close())},forceMinPriority:Ee=>{o||this.priority<Ee&&(x?x.close():u.close())}}}}function Vn(i,e){return Te.defer(function(){e(i)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Pi}=ie;var Li=function(i,e,s,o,u,x){var N=Pi[s];if(!N)throw new re(s);var X=(!i.enabledTransports||xt(i.enabledTransports,e)!==-1)&&(!i.disabledTransports||xt(i.disabledTransports,e)===-1),se;return X?(u=Object.assign({ignoreNullOrigin:i.ignoreNullOrigin},u),se=new Ai(e,o,x?x.getAssistant(N):N,u)):se=Mi,se},Mi={isSupported:function(){return!1},connect:function(i,e){var s=Te.defer(function(){e(new _e)});return{abort:function(){s.ensureAborted()},forceMinPriority:function(){}}}};function Oi(i){if(i==null)throw"You must pass an options object";if(i.cluster==null)throw"Options object must provide a cluster";"disableStats"in i&&ge.warn("The disableStats option is deprecated in favor of enableStats")}const ji=(i,e)=>{var s="socket_id="+encodeURIComponent(i.socketId);for(var o in e.params)s+="&"+encodeURIComponent(o)+"="+encodeURIComponent(e.params[o]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var o in u)s+="&"+encodeURIComponent(o)+"="+encodeURIComponent(u[o])}return s},Ri=i=>{if(typeof ie.getAuthorizers()[i.transport]>"u")throw`'${i.transport}' is not a recognized auth transport`;return(e,s)=>{const o=ji(e,i);ie.getAuthorizers()[i.transport](ie,o,i,g.UserAuthentication,s)}},Ii=(i,e)=>{var s="socket_id="+encodeURIComponent(i.socketId);s+="&channel_name="+encodeURIComponent(i.channelName);for(var o in e.params)s+="&"+encodeURIComponent(o)+"="+encodeURIComponent(e.params[o]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var o in u)s+="&"+encodeURIComponent(o)+"="+encodeURIComponent(u[o])}return s},Fi=i=>{if(typeof ie.getAuthorizers()[i.transport]>"u")throw`'${i.transport}' is not a recognized auth transport`;return(e,s)=>{const o=Ii(e,i);ie.getAuthorizers()[i.transport](ie,o,i,g.ChannelAuthorization,s)}},Ni=(i,e,s)=>{const o={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(u,x)=>{const N=i.channel(u.channelName);s(N,o).authorize(u.socketId,x)}};function zn(i,e){let s={activityTimeout:i.activityTimeout||b.activityTimeout,cluster:i.cluster,httpPath:i.httpPath||b.httpPath,httpPort:i.httpPort||b.httpPort,httpsPort:i.httpsPort||b.httpsPort,pongTimeout:i.pongTimeout||b.pongTimeout,statsHost:i.statsHost||b.stats_host,unavailableTimeout:i.unavailableTimeout||b.unavailableTimeout,wsPath:i.wsPath||b.wsPath,wsPort:i.wsPort||b.wsPort,wssPort:i.wssPort||b.wssPort,enableStats:Ui(i),httpHost:Di(i),useTLS:Bi(i),wsHost:Hi(i),userAuthenticator:Vi(i),channelAuthorizer:qi(i,e)};return"disabledTransports"in i&&(s.disabledTransports=i.disabledTransports),"enabledTransports"in i&&(s.enabledTransports=i.enabledTransports),"ignoreNullOrigin"in i&&(s.ignoreNullOrigin=i.ignoreNullOrigin),"timelineParams"in i&&(s.timelineParams=i.timelineParams),"nacl"in i&&(s.nacl=i.nacl),s}function Di(i){return i.httpHost?i.httpHost:i.cluster?`sockjs-${i.cluster}.pusher.com`:b.httpHost}function Hi(i){return i.wsHost?i.wsHost:$i(i.cluster)}function $i(i){return`ws-${i}.pusher.com`}function Bi(i){return ie.getProtocol()==="https:"?!0:i.forceTLS!==!1}function Ui(i){return"enableStats"in i?i.enableStats:"disableStats"in i?!i.disableStats:!1}const qn=i=>"customHandler"in i&&i.customHandler!=null;function Vi(i){const e=Object.assign(Object.assign({},b.userAuthentication),i.userAuthentication);return qn(e)?e.customHandler:Ri(e)}function zi(i,e){let s;return"channelAuthorization"in i?s=Object.assign(Object.assign({},b.channelAuthorization),i.channelAuthorization):(s={transport:i.authTransport||b.authTransport,endpoint:i.authEndpoint||b.authEndpoint},"auth"in i&&("params"in i.auth&&(s.params=i.auth.params),"headers"in i.auth&&(s.headers=i.auth.headers)),"authorizer"in i&&(s.customHandler=Ni(e,s,i.authorizer))),s}function qi(i,e){const s=zi(i,e);return qn(s)?s.customHandler:Fi(s)}class Wi extends S{constructor(e){super(function(s,o){ge.debug(`No callbacks on watchlist events for ${s}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}
3handleEvent(e){e.data.events.forEach(s=>{this.emit(s.name,s)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var s=e.event;s==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Xi(){let i,e;return{promise:new Promise((o,u)=>{i=o,e=u}),resolve:i,reject:e}}const Gi=Xi;class Ki extends S{constructor(e){super(function(s,o){ge.debug("No callbacks on user for "+s)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(s,o)=>{if(s){ge.warn(`Error during signin: ${s}`),this.emit("pusher:signin_error",Object.assign({},{type:"AuthError",error:s.message},s instanceof J?{status:s.status}:{})),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:o.auth,user_data:o.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:s,current:o})=>{s!=="connected"&&o==="connected"&&this._signin(),s==="connected"&&o!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Wi(e),this.pusher.connection.bind("message",s=>{var o=s.event;o==="pusher:signin_success"&&this._onSigninSuccess(s.data),this.serverToUserChannel&&this.serverToUserChannel.name===s.channel&&this.serverToUserChannel.handleEvent(s)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{ge.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){ge.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=s=>{s.subscriptionPending&&s.subscriptionCancelled?s.reinstateSubscription():!s.subscriptionPending&&this.pusher.connection.state==="connected"&&s.subscribe()};this.serverToUserChannel=new mn(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((s,o)=>{s.indexOf("pusher_internal:")===0||s.indexOf("pusher:")===0||this.emit(s,o)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:s}=Gi();e.done=!1;const o=()=>{e.done=!0};e.then(o).catch(o),this.signinDonePromise=e,this._signinDoneResolve=s}}class De{static ready(){De.isReady=!0;for(var e=0,s=De.instances.length;e<s;e++)De.instances[e].connect()}static getClientFeatures(){return Xe(Ct({ws:ie.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,s){Yi(e),Oi(s),this.key=e,this.options=s,this.config=zn(this.options,this),this.channels=Ze.createChannels(),this.global_emitter=new S,this.sessionID=ie.randomInt(1e9),this.timeline=new Ei(this.key,this.sessionID,{cluster:this.config.cluster,features:De.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Xt.INFO,version:b.VERSION}),this.config.enableStats&&(this.timelineSender=Ze.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+ie.TimelineTransport.name}));var o=u=>ie.getDefaultStrategy(this.config,u,Li);this.connection=Ze.createConnectionManager(this.key,{getStrategy:o,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",u=>{var x=u.event,N=x.indexOf("pusher_internal:")===0;if(u.channel){var X=this.channel(u.channel);X&&X.handleEvent(u)}N||this.global_emitter.emit(u.event,u.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",u=>{ge.warn(u)}),De.instances.push(this),this.timeline.info({instances:De.instances.length}),this.user=new Ki(this),De.isReady&&this.connect()}switchCluster(e){const{appKey:s,cluster:o}=e;this.key=s,this.options=Object.assign(Object.assign({},this.options),{cluster:o}),this.config=zn(this.options,this),this.connection.switchCluster(this.key)}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),s=this.timelineSender;this.timelineSenderTimer=new vt(6e4,function(){s.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,s,o){return this.global_emitter.bind(e,s,o),this}unbind(e,s,o){return this.global_emitter.unbind(e,s,o),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;
3for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var s=this.channels.add(e,this);return s.subscriptionPending&&s.subscriptionCancelled?s.reinstateSubscription():!s.subscriptionPending&&this.connection.state==="connected"&&s.subscribe(),s}unsubscribe(e){var s=this.channels.find(e);s&&s.subscriptionPending?s.cancelSubscription():(s=this.channels.remove(e),s&&s.subscribed&&s.unsubscribe())}send_event(e,s,o){return this.connection.send_event(e,s,o)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}De.instances=[],De.isReady=!1,De.logToConsole=!1,De.Runtime=ie,De.ScriptReceivers=ie.ScriptReceivers,De.DependenciesReceivers=ie.DependenciesReceivers,De.auth_callbacks=ie.auth_callbacks;const Gt=De;function Yi(i){if(i==null)throw"You must pass your app key when you instantiate Pusher."}ie.setup(De)}},k={};function l(h){var L=k[h];if(L!==void 0)return L.exports;var A=k[h]={exports:{}};return r[h].call(A.exports,A,A.exports,l),A.exports}l.d=(h,L)=>{for(var A in L)l.o(L,A)&&!l.o(h,A)&&Object.defineProperty(h,A,{enumerable:!0,get:L[A]})},l.o=(h,L)=>Object.prototype.hasOwnProperty.call(h,L);var f=l(721);return f})())})(Pn)),Pn.exports}var uo=lo();const co=ar(uo);window.Pusher=co;window.app_env=="local"&&(window.Pusher.logToConsole=!0);const xs={state:{createdAt:null,instance:void 0,isConnected:!1,components:{}},getUnixSeconds(){return Math.round(new Date().getTime()/1e3)},isBroadcastingEnabled(){return window.broadcast_driver&&window.broadcast_driver!=="log"&&window.broadcast_driver!=="null"},init(){this.isBroadcastingEnabled()&&(this.state.createdAt=this.getUnixSeconds(),this.state.instance=this.reverbInstance())},reverbInstance(){const n=(window.reverb_scheme??"https")==="https";return new ao({broadcaster:"reverb",key:window.reverb_key,wsHost:window.reverb_host,wsPort:window.reverb_port??80,wssPort:window.reverb_port??443,forceTLS:n,enabledTransports:["ws","wss"]})},listen(n,t){if(this.isBroadcastingEnabled())return this.state.components[n]={previousUpdate:null},typeof this.state.instance>"u"&&this.init(),this.state.instance.channel("auction-events").listen(".update",r=>{t(r.auction),this.state.components[n].previousUpdate=this.getUnixSeconds()})},listenFavoritesList(n,t){if(this.isBroadcastingEnabled())return typeof this.state.instance>"u"&&this.init(),this.state.instance.channel(`favorites.${n}`).listen("FavoritesUpdated",r=>{t(r.favorites)})},didReconnect(n,t){!this.isBroadcastingEnabled()||typeof this.state.instance>"u"||this.state.instance.connector.pusher.connection.bind("connected",()=>{setTimeout(()=>{this.shouldRefetch(n)&&t().then(()=>{this.state.components[n].previousUpdate=this.getUnixSeconds()}).catch(()=>{window.location.reload()})},1e3),this.state.isConnected=!0})},shouldRefetch(n){if(!this.state.isConnected||this.state.createdAt===null)return!1;const t=this.getUnixSeconds();return t-this.state.createdAt>30&&(this.state.components[n].previousUpdate===null||t-this.state.components[n].previousUpdate>30)}},ho={props:{modelValue:{type:Object,default:()=>{}},areas:{type:Array,default:()=>[]},categories:{type:Array,default:()=>[]},keywords:{type:Array,default:()=>[]},filterVisibility:{type:Object,default:()=>{}}},emits:["submit","update:modelValue"],data(){return{debounce:null,defaultVisibility:{haku:!0,alue:!1,kategoria:!1,piilota_paattyneet:!0,vain_varmat_kaupat:!0,jarjestys:!0}}},created(){this.areas&&this.areas.length>0&&(this.defaultVisibility.alue=!0),this.categories&&this.categories.length>0&&(this.defaultVisibility.kategoria=!0)},methods:{filterIsVisible(n){return this.filterVisibility&&this.filterVisibility[n]!==void 0?this.filterVisibility[n]:this.defaultVisibility[n]},debounceSearch(n,t){clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.modelValue.haku=n,this.filterChange("haku",n)},t)},filterInput(n){let t=n.target.name,r=n.target.value;this.filterChange(t,r)},switchCheckboxInput(n){let t=n.target.checked?1:0;this.filterChange(n.target.name,t)},filterChange(n,t){this.$emit("submit",{name:n,value:t})},submit(n){let r=new FormData(n.target).get("search");this.debounceSearch(r,50)}}},fo={class:"flex flex-row items-center gap-4 flex-wrap"},po={class:"flex-auto relative"},mo=["value"],vo=["value"],go=["value"],bo=["value"],yo={class:"flex justify-content-between flex-wrap gap-4"},_o={class:"flex flex-row gap-x-4 gap-y-2 flex-wrap"},ko={key:0,class:"flex items-center text-regular mb-0 whitespace-nowrap"},wo={key:1,class:"flex items-center text-regular mb-0 whitespace-nowrap"},So={key:0,class:"flex flex-row gap-y-2 gap-x-4 flex-wrap auction-list-sort-options"};function xo(n,t,r,k,l,f){return p(),v("form",{onSubmit:t[15]||(t[15]=Ge((...h)=>f.submit&&f.submit(...h),["prevent"])),class:"flex flex-col gap-4"},[a("div",fo,[a("div",po,[f.filterIsVisible("haku")?(p(),v("input",{key:0,t
3ype:"search",style:{"min-width":"250px"},name:"search",placeholder:"Haku",class:"form-control search-input",value:r.modelValue.haku,onInput:t[0]||(t[0]=h=>f.debounceSearch(h.target.value,600))},null,40,mo)):V("",!0),t[16]||(t[16]=a("button",{type:"submit",class:"absolute right-0 inset-y-0 flex items-center pr-3 border-0 bg-transparent text-gray"},[a("i",{class:"far fa-search"})],-1))]),f.filterIsVisible("alue")?Ae((p(),v("select",{key:0,style:{"min-width":"200px"},class:"flex-1 form-control search-input",name:"alue","onUpdate:modelValue":t[1]||(t[1]=h=>r.modelValue.alue=h),onChange:t[2]||(t[2]=(...h)=>f.filterInput&&f.filterInput(...h))},[t[17]||(t[17]=a("option",{value:""},"Koko Suomi",-1)),(p(!0),v(fe,null,Fe(r.areas,h=>(p(),v("option",{key:"area-"+h.id,value:h.name},B(h.name),9,vo))),128))],544)),[[on,r.modelValue.alue]]):V("",!0),f.filterIsVisible("kategoria")?Ae((p(),v("select",{key:1,style:{"min-width":"200px"},name:"kategoria",class:"flex-1 form-control search-input","onUpdate:modelValue":t[3]||(t[3]=h=>r.modelValue.kategoria=h),onChange:t[4]||(t[4]=(...h)=>f.filterInput&&f.filterInput(...h))},[t[18]||(t[18]=a("option",{value:""},"Kaikki kategoriat",-1)),(p(!0),v(fe,null,Fe(r.categories,h=>(p(),v(fe,{key:h.id},[a("option",{value:h.id},B(h.name),9,go),(p(!0),v(fe,null,Fe(h.subCats,L=>(p(),v("option",{value:L.id,key:L.id},"  "+B(L.name),9,bo))),128))],64))),128))],544)),[[on,r.modelValue.kategoria]]):V("",!0)]),a("div",yo,[a("div",_o,[f.filterIsVisible("piilota_paattyneet")?(p(),v("label",ko,[Ae(a("input",{class:"mt-0 mr-2",type:"checkbox",role:"switch",name:"piilota_paattyneet","true-value":1,"false-value":0,"onUpdate:modelValue":t[5]||(t[5]=h=>r.modelValue.piilota_paattyneet=h),onChange:t[6]||(t[6]=(...h)=>f.switchCheckboxInput&&f.switchCheckboxInput(...h))},null,544),[[an,r.modelValue.piilota_paattyneet]]),t[19]||(t[19]=ee(" Piilota päättyneet ",-1))])):V("",!0),f.filterIsVisible("vain_varmat_kaupat")?(p(),v("label",wo,[Ae(a("input",{class:"mt-0 mr-2",type:"checkbox",role:"switch",name:"vain_varmat_kaupat","true-value":1,"false-value":0,"onUpdate:modelValue":t[7]||(t[7]=h=>r.modelValue.vain_varmat_kaupat=h),onChange:t[8]||(t[8]=(...h)=>f.switchCheckboxInput&&f.switchCheckboxInput(...h))},null,544),[[an,r.modelValue.vain_varmat_kaupat]]),t[20]||(t[20]=ee(" Vain Varmat kaupat ",-1))])):V("",!0)]),f.filterIsVisible("jarjestys")?(p(),v("div",So,[a("label",{class:Be(["cursor-pointer",{active:r.modelValue.jarjestys=="suositut"}])},[t[21]||(t[21]=ee(" Suositut ",-1)),Ae(a("input",{type:"radio",class:"hidden",value:"suositut",name:"jarjestys",onChange:t[9]||(t[9]=(...h)=>f.filterInput&&f.filterInput(...h)),"onUpdate:modelValue":t[10]||(t[10]=h=>r.modelValue.jarjestys=h)},null,544),[[Dt,r.modelValue.jarjestys]])],2),a("label",{class:Be(["cursor-pointer",{active:r.modelValue.jarjestys=="uudet"}])},[t[22]||(t[22]=ee(" Uudet ",-1)),Ae(a("input",{type:"radio",class:"hidden",value:"uudet",name:"jarjestys",onChange:t[11]||(t[11]=(...h)=>f.filterInput&&f.filterInput(...h)),"onUpdate:modelValue":t[12]||(t[12]=h=>r.modelValue.jarjestys=h)},null,544),[[Dt,r.modelValue.jarjestys]])],2),a("label",{class:Be(["cursor-pointer",{active:r.modelValue.jarjestys=="paattyvat"}])},[t[23]||(t[23]=ee(" Päättyvät ",-1)),Ae(a("input",{type:"radio",class:"hidden",value:"paattyvat",name:"jarjestys",onChange:t[13]||(t[13]=(...h)=>f.filterInput&&f.filterInput(...h)),"onUpdate:modelValue":t[14]||(t[14]=h=>r.modelValue.jarjestys=h)},null,544),[[Dt,r.modelValue.jarjestys]])],2)])):V("",!0)])],32)}const To=Ue(ho,[["render",xo]]),Co={props:{buttonClass:{type:String,default:"btn btn-primary"},buttonText:{type:String,required:!0}},data(){return{showModal:!1}},components:{Modal:Mn}},Eo={key:0};function Ao(n,t,r,k,l,f){const h=Oe("Modal");return r.buttonText?(p(),v("div",Eo,[a("button",{onClick:t[0]||(t[0]=L=>l.showModal=!0),class:Be(r.buttonClass)},B(r.buttonText),3),l.showModal?(p(),We(h,{key:0,onClose:t[1]||(t[1]=L=>l.showModal=!1)},{default:He(()=>[a("div",null,[t[2]||(t[2]=a("h4",{class:"mt-0"},"Kiertonet Premium -ominaisuus",-1)),t[3]||(t[3]=ee(" Osta Kiertonet Premium ja saat seuraavat edut: ",-1)),t[4]||(t[4]=a("br",null,null,-1)),t[5]||(t[5]=a("ul",null,[a("li",null," Hakuvahti "),a("li",null," Korotusautomaatti "),a("li",null," Tekstiviesti-ilmoitukset "),a("li",null," Toivo myytävää ")],-1)),a("p",null,[a("b",null,"Alkaen 3,90 ⬠kuussa (sis. alv "+B(n.$root.config("vat_percent"))+" %)",1)]),t[6]||(t[6]=a("p",{class:"mb-0"},[a("a",{href:"/kiertonet-premium"},"Lue lisää & osta")],-1))])]),_:1})):V("",!0)])):V("",!0)}const Ns=Ue(Co,[["render",Ao]]),Po={components:{Modal:Mn,PremiumFeatureButton:Ns},data(){return{form:{message:"",area:""},showPurchaseWish:!1,areas:[],errors:[],submitting:!1}},methods:{openPurchaseWish(){if(!this.$root.user.isPremium){this.showPurchaseWish=!0;return}axios.get("/areas").then(n=>{this.areas=n.data,this.showPurchaseWish=!this.showPurchaseWish}).catch(n=>{console.log(n)})},submit(n){this.submitting=!0;let t=new FormData(n.target);axios.post("/purchase-wishes/create",t).then(r=>{window.location.reload()}).catch(r=>{r.response&&r.response.data&&r.response.data.errors&&r.response.data.errors.length&&(this.errors=r.response.data.errors[0]),this.loading=!1}).finally(()=>{this.submitting=!1})}}},Lo={key:0},Mo={class:"form-group"},Oo={class:"form-group"},jo=["value"],Ro={key:0,class:"alert alert-danger mt-3"},Io={class:"list-unstyled mb-0"},Fo=["disabled"];function No(n,t,r,k,l,f){const h=Oe("PremiumFeatureButton"),L=Oe("Modal");return n.$root.features("purchase_wishes")?(p(),v("span",Lo,[n.$root.user.isPremium?(p(),v("button",{key:0,ref:"purchaseWishButton",onClick:t[0]||(t[0]=Ge((...A)=>f.openPurchaseWish&&f.openPurchaseWish(...A),["prevent"])),type:"button",class:"hidden-xs btn btn-primary btn-outline btn-responsive"}," Mitä haluat ostaa? Toivo myytävää! ",512)):(p(),We(h,{key:1,"button-text":"Mitä haluat ostaa? Toivo myytävää!","button-class":"hidden-xs btn btn-primary btn-outline btn-responsive"})),je(at,{name:"fade"},{default:He(()=>[l.showPurchaseWish?(p(),We(L,{key:0,onClose:t[4]||(t[4]=A=>l.showPurchaseWish=!1)},{default:He(()=>[t[8]||(t[8]=a("h3",{class:"mt-0"},"Mitä haluaisit Kiertonettiin myyntiin?",-1)),t[9]||(t[9]=a("p",null,"Esitä toive myyntiin tulevasta kohteesta tai kohteista, niin välitämme ne eteenpäin potentiaalisille myyjille!",-1)),n.$root.user.isPremium?(p(),v("form",{key:0,onSubmit:t[3]||(t[3]=Ge((...A)=>f.submit&&f.submit(...A),["prevent"])),method:"post"},[a("div",Mo,[t[5]||(t[5]=a("label",{class:"control-label"},"Mitä myytävää toivot?",-1)),Ae(a("textarea",{type:"text-area","onUpdate:modelValue":t[1]||(t[1]=A=>l.form.message=A),name:"message",required:"",rows:"4",class:"form-control"},null,512),[[Cs,l.form.message]])]),a("div",Oo,[t[7]||(t[7]=a("label",{class:"control-label"},"Miltä alueelta toivoisit kohteen löytyvän?",-1)),Ae(a("select",{"onUpdate:modelValue":t[2]||(t[2]=A=>l.form.area=A),name:"area",class:"form-control"},[t[6]||(t[6]=a("option",{value:""},"Koko Suomi",-1)),(p(!0),v(fe,null,Fe(l.areas,A=>(p(),v("option",{value:A.id},B(A.name),9,jo))),256))],512),[[on,l.form.area]])]),l.errors&&l.errors.length?(p(),v("div",Ro,[a("ul",Io,[(p(!0),v(fe,null,Fe(l.errors,A=>(p(),v("li",{class:"text-danger",key:A},B(A),1))),128))])])):V("",!0),a("button",{class:"btn btn-primary",disabled:l.submitting}," Lähetä ",8,Fo)],32)):V("",!0)]),_:1})):V("",!0)]),_:1})])):V("",!0)}const Do=Ue(Po,[["render",No]]),tn={fetchEndState(n){return es.get("/auction-has-ended/"+n).then(t=>t.data||null)},fetchHighestBid(n){return es.get("/auction-highest-bid/"+n).then(t=>t.data||null)},priceDiffers(n,t){return Number(n||0)!==Number(t&&t.price||0)},bidIdDiffers(n,t){return(n||null)!=(t&&t.id||null)}},Ho={props:{page_title:{type:String,default:""},areas:{type:Array,default:()=>[]},categories:{type:Array,default:()=>[]},keywords:{type:Array,default:()=>[]},is_iframe:{type:[Boolean,Number],default:!1},show_created_at:{type:[Boolean,Number],default:!1},hide_seller:{type:[Boolean,Number],default:!1},fetch_url:{type:String,required:!0},descriptions:{type:Array,default:()=>[]},show_timer:{type:[Boolean,Number],default:!1},show_ended_auction_info:{type:[Boolean,Number],default:!1},cross_site_search:{type:[Boolean,Number],default:!1},has_search_watch:{type:[Boolean,Number],default:!0},can_add_search_watch_without_search:{type:[Boolean,Number],default:!1},show_highest_bidder:{type:[Boolean,Number],default:!1},no_results_text:{type:String,default:"Ei huutokauppoja näillä hakuehdoilla"},show_purchase_wish_button:{type:[Boolean,Number],default:!1},grayscale_if_ended:{type:[Boolean,Number],default:!0},fixed_params:{type:Object,default:()=>{}},default_params:{type:Object,default:()=>{}},filter_visibility:{type:Object,default:()=>{}},no_filters:{type:[Boolean,Number],default:!1}},data(){return{auctions:[],loadingAuctions:!0,params:{page:1,jarjestys:"uudet",alue:"",haku:"",kategoria:"",tyyppi:[],piilota_paattyneet:0,vain_varmat_kaupat:0,is_iframe:0},showSearchWatch:!1,metaData:{},crossSiteSearchResponse:null,userMatchingSearchWatchId:null,postingSearchWatch:!1,mounting:!0,refreshTimeout:null}},created(){this.params={...this.params,...this.default_params,...xn.getUrlParameters(),...this.fixed_params}},mounted(){this.fetchAuctions(),this.connectPusher()},beforeUnmount(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)},methods:{verifyHighestBid(n){tn.fetchEndState(n.id).then(t=>{t&&tn.priceDiffers(n.highest_bid,t.highestBid)&&this.scheduleRefresh()}).catch(()=>{})},confirmAuctionEnded(n){tn.fetchEndState(n.id).then(t=>{if(t){if(!t.hasEnded||tn.priceDiffers(n.highest_bid,t.highestBid)){this.scheduleRefresh();return}n.hasEnded=!0}}).catch(()=>{})},scheduleRefresh(){this.refreshTimeout||(this.refreshTimeout=setTimeout(()=>{this.refreshTimeout=null,this.fetchAuctions()},500+Math.floor(Math.random()*2e3)))},connectPusher(){xs.listen("list",n=>{let t=this.auctions.find(r=>r.id===n.id);t&&(t.endsAtUnix=n.endsAtUnix,t.hasEnded=n.hasEnded,document.body.className="",n.winningBid&&n.winningBid.price&&(t.highest_bid=n.winningBid.price,t.highest_bidder={highest_bidder_id:n.winningBid.user_id}))}),xs.didReconnect("list",()=>(this.fetchAuctions(),new Promise((n,t)=>{n()})))},fetchAuctions(){this.loadingAuctions=!0,axios.get(this.fetch_url,{params:this.params}).then(n=>{this.crossSiteSearchResponse=null,this.auctions=n.data.data,this.metaData={...n.data.meta,...n.data.links},this.userMatchingSearchWatchId=n.data.user_matching_search_watch_id,this.showSearchWatch=this.canShowSearchWatch()}).catch(n=>{console.log(n)}).finally(()=>{this.loadingAuctions=!1,this.mounting=!1,this.params.haku&&this.params.haku.length>2&&this.params.page==1&&this.cross_site_search&&this.searchFromSister()})},isPending(n){return n.hasEnded&&!n.accepted_timestamp&&n.highest_bid>0},search({name:n,value:t}){this.params.page=1;let r=xn.getUrlParameters();delete r.page,t!==null&&t!==""?r[n]=t:delete r[n],xn.pushParamsToRoute(r),this.fetchAuctions()},searchFromSister(){axios.get("/api/search-from-sister",{params:{page:this.params.page,search:this.params.haku,area:this.params.alue,hide_ended:this.params.piilota_paattyneet,only_sold_to_highest:this.params.vain_varmat_kaupat}}).then(n=>
3{n.data&&(this.crossSiteSearchResponse=n.data)}).catch(n=>{this.crossSiteSearchResponse=""})},canShowSearchWatch(){return this.params.haku&&this.params.haku.length>=2||this.can_add_search_watch_without_search||this.params.alue||!this.can_add_search_watch_without_search&&this.params.alue},addSearchWatch(){if(this.postingSearchWatch||!this.$root.user.isPremium)return!1;this.postingSearchWatch=!0,axios.post("/search-watches",{search:this.params.haku,area:this.params.alue,categories:this.params.kategoria}).then(n=>{this.userMatchingSearchWatchId=n.data,this.postingSearchWatch=!1}).catch(n=>{this.postingSearchWatch=!1,n.response.status==401?window.location.href=this.$root.loginUrl():alert("Jotain meni vikaan. Päivitä sivu ja yritä uudelleen.")})},removeSearchWatch(){if(this.postingSearchWatch)return!1;this.postingSearchWatch=!0,axios.delete("/search-watches/"+this.userMatchingSearchWatchId).then(n=>{this.userMatchingSearchWatchId=null,this.postingSearchWatch=!1}).catch(n=>{this.postingSearchWatch=!1,n.response.status==401?window.location.href=this.$root.loginUrl():alert("Jotain meni vikaan. Päivitä sivu ja yritä uudelleen.")})},normalizedCity(n){return n===n.toUpperCase()?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n}},components:{Pagination:lr,AuctionFilters:To,PurchaseWishButton:Do,PremiumFeatureButton:Ns,AuctionImageLabels:Ls}},$o={class:"flex flex-col gap-y-4"},Bo={key:0,class:"py-0 my-0"},Uo={key:1},Vo=["innerHTML"],zo={class:"flex justify-between gap-x-4 items-center mb-4"},qo={key:0,class:"whitespace-nowrap"},Wo={key:1,class:"text-right"},Xo={key:0,style:{height:"6000px"}},Go=["id"],Ko={class:"py-2 cursor-pointer"},Yo={class:"my-0"},Jo=["href","target"],Zo={class:"auction-content"},Qo={class:"auction-image relative"},ea=["alt"],ta={class:"hidden visible-xxs relative z-1"},na={key:0,class:"label varmat-kaupat-label more-info w-full block mt-n2",style:{"border-radius":"0px 0px 5px 5px"}},sa={key:1},ia={key:0},ra={key:1},oa={class:"w-full"},aa={class:"title line-clamp-2 mb-2 mr-n3"},la={class:"auction-info gap-4"},ua={class:"w-full"},ca={class:"flex justify-between items-center gap-x-2 flex-wrap seller-city"},da={key:0},ha={key:1},fa=["src","alt","title"],pa={key:0,class:"auction-created-at"},ma={class:"price-time mt-2"},va={class:"flex items-center gap-x-2 flex-wrap"},ga={class:"price"},ba={key:0,class:"sum"},ya={key:0,class:"text-sm text-regular text-success font-bold hidden-xxs"},_a={key:0,class:"counter-down"},ka={key:1},wa={key:0,class:"text-muted"},Sa={key:1,class:"text-sm text-regular text-success font-bold hidden visible-xxs"},xa={key:2,class:"hidden-xxs"},Ta={key:0},Ca={key:1},Ea={class:"my-5 flex flex-col text-center"},Aa={key:0,class:"row cross-site-search v-align-center"},Pa={class:"col-xs-9 col-sm-7"},La={class:"mt-0"},Ma=["href"],Oa={key:1,class:"bg-gray rounded p-4 my-4"},ja={class:"flex justify-between flex-wrap items-center gap-4"},Ra={class:"mb-0"},Ia=["href"],Fa=["href"];function Na(n,t,r,k,l,f){const h=Oe("AuctionFilters"),L=Oe("PremiumFeatureButton"),A=Oe("AuctionImageLabels"),w=Oe("timer"),T=Oe("PurchaseWishButton"),U=Oe("pagination"),b=ur("lazy");return p(),v("div",null,[a("div",$o,[!r.no_filters&&r.page_title?(p(),v("h1",Bo,B(r.page_title),1)):V("",!0),r.descriptions&&r.descriptions.length?(p(),v("div",Uo,[(p(!0),v(fe,null,Fe(r.descriptions,(d,E)=>(p(),v("div",{key:"desc-"+E,class:"well mb-0"},[a("span",{innerHTML:d},null,8,Vo)]))),128))])):V("",!0),r.no_filters?V("",!0):(p(),We(h,{key:2,modelValue:l.params,"onUpdate:modelValue":t[0]||(t[0]=d=>l.params=d),areas:r.areas,categories:r.categories,keywords:r.keywords,filterVisibility:r.filter_visibility,onSubmit:f.search},null,8,["modelValue","areas","categories","keywords","filterVisibility","onSubmit"])),a("div",zo,[l.metaData.total?(p(),v("small",qo,[a("b",null,B(l.metaData.from),1),t[3]||(t[3]=ee(" - ",-1)),a("b",null,B(l.metaData.to),1),t[4]||(t[4]=ee(" / ",-1)),a("b",null,B(l.metaData.total),1),t[5]||(t[5]=ee(" kpl ",-1))])):V("",!0),t[8]||(t[8]=a("hr",{class:"w-full"},null,-1)),r.has_search_watch&&l.showSearchWatch?(p(),v("div",Wo,[n.$root.user.isPremium?l.userMatchingSearchWatchId?(p(),v("button",{key:2,class:"btn btn-secondary",type:"button",onClick:t[2]||(t[2]=Ge(d=>f.removeSearchWatch(),["prevent"]))},[...t[7]||(t[7]=[ee("Hakuvahti tallennettu ",-1),a("i",{class:"fa fa-bell"},null,-1)])])):(p(),v("button",{key:1,ref:"searchWatchButton",type:"button",class:"btn btn-secondary btn-outline",onClick:t[1]||(t[1]=Ge(d=>f.addSearchWatch(),["prevent"]))},[...t[6]||(t[6]=[ee("Lisää hakuvahti ",-1),a("i",{class:"fa fa-bell"},null,-1)])],512)):(p(),We(L,{key:0,buttonClass:"btn btn-secondary btn-outline",buttonText:"Lisää hakuvahti"}))])):V("",!0)])]),l.mounting?(p(),v("div",Xo)):V("",!0),a("ul",{class:Be(["min-height-200 flex flex-col gap-4 list-unstyled auctions-list",{"loading-list":l.loadingAuctions&&!l.crossSiteSearchResponse}])},[(p(!0),v(fe,null,Fe(l.auctions,(d,E)=>(p(),v("li",{key:d.id,id:"item-"+E},[a("article",Ko,[a("h3",Yo,[a("a",{href:d.fullUrl,target:r.is_iframe?"_blank":""},[a("span",null,B(d.title),1)],8,Jo)]),a("div",Zo,[a("div",Qo,[Ae(a("img",{alt:d.name,class:Be({"ended-auction":r.grayscale_if_ended&&d.hasEnded})},null,10,ea),[[b,d.thumbnail_image_url]]),je(A,{auction:d,varmat_kaupat_label_class:"hidden-xxs"},null,8,["auction"]),a("div",ta,[!d.hasEnded&&d.is_sold_to_highest_bidder?(p(),v("span",na,"Varmat kaupat")):V("",!0),r.show_ended_auction_info?(p(),v("div",sa,[d.accepted=="ACCEPTED"?(p(),v("p",ia,[...t[9]||(t[9]=[a("span",{class:"label label-success w-full block mt-n2",style:{"border-radius":"0px 0px 5px 5px"}},"MYYTY",-1)])])):f.isPending(d)?(p(),v("p",ra,[...t[10]||(t[10]=[a("span",{class:"label label-warning w-full block mt-n2",style:{"border-radius":"0px 0px 5px 5px"}},"KÃSITTELYSSÃ",-1)])])):V("",!0)])):V("",!0)])]),a("div",oa,[a("span",aa,B(d.title),1),a("div",la,[a("div",ua,[a("div",ca,[d.city?(p(),v("span",da,B(f.normalizedCity(d.city)),1)):V("",!0),r.hide_seller?V("",!0):(p(),v("span",ha,[d.seller_logo_url?(p(),v("img",{key:0,src:d.seller_logo_url,alt:d.seller_name,class:"auction-seller-logo",title:d.seller_name},null,8,fa)):V("",!0)]))]),r.show_created_at?(p(),v("p",pa,[t[11]||(t[11]=ee(" Lisätty: ",
3-1)),a("b",null,B(n.moment(d.created_at).format("DD.MM.YYYY")),1)])):V("",!0),a("div",ma,[a("div",va,[a("div",ga,[d.is_buy_now?(p(),v("span",ba,B(n.$root.priceFormat(d.buy_now_price,0))+" â¬",1)):!d.highest_bid&&d.starting_price?(p(),v("span",{key:d.starting_price,class:"sum"},B(n.$root.priceFormat(d.starting_price,0))+" â¬",1)):(p(),v("span",{class:"sum",key:d.highest_bid},B(n.$root.priceFormat(d.highest_bid||0,0))+" ⬠",1))]),r.show_highest_bidder&&d.highest_bidder&&d.highest_bidder.highest_bidder_id==n.$root.user.id?(p(),v("div",ya," Sinulla on johtava tarjous! ")):V("",!0)]),r.show_timer?(p(),v("div",_a,[je(w,{"auction-id":d.id,time:d.endsAtUnix,hasEnded:d.hasEnded,onConfirmHighestBid:H=>f.verifyHighestBid(d),onCountdownFinished:H=>f.confirmAuctionEnded(d)},null,8,["auction-id","time","hasEnded","onConfirmHighestBid","onCountdownFinished"])])):(p(),v("div",ka,[r.show_timer?V("",!0):(p(),v("span",wa,B(n.moment(d.ends_at).format("DD.MM.YYYY")),1))]))]),r.show_highest_bidder&&d.highest_bidder&&d.highest_bidder.highest_bidder_id==n.$root.user.id?(p(),v("div",Sa," Sinulla on johtava tarjous! ")):V("",!0),r.show_ended_auction_info?(p(),v("div",xa,[d.accepted=="ACCEPTED"?(p(),v("p",Ta,[...t[12]||(t[12]=[a("span",{class:"label label-success"},"MYYTY",-1)])])):f.isPending(d)?(p(),v("p",Ca,[...t[13]||(t[13]=[a("span",{class:"label label-warning"},"KÃSITTELYSSÃ",-1)])])):V("",!0)])):V("",!0)])])])])])],8,Go))),128)),!l.loadingAuctions&&l.auctions.length==0?(p(),v(fe,{key:0},[a("div",Ea,[a("p",null,[a("b",null,B(r.no_results_text),1)]),r.show_purchase_wish_button?(p(),We(T,{key:0})):V("",!0)]),je(at,{name:"long-fade"},{default:He(()=>[l.crossSiteSearchResponse?(p(),v("div",Aa,[t[16]||(t[16]=a("div",{class:"col-xs-3 text-center"},[a("img",{class:"img circle-shadow-75",src:"/img/hahmot/mylly-maija-ympyra.png"})],-1)),a("div",Pa,[a("p",La,[a("b",null,[ee("Löysimme Huutomyllystä "+B(l.crossSiteSearchResponse.count)+" "+B(l.crossSiteSearchResponse.hide_ended?"aktiivista":"")+" "+B(l.crossSiteSearchResponse.only_sold_to_highest?"Varmat kaupat":"")+' huutokauppaa hakusanalla "'+B(l.crossSiteSearchResponse.search)+'"',1),l.crossSiteSearchResponse.area?(p(),v(fe,{key:0},[ee(" alueelta "+B(l.crossSiteSearchResponse.area),1)],64)):V("",!0),t[14]||(t[14]=ee(".",-1))])]),a("p",null,[a("a",{class:"btn btn-primary",href:l.crossSiteSearchResponse.link},"Katso Huutomyllyn hakutulokset âº",8,Ma)]),t[15]||(t[15]=a("p",null,[a("b",{class:"huutomylly-text-primary"},"Huutomylly"),ee(" on kaikille avoin huutokauppasivusto, jossa valikoidut luotettavat yritykset myyvät itselleen tarpeettomaksi jäänyttä omaisuutta."),a("br")],-1))])])):V("",!0)]),_:1})],64)):V("",!0)],2),je(U,{pagination:l.metaData,offset:7},null,8,["pagination"]),l.crossSiteSearchResponse&&l.auctions.length>0?(p(),v("div",Oa,[a("div",ja,[a("p",Ra,[t[17]||(t[17]=a("b",null,"Psst!",-1)),t[18]||(t[18]=ee(" Löysimme ",-1)),a("a",{href:l.crossSiteSearchResponse.link},"Huutomyllystä",8,Ia),ee(" "+B(l.crossSiteSearchResponse.count)+" "+B(l.crossSiteSearchResponse.hide_ended?"aktiivista":"")+" "+B(l.crossSiteSearchResponse.only_sold_to_highest?"Varmat kaupat":"")+' huutokauppaa hakusanalla "'+B(l.crossSiteSearchResponse.search)+'"',1),l.crossSiteSearchResponse.area?(p(),v(fe,{key:0},[ee(" alueelta "+B(l.crossSiteSearchResponse.area),1)],64)):V("",!0)]),a("a",{href:l.crossSiteSearchResponse.link,class:"btn btn-primary"},"Siirry Huutomyllyyn âº",8,Fa)])])):V("",!0)])}const tc=Ue(Ho,[["render",Na]]),Da={props:["className","label","content","isSub","openOnLoad"],data(){return{open:!!this.isSub}},created(){typeof this.openOnLoad<"u"&&(this.open=this.openOnLoad)}},Ha=["innerHTML"],$a={key:1,class:"list"},Ba=["innerHTML"];function Ua(n,t,r,k,l,f){return p(),v("div",{class:Be(r.isSub?`border-0 collapse-row ${r.className}`:`collapse-row ${r.className}`)},[a("div",{onClick:t[0]||(t[0]=h=>l.open=!l.open),class:Be(["label-text",{"pl-0 pr-4":r.isSub}])},[a("span",null,[a("b",null,B(r.label),1)]),l.open?(p(),v("i",{key:0,class:Be(["fal",r.isSub?"fa-chevron-up":"fa-minus"])},null,2)):(p(),v("i",{key:1,class:Be(["fal",r.isSub?"fa-chevron-down":"fa-plus"])},null,2))],2),je(at,{name:"collapse"},{default:He(()=>[Ae(a("div",{class:Be(["content",{isSub:r.isSub}])},[r.content?(p(),v(fe,{key:0},[Array.isArray(r.content)?(p(),v("ul",$a,[(p(!0),v(fe,null,Fe(r.content,(h,L)=>(p(),v("li",{class:"item",key:L,innerHTML:h},null,8,Ba))),128))])):(p(),v("div",{key:0,class:Be({"py-3":!r.isSub}),innerHTML:r.content},null,10,Ha))],64)):V("",!0),kt(n.$slots,"default")],2),[[nn,l.open]])]),_:3})],2)}const Va=Ue(Da,[["render",Ua]]),za={props:["openedTab","fixedMinBidRaise"],data(){return{minPriceSteps:null}},mounted(){this.fixedMinBidRaise||this.getMinPriceSteps()},methods:{getMinPriceSteps(){axios.get("/min-price-steps").then(n=>{this.minPriceSteps=n.data})}},components:{Collapse:Va}},qa={class:"auction-help-content"},Wa={key:0},Xa={key:1},Ga={class:"flex justify-between mb-2 gap-2 flex-wrap"},Ka={class:"table table-bordered table-striped small"},Ya={style:{width:"45%"}},Ja={style:{width:"30%"}},Za={key:0};function Qa(n,t,r,k,l,f){const h=Oe("Collapse");return p(),v("div",qa,[kt(n.$slots,"default"),je(h,{label:"Huutokaupan aikana",openOnLoad:r.openedTab=="all",className:"border-0"},{default:He(()=>[...t[0]||(t[0]=[a("div",null,[a("p",null,"Huutokaupalle on asetettu päättymisaika. Mikäli huutokaupan kohteena olevasta tavarasta jätetään tarjous viimeisen 3 minuutin aikana, huutokaupan päättymisaika siirtyy niin, että viimeisen tarjouksen jälkeen on aina 3 minuuttia aikaa huutokaupan päättymiseen. "),a("p",null,"Korkein tarjous on
3se hinta, jonka huutokaupan voittaja maksaa. Jos hinta on ALV 0%, ei hintaan lisätä veroa päälle eikä siihen sisälly vähennettävää arvonlisäveroa.")],-1)])]),_:1},8,["openOnLoad"]),je(h,{label:"Huutokaupan päättyessä",openOnLoad:r.openedTab=="all"},{default:He(()=>[...t[1]||(t[1]=[a("div",null,[a("p",null,"Huutokaupan päättyessä Kiertonet.fi vahvistaa päättyneen huutokaupan tavaran myyjälle sekä voittaneen huudon tehneelle. Tämän jälkeen myyjällä on mahdollisuus hyväksyä tai hylätä voittanut huutotarjous."),a("p",null,"Myyjän hyväksyessä voittaneen huutotarjouksen, Kiertonet.fi lähettää voittaneen huudon tehneelle tavaran maksutiedot sähköpostiin. Sähköpostin saapuessa huutajalla on kaksi arkipäivää aikaa maksaa huutamansa tavara tilisiirtona Kiertonet.fi:n asiakastilille. Maksun kirjautuessa asiakastilille, Kiertonet.fi ilmoittaa siitä tavaran myyjälle sähköpostitse sekä lähettää huutajalle maksukuitin, jolloin he voivat sopia tavaran luovutuksesta. Maksu kirjautuu 1-3 arkipäivän kuluessa."),a("p",null,"Tonttien, osakehuoneistojen ja kiinteistöjen osalta maksu tapahtuu tyypillisesti vasta kauppakirjan allekirjoituksen yhteydessä. Tätä ennen tehdään viranhaltijapäätös, johon liittyy kuntalain mukainen 14 vrk oikaisuvaatimusaika + 7 vrk tiedoksisaantiaika, jota ennen kauppakirjaa ei allekirjoiteta tai maksuja peritä.")],-1)])]),_:1},8,["openOnLoad"]),je(h,{label:"Minimikorotus",openOnLoad:r.openedTab=="all"||r.openedTab=="minPriceSteps"},{default:He(()=>[r.fixedMinBidRaise?(p(),v("div",Wa,[t[2]||(t[2]=ee(" Huutokaupassa on kiinteä huudon minimikorotus ",-1)),a("b",null,B(n.$root.priceFormat(r.fixedMinBidRaise))+" â¬",1),t[3]||(t[3]=ee(". Jokaisen huudon pitää olla vähintään minimikorotuksen verran korkeampi kuin sen hetkinen korkein tarjous. ",-1))])):l.minPriceSteps?(p(),v("div",Xa,[a("div",Ga,[a("small",null,[a("b",null,"Avaushuuto vähintään "+B(n.$root.config("first_bid_min_price"))+" â¬",1)]),t[4]||(t[4]=a("small",null,"Päivitetty 13.8.2024",-1))]),a("table",Ka,[t[5]||(t[5]=a("thead",null,[a("tr",null,[a("th",null,"Korkein tarjous"),a("th",null,"Minimikorotus")])],-1)),a("tbody",null,[(p(!0),v(fe,null,Fe(l.minPriceSteps,(L,A)=>(p(),v("tr",{key:A},[a("td",Ya,B(A==0?n.$root.config("first_bid_min_price"):A),1),a("td",Ja,B(n.$root.priceFormat(L))+" â¬",1)]))),128))])])])):V("",!0)]),_:1},8,["openOnLoad"]),je(h,{label:"Korotusautomaatti",openOnLoad:r.openedTab=="all"||r.openedTab=="autoBidInfo"},{default:He(()=>[a("div",null,[t[7]||(t[7]=a("p",null,"Korotusautomaatti tarjoaa automaattisesti puolestasi minimikorotuksen mukaisesti asettamaasi maksimisummaan asti.",-1)),t[8]||(t[8]=a("p",null,"Mikäli asettamasi korkein hinta ylittyy, saat siitä ilmoituksen sähköpostilla.",-1)),t[9]||(t[9]=a("p",null,"Korotusautomaatin tekemien tarjousten perässä näkyy tähti *. Korotusautomaatille hävinnyt tarjous on (suluissa).",-1)),t[10]||(t[10]=a("p",null,"Jos toinen tarjous on korotusautomaatin maksimisumman suuruinen (tai alle minimikorotuksen päässä siitä), korotusautomaatti voittaa, koska se on asetettu aiemmin. Tällöin minimikorotus ei välttämättä aina toteudu.",-1)),t[11]||(t[11]=a("p",null,"Jos kaksi korotusautomaattia kilpailee keskenään samalla maksimisummalla, aiemmin asetettu korotusautomaatti voittaa. Myös siinä tapauksessä, että uudemman korotusautomaatin summa on suurempi kuin vanhemman, mutta uudemmalla automaatilla ei ole varaa korottaa vanhemman yli minimikorotuksen verran.",-1)),t[12]||(t[12]=a("p",null,"Korotusautomaatin voi myös asettaa oman tavallisen huudon tai oman aikaisemman korotusautomaatin päälle. Korotusautomaatin voi myös nollata 'nollaa' napista.",-1)),n.$root.features("paid_premium")?(p(),v("p",Za,[...t[6]||(t[6]=[a("small",null,[ee("Korotusautomaatti on käytössä vain premium-jäsenillä. Premium-jäsenyyden voit aktivoida "),a("a",{href:"/kayttaja/premium",target:"_blank"},"täältä"),ee(".")],-1)])])):V("",!0)])]),_:1},8,["openOnLoad"]),je(h,{label:"Kohteen käyttötarkoitus",openOnLoad:r.openedTab=="all"||r.openedTab=="purpose"},{default:He(()=>[...t[13]||(t[13]=[a("div",null,[a("p",null,"Myyjä haluaa tietää mihin käyttötarkoitukseen ostaja aikoo kohdetta käyttää. Jos käyttötarkoitus ei ole sopiva, kauppa hylätään. Mikäli ostaja ei noudata ilmoittamaansa käyttötarkoitusta, myyjällä on oikeus purkaa kauppa."),a("p",null,"Myyjä näkee huutajien ilmoittamat käyttötarkoitukset vasta huutokaupan päätyttyÃ
3¤. Käyttäjät eivät koskaan näe toistensa käyttötarkoituksia.")],-1)])]),_:1},8,["openOnLoad"])])}const el=Ue(za,[["render",Qa]]),tl={props:["openedTab","fixedMinBidRaise"],emits:["close"],components:{AuctionHelpContent:el}},nl={class:"modal-dialog modal-md"},sl={class:"modal-content"},il={class:"modal-body"};function rl(n,t,r,k,l,f){const h=Oe("AuctionHelpContent");return p(),We(Ts,{to:"body"},[a("div",{class:"modal modal-bg modal-register-seller",onClick:t[1]||(t[1]=Ge(L=>n.$emit("close"),["self"])),tabindex:"-1",style:{display:"block"}},[a("div",nl,[a("div",sl,[a("div",il,[je(h,{openedTab:r.openedTab,fixedMinBidRaise:r.fixedMinBidRaise},{default:He(()=>[a("button",{type:"button",class:"close",onClick:t[0]||(t[0]=L=>n.$emit("close"))},[...t[2]||(t[2]=[a("span",{"aria-hidden":"true"},"Ã",-1)])]),t[3]||(t[3]=a("h3",{class:"mt-0 mb-4"},"Ohjeet",-1))]),_:1},8,["openedTab","fixedMinBidRaise"])])])])])])}const ol=Ue(tl,[["render",rl]]),al={props:{openedTab:{},fixedMinBidRaise:{},label:{type:String,default:"Ohjeet"}},data(){return{showModal:!1}},components:{AuctionHelpModal:ol}},ll=["aria-label"];function ul(n,t,r,k,l,f){const h=Oe("AuctionHelpModal");return p(),v("span",null,[a("button",{type:"button",class:"btn btn-link p-0","aria-label":r.label,onClick:t[0]||(t[0]=L=>l.showModal=!l.showModal)},[kt(n.$slots,"default")],8,ll),je(at,{name:"fade"},{default:He(()=>[l.showModal?(p(),We(h,{key:0,onClose:t[1]||(t[1]=L=>l.showModal=!1),openedTab:r.openedTab,fixedMinBidRaise:r.fixedMinBidRaise},null,8,["openedTab","fixedMinBidRaise"])):V("",!0)]),_:1})])}const nc=Ue(al,[["render",ul]]),cl={props:["reservation","product_id"],data(){return{submitting:!1}},methods:{reserve(){this.submitting=!0,axios.post(`/api/product-reservations/${this.product_id}`).then(n=>{this.submitting=!1,this.$emit("reserve",n.data)})},cancel(){this.submitting=!0,axios.post(`/api/product-reservations/${this.reservation.id}/delete`).then(n=>{this.submitting=!1,this.$emit("cancel",this.product_id)})}}},dl=["disabled"],hl=["disabled"];function fl(n,t,r,k,l,f){return p(),v("div",null,[r.reservation?V("",!0):(p(),v("button",{key:0,onClick:t[0]||(t[0]=h=>f.reserve()),class:"btn btn-primary mb-3",disabled:l.submitting}," Varaa tämä tavara ",8,dl)),r.reservation&&r.reservation.reserver_id==n.$root.user.id?(p(),v("button",{key:1,onClick:t[1]||(t[1]=h=>f.cancel()),class:"btn btn-default mb-3",disabled:l.submitting}," Peruuta varaus ",8,hl)):V("",!0)])}const pl=Ue(cl,[["render",fl]]),ml={props:["product","productLinkWithKey","mapApi","redirectPath"],data(){return{reservation:this.product.reservation,submitting:!1}},components:{ReservationAction:pl}},vl={key:0,class:"row"},gl={class:"col-lg-8"},bl={class:"single-header escape-container"},yl={class:"col-lg-4 single-sidebar"},_l={class:"well mt-5"},kl={key:1,class:"my-3"},wl={key:0,class:"seller-tools"},Sl=["href"],xl=["href"],Tl={class:"well well-sm"},Cl={class:"form-group"},El=["value"],Al={class:"col-lg-8"},Pl={class:"tab-content"},Ll={key:0},Ml={key:0},Ol={class:"table small table-striped"},jl={width:"240px",style:{border:"none"}},Rl={style:{border:"none"}},Il=["innerHTML"],Fl=["innerHTML"],Nl={key:1},Dl=["innerHTML"],Hl={class:"list-unstyled"},$l=["href"],Bl=["href"],Ul={key:1},Vl=["href"];function zl(n,t,r,k,l,f){const h=Oe("ReservationAction");return r.product?(p(),v("div",vl,[a("div",gl,[a("h1",bl,B(r.product.title),1)]),a("div",yl,[a("div",_l,[l.reservation&&l.reservation.reserver?(p(),v(fe,{key:0},[t[2]||(t[2]=a("h4",null,"Tämä tavara on varattu",-1)),a("p",null,"Varaaja: "+B(l.reservation.reserver.firstname)+" "+B(l.reservation.reserver.lastname),1)],64)):n.$root.loggedIn?r.product.userCanReserve?(p(),v(fe,{key:2},[t[4]||(t[4]=a("h4",null,"Varaa tavara",-1)),t[5]||(t[5]=a("p",{class:"mt-3"}," Voit varata tämän tavaran osastosi/organisaatiosi käyttöön. Saat tiedon sähköpostiisi kun tavaran tarjoaja hyväksyy tai hylkää varauksesi. ",-1))],64)):V("",!0):(p(),v("p",kl,[...t[3]||(t[3]=[ee("Jos haluat varata tämän tavaran, tarvitset käyttäjätunnuksen, joka on lisätty kalustonjakopalvelun osallistujalistalle. Mikäli sinulla ei vielä sellaista ole, luo käyttäjätunnus ",-1),a("a",{href:"/rekisteroidy/kayttaja"},"täältä.",-1),ee(" Pyydä sen jälkeen ylläpitoa lisäämään sinut listalle.",-1)])])),r.product.userCanReserve?(p(),We(h,{key:3,product_id:r.product.id,reservation:l.reservation,onReserve:t[0]||(t[0]=L=>l.reservation=L),onCancel:t[1]||(t[1]=L=>l.reservation=null)},null,8,["product_id","reservation"])):V("",!0)]),r.product.userCanEdit?(p(),v("div",wl,[t[8]||(t[8]=a("hr",{class:"mt-5"},null,-1)),a("p",null,[a("a",{href:"/myynti/kalustonjako/"+r.product.id+"/muokkaa",class:"btn btn-default"},[...t[6]||(t[6]=[a("i",{class:"fa fa-pencil"},null,-1),ee(" Muokkaa ilmoitusta ",-1)])],8,Sl)]),a("p",null,[a("a",{href:"/myynti/kalustonjako/uusi/"+r.product.id,class:"btn btn-default"},[...t[7]||(t[7]=[a("i",{class:"fa fa-pencil"},null,-1),ee(" Kopioi pohjaksi ",-1)])],8,xl)])])):V("",!0),a("div",Tl,[a("div",Cl,[t[9]||(t[9]=a("label",null,"Ilmoituksen piilolinkki:",-1)),a("input",{type:"text",value:r.productLinkWithKey,class:"form-control",readonly:""},null,8,El)])])]),a("div",Al,[t[17]||(t[17]=a("hr",null,null,-1)),a("div",Pl,[t[16]||(t[16]=a("h3",null,"Tiedot",-1)),r.product.modified_at?(p(),v("p",Ll,[a("small",null,[a("b",null,"Tietoja päivitetty "+B(n.moment(r.product.modified_at).format("DD.MM.YYYY H:mm")),1)])])):V("",!0),(p(!0),v(fe,null,Fe(r.product.extraData,(L,A)=>(p(),v("div",{key:A,style:{border:"none"}},[L.title?(p(),v("h4",Ml,B(L.title),1)):V("",!0),a("table",Ol,[a("tbody",null,[(p(!0),v(fe,null,Fe(L.data,(w,T)=>(p(),v("tr",{key:T},[a("td",jl,B(w.title),1),a("th",Rl,[a("span",{innerHTML:w.value},null,8,Il)])]))),128))])])]))),128)),a("p",{class:"text-overflow-ellipsis overflow-hidden",innerHTML:r.product.description},null,8,Fl),r.product.notes?(p(),v("h3",Nl,"Mahdolliset viat tai puutteet")):V("",!0),a("p",{innerHTML:r.product.notes},null,8,Dl),r.product.documents.length?(p(),v(fe,{key:2},[t[11]||(t[11]=a("h3",null,"Liitetiedostot",-1)),a("ul",Hl,[(p(!0),v(fe,null,Fe(r.product.documents,(L,A)=>(p(),v("li",{key:A},[a("a",{href:L.path,target:"_blank"},[t[10]||(t[10]=a("i",{class:"far fa-fw fa-file-pdf"},null,-1)),ee(B(L.name),1)],8,$l)]))),128))])],64)):V("",!0),n.$root.loggedIn&&r.product.contacts.length?(p(),v(fe,{key:3},[t[15]||(t[15]=a("h4",null,"Yhteyshenkilö",-1)),(p(!0),v(fe,null,Fe(r.product.contacts,L=>(p(),v("p",{key:L.id},[ee(B(L.name),1),t[13]||(t[13]=a("br",null,null,-1)),L.phone?(p(),v("a",{key:0,href:"tel:"+L.phone},"p. "+B(L.phone),9,Bl)):V("",!0),t[14]||(t[14]=a("br",null,null,-1)),L.email?(p(),v("span",Ul,[(p(!0),v(fe,null,Fe(L.email.split(","),A=>(p(),v("span",{key:A},[a("a",{href:"mailto:"+A.trim()},B(A.trim()),9,Vl),t[12]||(t[12]=a("br",null,null,-1))]))),128))])):V("",!0)]))),128))],64)):V("",!0),a("h3",null,"Tavaran ID: "+B(r.product.id),1)])])])):V("",!0)}const sc=Ue(ml,[["render",zl]]),ql={props:["seller","user","wrapBox"],data(){return{buyers:[],buyerId:"",search:"",debounce:null,open_buyer:"",loading:!1,hide_ready:!1,galleryAuctionId:null,galleryImages:[],readyCount:0,totalCount:0,cancelAuctionForm:{submitting:!1,action_type:"cancel",is_open:!1,auction_id:null,auction:null,auction_price:null,refund_price:null,returned_amount:null,reason:"Tavaraa ei löytynyt",reason_preselect:"",confirm:!1}}},mounted(){this.user?this.selectBuyer(this.user.id):this.getBuyersWithAuctions().then(()=>{this.buyers.length>20&&(this.hide_ready=!0)})},methods:{openGallery(n){this.galleryImages=n.images,this.galleryAuctionId=n.id},toggleOpenBuyer(n){if(this.open_buyer==n){this.open_buyer="";return}this.open_buyer=n},selectBuyer(n){this.buyerId=n,this.getBuyersWithAuctions().then(()=>{document.getElementById("listTitle").scrollIntoView(!0)})},getBuyersWithAuctions(n=!0){this.loading=!0;let t={search:this.search,buyerId:this.buyerId};return axios.get(`/pickup-list-auctions/${this.seller.id}`,{params:t}).then(r=>{this.buyers=r.data.auctions,this.readyCount=r.data.readyCount,this.totalCount=r.data.totalCount,n&&(this.buyers.length==1?this.open_buyer=this.buyers[0].id:this.open_buyer="")}).finally(()=>{this.loading=!1})},debounceSearch(n,t){this.search=n,clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.getBuyersWithAuctions()},t)},clearSearch(){this.search="",this.getBuyersWithAuctions(),this.$refs.searchInput.focus()},cancelPickup(n){confirm('Haluatko varmasti poistaa "Noudettu" merkinnän?')&&axios.post(`/cancel-pickup/${this.seller.id}`,{ids:[n.id]}).then(t=>
3{n.pickup_status=null,this.updatePickedUpCount(n.buyer_id)})},markAsPickedUp(n){axios.post(`/mark-as-picked-up/${this.seller.id}`,{ids:[n.id]}).then(t=>{n.pickup_status="PICKED_UP",this.updatePickedUpCount(n.buyer_id)})},updatePickedUpCount(n){let t=this.buyers.find(r=>r.id==n);t&&(t.picked_up_amount=t.auctions.filter(r=>r.pickup_status=="PICKED_UP").length)},openCancelAuctionForm(n){n.pending_invoice_refund||(this.cancelAuctionForm.auction_id=n.id,this.cancelAuctionForm.auction=n,this.cancelAuctionForm.refund_price=null,this.cancelAuctionForm.returned_amount=parseInt(n.auction_price_with_vat),this.cancelAuctionForm.confirm=!1,this.cancelAuctionForm.is_open=!0)},submitCancelAuctionForm(){!this.cancelAuctionForm.confirm||this.cancelAuctionForm.submitting||(this.cancelAuctionForm.submitting=!0,this.submitRefundRequest())},submitRefundRequest(){const n=this.cancelAuctionForm.action_type=="partial_refund";return axios.post(`/admin/auction-sales/${this.cancelAuctionForm.auction.invoice_id}/refund-requests`,{type:n?"PARTIAL_REFUND":"CANCEL",refund_amount:n?this.cancelAuctionForm.refund_price:this.cancelAuctionForm.returned_amount,reason:this.cancelAuctionForm.reason}).then(()=>{this.cancelAuctionForm.is_open=!1,this.cancelAuctionForm.confirm=!1,this.getBuyersWithAuctions(!1)}).finally(()=>{this.cancelAuctionForm.submitting=!1})}},computed:{filteredBuyers(){return this.buyers.filter(n=>this.hide_ready?!n.is_ready:!0)},selectedBuyer(){return this.buyers.find(n=>n.id==this.buyerId)}},watch:{"cancelAuctionForm.reason_preselect":function(n,t){n&&n!=t&&(this.cancelAuctionForm.reason=n)}},components:{Modal:Mn,FormField:cr,Gallery:Ms}},Wl={class:"mx-lg-0 mb-5 box"},Xl={class:"flex justify-between gap-4 items-center"},Gl={key:0,class:"text-muted"},Kl={key:0,class:"flex justify-between gap-4 bg-gray p-4 flex-wrap",id:"selectedBuyer"},Yl={class:"flex flex-col gap-1"},Jl=["href"],Zl={key:0},Ql={class:"relative flex-1 items-center"},eu=["value"],tu={class:"absolute right-0 inset-y-0 flex items-center border-0 bg-transparent"},nu={class:"text-brand px-4 py-3 fa fa-spinner fa-spin"},su={class:"checkbox"},iu={key:2,class:"flex flex-col"},ru=["onClick"],ou={style:{"overflow-wrap":"anywhere"}},au={class:"flex items-center gap-4"},lu={key:0,class:"fa fa-caret-down"},uu={key:1,class:"fa fa-caret-up"},cu={class:"list-unstyled"},du={key:0,class:"my-2 flex justify-between gap-4"},hu={class:"flex gap-4 text-sm"},fu=["href"],pu=["href"],mu=["onClick"],vu={class:"flex flex-col gap-2"},gu={class:"text-sm visible-xs"},bu=["href"],yu={class:"flex justify-between gap-4"},_u={class:"flex items-center gap-4"},ku=["src","alt","onClick"],wu={class:"flex flex-col gap-2"},Su={class:"text-sm hidden-xs"},xu=["href"],Tu={class:"flex items-center gap-4"},Cu={class:"text-sm"},Eu={class:"flex items-center flex-wrap gap-x-4 gap-y-2"},Au={key:0,class:"label label-warning py-1 mb-0"},Pu={key:1,class:"label label-success py-1 mb-0"},Lu={key:2,class:"text-sm font-bold text-danger"},Mu={key:0},Ou={key:1},ju=["onClick"],Ru={class:"flex items-center gap-2"},Iu=["id","onInput"],Fu=["id","onInput"],Nu={key:3,class:"text-center py-5"},Du={key:0},Hu={key:1},$u={class:"mb-4"},Bu={class:"radio"},Uu={class:"radio"},Vu={class:"form-group"},zu={class:"mb-4"},qu={class:"checkbox mt-4"},Wu={class:"mt-4 flex flex-row gap-4 self-end"},Xu=["disabled"];function Gu(n,t,r,k,l,f){const h=Oe("FormField"),L=Oe("Modal"),A=Oe("Gallery");return p(),v("div",Wl,[a("div",Xl,[t[16]||(t[16]=a("h2",{class:"mb-5",id:"listTitle"}," Luovutuslista ",-1)),!l.buyerId&&!l.search&&l.totalCount>0?(p(),v("div",Gl," Noudettu "+B(l.readyCount)+" / "+B(l.totalCount),1)):V("",!0)]),l.buyerId&&f.selectedBuyer?(p(),v("div",Kl,[a("div",Yl,[a("b",null,[n.$root.user.isAdmin?(p(),v("a",{key:0,href:`/yllapito/kayttajat/${f.selectedBuyer.id}`,target:"_blank"},B(f.selectedBuyer.name),9,Jl)):V("",!0)]),f.selectedBuyer.company?(p(),v("span",Zl,B(f.selectedBuyer.company)+" ("+B(f.selectedBuyer.vat_number)+")",1)):V("",!0),a("span",null,B(f.selectedBuyer.email),1),a("span",null,B(f.selectedBuyer.phone),1)])])):(p(),v("form",{key:1,class:"mb-4 mb-sm-5 flex flex-wrap items-center gap-x-4",onSubmit:t[3]||(t[3]=Ge((...w)=>f.getBuyersWithAuctions&&f.getBuyersWithAuctions(...w),["prevent"])),action:"#",method:"GET"},[a("div",Ql,[a("input",{type:"text",placeholder:"Nimi, puhelinnumero, tavara...",class:"form-control",value:l.search,onInput:t[0]||(t[0]=w=>f.debounceSearch(w.target.value,800)),style:{"min-width":"250px"},ref:"searchInput"},null,40,eu),a("div",tu,[Ae(a("i",{class:"text-muted px-4 py-3 far fa-times cursor-pointer",onClick:t[1]||(t[1]=w=>f.clearSearch())},null,512),[[nn,!l.loading&&l.search]]),Ae(a("i",nu,null,512),[[nn,l.loading]])])]),a("div",su,[a("label",null,[Ae(a("input",{type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=w=>l.hide_ready=w)},null,512),[[an,l.hide_ready]]),t[17]||(t[17]=ee(" Piilota valmiit ",-1))])])],32)),f.filteredBuyers.length>0?(p(),v("div",iu,[(p(!0),v(fe,null,Fe(f.filteredBuyers,(w,T)=>(p(),v("div",{class:Be(["px-4 py-1",{"bg-gray":l.open_buyer==w.id}]),style:{"border-bottom":"1px solid #e5e5e5"}},[l.buyerId?V("",!0):(p(),v("div",{key:0,class:"text-sm py-3 flex justify-between items-center cursor-pointer",onClick:U=>f.toggleOpenBuyer(w.id)},[a("span",{class:Be(["flex gap-2 flex-wrap",{"text-success":w.picked_up_amount==w.amount}])},[a("b",null,B(w.name),1),a("span",ou,B(w.email),1),a("span",null,B(w.phone),1)],2),a("div",au,[a("span",{class:Be(["whitespace-nowrap",{"text-success":w.picked_up_amount==w.amount}])},B(w.picked_up_amount)+"/"+B(w.amount)+" kpl",3),l.open_buyer!=w.id?(p(),v("i",lu)):V("",!0),l.o
3pen_buyer==w.id?(p(),v("i",uu)):V("",!0)])],8,ru)),Ae(a("ul",cu,[w.signature_document_url?(p(),v("li",du,[a("div",hu,[a("a",{href:w.signature_document_url,target:"_blank"},[...t[18]||(t[18]=[ee("Luovutusasiakirja ",-1),a("i",{class:"fa fa-file-pdf"},null,-1)])],8,fu),a("a",{href:w.pickup_list_url,target:"_blank"},[...t[19]||(t[19]=[ee("Noutolista ",-1),a("i",{class:"fa fa-file-pdf"},null,-1)])],8,pu)]),a("div",null,[l.buyerId?(p(),v("a",{key:1,href:"",onClick:t[4]||(t[4]=Ge(U=>f.selectBuyer(""),["prevent"]))},[...t[21]||(t[21]=[a("i",{class:"fa fa-eye-slash"},null,-1)])])):(p(),v("a",{key:0,href:"",onClick:Ge(U=>f.selectBuyer(w.id),["prevent"])},[...t[20]||(t[20]=[a("i",{class:"fa fa-eye"},null,-1)])],8,mu))])])):V("",!0),(p(!0),v(fe,null,Fe(w.auctions,U=>(p(),v("li",{key:U.id,class:"py-4",style:{"border-top":"1px solid #e5e5e5"}},[a("div",vu,[a("b",gu,[ee("#"+B(U.id)+" "+B(U.title)+" ",1),a("a",{href:"/"+U.fullUrl,target:"_blank"},[...t[22]||(t[22]=[a("i",{class:"fa fa-fw fa-external-link"},null,-1)])],8,bu)]),a("div",yu,[a("div",_u,[a("img",{class:"rounded",src:U.thumbnail_image_url,alt:U.title,style:{"max-width":"120px"},onClick:b=>f.openGallery(U)},null,8,ku),a("div",wu,[a("b",Su,[ee("#"+B(U.id)+" "+B(U.title)+" ",1),a("a",{href:"/"+U.fullUrl,target:"_blank"},[...t[23]||(t[23]=[a("i",{class:"fa fa-fw fa-external-link"},null,-1)])],8,xu)]),a("div",Tu,[a("div",Cu,[a("div",null,B(U.street?U.street+",":"")+" "+B(U.zip)+" "+B(U.city),1)])]),a("div",Eu,[U.pickup_status?(p(),v("span",Pu," Noudettu ")):(p(),v("span",Au," Ei noudettu ")),U.pending_invoice_refund?(p(),v("span",Lu,[U.pending_invoice_refund.type=="PARTIAL_REFUND"?(p(),v("span",Mu,"Osahyvitys "+B(n.$root.priceFormat(U.pending_invoice_refund.refund_amount))+" â¬",1)):U.pending_invoice_refund.type=="CANCEL"?(p(),v("span",Ou,"Peruttu, hyv. "+B(n.$root.priceFormat(U.pending_invoice_refund.refund_amount))+" â¬",1)):V("",!0)])):n.$root.user.isAdmin?(p(),v("a",{key:3,href:"",onClick:Ge(b=>f.openCancelAuctionForm(U),["prevent"]),class:"text-sm"},"Peru/Hyvitä",8,ju)):V("",!0)])])]),a("div",Ru,[U.pickup_status?(p(),v("input",{key:1,id:"cancel_pickup_"+U.id,type:"checkbox",class:"checkbox-lg mt-0",checked:"",onInput:b=>f.cancelPickup(U)},null,40,Fu)):(p(),v("input",{key:0,id:"mark_pickup_"+U.id,type:"checkbox",class:"checkbox-lg mt-0",onInput:b=>f.markAsPickedUp(U)},null,40,Iu))])])])]))),128))],512),[[nn,l.open_buyer==w.id]])],2))),256))])):(p(),v("div",Nu,[l.loading?(p(),v("p",Hu,[...t[24]||(t[24]=[a("i",{class:"text-lg fa fa-spinner fa-spin"},null,-1)])])):(p(),v("p",Du,"Ei noutamattomia kohteita"))])),je(at,{name:"fade"},{default:He(()=>[l.cancelAuctionForm.is_open?(p(),We(L,{key:0,onClose:t[14]||(t[14]=w=>l.cancelAuctionForm.is_open=!1),closeOnClickOutside:!1},{default:He(()=>[a("form",{action:"",onSubmit:t[13]||(t[13]=Ge(w=>f.submitCancelAuctionForm(),["prevent"])),class:"flex flex-col"},[t[31]||(t[31]=a("div",{class:"pr-4"},[a("h3",{class:"mt-0 mb-4"},"Hyvitys / kaupan peruutus")],-1)),a("h5",null,B(l.cancelAuctionForm.auction.full_title),1),a("div",null,[t[25]||(t[25]=ee(" Kauppahinta: ",-1)),a("b",null,B(l.cancelAuctionForm.auction.auction_price_with_vat)+" â¬",1)]),a("div",$u,[t[26]||(t[26]=ee(" Ostaja: ",-1)),a("b",null,B(l.cancelAuctionForm.auction.buyer_firstname)+" "+B(l.cancelAuctionForm.auction.buyer_lastname),1)]),a("div",Bu,[a("label",null,[Ae(a("input",{type:"radio",name:"action_type",value:"cancel","onUpdate:modelValue":t[5]||(t[5]=w=>l.cancelAuctionForm.action_type=w)},null,512),[[Dt,l.cancelAuctionForm.action_type]]),t[27]||(t[27]=ee(" Kauppa perutaan ",-1))])]),a("div",Uu,[a("label",null,[Ae(a("input",{type:"radio",name:"action_type",value:"partial_refund","onUpdate:modelValue":t[6]||(t[6]=w=>l.cancelAuctionForm.action_type=w)},null,512),[[Dt,l.cancelAuctionForm.action_type]]),t[28]||(t[28]=ee(" Hyvitys kauppahinnasta ",-1))])]),l.cancelAuctionForm.action_type=="partial_refund"?(p(),We(h,{key:0,class:"w-full",label:"Ostajalle palautettava
3summa",name:"refund_price",type:"number",appends:"⬠(max: "+l.cancelAuctionForm.auction.auction_price_with_vat+" â¬)",max:l.cancelAuctionForm.auction.auction_price_with_vat-1,modelValue:l.cancelAuctionForm.refund_price,"onUpdate:modelValue":t[7]||(t[7]=w=>l.cancelAuctionForm.refund_price=w)},null,8,["appends","max","modelValue"])):V("",!0),l.cancelAuctionForm.action_type=="cancel"?(p(),We(h,{key:1,class:"w-full",label:"Ostajalle palautettava summa",name:"returned_amount",type:"number",required:"",appends:"⬠(max: "+l.cancelAuctionForm.auction.auction_price_with_vat+" â¬)",max:l.cancelAuctionForm.auction.auction_price_with_vat,modelValue:l.cancelAuctionForm.returned_amount,"onUpdate:modelValue":t[8]||(t[8]=w=>l.cancelAuctionForm.returned_amount=w)},null,8,["appends","max","modelValue"])):V("",!0),t[32]||(t[32]=a("label",null,"Syy",-1)),a("div",Vu,[Ae(a("select",{class:"form-control",name:"reason_preselect","onUpdate:modelValue":t[9]||(t[9]=w=>l.cancelAuctionForm.reason_preselect=w)},[...t[29]||(t[29]=[a("option",{value:""},"-- Syyn pikavalinta --",-1),a("option",null,"Tavaraa ei löytynyt",-1),a("option",null,"Osa tavaroista puuttui",-1),a("option",null,"Kohde ei vastannut ilmoituksen kuvausta",-1),a("option",null,"Muu",-1)])],512),[[on,l.cancelAuctionForm.reason_preselect]])]),a("div",zu,[Ae(a("textarea",{class:"form-control",name:"reason",rows:"2",placeholder:"Syy perumiselle","onUpdate:modelValue":t[10]||(t[10]=w=>l.cancelAuctionForm.reason=w)},null,512),[[Cs,l.cancelAuctionForm.reason]])]),a("div",qu,[a("label",null,[Ae(a("input",{type:"checkbox","onUpdate:modelValue":t[11]||(t[11]=w=>l.cancelAuctionForm.confirm=w)},null,512),[[an,l.cancelAuctionForm.confirm]]),t[30]||(t[30]=ee(" Olen varma ",-1))])]),a("div",Wu,[a("button",{onClick:t[12]||(t[12]=Ge(w=>l.cancelAuctionForm.is_open=!1,["prevent"])),class:"btn btn-default"},"Peruuta"),a("button",{disabled:!l.cancelAuctionForm.confirm||l.cancelAuctionForm.submitting,type:"submit",class:"btn btn-primary"},"Vahvista",8,Xu)])],32)]),_:1})):V("",!0)]),_:1}),l.galleryAuctionId?(p(),We(A,{key:4,images:l.galleryImages,onClose:t[15]||(t[15]=w=>l.galleryAuctionId=null),activeIndex:0},null,8,["images"])):V("",!0)])}const ic=Ue(ql,[["render",Gu]]);export{nc as A,Qu as B,ec as C,xs as E,Ms as G,ic as P,pl as R,sc as a,tc as b,el as c,tn as d,Ls as e,Ke as f,$t as g,Va as h,wr as i,Lr as j,Do as k,Sr as l,ae as s,Ye as t,cn as x};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.