UNPKG

@flows/js

Version:

Flows JS SDK - Build native product growth experiences, your way

381 lines (347 loc) 70.2 kB
"use strict";var flows_js=(()=>{var ge=Object.defineProperty,Ls=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,Ds=Object.getOwnPropertyDescriptors,Us=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols;var ht=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable;var ko=t=>{throw TypeError(t)};var yo=(t,e,o)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,b=(t,e)=>{for(var o in e||(e={}))ht.call(e,o)&&yo(t,o,e[o]);if(De)for(var o of De(e))wo.call(e,o)&&yo(t,o,e[o]);return t},y=(t,e)=>Ls(t,Ds(e));var Ao=(t,e)=>{var o={};for(var r in t)ht.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&De)for(var r of De(t))e.indexOf(r)<0&&wo.call(t,r)&&(o[r]=t[r]);return o};var p=(t,e)=>()=>(t&&(e=t(t=0)),e);var So=(t,e)=>{for(var o in e)ge(t,o,{get:e[o],enumerable:!0})},Ws=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Us(e))!ht.call(t,n)&&n!==o&&ge(t,n,{get:()=>e[n],enumerable:!(r=vo(e,n))||r.enumerable});return t};var Hs=t=>Ws(ge({},"__esModule",{value:!0}),t),he=(t,e,o,r)=>{for(var n=r>1?void 0:r?vo(e,o):e,s=t.length-1,i;s>=0;s--)(i=t[s])&&(n=(r?i(e,o,n):i(n))||n);return r&&n&&ge(e,o,n),n};var $o=(t,e,o)=>e.has(t)||ko("Cannot "+o);var Ue=(t,e,o)=>($o(t,e,"read from private field"),o?o.call(t):e.get(t)),We=(t,e,o)=>e.has(t)?ko("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),He=(t,e,o,r)=>($o(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var Po,ze,Co=p(()=>{"use strict";Po=(t,{body:e,method:o,version:r})=>fetch(t,{method:o,headers:{"Content-Type":"application/json","x-flows-version":r},body:e?JSON.stringify(e):void 0}).then(async n=>{var a;let s=await n.text(),i=s?JSON.parse(s):void 0;if(!n.ok){let l=i;throw new Error((a=l==null?void 0:l.message)!=null?a:n.statusText)}return i}),ze=(t,e)=>({getBlocks:o=>Po(`${t}/v2/sdk/blocks`,{method:"POST",body:o,version:e}),sendEvent:o=>Po(`${t}/v2/sdk/events`,{method:"POST",body:o,version:e})})});var zs,Ks,xt,bt,E,Ke=p(()=>{"use strict";zs="#22262d",Ks="#fff",xt="%cFlows%c",bt=`color:${Ks};background:${zs};padding:2px 4px;border-radius:4px`,E={error:(t,...e)=>{console.error(`${xt} ${t}`,bt,"",...e)},warn:(t,...e)=>{console.warn(`${xt} ${t}`,bt,"",...e)},info:(t,...e)=>{console.info(`${xt} ${t}`,bt,"",...e)}}});var yt,Bo,_o,Eo=p(()=>{"use strict";Ke();yt=(t,e)=>{let o=new Set([...e.exitedBlockIds,...e.updatedBlocks.map(r=>r.id)]);return[...t.filter(r=>!o.has(r.id)),...e.updatedBlocks]},Bo=(t,e)=>{t.slottable&&!t.slotId&&(e==="component"&&E.error(`Encountered workflow block "${t.componentType}" that is slottable but has no slotId`),e==="tour-component"&&E.error(`Encountered tour block "${t.componentType}" that is slottable but has no slotId`))},_o=t=>{t.forEach(e=>{var o;Bo(e,"component"),(o=e.tourBlocks)==null||o.forEach(r=>{Bo(r,"tour-component")})})}});function ne(t){return t==="__proto__"}var vt=p(()=>{"use strict"});function To(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}var Io=p(()=>{"use strict"});function se(t){var e;return typeof t=="string"||typeof t=="symbol"?t:Object.is((e=t==null?void 0:t.valueOf)==null?void 0:e.call(t),-0)?"-0":String(t)}var Ve=p(()=>{"use strict"});function wt(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(wt).join(",");let e=String(t);return e==="0"&&Object.is(Number(t),-0)?"-0":e}var Mo=p(()=>{"use strict"});function Fe(t){if(Array.isArray(t))return t.map(se);if(typeof t=="symbol")return[t];t=wt(t);let e=[],o=t.length;if(o===0)return e;let r=0,n="",s="",i=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<o;){let a=t[r];s?a==="\\"&&r+1<o?(r++,n+=t[r]):a===s?s="":n+=a:i?a==='"'||a==="'"?s=a:a==="]"?(i=!1,e.push(n),n=""):n+=a:a==="["?(i=!0,n&&(e.push(n),n="")):a==="."?n&&(e.push(n),n=""):n+=a,r++}return n&&e.push(n),e}var kt=p(()=>{"use strict";Mo();Ve()});function At(t,e,o){if(t==null)return o;switch(typeof e){case"string":{if(ne(e))return o;let r=t[e];return r===void 0?To(e)?At(t,Fe(e),o):o:r}case"number":case"symbol":{typeof e=="number"&&(e=se(e));let r=t[e];return r===void 0?o:r}default:{if(Array.isArray(e))return Vs(t,e,o);if(Object.is(e==null?void 0:e.valueOf(),-0)?e="-0":e=String(e),ne(e))return o;let r=t[e];return r===void 0?o:r}}}function Vs(t,e,o){if(e.length===0)return o;let r=t;for(let n=0;n<e.length;n++){if(r==null||ne(e[n]))return o;r=r[e[n]]}return r===void 0?o:r}var Ro=p(()=>{"use strict";vt();Io();Ve();kt()});function St(t){return t!==null&&(typeof t=="object"||typeof t=="function")}var No=p(()=>{"use strict"});function Oo(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}var Lo=p(()=>{"use strict"});function Do(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return Fs.test(t)}}var Fs,Uo=p(()=>{"use strict";Fs=/^(?:0|[1-9]\d*)$/});function Wo(t){return typeof t=="symbol"||t instanceof Symbol}var Ho=p(()=>{"use strict"});function zo(t,e){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Wo(t)?!0:typeof t=="string"&&(js.test(t)||!qs.test(t))||e!=null&&Object.hasOwn(e,t)}var qs,js,Ko=p(()=>{"use strict";Ho();qs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,js=/^\w*$/});var Vo,Fo=p(()=>{"use strict";Lo();Vo=(t,e,o)=>{let r=t[e];(!(Object.hasOwn(t,e)&&Oo(r,o))||o===void 0&&!(e in t))&&(t[e]=o)}});function qo(t,e,o,r){if(t==null&&!St(t))return t;let n;zo(e,t)?n=[e]:Array.isArray(e)?n=e:n=Fe(e);let s=o(At(t,n)),i=t;for(let a=0;a<n.length&&i!=null;a++){let l=se(n[a]);if(ne(l))continue;let u;if(a===n.length-1)u=s;else{let f=i[l],d=r==null?void 0:r(f,l,t);u=d!==void 0?d:St(f)?f:Do(n[a+1])?[]:{}}Vo(i,l,u),i=i[l]}return t}var jo=p(()=>{"use strict";Ro();vt();Fo();Uo();Ko();Ve();No();kt()});function ie(t,e,o){return qo(t,e,()=>o,()=>{})}var Go=p(()=>{"use strict";jo()});function $t(t,e,{signal:o,edges:r}={}){let n,s=null,i=r!=null&&r.includes("leading"),a=r==null||r.includes("trailing"),l=()=>{s!==null&&(t.apply(n,s),n=void 0,s=null)},u=()=>{a&&l(),m()},f=null,d=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,u()},e)},c=()=>{f!==null&&(clearTimeout(f),f=null)},m=()=>{c(),n=void 0,s=null},h=()=>{l()},B=function(..._){if(o!=null&&o.aborted)return;n=this,s=_;let M=f==null;d(),i&&M&&l()};return B.schedule=d,B.cancel=m,B.flush=h,o==null||o.addEventListener("abort",m,{once:!0}),B}var Zo=p(()=>{"use strict"});function ae(t,e){let o={},r=Object.keys(t);for(let n=0;n<r.length;n++){let s=r[n],i=t[s];o[s]=e(i,s,t)}return o}var Jo=p(()=>{"use strict"});var Yo=p(()=>{"use strict";Go()});var Pt=p(()=>{"use strict";Zo();Jo()});var xe,Xo=p(()=>{"use strict";xe=(t,e)=>{let o="",r=0;for(;r<t.length;){let n=t.indexOf("{{",r);if(n===-1){o+=t.slice(r);break}o+=t.slice(r,n);let s=t.indexOf("}}",n+2);if(s===-1){o+=t.slice(n);break}let a=t.slice(n+2,s).trim(),l=a.indexOf("|"),u=(l===-1?a:a.slice(0,l)).trim(),f=l===-1?void 0:a.slice(l+1).trim(),d=t.slice(n,s+2);if(!u){o+=d,r=s+2;continue}let c=e[u];if(typeof c=="string"||typeof c=="number"||typeof c=="boolean"){o+=c.toString(),r=s+2;continue}o+=f!=null?f:"",r=s+2}return o}});var Qo,Ct,er,tr=p(()=>{"use strict";Yo();Pt();Xo();Qo=({propMeta:t,userProperties:e})=>{let o=t.value,r={label:xe(o.label,e),openInNew:o.openInNew};return o.url!==void 0&&(r.url=xe(o.url,e)),r},Ct=t=>{var f,d;let{block:e,exitNodeCb:o,removeBlock:r,setStateMemory:n}=t,s=({properties:c,parentKey:m})=>{var B;let h=b({},c);return delete h.f__exit_nodes,(B=c.f__exit_nodes)==null||B.forEach(_=>{let M=()=>o({key:[m,_].filter(R=>R!==void 0).join("."),blockId:e.id});h[_]=M}),Object.entries(c).forEach(([_,M])=>{Array.isArray(M)&&(h[_]=M.map((R,Oe)=>typeof R=="object"?s({properties:R,parentKey:[m,_,Oe].filter(Le=>Le!==void 0).join(".")}):R))}),h},i=s({properties:e.data}),a=({value:c,parentKey:m})=>typeof c=="string"?xe(c,t.userProperties):Array.isArray(c)?c.map((h,B)=>h&&typeof h=="object"?ae(h,(_,M)=>{let R=[m,B,M].join(".");return a({value:_,parentKey:R})}):h):c,l=ae(i,(c,m)=>a({value:c,parentKey:m}));for(let c of(f=e.propertyMeta)!=null?f:[]){if(c.type==="state-memory"){let m={value:c.value,setValue:h=>{n({key:c.key,value:h,blockId:e.id})},triggers:(d=c.triggers)!=null?d:[]};ie(l,c.key,m)}if(c.type==="block-state"){let m=Ct(y(b({},t),{block:c.value}));ie(l,c.key,m)}if(c.type==="action"){let m=Qo({propMeta:c,userProperties:t.userProperties}),h=c.value.exitNode;h&&(m.callAction=()=>(e.exitNodes.includes(h)&&r(e.id),o({key:h,blockId:e.id}))),ie(l,c.key,m)}}let u=e.exitNodes.reduce((c,m)=>{let h=()=>(r(e.id),o({key:m,blockId:e.id}));return c[m]=h,c},{});return b(b({__flows:{id:e.id,key:e.key,workflowId:e.workflowId}},l),u)},er=({tourSteps:t,tourStep:e,currentIndex:o,userProperties:r,handleCancel:n,handleContinue:s,handlePrevious:i})=>{var c;let a=o===0,l=m=>typeof m=="string"?xe(m,r):Array.isArray(m)?m.map(h=>h&&typeof h=="object"?ae(h,l):h):m,u=ae(e.data,l);for(let m of(c=e.propertyMeta)!=null?c:[])if(m.type==="action"){let h=Qo({propMeta:m,userProperties:r});m.value.exitNode&&(h.callAction=async()=>{m.value.exitNode==="continue"&&s(),m.value.exitNode==="previous"&&i(),m.value.exitNode==="cancel"&&n()}),ie(u,m.key,h)}let f=t.filter(m=>m.type==="tour-component"),d=f.findIndex(m=>m.id===e.id);return y(b({__flows:{id:e.id,key:e.key,workflowId:e.workflowId,tourVisibleStepCount:f.length,tourVisibleStepIndex:d}},u),{continue:s,previous:a?void 0:i,cancel:n})}});var Gs,or,rr,Bt,_t,Et,nr,Tt,sr,ir,ar,qe,lr,pr=p(()=>{"use strict";Gs=/^https?:\/\/localhost/,or=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,rr=t=>(!!t).toString(),Bt="flows-debug-enabled",_t="flows-debug-position",Et=[{value:"top-left",label:"Top Left"},{value:"top-right",label:"Top Right"},{value:"bottom-left",label:"Bottom Left"},{value:"bottom-right",label:"Bottom Right"}],nr=()=>{let t=localStorage.getItem(_t);return Et.some(e=>e.value===t)?t:"bottom-right"},Tt={organizationId:{true:"Organization ID is valid.",false:"Organization ID is not valid."},userId:{true:"User ID is set.",false:"User ID is not set."},environment:{true:"Environment is set.",false:"Environment is not set."},apiError:{true:"API responded successfully.",false:"API returned an error. Check the browser console for details."},title:{user:"User Information","sdk-setup":"SDK Setup",blocks:"Blocks",pathname:"Pathname",settings:"Settings"}},sr=t=>{if(typeof t!="undefined")return t;let e=sessionStorage.getItem(Bt);return e?e==="true":Gs.test(window.location.origin)},ir=t=>`https://app.flows.sh/org/${t}`,ar="https://flows.sh/docs/sdk-overview#debug-mode",qe=()=>{if(typeof window=="undefined")return!1;let t=navigator.userAgent.includes("Mac"),e=/(?:iphone|ipad|ipod)/i.test(navigator.userAgent);return t||e},lr=t=>(qe()?t.metaKey:t.ctrlKey)&&t.shiftKey&&t.altKey&&t.key.toLowerCase()==="f"});var fr,cr=p(()=>{"use strict";fr=t=>{var e;if(!(!t||t==="disabled"))return t==="automatic"?(e=navigator.languages.at(0))!=null?e:navigator.language:t}});var It,Mt,Rt,Nt,Ot,Lt,Dt,Ut,Wt,ur=p(()=>{"use strict";It=(t,e)=>e?Array.isArray(e)?e.some(o=>It(t,o)):typeof t!="string"?!1:new RegExp(e).test(t):!0,Mt=(t,e)=>e===void 0?!0:Array.isArray(e)?e.some(o=>Mt(t,o)):t===e,Rt=(t,e)=>e===void 0?!0:Array.isArray(e)?e.every(o=>Rt(t,o)):t!==e,Nt=(t,e)=>e?Array.isArray(e)?e.some(o=>Nt(t,o)):typeof t!="string"?!1:t.includes(e):!0,Ot=(t,e)=>e?Array.isArray(e)?e.every(o=>Ot(t,o)):typeof t!="string"?!1:!t.includes(e):!0,Lt=(t,e)=>e?Array.isArray(e)?e.some(o=>Lt(t,o)):typeof t!="string"?!1:t.startsWith(e):!0,Dt=(t,e)=>e?Array.isArray(e)?e.some(o=>Dt(t,o)):typeof t!="string"?!1:t.endsWith(e):!0,Ut=(t,e)=>e?Array.isArray(e)?e.every(o=>Ut(t,o)):typeof t!="string"?!1:!t.startsWith(e):!0,Wt=(t,e)=>e?Array.isArray(e)?e.every(o=>Wt(t,o)):typeof t!="string"?!1:!t.endsWith(e):!0});var dr=p(()=>{"use strict";ur()});var N,je,mr,gr,hr=p(()=>{"use strict";dr();N=({operator:t,pathname:e,value:o})=>t==="eq"?Mt(e,o):t==="ne"?Rt(e,o):t==="contains"?Nt(e,o):t==="notContains"?Ot(e,o):t==="startsWith"?Lt(e,o):t==="endsWith"?Dt(e,o):t==="notStartsWith"?Ut(e,o):t==="notEndsWith"?Wt(e,o):t==="regex"?It(e,o):!0,je=({eventTarget:t,value:e})=>e?Array.from(document.querySelectorAll(e)).some(o=>o.contains(t)):!1,mr=t=>typeof t!="string"?!1:t.trim()?!!document.querySelector(t):!0,gr=t=>typeof t!="string"?!1:t.trim()?!document.querySelector(t):!0});var Ht=p(()=>{"use strict";hr()});var z,xr=p(()=>{"use strict";z=()=>window.location.pathname+window.location.search});var br,yr=p(()=>{"use strict";Ke();Ht();br=(t,e)=>{var n;let o=t.tour_trigger;return((n=t.currentTourIndex)!=null?n:0)>0||!o?!0:o.$and?o.$and.every(s=>{let i=s.type;if(i==="navigation"){if(!s.operator)return!0;let a=s.values;return a!=null&&a.every(l=>!l)?!0:N({operator:s.operator,pathname:e.pathname,value:a})}if(i==="dom-element"){let a=s.value;return typeof a!="string"?!1:a?!!document.querySelector(a):!0}if(i==="not-dom-element"){let a=s.value;return typeof a!="string"?!1:a?!document.querySelector(a):!0}if(i==="click"){let a=s.value;if(typeof a!="string")return!1;if(!a)return!0;if(!e.event||!(e.event instanceof MouseEvent))return!1;let l=e.event.target;return!l||!(l instanceof Element)?!1:je({eventTarget:l,value:a})}return E.error(`Aborting tour start due to an unrecognized tour trigger type: ${i}. Try updating the SDK or changing the tour trigger configuration.`),!1}):(E.error("Aborting tour start due to an unsupported tour trigger format. Try updating the SDK or changing the tour trigger configuration."),!1)}});var zt,vr=p(()=>{"use strict";zt=(t,e)=>new Proxy(t,{get(o,r,n){return r==="props"&&e(t.id),Reflect.get(o,r,n)}})});var wr=p(()=>{"use strict"});var kr=p(()=>{"use strict"});var Ar=p(()=>{"use strict"});var Sr=p(()=>{"use strict"});var $r=p(()=>{"use strict"});var Pr=p(()=>{"use strict"});var Cr=p(()=>{"use strict";vr();wr();kr();Ar();Sr();$r();Pr()});function Zs(t){return typeof t=="object"&&t!==null&&"exitedBlockIds"in t&&"updatedBlocks"in t}var Br,_r=p(()=>{"use strict";Br=t=>{let e=t.data;if(typeof e!="string")return null;try{let o=JSON.parse(e);if(Zs(o))return{type:"block-updates",exitedBlockIds:o.exitedBlockIds,updatedBlocks:o.updatedBlocks}}catch(o){}return null}});var T=p(()=>{"use strict";Co();Eo();tr();pr();cr();Ke();Ht();xr();yr();Cr();_r()});function Vt(){if(le>1)le--;else{for(var t,e=!1;be!==void 0;){var o=be;for(be=void 0,Kt++;o!==void 0;){var r=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&Mr(o))try{o.c()}catch(n){e||(t=n,e=!0)}o=r}}if(Kt=0,le--,e)throw t}}function Tr(t){var e=x;x=void 0;try{return t()}finally{x=e}}function Ir(t){if(x!==void 0){var e=t.n;if(e===void 0||e.t!==x)return e={i:0,S:t,p:x.s,n:void 0,t:x,e:void 0,x:void 0,r:e},x.s!==void 0&&(x.s.n=e),x.s=e,t.n=e,32&x.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=x.s,e.n=void 0,x.s.n=e,x.s=e),e}}function k(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}function O(t,e){return new k(t,e)}function Mr(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Rr(t){for(var e=t.s;e!==void 0;e=e.n){var o=e.S.n;if(o!==void 0&&(e.r=o),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Nr(t){for(var e=t.s,o=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):o=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=o}function q(t,e){k.call(this,void 0),this.x=t,this.s=void 0,this.g=Ge-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}function L(t,e){return new q(t,e)}function Or(t){var e=t.u;if(t.u=void 0,typeof e=="function"){le++;var o=x;x=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,Ft(t),r}finally{x=o,Vt()}}}function Ft(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Or(t)}function Ys(t){if(x!==this)throw new Error("Out-of-order effect");Nr(this),x=t,this.f&=-2,8&this.f&&Ft(this),Vt()}function pe(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e==null?void 0:e.name,Er&&Er.push(this)}function A(t,e){var o=new pe(t,e);try{o.c()}catch(n){throw o.d(),n}var r=o.d.bind(o);return r[Symbol.dispose]=r,r}var Js,x,Er,be,le,Kt,Ge,U=p(()=>{"use strict";Js=Symbol.for("preact-signals");x=void 0;be=void 0,le=0,Kt=0,Ge=0;k.prototype.brand=Js;k.prototype.h=function(){return!0};k.prototype.S=function(t){var e=this,o=this.t;o!==t&&t.e===void 0&&(t.x=o,this.t=t,o!==void 0?o.e=t:Tr(function(){var r;(r=e.W)==null||r.call(e)}))};k.prototype.U=function(t){var e=this;if(this.t!==void 0){var o=t.e,r=t.x;o!==void 0&&(o.x=r,t.e=void 0),r!==void 0&&(r.e=o,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&Tr(function(){var n;(n=e.Z)==null||n.call(e)}))}};k.prototype.subscribe=function(t){var e=this;return A(function(){var o=e.value,r=x;x=void 0;try{t(o)}finally{x=r}},{name:"sub"})};k.prototype.valueOf=function(){return this.value};k.prototype.toString=function(){return this.value+""};k.prototype.toJSON=function(){return this.value};k.prototype.peek=function(){var t=x;x=void 0;try{return this.value}finally{x=t}};Object.defineProperty(k.prototype,"value",{get:function(){var t=Ir(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Kt>100)throw new Error("Cycle detected");this.v=t,this.i++,Ge++,le++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Vt()}}}});q.prototype=new k;q.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ge))return!0;if(this.g=Ge,this.f|=1,this.i>0&&!Mr(this))return this.f&=-2,!0;var t=x;try{Rr(this),x=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(o){this.v=o,this.f|=16,this.i++}return x=t,Nr(this),this.f&=-2,!0};q.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}k.prototype.S.call(this,t)};q.prototype.U=function(t){if(this.t!==void 0&&(k.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};q.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(q.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Ir(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});pe.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};pe.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Or(this),Rr(this),le++;var t=x;return x=this,Ys.bind(this,t)};pe.prototype.N=function(){2&this.f||(this.f|=2,this.o=be,be=this)};pe.prototype.d=function(){this.f|=8,1&this.f||Ft(this)};pe.prototype.dispose=function(){this.d()}});var v,I,j,$,ye,ve,we,ke,Lr,fe,P,D=p(()=>{"use strict";T();U();v=O(),I=O(),j=O(null),$=L(()=>{var t;return(t=j.value)!=null?t:[]}),ye=O([]);A(()=>{let t=$.value;_o(t)});ve=O(!1),we=O(!1),ke=t=>{j.value=$.value.filter(e=>e.id!==t)},Lr=(t,e)=>{j.value=$.value.map(o=>o.id===t?e(o):o)},fe=L(()=>$.value.filter(t=>t.type==="tour")),P=O([])});var Wr,Hr,Ur=p(()=>{Wr="@flows/js",Hr="1.19.4"});var K,Ae=p(()=>{"use strict";Ur();K=`${Wr}@${Hr}`});var Ze,Ye,Qr,Xr,Je,en,tn,Zt,Jt=p(()=>{"use strict";Ze=globalThis,Ye=Ze.ShadowRoot&&(Ze.ShadyCSS===void 0||Ze.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Qr=Symbol(),Xr=new WeakMap,Je=class{constructor(e,o,r){if(this._$cssResult$=!0,r!==Qr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=o}get styleSheet(){let e=this.o,o=this.t;if(Ye&&e===void 0){let r=o!==void 0&&o.length===1;r&&(e=Xr.get(o)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Xr.set(o,e))}return e}toString(){return this.cssText}},en=t=>new Je(typeof t=="string"?t:t+"",void 0,Qr),tn=(t,e)=>{if(Ye)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let r=document.createElement("style"),n=Ze.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=o.cssText,t.appendChild(r)}},Zt=Ye?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let o="";for(let r of e.cssRules)o+=r.cssText;return en(o)})(t):t});var ei,ti,oi,ri,ni,si,V,on,ii,Yt,$e,Pe,Xe,rn,nn,sn,W,an,Ce=p(()=>{"use strict";Jt();Jt();({is:ei,defineProperty:ti,getOwnPropertyDescriptor:oi,getOwnPropertyNames:ri,getOwnPropertySymbols:ni,getPrototypeOf:si}=Object),V=globalThis,on=V.trustedTypes,ii=on?on.emptyScript:"",Yt=V.reactiveElementPolyfillSupport,$e=(t,e)=>t,Pe={toAttribute(t,e){switch(e){case Boolean:t=t?ii:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=t!==null;break;case Number:o=t===null?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(r){o=null}}return o}},Xe=(t,e)=>!ei(t,e),rn={attribute:!0,type:String,converter:Pe,reflect:!1,useDefault:!1,hasChanged:Xe};(nn=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(sn=V.litPropertyMetadata)!=null||(V.litPropertyMetadata=new WeakMap);W=class extends HTMLElement{static addInitializer(e){var o;this._$Ei(),((o=this.l)!=null?o:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,o=rn){if(o.state&&(o.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((o=Object.create(o)).wrapped=!0),this.elementProperties.set(e,o),!o.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,o);n!==void 0&&ti(this.prototype,e,n)}}static getPropertyDescriptor(e,o,r){var i;let{get:n,set:s}=(i=oi(this.prototype,e))!=null?i:{get(){return this[o]},set(a){this[o]=a}};return{get:n,set(a){let l=n==null?void 0:n.call(this);s==null||s.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var o;return(o=this.elementProperties.get(e))!=null?o:rn}static _$Ei(){if(this.hasOwnProperty($e("elementProperties")))return;let e=si(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($e("properties"))){let o=this.properties,r=[...ri(o),...ni(o)];for(let n of r)this.createProperty(n,o[n])}let e=this[Symbol.metadata];if(e!==null){let o=litPropertyMetadata.get(e);if(o!==void 0)for(let[r,n]of o)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[o,r]of this.elementProperties){let n=this._$Eu(o,r);n!==void 0&&this._$Eh.set(n,o)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let o=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)o.unshift(Zt(n))}else e!==void 0&&o.push(Zt(e));return o}static _$Eu(e,o){let r=o.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(o=>this.enableUpdating=o),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(o=>o(this))}addController(e){var o,r;((o=this._$EO)!=null?o:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var o;(o=this._$EO)==null||o.delete(e)}_$E_(){let e=new Map,o=this.constructor.elementProperties;for(let r of o.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var o;let e=(o=this.shadowRoot)!=null?o:this.attachShadow(this.constructor.shadowRootOptions);return tn(e,this.constructor.elementStyles),e}connectedCallback(){var e,o;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(o=this._$EO)==null||o.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(o=>{var r;return(r=o.hostDisconnected)==null?void 0:r.call(o)})}attributeChangedCallback(e,o,r){this._$AK(e,r)}_$ET(e,o){var s;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let i=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:Pe).toAttribute(o,r.type);this._$Em=e,i==null?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(e,o){var s,i,a;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),u=typeof l.converter=="function"?{fromAttribute:l.converter}:((s=l.converter)==null?void 0:s.fromAttribute)!==void 0?l.converter:Pe;this._$Em=n;let f=u.fromAttribute(o,l.type);this[n]=(a=f!=null?f:(i=this._$Ej)==null?void 0:i.get(n))!=null?a:f,this._$Em=null}}requestUpdate(e,o,r,n=!1,s){var i,a;if(e!==void 0){let l=this.constructor;if(n===!1&&(s=this[e]),r!=null||(r=l.getPropertyOptions(e)),!(((i=r.hasChanged)!=null?i:Xe)(s,o)||r.useDefault&&r.reflect&&s===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,o,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,o,{useDefault:r,reflect:n,wrapped:s},i){var a,l,u;r&&!((a=this._$Ej)!=null?a:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(l=i!=null?i:o)!=null?l:this[e]),s!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(o=void 0),this._$AL.set(e,o)),n===!0&&this._$Em!==e&&((u=this._$Eq)!=null?u:this._$Eq=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(o){Promise.reject(o)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,a]of s){let{wrapped:l}=a,u=this[i];l!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,a,u)}}let e=!1,o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),(n=this._$EO)==null||n.forEach(s=>{var i;return(i=s.hostUpdate)==null?void 0:i.call(s)}),this.update(o)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(o)}willUpdate(e){}_$AE(e){var o;(o=this._$EO)==null||o.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(o=>this._$ET(o,this[o]))),this._$EM()}updated(e){}firstUpdated(e){}};W.elementStyles=[],W.shadowRootOptions={mode:"open"},W[$e("elementProperties")]=new Map,W[$e("finalized")]=new Map,Yt==null||Yt({ReactiveElement:W}),((an=V.reactiveElementVersions)!=null?an:V.reactiveElementVersions=[]).push("2.1.2")});function yn(t,e){if(!oo(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return pn!==void 0?pn.createHTML(e):e}function ee(t,e,o=t,r){var i,a,l;if(e===Q)return e;let n=r!==void 0?(i=o._$Co)==null?void 0:i[r]:o._$Cl,s=Te(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==s&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,o,r)),r!==void 0?((l=o._$Co)!=null?l:o._$Co=[])[r]=n:o._$Cl=n),n!==void 0&&(e=ee(t,n._$AS(t,e.values),n,r)),e}var _e,ln,Qe,pn,eo,H,to,ai,X,Ee,Te,oo,hn,Xt,Be,fn,cn,J,un,dn,xn,ro,g,bn,Ul,Q,w,mn,Y,vn,Ie,et,ce,te,tt,ot,rt,nt,wn,Qt,gn,kn,ue=p(()=>{"use strict";_e=globalThis,ln=t=>t,Qe=_e.trustedTypes,pn=Qe?Qe.createPolicy("lit-html",{createHTML:t=>t}):void 0,eo="$lit$",H=`lit$${Math.random().toFixed(9).slice(2)}$`,to="?"+H,ai=`<${to}>`,X=document,Ee=()=>X.createComment(""),Te=t=>t===null||typeof t!="object"&&typeof t!="function",oo=Array.isArray,hn=t=>oo(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Xt=`[ \f\r]`,Be=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fn=/-->/g,cn=/>/g,J=RegExp(`>|${Xt}(?:([^\\s"'>=/]+)(${Xt}*=${Xt}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),un=/'/g,dn=/"/g,xn=/^(?:script|style|textarea|title)$/i,ro=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),g=ro(1),bn=ro(2),Ul=ro(3),Q=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),mn=new WeakMap,Y=X.createTreeWalker(X,129);vn=(t,e)=>{let o=t.length-1,r=[],n,s=e===2?"<svg>":e===3?"<math>":"",i=Be;for(let a=0;a<o;a++){let l=t[a],u,f,d=-1,c=0;for(;c<l.length&&(i.lastIndex=c,f=i.exec(l),f!==null);)c=i.lastIndex,i===Be?f[1]==="!--"?i=fn:f[1]!==void 0?i=cn:f[2]!==void 0?(xn.test(f[2])&&(n=RegExp("</"+f[2],"g")),i=J):f[3]!==void 0&&(i=J):i===J?f[0]===">"?(i=n!=null?n:Be,d=-1):f[1]===void 0?d=-2:(d=i.lastIndex-f[2].length,u=f[1],i=f[3]===void 0?J:f[3]==='"'?dn:un):i===dn||i===un?i=J:i===fn||i===cn?i=Be:(i=J,n=void 0);let m=i===J&&t[a+1].startsWith("/>")?" ":"";s+=i===Be?l+ai:d>=0?(r.push(u),l.slice(0,d)+eo+l.slice(d)+H+m):l+H+(d===-2?a:m)}return[yn(t,s+(t[o]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Ie=class t{constructor({strings:e,_$litType$:o},r){let n;this.parts=[];let s=0,i=0,a=e.length-1,l=this.parts,[u,f]=vn(e,o);if(this.el=t.createElement(u,r),Y.currentNode=this.el.content,o===2||o===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(n=Y.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let d of n.getAttributeNames())if(d.endsWith(eo)){let c=f[i++],m=n.getAttribute(d).split(H),h=/([.?@])?(.*)/.exec(c);l.push({type:1,index:s,name:h[2],strings:m,ctor:h[1]==="."?tt:h[1]==="?"?ot:h[1]==="@"?rt:te}),n.removeAttribute(d)}else d.startsWith(H)&&(l.push({type:6,index:s}),n.removeAttribute(d));if(xn.test(n.tagName)){let d=n.textContent.split(H),c=d.length-1;if(c>0){n.textContent=Qe?Qe.emptyScript:"";for(let m=0;m<c;m++)n.append(d[m],Ee()),Y.nextNode(),l.push({type:2,index:++s});n.append(d[c],Ee())}}}else if(n.nodeType===8)if(n.data===to)l.push({type:2,index:s});else{let d=-1;for(;(d=n.data.indexOf(H,d+1))!==-1;)l.push({type:7,index:s}),d+=H.length-1}s++}}static createElement(e,o){let r=X.createElement("template");return r.innerHTML=e,r}};et=class{constructor(e,o){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var u;let{el:{content:o},parts:r}=this._$AD,n=((u=e==null?void 0:e.creationScope)!=null?u:X).importNode(o,!0);Y.currentNode=n;let s=Y.nextNode(),i=0,a=0,l=r[0];for(;l!==void 0;){if(i===l.index){let f;l.type===2?f=new ce(s,s.nextSibling,this,e):l.type===1?f=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(f=new nt(s,this,e)),this._$AV.push(f),l=r[++a]}i!==(l==null?void 0:l.index)&&(s=Y.nextNode(),i++)}return Y.currentNode=X,n}p(e){let o=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,o),o+=r.strings.length-2):r._$AI(e[o])),o++}},ce=class t{get _$AU(){var e,o;return(o=(e=this._$AM)==null?void 0:e._$AU)!=null?o:this._$Cv}constructor(e,o,r,n){var s;this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=o,this._$AM=r,this.options=n,this._$Cv=(s=n==null?void 0:n.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode,o=this._$AM;return o!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=o.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,o=this){e=ee(this,e,o),Te(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==Q&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):hn(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Te(this._$AH)?this._$AA.nextSibling.data=e:this.T(X.createTextNode(e)),this._$AH=e}$(e){var s;let{values:o,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Ie.createElement(yn(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===n)this._$AH.p(o);else{let i=new et(n,this),a=i.u(this.options);i.p(o),this.T(a),this._$AH=i}}_$AC(e){let o=mn.get(e.strings);return o===void 0&&mn.set(e.strings,o=new Ie(e)),o}k(e){oo(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,r,n=0;for(let s of e)n===o.length?o.push(r=new t(this.O(Ee()),this.O(Ee()),this,this.options)):r=o[n],r._$AI(s),n++;n<o.length&&(this._$AR(r&&r._$AB.nextSibling,n),o.length=n)}_$AR(e=this._$AA.nextSibling,o){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,o);e!==this._$AB;){let n=ln(e).nextSibling;ln(e).remove(),e=n}}setConnected(e){var o;this._$AM===void 0&&(this._$Cv=e,(o=this._$AP)==null||o.call(this,e))}},te=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,o,r,n,s){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=o,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=w}_$AI(e,o=this,r,n){let s=this.strings,i=!1;if(s===void 0)e=ee(this,e,o,0),i=!Te(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=ee(this,a[r+l],o,l),u===Q&&(u=this._$AH[l]),i||(i=!Te(u)||u!==this._$AH[l]),u===w?e=w:e!==w&&(e+=(u!=null?u:"")+s[l+1]),this._$AH[l]=u}i&&!n&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},tt=class extends te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},ot=class extends te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},rt=class extends te{constructor(e,o,r,n,s){super(e,o,r,n,s),this.type=5}_$AI(e,o=this){var i;if((e=(i=ee(this,e,o,0))!=null?i:w)===Q)return;let r=this._$AH,n=e===w&&r!==w||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==w&&(r===w||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var o,r;typeof this._$AH=="function"?this._$AH.call((r=(o=this.options)==null?void 0:o.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},nt=class{constructor(e,o,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=o,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}},wn={M:eo,P:H,A:to,C:1,L:vn,R:et,D:hn,V:ee,I:ce,H:te,N:ot,U:rt,B:tt,F:nt},Qt=_e.litHtmlPolyfillSupport;Qt==null||Qt(Ie,ce),((gn=_e.litHtmlVersions)!=null?gn:_e.litHtmlVersions=[]).push("3.3.2");kn=(t,e,o)=>{var s,i;let r=(s=o==null?void 0:o.renderBefore)!=null?s:e,n=r._$litPart$;if(n===void 0){let a=(i=o==null?void 0:o.renderBefore)!=null?i:null;r._$litPart$=n=new ce(e.insertBefore(Ee(),a),a,void 0,o!=null?o:{})}return n._$AI(t),n}});var oe,F,An,no,Sn,$n=p(()=>{"use strict";Ce();Ce();ue();ue();oe=globalThis,F=class extends W{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var o,r;let e=super.createRenderRoot();return(r=(o=this.renderOptions).renderBefore)!=null||(o.renderBefore=e.firstChild),e}update(e){let o=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=kn(o,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Q}};F._$litElement$=!0,F.finalized=!0,(An=oe.litElementHydrateSupport)==null||An.call(oe,{LitElement:F});no=oe.litElementPolyfillSupport;no==null||no({LitElement:F});((Sn=oe.litElementVersions)!=null?Sn:oe.litElementVersions=[]).push("4.2.2")});var Pn=p(()=>{"use strict";});var S=p(()=>{"use strict";Ce();ue();$n();Pn()});var Cn=p(()=>{"use strict";});function st(t){return(e,o)=>typeof o=="object"?pi(t,e,o):((r,n,s)=>{let i=n.hasOwnProperty(s);return n.constructor.createProperty(s,r),i?Object.getOwnPropertyDescriptor(n,s):void 0})(t,e,o)}var li,pi,so=p(()=>{"use strict";Ce();li={attribute:!0,type:String,converter:Pe,reflect:!1,hasChanged:Xe},pi=(t=li,e,o)=>{let{kind:r,metadata:n}=o,s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),r==="setter"&&((t=Object.create(t)).wrapped=!0),s.set(o.name,t),r==="accessor"){let{name:i}=o;return{set(a){let l=e.get.call(this);e.set.call(this,a),this.requestUpdate(i,l,t,!0,a)},init(a){return a!==void 0&&this.C(i,void 0,t,a),a}}}if(r==="setter"){let{name:i}=o;return function(a){let l=this[i];e.call(this,a),this.requestUpdate(i,l,t,!0,a)}}throw Error("Unsupported decorator location: "+r)}});function it(t){return st(y(b({},t),{state:!0,attribute:!1}))}var Bn=p(()=>{"use strict";so();});var _n=p(()=>{"use strict";});var de=p(()=>{"use strict";});var En=p(()=>{"use strict";de();});var Tn=p(()=>{"use strict";de();});var In=p(()=>{"use strict";de();});var Mn=p(()=>{"use strict";de();});var Rn=p(()=>{"use strict";de();});var Nn=p(()=>{"use strict";Cn();so();Bn();_n();En();Tn();In();Mn();Rn()});var Ln,On=p(()=>{Ln=`:root { --flows-debug-bg-default: #ffffff; --flows-debug-bg-subtle: #f9fafc; --flows-debug-bg-hover: #ebeef3; --flows-debug-fg-default: #15181c; --flows-debug-fg-subtle: #6b727b; --flows-debug-border: 1px solid #d9dde2; --flows-debug-fg-success: #188635; --flows-debug-fg-error: #cf2320; --flows-debug-overlay: hsla(0, 0%, 100%, 0.2); --flows-debug-overlay-hover: hsla(0, 0%, 100%, 0.3); --flows-debug-small-shadow: 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 4px 4px -1px rgba(0, 0, 0, 0.02); --flows-debug-shadow: 0px 3px 8px rgba(0, 0, 0, 0.07), 0px 2px 5px rgba(0, 0, 0, 0.07), 0px 1px 1px rgba(0, 0, 0, 0.07); --flows-debug-system-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; --flows-debug-mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; } .dark { --flows-debug-bg-default: #15181c; --flows-debug-bg-subtle: #22262d; --flows-debug-bg-hover: #2b313a; --flows-debug-fg-default: #f9fafc; --flows-debug-fg-subtle: #8b929b; --flows-debug-border: 1px solid #353c46; --flows-debug-fg-success: #33a449; --flows-debug-fg-error: #ea6369; --flows-debug-overlay: hsla(0, 0%, 100%, 0.1); --flows-debug-overlay-hover: hsla(0, 0%, 100%, 0.2); --flows-debug-small-shadow: 0px 4px 4px -1px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12); --flows-debug-shadow: 0px 3px 8px rgba(0, 0, 0, 0.188), 0px 2px 5px rgba(0, 0, 0, 0.188), 0px 1px 1px rgba(0, 0, 0, 0.188); } @keyframes flows-debug-fadeIn { from { opacity: 0; scale: 0.5; } 80% { opacity: 1; scale: 1.2; } to { scale: 1; } } .flows-debug { position: fixed; z-index: 10000; color: var(--flows-debug-fg-default); } :where(.flows-debug) hr { border-top: var(--flows-debug-border); } :where(.flows-debug) a { color: inherit; text-decoration: none; } :where(.flows-debug) p { margin: 0; } .flows-debug-btn { border: none; background: transparent; cursor: pointer; padding: 0; color: var(--flows-debug-fg-default); } .flows-debug-top-left { top: 16px; left: 16px; } .flows-debug-bottom-right { bottom: 16px; right: 16px; } .flows-debug-bottom-left { bottom: 16px; left: 16px; } .flows-debug-top-right { top: 16px; right: 16px; } .flows-debug-menu { background: var(--flows-debug-bg-default); display: flex; align-items: center; justify-content: center; height: 36px; width: 36px; border-radius: 99px; margin: 0; cursor: pointer; border: var(--flows-debug-border); box-shadow: var(--flows-debug-small-shadow); animation: flows-debug-fadeIn 120ms ease-out; } .flows-debug-menu-inset { color: var(--flows-debug-fg-default); transition: background 120ms ease-in-out; padding: 7px; border-radius: 99px; display: flex; } .flows-debug-menu:hover .flows-debug-menu-inset { background: var(--flows-debug-bg-hover); } .flows-debug-menu-error { background: var(--flows-debug-fg-error) !important; } .flows-debug-menu-inset-error { background: var(--flows-debug-overlay) !important; color: var(--flows-debug-bg-default) !important; &:hover { background: var(--flows-debug-overlay-hover) !important; } } .flows-debug-popover { position: absolute; margin-top: 8px; margin-bottom: 8px; background: var(--flows-debug-bg-default); border: var(--flows-debug-border); border-radius: 8px; box-shadow: var(--flows-debug-shadow); font-size: 13px; font-family: var(--flows-debug-system-font); } .flows-debug-popover-wide { width: 360px; } .flows-debug-popover-narrow { width: 260px; } .flows-debug-top-right .flows-debug-popover { right: 0; top: 100%; } .flows-debug-bottom-right .flows-debug-popover { right: 0; bottom: 100%; } .flows-debug-top-left .flows-debug-popover { left: 0; top: 100%; } .flows-debug-bottom-left .flows-debug-popover { left: 0; bottom: 100%; } .flows-debug-section-header { display: flex; gap: 4px; align-items: center; border-bottom: var(--flows-debug-border); padding: 12px 16px 12px 8px; } .flows-debug-section-label { font-weight: 600; } .flows-debug-section-content { padding: 16px; } .flows-debug-code-block { padding: 8px; border-radius: 4px; background: var(--flows-debug-bg-subtle); font-size: 12px; font-family: var(--flows-debug-mono-font); overflow-x: auto; max-height: 480px; border: var(--flows-debug-border); scrollbar-width: thin; scrollbar-color: var(--flows-debug-fg-subtle) transparent; } .flows-debug-inline-code { font-family: var(--flows-debug-mono-font); font-size: 12px; } .flows-debug-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px; border-radius: 6px; transition: background 120ms ease-in-out; } .flows-debug-item-interactive { cursor: pointer; &:hover { background: var(--flows-debug-bg-hover); } } .flows-debug-item-info { font-size: 12px; color: var(--flows-debug-fg-subtle); margin-top: 2px; } .flows-debug-item-label { font-weight: 600; } .flows-debug-item-secondary { color: var(--flows-debug-fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .flows-debug-item-list { display: flex; flex-direction: column; padding: 6px; } .flows-debug-info-line { margin-bottom: 4px; } .flows-debug-button-secondary { font-weight: 600; padding: 4px 8px; border-radius: 6px; color: var(--flows-debug-fg-default); background-color: var(--flows-debug-bg-subtle); border: var(--flows-debug-border); cursor: pointer; transition: all 80ms ease-in-out; flex-shrink: 0; &:hover { background-color: var(--flows-debug-bg-hover); } &:active { background-color: var(--flows-debug-bg-default); } } .flows-debug-section-close { padding: 4px; border-radius: 6px; width: 24px; height: 24px; &:hover { background-color: var(--flows-debug-bg-hover); } } .flows-debug-select-wrap { position: relative; svg { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; } } .flows-debug-select { all: unset; border-radius: 6px; color: var(--flows-debug-fg-default); background-color: var(--flows-debug-bg-subtle); border: var(--flows-debug-border); padding: 4px 8px; padding-right: 28px; cursor: pointer; transition: all 80ms ease-in-out; &:focus { outline: none; } &:hover { background-color: var(--flows-debug-bg-hover); } } .flows-debug-shortcut-list { display: flex; gap: 4px; } .flows-debug-shortcut { display: flex; align-items: center; font-size: 12px; color: var(--flows-debug-fg-default); background-color: var(--flows-debug-bg-subtle); min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px; justify-content: center; border: var(--flows-debug-border); } .flows-debug-validation-item { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; &:last-child { margin-bottom: 0; } } .flows-debug-validation-valid { color: var(--flows-debug-fg-success); flex-shrink: 0; } .flows-debug-validation-invalid { color: var(--flows-debug-fg-error); flex-shrink: 0; } .flows-debug-print-button { margin-top: 8px; } `});function Dn(t){var e,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(o=Dn(t[e]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function lt(){for(var t,e,o=0,r="",n=arguments.length;o<n;o++)(t=arguments[o])&&(e=Dn(t))&&(r&&(r+=" "),r+=e);return r}var Un=p(()=>{"use strict"});function io(t){return class extends t{performUpdate(){var e;if(this.isUpdatePending===!1)return;(e=this._$Oo)===null||e===void 0||e.call(this);let o=!0;this._$Oo=A((()=>{o?(o=!1,super.performUpdate()):this.requestUpdate()}))}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Oo)===null||e===void 0||e.call(this)}}}var Wn=p(()=>{"use strict";U();});var Hn,ao,pt,ft=p(()=>{"use strict";Hn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ao=t=>(...e)=>({_$litDirective$:t,values:e}),pt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,o,r){this._$Ct=e,this._$AM=o,this._$Ci=r}_$AS(e,o){return this.update(e,o)}update(e,o){return this.render(...o)}}});var zn=p(()=>{"use strict";ft()});var Np,Kn,Vn=p(()=>{"use strict";ue();({I:Np}=wn),Kn=t=>t.strings===void 0});function ci(t){this._$AN!==void 0?(ct(this),this._$AM=t,Fn(this)):this._$AM=t}function ui(t,e=!1,o=0){let r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(r))for(let s=o;s<r.length;s++)Me(r[s],!1),ct(r[s]);else r!=null&&(Me(r,!1),ct(r));else Me(this,t)}var Me,ct,Fn,di,ut,qn=p(()=>{"use strict";Vn();ft();ft();Me=(t,e)=>{var r;let o=t._$AN;if(o===void 0)return!1;for(let n of o)(r=n._$AO)==null||r.call(n,e,!1),Me(n,e);return!0},ct=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while((o==null?void 0:o.size)===0)},Fn=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),di(e)}};di=t=>{var e,o;t.type==Hn.CHILD&&((e=t._$AP)!=null||(t._$AP=ui),(o=t._$AQ)!=null||(t._$AQ=ci))},ut=class extends pt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,r){super._$AT(e,o,r),Fn(this),this.isConnected=e._$AU}_$AO(e,o=!0){var r,n;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(n=this.disconnected)==null||n.call(this)),o&&(Me(this,e),ct(this))}setValue(e){if(Kn(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}}});var jn=p(()=>{"use strict";qn()});var lo,po=p(()=>{"use strict";zn();jn();lo=ao(class extends ut{render(t){var e;if(t!==this._$Oi){(e=this._$Oo)===null||e===void 0||e.call(this),this._$Oi=t;let o=!0;this._$Oo=t.subscribe((r=>{o===!1&&this.setValue(r)})),o=!1}return t.peek()}disconnected(){var t;(t=this._$Oo)===null||t===void 0||t.call(this)}reconnected(){var t;this._$Oo=(t=this._$Oi)===null||t===void 0?void 0:t.subscribe((e=>{this.setValue(e)}))}})});var Gn=p(()=>{"use strict";ue()});var fo,mi,gi,Zn=p(()=>{"use strict";Gn();po();U();fo=t=>(e,...o)=>t(e,...o.map((r=>r instanceof k?lo(r):r))),mi=fo(g),gi=fo(bn)});var Jn=p(()=>{"use strict";U();Wn();po();Zn()});var Yn,Xn=p(()=>{"use strict";S();Yn=()=>g`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 40 40" > <path d="M38.02 12.24C36.7 10 34.87 8.22 32.56 6.94C30.38 5.74 27.83 5.08 25 5H16C12.97 5 9.76 5.66 7.45 6.94C5.14 8.22 3.3 10 1.99 12.23C0.67 14.46 0 17.08 0 20.02C0 22.96 0.67 25.53 1.99 27.76C3.3 29.99 5.15 31.78 7.47 33.05C9.8 34.33 12.94 35 16 35H25C27.81 34.94 30.4 34.26 32.6 33.05C34.91 31.77 36.74 29.99 38.04 27.76C39.34 25.52 40 22.92 40 20.01C40 17.1 39.33 14.48 38.02 12.24ZM30.3 19.89L27.37 22.82C26.63 23.56 25.62 24 24.58 24H19.95C18.9 24 17.9 24.39 17.16 25.13L16.12 26C13.19 28.46 8.72 26.37 8.72 22.55C8.72 21.65 9.08 20.79 9.71 20.16L12.64 17.23C13.38 16.49 14.4 16 15.45 16H20.08C21.13 16 22.12 15.66 22.86 14.92L23.79 14.09C26.65 11.53 31.2 13.5 31.29 17.34V17.5C31.29 18.4 30.94 19.26 30.3 19.89Z" /> </svg>`});var Qn,es=p(()=>{"use strict";S();Qn=()=>g`<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z" fill="currentColor" /> </svg>`});var ts,os=p(()=>{"use strict";S();es();ts=({children:t,label:e,onClose:o})=>g`<div class="flows-debug-popover-wide"> <div class="flows-debug-section-header"> <button class="flows-debug-btn flows-debug-section-close" @click=${o} type="button"> ${Qn()} </button> <p class="flows-debug-section-label">${e}</p> </div> <div class="flows-debug-section-content">${t}</div> </div>`});var rs,ns=p(()=>{"use strict";S();rs=()=>g`<svg fill="currentColor" height="16" width="16" xmlns="http://www.w3.org/2000/svg"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z" /> </svg>`});var ss,is=p(()=>{"use strict";T();S();Ae();ns();ss=({position:t,onPositionChange:e})=>g` <div class="flows-debug-item"> <div> <label class="flows-debug-item-label" htmlFor="debug-panel-position"> Position </label> <