v-onboarding 2.3.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -702,6 +702,7 @@ const defaultVOnboardingWrapperOptions = {
702
702
  inline: "center"
703
703
  }
704
704
  },
705
+ autoFinishByExit: true,
705
706
  labels: {
706
707
  previousButton: "Previous",
707
708
  nextButton: "Next",
@@ -709,7 +710,8 @@ const defaultVOnboardingWrapperOptions = {
709
710
  },
710
711
  hideButtons: {
711
712
  previous: false,
712
- next: false
713
+ next: false,
714
+ exit: false
713
715
  }
714
716
  };
715
717
  function useSvgOverlay() {
@@ -794,13 +796,14 @@ const _sfc_main$1 = defineComponent({
794
796
  setup() {
795
797
  const show = ref(false);
796
798
  const state = inject(STATE_INJECT_KEY, {});
797
- const { step, isFirstStep, isLastStep, options, next, previous, exit, finish } = toRefs(state.value);
799
+ const { step, isFirstStep, isLastStep, options, next, previous, exit: stateExit, finish } = toRefs(state.value);
798
800
  const mergedOptions = computed(() => merge({}, options == null ? void 0 : options.value, step.value.options));
799
801
  const isButtonVisible = computed(() => {
800
- var _a, _b;
802
+ var _a, _b, _c;
801
803
  return {
802
804
  previous: !((_a = mergedOptions.value.hideButtons) == null ? void 0 : _a.previous),
803
- next: !((_b = mergedOptions.value.hideButtons) == null ? void 0 : _b.next)
805
+ next: !((_b = mergedOptions.value.hideButtons) == null ? void 0 : _b.next),
806
+ exit: !((_c = mergedOptions.value.hideButtons) == null ? void 0 : _c.exit)
804
807
  };
805
808
  });
806
809
  const buttonLabels = computed(() => {
@@ -831,6 +834,13 @@ const _sfc_main$1 = defineComponent({
831
834
  }
832
835
  };
833
836
  watch(step, attachElement, { immediate: true });
837
+ const exit = () => {
838
+ var _a;
839
+ stateExit.value();
840
+ if ((_a = mergedOptions.value) == null ? void 0 : _a.autoFinishByExit) {
841
+ finish.value();
842
+ }
843
+ };
834
844
  return {
835
845
  stepElement,
836
846
  next,
@@ -847,7 +857,7 @@ const _sfc_main$1 = defineComponent({
847
857
  };
848
858
  }
849
859
  });
850
- const _hoisted_1$1 = { style: { "width": "100%", "height": "100%", "position": "fixed", "top": "0", "left": "0", "opacity": "0.5", "z-index": "var(--v-onboarding-overlay-z, 10)", "pointer-events": "none" } };
860
+ const _hoisted_1$1 = { style: { "width": "100%", "height": "100%", "position": "fixed", "top": "0", "left": "0", "fill": "var(--v-onboarding-overlay-fill, black)", "opacity": "var(--v-onboarding-overlay-opacity, 0.5)", "z-index": "var(--v-onboarding-overlay-z, 10)", "pointer-events": "none" } };
851
861
  const _hoisted_2 = ["d"];
852
862
  const _hoisted_3 = {
853
863
  ref: "stepElement",
@@ -892,10 +902,11 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
892
902
  createElementVNode("div", _hoisted_4, [
893
903
  createElementVNode("div", _hoisted_5, [
894
904
  _ctx.step.content.title ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(_ctx.step.content.title), 1)) : createCommentVNode("", true),
895
- createElementVNode("button", {
905
+ _ctx.isButtonVisible.exit ? (openBlock(), createElementBlock("button", {
906
+ key: 1,
896
907
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.exit && _ctx.exit(...args)),
897
908
  class: "v-onboarding-item__header-close"
898
- }, _hoisted_8)
909
+ }, _hoisted_8)) : createCommentVNode("", true)
899
910
  ]),
900
911
  _ctx.step.content.description ? (openBlock(), createElementBlock("p", _hoisted_9, toDisplayString(_ctx.step.content.description), 1)) : createCommentVNode("", true),
901
912
  createElementVNode("div", _hoisted_10, [
@@ -1,12 +1,12 @@
1
- (function(B,J){typeof exports=="object"&&typeof module!="undefined"?J(exports,require("@popperjs/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@popperjs/core","vue"],J):(B=typeof globalThis!="undefined"?globalThis:B||self,J(B["v-onboarding"]={},B.core,B.Vue))})(this,function(B,J,o){"use strict";const Nt=Symbol("onboardingState"),mt={IDLE:-1,FINISHED:-2};var rt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vt={exports:{}};(function(r,b){var p=200,m="__lodash_hash_undefined__",u=800,a=16,v=9007199254740991,N="[object Arguments]",V="[object Array]",H="[object AsyncFunction]",w="[object Boolean]",T="[object Date]",I="[object Error]",j="[object Function]",L="[object GeneratorFunction]",E="[object Map]",S="[object Number]",x="[object Null]",f="[object Object]",s="[object Proxy]",d="[object RegExp]",O="[object Set]",A="[object String]",P="[object Undefined]",D="[object WeakMap]",M="[object ArrayBuffer]",k="[object DataView]",U="[object Float32Array]",G="[object Float64Array]",R="[object Int8Array]",it="[object Int16Array]",at="[object Int32Array]",st="[object Uint8Array]",lt="[object Uint8ClampedArray]",Ce="[object Uint16Array]",Ee="[object Uint32Array]",$e=/[\\^$.*+?()[\]{}|]/g,Be=/^\[object .+?Constructor\]$/,je=/^(?:0|[1-9]\d*)$/,g={};g[U]=g[G]=g[R]=g[it]=g[at]=g[st]=g[lt]=g[Ce]=g[Ee]=!0,g[N]=g[V]=g[M]=g[w]=g[k]=g[T]=g[I]=g[j]=g[E]=g[S]=g[f]=g[d]=g[O]=g[A]=g[D]=!1;var zt=typeof rt=="object"&&rt&&rt.Object===Object&&rt,Ae=typeof self=="object"&&self&&self.Object===Object&&self,Y=zt||Ae||Function("return this")(),Ft=b&&!b.nodeType&&b,X=Ft&&!0&&r&&!r.nodeType&&r,Ht=X&&X.exports===Ft,yt=Ht&&zt.process,Pt=function(){try{var t=X&&X.require&&X.require("util").types;return t||yt&&yt.binding&&yt.binding("util")}catch{}}(),Dt=Pt&&Pt.isTypedArray;function Ne(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ve(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Ie(t){return function(e){return t(e)}}function Le(t,e){return t==null?void 0:t[e]}function ze(t,e){return function(n){return t(e(n))}}var Fe=Array.prototype,He=Function.prototype,ct=Object.prototype,Tt=Y["__core-js_shared__"],dt=He.toString,z=ct.hasOwnProperty,Mt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),kt=ct.toString,Pe=dt.call(Object),De=RegExp("^"+dt.call(z).replace($e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=Ht?Y.Buffer:void 0,Ut=Y.Symbol,Gt=Y.Uint8Array,Rt=ut?ut.allocUnsafe:void 0,qt=ze(Object.getPrototypeOf,Object),Kt=Object.create,Me=ct.propertyIsEnumerable,ke=Fe.splice,q=Ut?Ut.toStringTag:void 0,ft=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ue=ut?ut.isBuffer:void 0,Wt=Math.max,Ge=Date.now,Qt=xt(Y,"Map"),tt=xt(Object,"create"),Re=function(){function t(){}return function(e){if(!W(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function qe(){this.__data__=tt?tt(null):{},this.size=0}function Ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function We(t){var e=this.__data__;if(tt){var n=e[t];return n===m?void 0:n}return z.call(e,t)?e[t]:void 0}function Qe(t){var e=this.__data__;return tt?e[t]!==void 0:z.call(e,t)}function Ze(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tt&&e===void 0?m:e,this}K.prototype.clear=qe,K.prototype.delete=Ke,K.prototype.get=We,K.prototype.has=Qe,K.prototype.set=Ze;function F(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Je(){this.__data__=[],this.size=0}function Ye(t){var e=this.__data__,n=pt(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():ke.call(e,n,1),--this.size,!0}function Xe(t){var e=this.__data__,n=pt(e,t);return n<0?void 0:e[n][1]}function tn(t){return pt(this.__data__,t)>-1}function en(t,e){var n=this.__data__,i=pt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}F.prototype.clear=Je,F.prototype.delete=Ye,F.prototype.get=Xe,F.prototype.has=tn,F.prototype.set=en;function Q(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function nn(){this.size=0,this.__data__={hash:new K,map:new(Qt||F),string:new K}}function rn(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function on(t){return gt(this,t).get(t)}function an(t){return gt(this,t).has(t)}function sn(t,e){var n=gt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}Q.prototype.clear=nn,Q.prototype.delete=rn,Q.prototype.get=on,Q.prototype.has=an,Q.prototype.set=sn;function Z(t){var e=this.__data__=new F(t);this.size=e.size}function ln(){this.__data__=new F,this.size=0}function cn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function dn(t){return this.__data__.get(t)}function un(t){return this.__data__.has(t)}function fn(t,e){var n=this.__data__;if(n instanceof F){var i=n.__data__;if(!Qt||i.length<p-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Q(i)}return n.set(t,e),this.size=n.size,this}Z.prototype.clear=ln,Z.prototype.delete=cn,Z.prototype.get=dn,Z.prototype.has=un,Z.prototype.set=fn;function pn(t,e){var n=Et(t),i=!n&&Ct(t),c=!n&&!i&&te(t),h=!n&&!i&&!c&&ne(t),_=n||i||c||h,l=_?Ve(t.length,String):[],y=l.length;for(var $ in t)(e||z.call(t,$))&&!(_&&($=="length"||c&&($=="offset"||$=="parent")||h&&($=="buffer"||$=="byteLength"||$=="byteOffset")||Yt($,y)))&&l.push($);return l}function St(t,e,n){(n!==void 0&&!bt(t[e],n)||n===void 0&&!(e in t))&&wt(t,e,n)}function hn(t,e,n){var i=t[e];(!(z.call(t,e)&&bt(i,n))||n===void 0&&!(e in t))&&wt(t,e,n)}function pt(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function wt(t,e,n){e=="__proto__"&&ft?ft(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var gn=$n();function ht(t){return t==null?t===void 0?P:x:q&&q in Object(t)?Bn(t):Ln(t)}function Zt(t){return et(t)&&ht(t)==N}function bn(t){if(!W(t)||Vn(t))return!1;var e=Bt(t)?De:Be;return e.test(Pn(t))}function mn(t){return et(t)&&ee(t.length)&&!!g[ht(t)]}function vn(t){if(!W(t))return In(t);var e=Xt(t),n=[];for(var i in t)i=="constructor"&&(e||!z.call(t,i))||n.push(i);return n}function Jt(t,e,n,i,c){t!==e&&gn(e,function(h,_){if(c||(c=new Z),W(h))_n(t,e,_,n,Jt,i,c);else{var l=i?i(Ot(t,_),h,_+"",t,e,c):void 0;l===void 0&&(l=h),St(t,_,l)}},re)}function _n(t,e,n,i,c,h,_){var l=Ot(t,n),y=Ot(e,n),$=_.get(y);if($){St(t,n,$);return}var C=h?h(l,y,n+"",t,e,_):void 0,nt=C===void 0;if(nt){var jt=Et(y),At=!jt&&te(y),ie=!jt&&!At&&ne(y);C=y,jt||At||ie?Et(l)?C=l:Dn(l)?C=On(l):At?(nt=!1,C=Sn(y,!0)):ie?(nt=!1,C=xn(y,!0)):C=[]:Mn(y)||Ct(y)?(C=l,Ct(l)?C=kn(l):(!W(l)||Bt(l))&&(C=jn(y))):nt=!1}nt&&(_.set(y,C),c(C,y,i,h,_),_.delete(y)),St(t,n,C)}function yn(t,e){return Fn(zn(t,e,oe),t+"")}var Tn=ft?function(t,e){return ft(t,"toString",{configurable:!0,enumerable:!1,value:Gn(e),writable:!0})}:oe;function Sn(t,e){if(e)return t.slice();var n=t.length,i=Rt?Rt(n):new t.constructor(n);return t.copy(i),i}function wn(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function xn(t,e){var n=e?wn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function On(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function Cn(t,e,n,i){var c=!n;n||(n={});for(var h=-1,_=e.length;++h<_;){var l=e[h],y=i?i(n[l],t[l],l,n,t):void 0;y===void 0&&(y=t[l]),c?wt(n,l,y):hn(n,l,y)}return n}function En(t){return yn(function(e,n){var i=-1,c=n.length,h=c>1?n[c-1]:void 0,_=c>2?n[2]:void 0;for(h=t.length>3&&typeof h=="function"?(c--,h):void 0,_&&An(n[0],n[1],_)&&(h=c<3?void 0:h,c=1),e=Object(e);++i<c;){var l=n[i];l&&t(e,l,i,h)}return e})}function $n(t){return function(e,n,i){for(var c=-1,h=Object(e),_=i(e),l=_.length;l--;){var y=_[t?l:++c];if(n(h[y],y,h)===!1)break}return e}}function gt(t,e){var n=t.__data__;return Nn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xt(t,e){var n=Le(t,e);return bn(n)?n:void 0}function Bn(t){var e=z.call(t,q),n=t[q];try{t[q]=void 0;var i=!0}catch{}var c=kt.call(t);return i&&(e?t[q]=n:delete t[q]),c}function jn(t){return typeof t.constructor=="function"&&!Xt(t)?Re(qt(t)):{}}function Yt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&je.test(t))&&t>-1&&t%1==0&&t<e}function An(t,e,n){if(!W(n))return!1;var i=typeof e;return(i=="number"?$t(n)&&Yt(e,n.length):i=="string"&&e in n)?bt(n[e],t):!1}function Nn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Vn(t){return!!Mt&&Mt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function In(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ln(t){return kt.call(t)}function zn(t,e,n){return e=Wt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,c=-1,h=Wt(i.length-e,0),_=Array(h);++c<h;)_[c]=i[e+c];c=-1;for(var l=Array(e+1);++c<e;)l[c]=i[c];return l[e]=n(_),Ne(t,this,l)}}function Ot(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Fn=Hn(Tn);function Hn(t){var e=0,n=0;return function(){var i=Ge(),c=a-(i-n);if(n=i,c>0){if(++e>=u)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pn(t){if(t!=null){try{return dt.call(t)}catch{}try{return t+""}catch{}}return""}function bt(t,e){return t===e||t!==t&&e!==e}var Ct=Zt(function(){return arguments}())?Zt:function(t){return et(t)&&z.call(t,"callee")&&!Me.call(t,"callee")},Et=Array.isArray;function $t(t){return t!=null&&ee(t.length)&&!Bt(t)}function Dn(t){return et(t)&&$t(t)}var te=Ue||Rn;function Bt(t){if(!W(t))return!1;var e=ht(t);return e==j||e==L||e==H||e==s}function ee(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function W(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function et(t){return t!=null&&typeof t=="object"}function Mn(t){if(!et(t)||ht(t)!=f)return!1;var e=qt(t);if(e===null)return!0;var n=z.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dt.call(n)==Pe}var ne=Dt?Ie(Dt):mn;function kn(t){return Cn(t,re(t))}function re(t){return $t(t)?pn(t,!0):vn(t)}var Un=En(function(t,e,n){Jt(t,e,n)});function Gn(t){return function(){return t}}function oe(t){return t}function Rn(){return!1}r.exports=Un})(vt,vt.exports);var Vt=vt.exports;function _t(r){return typeof r=="string"?document.querySelector(r):typeof r=="function"?r():null}const ot={popper:{},overlay:{enabled:!0,padding:0,borderRadius:0},scrollToStep:{enabled:!0,options:{behavior:"smooth",block:"center",inline:"center"}},labels:{previousButton:"Previous",nextButton:"Next",finishButton:"Finish"},hideButtons:{previous:!1,next:!1}};function ae(){var v,N,V,H;const r=o.ref(""),b=o.ref(null),p=o.ref((N=(v=ot.overlay)==null?void 0:v.padding)!=null?N:0),m=o.ref((H=(V=ot.overlay)==null?void 0:V.borderRadius)!=null?H:0),u=()=>{a(b.value,{padding:p.value,borderRadius:m.value})},a=async(w,T=ot.overlay)=>{var A,P,D,M,k,U,G,R,it,at,st,lt;if(!w)return;const{innerWidth:I,innerHeight:j}=window,{left:L,top:E,width:S,height:x}=w.getBoundingClientRect(),f=typeof T.padding=="number"?{top:T.padding,right:T.padding,bottom:T.padding,left:T.padding}:T.padding,s=typeof T.borderRadius=="number"?{leftTop:T.borderRadius,rightTop:T.borderRadius,rightBottom:T.borderRadius,leftBottom:T.borderRadius}:T.borderRadius,d={top:E-((A=f==null?void 0:f.top)!=null?A:0),right:L+S+((P=f==null?void 0:f.right)!=null?P:0),bottom:E+x+((D=f==null?void 0:f.bottom)!=null?D:0),left:L-((M=f==null?void 0:f.left)!=null?M:0)},O={leftTop:`M${d.left+((k=s==null?void 0:s.leftTop)!=null?k:0)},${d.top} Q${d.left},${d.top} ${d.left},${d.top+((U=s==null?void 0:s.leftTop)!=null?U:0)}`,rightTop:`V${d.top+((G=s==null?void 0:s.rightTop)!=null?G:0)} Q${d.right},${d.top} ${d.right-((R=s==null?void 0:s.rightTop)!=null?R:0)},${d.top}`,rightBottom:`H${d.right-((it=s==null?void 0:s.rightBottom)!=null?it:0)} Q${d.right},${d.bottom} ${d.right},${d.bottom-((at=s==null?void 0:s.rightBottom)!=null?at:0)}`,leftBottom:`V${d.bottom-((st=s==null?void 0:s.leftBottom)!=null?st:0)} Q${d.left},${d.bottom} ${d.left+((lt=s==null?void 0:s.leftBottom)!=null?lt:0)},${d.bottom}`};r.value=`
2
- M${I},${j}
1
+ (function(E,Y){typeof exports=="object"&&typeof module!="undefined"?Y(exports,require("@popperjs/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@popperjs/core","vue"],Y):(E=typeof globalThis!="undefined"?globalThis:E||self,Y(E["v-onboarding"]={},E.core,E.Vue))})(this,function(E,Y,o){"use strict";const Nt=Symbol("onboardingState"),mt={IDLE:-1,FINISHED:-2};var ot=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vt={exports:{}};(function(r,b){var p=200,m="__lodash_hash_undefined__",f=800,s=16,v=9007199254740991,N="[object Arguments]",V="[object Array]",I="[object AsyncFunction]",T="[object Boolean]",S="[object Date]",L="[object Error]",$="[object Function]",z="[object GeneratorFunction]",C="[object Map]",w="[object Number]",Q="[object Null]",u="[object Object]",a="[object Proxy]",l="[object RegExp]",x="[object Set]",j="[object String]",A="[object Undefined]",P="[object WeakMap]",k="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",U="[object Float64Array]",G="[object Int8Array]",R="[object Int16Array]",at="[object Int32Array]",st="[object Uint8Array]",lt="[object Uint8ClampedArray]",Ce="[object Uint16Array]",Be="[object Uint32Array]",Ee=/[\\^$.*+?()[\]{}|]/g,$e=/^\[object .+?Constructor\]$/,je=/^(?:0|[1-9]\d*)$/,g={};g[M]=g[U]=g[G]=g[R]=g[at]=g[st]=g[lt]=g[Ce]=g[Be]=!0,g[N]=g[V]=g[k]=g[T]=g[D]=g[S]=g[L]=g[$]=g[C]=g[w]=g[u]=g[l]=g[x]=g[j]=g[P]=!1;var zt=typeof ot=="object"&&ot&&ot.Object===Object&&ot,Ae=typeof self=="object"&&self&&self.Object===Object&&self,X=zt||Ae||Function("return this")(),Ft=b&&!b.nodeType&&b,tt=Ft&&!0&&r&&!r.nodeType&&r,Ht=tt&&tt.exports===Ft,yt=Ht&&zt.process,Pt=function(){try{var t=tt&&tt.require&&tt.require("util").types;return t||yt&&yt.binding&&yt.binding("util")}catch{}}(),kt=Pt&&Pt.isTypedArray;function Ne(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ve(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Ie(t){return function(e){return t(e)}}function Le(t,e){return t==null?void 0:t[e]}function ze(t,e){return function(n){return t(e(n))}}var Fe=Array.prototype,He=Function.prototype,ct=Object.prototype,Tt=X["__core-js_shared__"],dt=He.toString,F=ct.hasOwnProperty,Dt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Mt=ct.toString,Pe=dt.call(Object),ke=RegExp("^"+dt.call(F).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=Ht?X.Buffer:void 0,Ut=X.Symbol,Gt=X.Uint8Array,Rt=ut?ut.allocUnsafe:void 0,qt=ze(Object.getPrototypeOf,Object),Kt=Object.create,De=ct.propertyIsEnumerable,Me=Fe.splice,q=Ut?Ut.toStringTag:void 0,ft=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ue=ut?ut.isBuffer:void 0,Wt=Math.max,Ge=Date.now,Qt=xt(X,"Map"),et=xt(Object,"create"),Re=function(){function t(){}return function(e){if(!W(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function K(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function qe(){this.__data__=et?et(null):{},this.size=0}function Ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function We(t){var e=this.__data__;if(et){var n=e[t];return n===m?void 0:n}return F.call(e,t)?e[t]:void 0}function Qe(t){var e=this.__data__;return et?e[t]!==void 0:F.call(e,t)}function Ze(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=et&&e===void 0?m:e,this}K.prototype.clear=qe,K.prototype.delete=Ke,K.prototype.get=We,K.prototype.has=Qe,K.prototype.set=Ze;function H(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Je(){this.__data__=[],this.size=0}function Ye(t){var e=this.__data__,n=pt(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Me.call(e,n,1),--this.size,!0}function Xe(t){var e=this.__data__,n=pt(e,t);return n<0?void 0:e[n][1]}function tn(t){return pt(this.__data__,t)>-1}function en(t,e){var n=this.__data__,i=pt(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}H.prototype.clear=Je,H.prototype.delete=Ye,H.prototype.get=Xe,H.prototype.has=tn,H.prototype.set=en;function Z(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function nn(){this.size=0,this.__data__={hash:new K,map:new(Qt||H),string:new K}}function rn(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function on(t){return gt(this,t).get(t)}function an(t){return gt(this,t).has(t)}function sn(t,e){var n=gt(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}Z.prototype.clear=nn,Z.prototype.delete=rn,Z.prototype.get=on,Z.prototype.has=an,Z.prototype.set=sn;function J(t){var e=this.__data__=new H(t);this.size=e.size}function ln(){this.__data__=new H,this.size=0}function cn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function dn(t){return this.__data__.get(t)}function un(t){return this.__data__.has(t)}function fn(t,e){var n=this.__data__;if(n instanceof H){var i=n.__data__;if(!Qt||i.length<p-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Z(i)}return n.set(t,e),this.size=n.size,this}J.prototype.clear=ln,J.prototype.delete=cn,J.prototype.get=dn,J.prototype.has=un,J.prototype.set=fn;function pn(t,e){var n=Bt(t),i=!n&&Ct(t),d=!n&&!i&&te(t),h=!n&&!i&&!d&&ne(t),_=n||i||d||h,c=_?Ve(t.length,String):[],y=c.length;for(var B in t)(e||F.call(t,B))&&!(_&&(B=="length"||d&&(B=="offset"||B=="parent")||h&&(B=="buffer"||B=="byteLength"||B=="byteOffset")||Yt(B,y)))&&c.push(B);return c}function St(t,e,n){(n!==void 0&&!bt(t[e],n)||n===void 0&&!(e in t))&&wt(t,e,n)}function hn(t,e,n){var i=t[e];(!(F.call(t,e)&&bt(i,n))||n===void 0&&!(e in t))&&wt(t,e,n)}function pt(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function wt(t,e,n){e=="__proto__"&&ft?ft(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var gn=En();function ht(t){return t==null?t===void 0?A:Q:q&&q in Object(t)?$n(t):Ln(t)}function Zt(t){return nt(t)&&ht(t)==N}function bn(t){if(!W(t)||Vn(t))return!1;var e=$t(t)?ke:$e;return e.test(Pn(t))}function mn(t){return nt(t)&&ee(t.length)&&!!g[ht(t)]}function vn(t){if(!W(t))return In(t);var e=Xt(t),n=[];for(var i in t)i=="constructor"&&(e||!F.call(t,i))||n.push(i);return n}function Jt(t,e,n,i,d){t!==e&&gn(e,function(h,_){if(d||(d=new J),W(h))_n(t,e,_,n,Jt,i,d);else{var c=i?i(Ot(t,_),h,_+"",t,e,d):void 0;c===void 0&&(c=h),St(t,_,c)}},re)}function _n(t,e,n,i,d,h,_){var c=Ot(t,n),y=Ot(e,n),B=_.get(y);if(B){St(t,n,B);return}var O=h?h(c,y,n+"",t,e,_):void 0,rt=O===void 0;if(rt){var jt=Bt(y),At=!jt&&te(y),ie=!jt&&!At&&ne(y);O=y,jt||At||ie?Bt(c)?O=c:kn(c)?O=On(c):At?(rt=!1,O=Sn(y,!0)):ie?(rt=!1,O=xn(y,!0)):O=[]:Dn(y)||Ct(y)?(O=c,Ct(c)?O=Mn(c):(!W(c)||$t(c))&&(O=jn(y))):rt=!1}rt&&(_.set(y,O),d(O,y,i,h,_),_.delete(y)),St(t,n,O)}function yn(t,e){return Fn(zn(t,e,oe),t+"")}var Tn=ft?function(t,e){return ft(t,"toString",{configurable:!0,enumerable:!1,value:Gn(e),writable:!0})}:oe;function Sn(t,e){if(e)return t.slice();var n=t.length,i=Rt?Rt(n):new t.constructor(n);return t.copy(i),i}function wn(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function xn(t,e){var n=e?wn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function On(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function Cn(t,e,n,i){var d=!n;n||(n={});for(var h=-1,_=e.length;++h<_;){var c=e[h],y=i?i(n[c],t[c],c,n,t):void 0;y===void 0&&(y=t[c]),d?wt(n,c,y):hn(n,c,y)}return n}function Bn(t){return yn(function(e,n){var i=-1,d=n.length,h=d>1?n[d-1]:void 0,_=d>2?n[2]:void 0;for(h=t.length>3&&typeof h=="function"?(d--,h):void 0,_&&An(n[0],n[1],_)&&(h=d<3?void 0:h,d=1),e=Object(e);++i<d;){var c=n[i];c&&t(e,c,i,h)}return e})}function En(t){return function(e,n,i){for(var d=-1,h=Object(e),_=i(e),c=_.length;c--;){var y=_[t?c:++d];if(n(h[y],y,h)===!1)break}return e}}function gt(t,e){var n=t.__data__;return Nn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function xt(t,e){var n=Le(t,e);return bn(n)?n:void 0}function $n(t){var e=F.call(t,q),n=t[q];try{t[q]=void 0;var i=!0}catch{}var d=Mt.call(t);return i&&(e?t[q]=n:delete t[q]),d}function jn(t){return typeof t.constructor=="function"&&!Xt(t)?Re(qt(t)):{}}function Yt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&je.test(t))&&t>-1&&t%1==0&&t<e}function An(t,e,n){if(!W(n))return!1;var i=typeof e;return(i=="number"?Et(n)&&Yt(e,n.length):i=="string"&&e in n)?bt(n[e],t):!1}function Nn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Vn(t){return!!Dt&&Dt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function In(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Ln(t){return Mt.call(t)}function zn(t,e,n){return e=Wt(e===void 0?t.length-1:e,0),function(){for(var i=arguments,d=-1,h=Wt(i.length-e,0),_=Array(h);++d<h;)_[d]=i[e+d];d=-1;for(var c=Array(e+1);++d<e;)c[d]=i[d];return c[e]=n(_),Ne(t,this,c)}}function Ot(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Fn=Hn(Tn);function Hn(t){var e=0,n=0;return function(){var i=Ge(),d=s-(i-n);if(n=i,d>0){if(++e>=f)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pn(t){if(t!=null){try{return dt.call(t)}catch{}try{return t+""}catch{}}return""}function bt(t,e){return t===e||t!==t&&e!==e}var Ct=Zt(function(){return arguments}())?Zt:function(t){return nt(t)&&F.call(t,"callee")&&!De.call(t,"callee")},Bt=Array.isArray;function Et(t){return t!=null&&ee(t.length)&&!$t(t)}function kn(t){return nt(t)&&Et(t)}var te=Ue||Rn;function $t(t){if(!W(t))return!1;var e=ht(t);return e==$||e==z||e==I||e==a}function ee(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function W(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nt(t){return t!=null&&typeof t=="object"}function Dn(t){if(!nt(t)||ht(t)!=u)return!1;var e=qt(t);if(e===null)return!0;var n=F.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dt.call(n)==Pe}var ne=kt?Ie(kt):mn;function Mn(t){return Cn(t,re(t))}function re(t){return Et(t)?pn(t,!0):vn(t)}var Un=Bn(function(t,e,n){Jt(t,e,n)});function Gn(t){return function(){return t}}function oe(t){return t}function Rn(){return!1}r.exports=Un})(vt,vt.exports);var Vt=vt.exports;function _t(r){return typeof r=="string"?document.querySelector(r):typeof r=="function"?r():null}const it={popper:{},overlay:{enabled:!0,padding:0,borderRadius:0},scrollToStep:{enabled:!0,options:{behavior:"smooth",block:"center",inline:"center"}},autoFinishByExit:!0,labels:{previousButton:"Previous",nextButton:"Next",finishButton:"Finish"},hideButtons:{previous:!1,next:!1,exit:!1}};function ae(){var v,N,V,I;const r=o.ref(""),b=o.ref(null),p=o.ref((N=(v=it.overlay)==null?void 0:v.padding)!=null?N:0),m=o.ref((I=(V=it.overlay)==null?void 0:V.borderRadius)!=null?I:0),f=()=>{s(b.value,{padding:p.value,borderRadius:m.value})},s=async(T,S=it.overlay)=>{var j,A,P,k,D,M,U,G,R,at,st,lt;if(!T)return;const{innerWidth:L,innerHeight:$}=window,{left:z,top:C,width:w,height:Q}=T.getBoundingClientRect(),u=typeof S.padding=="number"?{top:S.padding,right:S.padding,bottom:S.padding,left:S.padding}:S.padding,a=typeof S.borderRadius=="number"?{leftTop:S.borderRadius,rightTop:S.borderRadius,rightBottom:S.borderRadius,leftBottom:S.borderRadius}:S.borderRadius,l={top:C-((j=u==null?void 0:u.top)!=null?j:0),right:z+w+((A=u==null?void 0:u.right)!=null?A:0),bottom:C+Q+((P=u==null?void 0:u.bottom)!=null?P:0),left:z-((k=u==null?void 0:u.left)!=null?k:0)},x={leftTop:`M${l.left+((D=a==null?void 0:a.leftTop)!=null?D:0)},${l.top} Q${l.left},${l.top} ${l.left},${l.top+((M=a==null?void 0:a.leftTop)!=null?M:0)}`,rightTop:`V${l.top+((U=a==null?void 0:a.rightTop)!=null?U:0)} Q${l.right},${l.top} ${l.right-((G=a==null?void 0:a.rightTop)!=null?G:0)},${l.top}`,rightBottom:`H${l.right-((R=a==null?void 0:a.rightBottom)!=null?R:0)} Q${l.right},${l.bottom} ${l.right},${l.bottom-((at=a==null?void 0:a.rightBottom)!=null?at:0)}`,leftBottom:`V${l.bottom-((st=a==null?void 0:a.leftBottom)!=null?st:0)} Q${l.left},${l.bottom} ${l.left+((lt=a==null?void 0:a.leftBottom)!=null?lt:0)},${l.bottom}`};r.value=`
2
+ M${L},${$}
3
3
  H0V0
4
- H${I}V${j}
4
+ H${L}V${$}
5
5
  Z
6
- ${O.leftTop}
7
- ${O.leftBottom}
8
- ${O.rightBottom}
9
- ${O.rightTop}
6
+ ${x.leftTop}
7
+ ${x.leftBottom}
8
+ ${x.rightBottom}
9
+ ${x.rightTop}
10
10
  Z
11
- `,b.value=w,p.value=f,m.value=s};return o.onMounted(()=>{window.addEventListener("scroll",u),window.addEventListener("resize",u)}),o.onUnmounted(()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u)}),{path:r,updatePath:a}}var It=(r,b)=>{const p=r.__vccOpts||r;for(const[m,u]of b)p[m]=u;return p};const se=o.defineComponent({name:"VOnboardingStep",setup(){const r=o.ref(!1),b=o.inject(Nt,{}),{step:p,isFirstStep:m,isLastStep:u,options:a,next:v,previous:N,exit:V,finish:H}=o.toRefs(b.value),w=o.computed(()=>Vt({},a==null?void 0:a.value,p.value.options)),T=o.computed(()=>{var x,f;return{previous:!((x=w.value.hideButtons)!=null&&x.previous),next:!((f=w.value.hideButtons)!=null&&f.next)}}),I=o.computed(()=>{var x,f,s,d,O,A;return{previous:(f=(x=w.value)==null?void 0:x.labels)==null?void 0:f.previousButton,next:(d=(s=w.value)==null?void 0:s.labels)==null?void 0:d.nextButton,finish:(A=(O=w.value)==null?void 0:O.labels)==null?void 0:A.finishButton}}),{updatePath:j,path:L}=ae(),E=o.ref(),S=()=>{var f,s,d,O,A,P,D,M,k,U,G,R;const x=_t((s=(f=p==null?void 0:p.value)==null?void 0:f.attachTo)==null?void 0:s.element);x&&E.value&&(r.value=!0,(O=(d=w.value)==null?void 0:d.scrollToStep)!=null&&O.enabled&&x.scrollIntoView((P=(A=w.value)==null?void 0:A.scrollToStep)==null?void 0:P.options),J.createPopper(x,E.value,w.value.popper),(M=(D=w.value)==null?void 0:D.overlay)!=null&&M.enabled&&j(x,{padding:(U=(k=w.value)==null?void 0:k.overlay)==null?void 0:U.padding,borderRadius:(R=(G=w.value)==null?void 0:G.overlay)==null?void 0:R.borderRadius}))};return o.watch(p,S,{immediate:!0}),{stepElement:E,next:v,previous:N,path:L,show:r,step:p,isFirstStep:m,isLastStep:u,exit:V,finish:H,isButtonVisible:T,buttonLabels:I}}}),le={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",opacity:"0.5","z-index":"var(--v-onboarding-overlay-z, 10)","pointer-events":"none"}},ce=["d"],de={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},ue={class:"v-onboarding-item"},fe={class:"v-onboarding-item__header"},pe={key:0,class:"v-onboarding-item__header-title"},he=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],ge={key:0,class:"v-onboarding-item__description"},be={class:"v-onboarding-item__actions"},me=o.createElementVNode("div",{"data-popper-arrow":""},null,-1);function ve(r,b,p,m,u,a){return o.withDirectives((o.openBlock(),o.createElementBlock("div",null,[(o.openBlock(),o.createElementBlock("svg",le,[o.createElementVNode("path",{d:r.path},null,8,ce)])),o.createElementVNode("div",de,[r.step?o.renderSlot(r.$slots,"default",{key:0},()=>[o.createElementVNode("div",ue,[o.createElementVNode("div",fe,[r.step.content.title?(o.openBlock(),o.createElementBlock("span",pe,o.toDisplayString(r.step.content.title),1)):o.createCommentVNode("",!0),o.createElementVNode("button",{onClick:b[0]||(b[0]=(...v)=>r.exit&&r.exit(...v)),class:"v-onboarding-item__header-close"},he)]),r.step.content.description?(o.openBlock(),o.createElementBlock("p",ge,o.toDisplayString(r.step.content.description),1)):o.createCommentVNode("",!0),o.createElementVNode("div",be,[!r.isFirstStep&&r.isButtonVisible.previous?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",onClick:b[1]||(b[1]=(...v)=>r.previous&&r.previous(...v)),class:"v-onboarding-btn-secondary"},o.toDisplayString(r.buttonLabels.previous),1)):o.createCommentVNode("",!0),r.isButtonVisible.next?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:b[2]||(b[2]=()=>r.isLastStep?r.finish():r.next()),type:"button",class:"v-onboarding-btn-primary"},o.toDisplayString(r.isLastStep?r.buttonLabels.finish:r.buttonLabels.next),1)):o.createCommentVNode("",!0)])])]):o.createCommentVNode("",!0),me],512)],512)),[[o.vShow,r.show]])}var Lt=It(se,[["render",ve]]);const _e=o.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:Lt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["finish","exit"],setup(r,{expose:b,emit:p}){const m=o.ref(mt.IDLE),u=o.ref(m.value),a=S=>{typeof S=="function"?m.value=S(m.value):m.value=S},{beforeHook:v,afterHook:N}=Te(),V=o.computed(()=>{var S;return(S=r.steps)==null?void 0:S[u.value]});o.watch(m,async(S,x)=>{var d,O;const f=(d=r.steps)==null?void 0:d[x];f&&await N(f);const s=(O=r.steps)==null?void 0:O[S];s&&await v(s),u.value=S});const H=o.computed(()=>u.value===mt.FINISHED),w=()=>a(0),T=()=>{a(mt.FINISHED),p("finish")},I=()=>p("exit");b({start:w,finish:T,goToStep:a});const j=()=>{a(S=>S-1)},L=()=>{const S=u.value+1;if(S===r.steps.length){T();return}a(S)},E=o.computed(()=>({step:V,options:o.computed(()=>Vt({},ot,r.options)),next:L,previous:j,finish:T,exit:I,isFirstStep:o.computed(()=>u.value===0),isLastStep:o.computed(()=>u.value===r.steps.length-1)}));return o.provide(Nt,E),{index:m,activeStep:V,next:L,previous:j,isFinished:H,setIndex:a,isFirstStep:E.value.isFirstStep,isLastStep:E.value.isLastStep,finish:T,exit:I}}});function ye(){return{setClassName:({element:p,classList:m=[]})=>{!p||p.classList.add(...m)},unsetClassName:({element:p,classList:m=[]})=>{!p||p.classList.remove(...m)}}}function Te(){const{setClassName:r,unsetClassName:b}=ye();return{beforeHook:u=>{var a,v;return r({element:_t(u.attachTo.element),classList:u.attachTo.classList}),(v=(a=u.on)==null?void 0:a.beforeStep)==null?void 0:v.call(a)},afterHook:u=>{var a,v;return b({element:_t(u.attachTo.element),classList:u.attachTo.classList}),(v=(a=u.on)==null?void 0:a.afterStep)==null?void 0:v.call(a)}}}const Se={key:0,"data-v-onboarding-wrapper":""};function we(r,b,p,m,u,a){const v=o.resolveComponent("VOnboardingStep");return r.isFinished?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Se,[o.renderSlot(r.$slots,"default",{key:r.index,step:r.activeStep,next:r.next,previous:r.previous,exit:r.exit,isFirst:r.isFirstStep,isLast:r.isLastStep,index:r.index},()=>[(o.openBlock(),o.createBlock(v,{key:r.index}))])]))}var xe=It(_e,[["render",we]]);function Oe(r){return{start:()=>{var a;return(a=r==null?void 0:r.value)==null?void 0:a.start()},finish:()=>{var a;return(a=r==null?void 0:r.value)==null?void 0:a.finish()},exit:()=>{var a;return(a=r==null?void 0:r.value)==null?void 0:a.exit()},goToStep:a=>{var v;return(v=r==null?void 0:r.value)==null?void 0:v.goToStep(a)}}}var Kn=(()=>`.v-onboarding-item{width:20rem;padding:1rem;background-color:#fff;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;border-radius:.375rem}.v-onboarding-item__header{display:flex;justify-content:space-between}.v-onboarding-item__header-title{font-size:1.25rem;font-weight:500;line-height:1.5}.v-onboarding-item__header-close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:50%}.v-onboarding-item__header-close:hover{background:rgba(0,0,0,.1)}.v-onboarding-item__description{font-size:.875rem;color:#71717a;margin-top:.5rem}.v-onboarding-item__actions{display:flex;margin-top:1rem}.v-onboarding-item__actions>:not([hidden])~:not([hidden]){margin-left:.5rem}.v-onboarding-item__actions button{display:inline-flex;flex:1;align-items:center;justify-content:center;padding:.5rem 1.25rem;border-width:1px;border-style:solid;font-size:1rem;font-weight:500;box-shadow:0 1px 2px #0000000d;border-radius:9999px;background-color:transparent;background-image:none;cursor:pointer}.v-onboarding-item__actions button.v-onboarding-btn-primary{border-color:transparent;color:#fff;background-color:#4f46e5}.v-onboarding-item__actions button.v-onboarding-btn-primary:hover{background-color:#4338ca}.v-onboarding-item__actions button.v-onboarding-btn-secondary{border-color:#d4d4d8;color:#3f3f46}.v-onboarding-item__actions button.v-onboarding-btn-secondary:hover{background-color:#fafafa}[data-v-onboarding-wrapper] [data-popper-arrow]:before{content:"";background:var(--v-onboarding-step-arrow-background, white);top:0;left:0;transition:transform .2s ease-out,visibility .2s ease-out;visibility:visible;transform:translate(0) rotate(45deg);transform-origin:center;width:var(--v-onboarding-step-arrow-size, 10px);height:var(--v-onboarding-step-arrow-size, 10px);position:absolute;z-index:-1}[data-v-onboarding-wrapper] [data-popper-placement^=top]>[data-popper-arrow]{bottom:5px}[data-v-onboarding-wrapper] [data-popper-placement^=right]>[data-popper-arrow]{left:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=bottom]>[data-popper-arrow]{top:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=left]>[data-popper-arrow]{right:-4px}
12
- `)();B.VOnboardingStep=Lt,B.VOnboardingWrapper=xe,B.useVOnboarding=Oe,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
11
+ `,b.value=T,p.value=u,m.value=a};return o.onMounted(()=>{window.addEventListener("scroll",f),window.addEventListener("resize",f)}),o.onUnmounted(()=>{window.removeEventListener("scroll",f),window.removeEventListener("resize",f)}),{path:r,updatePath:s}}var It=(r,b)=>{const p=r.__vccOpts||r;for(const[m,f]of b)p[m]=f;return p};const se=o.defineComponent({name:"VOnboardingStep",setup(){const r=o.ref(!1),b=o.inject(Nt,{}),{step:p,isFirstStep:m,isLastStep:f,options:s,next:v,previous:N,exit:V,finish:I}=o.toRefs(b.value),T=o.computed(()=>Vt({},s==null?void 0:s.value,p.value.options)),S=o.computed(()=>{var u,a,l;return{previous:!((u=T.value.hideButtons)!=null&&u.previous),next:!((a=T.value.hideButtons)!=null&&a.next),exit:!((l=T.value.hideButtons)!=null&&l.exit)}}),L=o.computed(()=>{var u,a,l,x,j,A;return{previous:(a=(u=T.value)==null?void 0:u.labels)==null?void 0:a.previousButton,next:(x=(l=T.value)==null?void 0:l.labels)==null?void 0:x.nextButton,finish:(A=(j=T.value)==null?void 0:j.labels)==null?void 0:A.finishButton}}),{updatePath:$,path:z}=ae(),C=o.ref(),w=()=>{var a,l,x,j,A,P,k,D,M,U,G,R;const u=_t((l=(a=p==null?void 0:p.value)==null?void 0:a.attachTo)==null?void 0:l.element);u&&C.value&&(r.value=!0,(j=(x=T.value)==null?void 0:x.scrollToStep)!=null&&j.enabled&&u.scrollIntoView((P=(A=T.value)==null?void 0:A.scrollToStep)==null?void 0:P.options),Y.createPopper(u,C.value,T.value.popper),(D=(k=T.value)==null?void 0:k.overlay)!=null&&D.enabled&&$(u,{padding:(U=(M=T.value)==null?void 0:M.overlay)==null?void 0:U.padding,borderRadius:(R=(G=T.value)==null?void 0:G.overlay)==null?void 0:R.borderRadius}))};return o.watch(p,w,{immediate:!0}),{stepElement:C,next:v,previous:N,path:z,show:r,step:p,isFirstStep:m,isLastStep:f,exit:()=>{var u;V.value(),(u=T.value)!=null&&u.autoFinishByExit&&I.value()},finish:I,isButtonVisible:S,buttonLabels:L}}}),le={style:{width:"100%",height:"100%",position:"fixed",top:"0",left:"0",fill:"var(--v-onboarding-overlay-fill, black)",opacity:"var(--v-onboarding-overlay-opacity, 0.5)","z-index":"var(--v-onboarding-overlay-z, 10)","pointer-events":"none"}},ce=["d"],de={ref:"stepElement",style:{position:"relative","z-index":"var(--v-onboarding-step-z, 20)"}},ue={class:"v-onboarding-item"},fe={class:"v-onboarding-item__header"},pe={key:0,class:"v-onboarding-item__header-title"},he=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],ge={key:0,class:"v-onboarding-item__description"},be={class:"v-onboarding-item__actions"},me=o.createElementVNode("div",{"data-popper-arrow":""},null,-1);function ve(r,b,p,m,f,s){return o.withDirectives((o.openBlock(),o.createElementBlock("div",null,[(o.openBlock(),o.createElementBlock("svg",le,[o.createElementVNode("path",{d:r.path},null,8,ce)])),o.createElementVNode("div",de,[r.step?o.renderSlot(r.$slots,"default",{key:0},()=>[o.createElementVNode("div",ue,[o.createElementVNode("div",fe,[r.step.content.title?(o.openBlock(),o.createElementBlock("span",pe,o.toDisplayString(r.step.content.title),1)):o.createCommentVNode("",!0),r.isButtonVisible.exit?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:b[0]||(b[0]=(...v)=>r.exit&&r.exit(...v)),class:"v-onboarding-item__header-close"},he)):o.createCommentVNode("",!0)]),r.step.content.description?(o.openBlock(),o.createElementBlock("p",ge,o.toDisplayString(r.step.content.description),1)):o.createCommentVNode("",!0),o.createElementVNode("div",be,[!r.isFirstStep&&r.isButtonVisible.previous?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",onClick:b[1]||(b[1]=(...v)=>r.previous&&r.previous(...v)),class:"v-onboarding-btn-secondary"},o.toDisplayString(r.buttonLabels.previous),1)):o.createCommentVNode("",!0),r.isButtonVisible.next?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:b[2]||(b[2]=()=>r.isLastStep?r.finish():r.next()),type:"button",class:"v-onboarding-btn-primary"},o.toDisplayString(r.isLastStep?r.buttonLabels.finish:r.buttonLabels.next),1)):o.createCommentVNode("",!0)])])]):o.createCommentVNode("",!0),me],512)],512)),[[o.vShow,r.show]])}var Lt=It(se,[["render",ve]]);const _e=o.defineComponent({name:"VOnboardingWrapper",components:{VOnboardingStep:Lt},props:{steps:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},emits:["finish","exit"],setup(r,{expose:b,emit:p}){const m=o.ref(mt.IDLE),f=o.ref(m.value),s=w=>{typeof w=="function"?m.value=w(m.value):m.value=w},{beforeHook:v,afterHook:N}=Te(),V=o.computed(()=>{var w;return(w=r.steps)==null?void 0:w[f.value]});o.watch(m,async(w,Q)=>{var l,x;const u=(l=r.steps)==null?void 0:l[Q];u&&await N(u);const a=(x=r.steps)==null?void 0:x[w];a&&await v(a),f.value=w});const I=o.computed(()=>f.value===mt.FINISHED),T=()=>s(0),S=()=>{s(mt.FINISHED),p("finish")},L=()=>p("exit");b({start:T,finish:S,goToStep:s});const $=()=>{s(w=>w-1)},z=()=>{const w=f.value+1;if(w===r.steps.length){S();return}s(w)},C=o.computed(()=>({step:V,options:o.computed(()=>Vt({},it,r.options)),next:z,previous:$,finish:S,exit:L,isFirstStep:o.computed(()=>f.value===0),isLastStep:o.computed(()=>f.value===r.steps.length-1)}));return o.provide(Nt,C),{index:m,activeStep:V,next:z,previous:$,isFinished:I,setIndex:s,isFirstStep:C.value.isFirstStep,isLastStep:C.value.isLastStep,finish:S,exit:L}}});function ye(){return{setClassName:({element:p,classList:m=[]})=>{!p||p.classList.add(...m)},unsetClassName:({element:p,classList:m=[]})=>{!p||p.classList.remove(...m)}}}function Te(){const{setClassName:r,unsetClassName:b}=ye();return{beforeHook:f=>{var s,v;return r({element:_t(f.attachTo.element),classList:f.attachTo.classList}),(v=(s=f.on)==null?void 0:s.beforeStep)==null?void 0:v.call(s)},afterHook:f=>{var s,v;return b({element:_t(f.attachTo.element),classList:f.attachTo.classList}),(v=(s=f.on)==null?void 0:s.afterStep)==null?void 0:v.call(s)}}}const Se={key:0,"data-v-onboarding-wrapper":""};function we(r,b,p,m,f,s){const v=o.resolveComponent("VOnboardingStep");return r.isFinished?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Se,[o.renderSlot(r.$slots,"default",{key:r.index,step:r.activeStep,next:r.next,previous:r.previous,exit:r.exit,isFirst:r.isFirstStep,isLast:r.isLastStep,index:r.index},()=>[(o.openBlock(),o.createBlock(v,{key:r.index}))])]))}var xe=It(_e,[["render",we]]);function Oe(r){return{start:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.start()},finish:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.finish()},exit:()=>{var s;return(s=r==null?void 0:r.value)==null?void 0:s.exit()},goToStep:s=>{var v;return(v=r==null?void 0:r.value)==null?void 0:v.goToStep(s)}}}var Kn=(()=>`.v-onboarding-item{width:20rem;padding:1rem;background-color:#fff;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;border-radius:.375rem}.v-onboarding-item__header{display:flex;justify-content:space-between}.v-onboarding-item__header-title{font-size:1.25rem;font-weight:500;line-height:1.5}.v-onboarding-item__header-close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:50%}.v-onboarding-item__header-close:hover{background:rgba(0,0,0,.1)}.v-onboarding-item__description{font-size:.875rem;color:#71717a;margin-top:.5rem}.v-onboarding-item__actions{display:flex;margin-top:1rem}.v-onboarding-item__actions>:not([hidden])~:not([hidden]){margin-left:.5rem}.v-onboarding-item__actions button{display:inline-flex;flex:1;align-items:center;justify-content:center;padding:.5rem 1.25rem;border-width:1px;border-style:solid;font-size:1rem;font-weight:500;box-shadow:0 1px 2px #0000000d;border-radius:9999px;background-color:transparent;background-image:none;cursor:pointer}.v-onboarding-item__actions button.v-onboarding-btn-primary{border-color:transparent;color:#fff;background-color:#4f46e5}.v-onboarding-item__actions button.v-onboarding-btn-primary:hover{background-color:#4338ca}.v-onboarding-item__actions button.v-onboarding-btn-secondary{border-color:#d4d4d8;color:#3f3f46}.v-onboarding-item__actions button.v-onboarding-btn-secondary:hover{background-color:#fafafa}[data-v-onboarding-wrapper] [data-popper-arrow]:before{content:"";background:var(--v-onboarding-step-arrow-background, white);top:0;left:0;transition:transform .2s ease-out,visibility .2s ease-out;visibility:visible;transform:translate(0) rotate(45deg);transform-origin:center;width:var(--v-onboarding-step-arrow-size, 10px);height:var(--v-onboarding-step-arrow-size, 10px);position:absolute;z-index:-1}[data-v-onboarding-wrapper] [data-popper-placement^=top]>[data-popper-arrow]{bottom:5px}[data-v-onboarding-wrapper] [data-popper-placement^=right]>[data-popper-arrow]{left:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=bottom]>[data-popper-arrow]{top:-4px}[data-v-onboarding-wrapper] [data-popper-placement^=left]>[data-popper-arrow]{right:-4px}
12
+ `)();E.VOnboardingStep=Lt,E.VOnboardingWrapper=xe,E.useVOnboarding=Oe,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-onboarding",
3
- "version": "2.3.2",
3
+ "version": "2.5.0",
4
4
  "description": "v-onboarding is a super-slim, fully-typed onboarding component for Vue 3",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,9 +23,11 @@ export interface VOnboardingWrapperOptions {
23
23
  enabled?: boolean
24
24
  options?: ScrollIntoViewOptions
25
25
  },
26
+ autoFinishByExit?: boolean
26
27
  hideButtons?: {
27
28
  previous?: boolean
28
29
  next?: boolean
30
+ exit?: boolean
29
31
  },
30
32
  labels?: {
31
33
  previousButton?: string
@@ -49,6 +51,7 @@ export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
49
51
  inline: 'center'
50
52
  }
51
53
  },
54
+ autoFinishByExit: true,
52
55
  labels: {
53
56
  previousButton: 'Previous',
54
57
  nextButton: 'Next',
@@ -56,6 +59,7 @@ export const defaultVOnboardingWrapperOptions: VOnboardingWrapperOptions = {
56
59
  },
57
60
  hideButtons: {
58
61
  previous: false,
59
- next: false
62
+ next: false,
63
+ exit: false
60
64
  }
61
65
  }