diff --git a/dist/assets/index-Cqm0kIT0.js b/dist/assets/index-DIE0ehhM.js similarity index 95% rename from dist/assets/index-Cqm0kIT0.js rename to dist/assets/index-DIE0ehhM.js index 0510c46..99b0e18 100644 --- a/dist/assets/index-Cqm0kIT0.js +++ b/dist/assets/index-DIE0ehhM.js @@ -43,7 +43,7 @@ Error generating stack: `+l.message+` dompurify/dist/purify.es.mjs: (*! @license DOMPurify 3.0.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.10/LICENSE *) -*/function gi(e,t=!1){return t?(location.protocol==="https:"?"wss://":"ws://")+location.host+e:e}async function Do(e,t){const n=await window.fetch(gi(e),t);if(n.status>=400){let r=await n.text();try{r=JSON.parse(r).error}catch{}throw Ro.error(r),new Error(r)}return n}function yi(e,t,n){return Do(e,{...n,method:"POST",headers:{"Content-Type":"application/json",...n==null?void 0:n.headers},body:JSON.stringify(t)})}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>r0(n,t))}function Gn(...e){return p.useCallback(Fp(...e),e)}const wi=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),l=o.find(o0);if(l){const i=l.props.children,a=o.map(u=>u===l?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return p.createElement(cs,J({},r,{ref:t}),p.isValidElement(i)?p.cloneElement(i,void 0,a):null)}return p.createElement(cs,J({},r,{ref:t}),n)});wi.displayName="Slot";const cs=p.forwardRef((e,t)=>{const{children:n,...r}=e;return p.isValidElement(n)?p.cloneElement(n,{...l0(r,n.props),ref:t?Fp(t,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});cs.displayName="SlotClone";const Up=({children:e})=>p.createElement(p.Fragment,null,e);function o0(e){return p.isValidElement(e)&&e.type===Up}function l0(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...a)=>{l(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Bp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,ed=i0,Hp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ed(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,i=Object.keys(o).map(s=>{const c=n==null?void 0:n[s],d=l==null?void 0:l[s];if(c===null)return null;const h=qc(c)||qc(d);return o[s][h]}),a=n&&Object.entries(n).reduce((s,c)=>{let[d,h]=c;return h===void 0||(s[d]=h),s},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((s,c)=>{let{class:d,className:h,...w}=c;return Object.entries(w).every(S=>{let[y,N]=S;return Array.isArray(N)?N.includes({...l,...a}[y]):{...l,...a}[y]===N})?[...s,d,h]:s},[]);return ed(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};function Wp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ta(l)))==null?void 0:i.classGroupId}const td=/^\[(.+)\]$/;function u0(e){if(td.test(e)){const t=td.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function c0(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return f0(Object.entries(e.classGroups),n).forEach(([l,i])=>{ds(i,r,l,t)}),r}function ds(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:nd(t,o);l.classGroupId=n;return}if(typeof o=="function"){if(d0(o)){ds(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,i])=>{ds(i,nd(t,l),n,r)})})}function nd(e,t){let n=e;return t.split(fu).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function d0(e){return e.isThemeGetter}function f0(e,t){return t?e.map(([n,r])=>{const o=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,a])=>[t+i,a])):l);return[n,o]}):e}function p0(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(l,i){n.set(l,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=r.get(l))!==void 0)return o(l,i),i},set(l,i){n.has(l)?n.set(l,i):o(l,i)}}}const Yp="!";function m0(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(i){const a=[];let u=0,s=0,c;for(let y=0;ys?c-s:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:w,maybePostfixModifierPosition:S}}}function h0(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function v0(e){return{cache:p0(e.cacheSize),splitModifiers:m0(e),...s0(e)}}const g0=/\s+/;function y0(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,l=new Set;return e.trim().split(g0).map(i=>{const{modifiers:a,hasImportantModifier:u,baseClassName:s,maybePostfixModifierPosition:c}=n(i);let d=r(c?s.substring(0,c):s),h=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:i};if(d=r(s),!d)return{isTailwindClass:!1,originalClassName:i};h=!1}const w=h0(a).join(":");return{isTailwindClass:!0,modifierId:u?w+Yp:w,classGroupId:d,originalClassName:i,hasPostfixModifier:h}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:u,hasPostfixModifier:s}=i,c=a+u;return l.has(c)?!1:(l.add(c),o(u,s).forEach(d=>l.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function w0(){let e=0,t,n,r="";for(;ed(c),e());return n=v0(s),r=n.cache.get,o=n.cache.set,l=a,a(u)}function a(u){const s=r(u);if(s)return s;const c=y0(u,n);return o(u,c),c}return function(){return l(w0.apply(null,arguments))}}function ne(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Gp=/^\[(?:([a-z-]+):)?(.+)\]$/i,S0=/^\d+\/\d+$/,E0=new Set(["px","full","screen"]),k0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,b0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,N0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Bt(e){return jn(e)||E0.has(e)||S0.test(e)}function rn(e){return Mr(e,"length",L0)}function jn(e){return!!e&&!Number.isNaN(Number(e))}function sl(e){return Mr(e,"number",jn)}function Jr(e){return!!e&&Number.isInteger(Number(e))}function $0(e){return e.endsWith("%")&&jn(e.slice(0,-1))}function F(e){return Gp.test(e)}function on(e){return k0.test(e)}const T0=new Set(["length","size","percentage"]);function P0(e){return Mr(e,T0,Kp)}function R0(e){return Mr(e,"position",Kp)}const D0=new Set(["image","url"]);function O0(e){return Mr(e,D0,j0)}function A0(e){return Mr(e,"",M0)}function qr(){return!0}function Mr(e,t,n){const r=Gp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function L0(e){return C0.test(e)&&!b0.test(e)}function Kp(){return!1}function M0(e){return N0.test(e)}function j0(e){return _0.test(e)}function I0(){const e=ne("colors"),t=ne("spacing"),n=ne("blur"),r=ne("brightness"),o=ne("borderColor"),l=ne("borderRadius"),i=ne("borderSpacing"),a=ne("borderWidth"),u=ne("contrast"),s=ne("grayscale"),c=ne("hueRotate"),d=ne("invert"),h=ne("gap"),w=ne("gradientColorStops"),S=ne("gradientColorStopPositions"),y=ne("inset"),N=ne("margin"),m=ne("opacity"),f=ne("padding"),v=ne("saturate"),E=ne("scale"),k=ne("sepia"),T=ne("skew"),$=ne("space"),b=ne("translate"),U=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",F,t],B=()=>[F,t],he=()=>["",Bt,rn],G=()=>["auto",jn,F],ke=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ve=()=>["solid","dashed","dotted","double","none"],Ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",F],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[jn,sl],M=()=>[jn,F];return{cacheSize:500,separator:":",theme:{colors:[qr],spacing:[Bt,rn],blur:["none","",on,F],brightness:I(),borderColor:[e],borderRadius:["none","","full",on,F],borderSpacing:B(),borderWidth:he(),contrast:I(),grayscale:L(),hueRotate:M(),invert:L(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[$0,rn],inset:Q(),margin:Q(),opacity:I(),padding:B(),saturate:I(),scale:I(),sepia:L(),skew:M(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[on]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ke(),F]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Jr,F]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Jr,F]}],"grid-cols":[{"grid-cols":[qr]}],"col-start-end":[{col:["auto",{span:["full",Jr,F]},F]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[qr]}],"row-start-end":[{row:["auto",{span:[Jr,F]},F]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[on]},on]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",on,rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sl]}],"font-family":[{font:[qr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",jn,sl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bt,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bt,rn]}],"underline-offset":[{"underline-offset":["auto",Bt,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ke(),R0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},O0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...ve(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:ve()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ve()]}],"outline-offset":[{"outline-offset":[Bt,F]}],"outline-w":[{outline:[Bt,rn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Bt,rn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",on,A0]}],"shadow-color":[{shadow:[qr]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":Ie()}],"bg-blend":[{"bg-blend":Ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",on,F]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",F]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Jr,F]}],"translate-x":[{"translate-x":[b]}],"translate-y":[{"translate-y":[b]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Bt,rn,sl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const z0=x0(I0);function dt(...e){return z0(a0(e))}const pu=Hp("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Dt=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},l)=>{const i=r?wi:"button";return x.jsx(i,{className:dt(pu({variant:t,size:n,className:e})),ref:l,...o})});Dt.displayName="Button";const xt=p.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:dt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));xt.displayName="Input";function mu(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,l;for(l=0;l=0)&&(n[o]=e[o]);return n}var F0=["color"],U0=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,F0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),B0=["color"],H0=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,B0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),W0=["color"],Xp=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,W0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function hu({open:e,setOpen:t}){return x.jsx(Dt,{size:"sm","mr-2":"",variant:"secondary",onClick:()=>t(!e),children:e?x.jsx(H0,{}):x.jsx(U0,{})})}var V0={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const rd=e=>{let t;const n=new Set,r=(c,d)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const w=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(S=>S(t,w))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>s,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(V0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(r,o,u);return u},Y0=e=>e?rd(e):rd;var Zp={exports:{}},Jp={},qp={exports:{}},em={};/** +*/function gi(e,t=!1){return t?(location.protocol==="https:"?"wss://":"ws://")+location.host+e:e}async function Do(e,t){const n=await window.fetch(gi(e),t);if(n.status>=400){let r=await n.text();try{r=JSON.parse(r).error}catch{}throw Ro.error(r),new Error(r)}return n}function yi(e,t,n){return Do(e,{...n,method:"POST",headers:{"Content-Type":"application/json",...n==null?void 0:n.headers},body:JSON.stringify(t)})}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>r0(n,t))}function Gn(...e){return p.useCallback(Fp(...e),e)}const wi=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),l=o.find(o0);if(l){const i=l.props.children,a=o.map(u=>u===l?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return p.createElement(cs,J({},r,{ref:t}),p.isValidElement(i)?p.cloneElement(i,void 0,a):null)}return p.createElement(cs,J({},r,{ref:t}),n)});wi.displayName="Slot";const cs=p.forwardRef((e,t)=>{const{children:n,...r}=e;return p.isValidElement(n)?p.cloneElement(n,{...l0(r,n.props),ref:t?Fp(t,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});cs.displayName="SlotClone";const Up=({children:e})=>p.createElement(p.Fragment,null,e);function o0(e){return p.isValidElement(e)&&e.type===Up}function l0(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...a)=>{l(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Bp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,ed=i0,Hp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ed(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,i=Object.keys(o).map(s=>{const c=n==null?void 0:n[s],d=l==null?void 0:l[s];if(c===null)return null;const h=qc(c)||qc(d);return o[s][h]}),a=n&&Object.entries(n).reduce((s,c)=>{let[d,h]=c;return h===void 0||(s[d]=h),s},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((s,c)=>{let{class:d,className:h,...w}=c;return Object.entries(w).every(S=>{let[y,N]=S;return Array.isArray(N)?N.includes({...l,...a}[y]):{...l,...a}[y]===N})?[...s,d,h]:s},[]);return ed(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};function Wp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ta(l)))==null?void 0:i.classGroupId}const td=/^\[(.+)\]$/;function u0(e){if(td.test(e)){const t=td.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function c0(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return f0(Object.entries(e.classGroups),n).forEach(([l,i])=>{ds(i,r,l,t)}),r}function ds(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:nd(t,o);l.classGroupId=n;return}if(typeof o=="function"){if(d0(o)){ds(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,i])=>{ds(i,nd(t,l),n,r)})})}function nd(e,t){let n=e;return t.split(fu).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function d0(e){return e.isThemeGetter}function f0(e,t){return t?e.map(([n,r])=>{const o=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,a])=>[t+i,a])):l);return[n,o]}):e}function p0(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(l,i){n.set(l,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=r.get(l))!==void 0)return o(l,i),i},set(l,i){n.has(l)?n.set(l,i):o(l,i)}}}const Yp="!";function m0(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(i){const a=[];let u=0,s=0,c;for(let y=0;ys?c-s:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:w,maybePostfixModifierPosition:S}}}function h0(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function v0(e){return{cache:p0(e.cacheSize),splitModifiers:m0(e),...s0(e)}}const g0=/\s+/;function y0(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,l=new Set;return e.trim().split(g0).map(i=>{const{modifiers:a,hasImportantModifier:u,baseClassName:s,maybePostfixModifierPosition:c}=n(i);let d=r(c?s.substring(0,c):s),h=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:i};if(d=r(s),!d)return{isTailwindClass:!1,originalClassName:i};h=!1}const w=h0(a).join(":");return{isTailwindClass:!0,modifierId:u?w+Yp:w,classGroupId:d,originalClassName:i,hasPostfixModifier:h}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:u,hasPostfixModifier:s}=i,c=a+u;return l.has(c)?!1:(l.add(c),o(u,s).forEach(d=>l.add(a+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function w0(){let e=0,t,n,r="";for(;ed(c),e());return n=v0(s),r=n.cache.get,o=n.cache.set,l=a,a(u)}function a(u){const s=r(u);if(s)return s;const c=y0(u,n);return o(u,c),c}return function(){return l(w0.apply(null,arguments))}}function ne(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Gp=/^\[(?:([a-z-]+):)?(.+)\]$/i,S0=/^\d+\/\d+$/,E0=new Set(["px","full","screen"]),k0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,b0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,N0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Bt(e){return jn(e)||E0.has(e)||S0.test(e)}function rn(e){return Mr(e,"length",L0)}function jn(e){return!!e&&!Number.isNaN(Number(e))}function sl(e){return Mr(e,"number",jn)}function Jr(e){return!!e&&Number.isInteger(Number(e))}function $0(e){return e.endsWith("%")&&jn(e.slice(0,-1))}function F(e){return Gp.test(e)}function on(e){return k0.test(e)}const T0=new Set(["length","size","percentage"]);function P0(e){return Mr(e,T0,Kp)}function R0(e){return Mr(e,"position",Kp)}const D0=new Set(["image","url"]);function O0(e){return Mr(e,D0,j0)}function A0(e){return Mr(e,"",M0)}function qr(){return!0}function Mr(e,t,n){const r=Gp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function L0(e){return C0.test(e)&&!b0.test(e)}function Kp(){return!1}function M0(e){return N0.test(e)}function j0(e){return _0.test(e)}function I0(){const e=ne("colors"),t=ne("spacing"),n=ne("blur"),r=ne("brightness"),o=ne("borderColor"),l=ne("borderRadius"),i=ne("borderSpacing"),a=ne("borderWidth"),u=ne("contrast"),s=ne("grayscale"),c=ne("hueRotate"),d=ne("invert"),h=ne("gap"),w=ne("gradientColorStops"),S=ne("gradientColorStopPositions"),y=ne("inset"),N=ne("margin"),m=ne("opacity"),f=ne("padding"),v=ne("saturate"),E=ne("scale"),k=ne("sepia"),T=ne("skew"),$=ne("space"),b=ne("translate"),U=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",F,t],B=()=>[F,t],he=()=>["",Bt,rn],G=()=>["auto",jn,F],ke=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ve=()=>["solid","dashed","dotted","double","none"],Ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",F],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[jn,sl],M=()=>[jn,F];return{cacheSize:500,separator:":",theme:{colors:[qr],spacing:[Bt,rn],blur:["none","",on,F],brightness:I(),borderColor:[e],borderRadius:["none","","full",on,F],borderSpacing:B(),borderWidth:he(),contrast:I(),grayscale:L(),hueRotate:M(),invert:L(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[$0,rn],inset:Q(),margin:Q(),opacity:I(),padding:B(),saturate:I(),scale:I(),sepia:L(),skew:M(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[on]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ke(),F]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Jr,F]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Jr,F]}],"grid-cols":[{"grid-cols":[qr]}],"col-start-end":[{col:["auto",{span:["full",Jr,F]},F]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[qr]}],"row-start-end":[{row:["auto",{span:[Jr,F]},F]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[on]},on]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",on,rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sl]}],"font-family":[{font:[qr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",jn,sl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bt,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bt,rn]}],"underline-offset":[{"underline-offset":["auto",Bt,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ke(),R0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},O0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...ve(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:ve()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ve()]}],"outline-offset":[{"outline-offset":[Bt,F]}],"outline-w":[{outline:[Bt,rn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Bt,rn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",on,A0]}],"shadow-color":[{shadow:[qr]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":Ie()}],"bg-blend":[{"bg-blend":Ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",on,F]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",F]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Jr,F]}],"translate-x":[{"translate-x":[b]}],"translate-y":[{"translate-y":[b]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Bt,rn,sl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const z0=x0(I0);function dt(...e){return z0(a0(e))}const pu=Hp("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Dt=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},l)=>{const i=r?wi:"button";return x.jsx(i,{className:dt(pu({variant:t,size:n,className:e})),ref:l,...o})});Dt.displayName="Button";function mu(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,l;for(l=0;l=0)&&(n[o]=e[o]);return n}var F0=["color"],U0=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,F0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),B0=["color"],H0=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,B0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),W0=["color"],Xp=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=mu(e,W0);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function hu({open:e,setOpen:t}){return x.jsx(Dt,{size:"sm","mr-2":"",variant:"secondary",onClick:()=>t(!e),children:e?x.jsx(H0,{}):x.jsx(U0,{})})}var V0={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const rd=e=>{let t;const n=new Set,r=(c,d)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const w=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(S=>S(t,w))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>s,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(V0?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(r,o,u);return u},Y0=e=>e?rd(e):rd;var Zp={exports:{}},Jp={},qp={exports:{}},em={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -99,9 +99,9 @@ dompurify/dist/purify.es.mjs: `)},md=function(){var e=parseInt(document.body.getAttribute(kr)||"0",10);return isFinite(e)?e:0},d1=function(){p.useEffect(function(){return document.body.setAttribute(kr,(md()+1).toString()),function(){var e=md()-1;e<=0?document.body.removeAttribute(kr):document.body.setAttribute(kr,e.toString())}},[])},f1=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;d1();var l=p.useMemo(function(){return s1(o)},[o]);return p.createElement(u1,{styles:c1(l,!t,o,n?"":"!important")})},ms=!1;if(typeof window<"u")try{var cl=Object.defineProperty({},"passive",{get:function(){return ms=!0,!0}});window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{ms=!1}var nr=ms?{passive:!1}:!1,p1=function(e){return e.tagName==="TEXTAREA"},um=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!p1(e)&&n[t]==="visible")},m1=function(e){return um(e,"overflowY")},h1=function(e){return um(e,"overflowX")},hd=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=cm(e,n);if(r){var o=dm(e,n),l=o[1],i=o[2];if(l>i)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},v1=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},g1=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cm=function(e,t){return e==="v"?m1(t):h1(t)},dm=function(e,t){return e==="v"?v1(t):g1(t)},y1=function(e,t){return e==="h"&&t==="rtl"?-1:1},w1=function(e,t,n,r,o){var l=y1(e,window.getComputedStyle(t).direction),i=l*r,a=n.target,u=t.contains(a),s=!1,c=i>0,d=0,h=0;do{var w=dm(e,a),S=w[0],y=w[1],N=w[2],m=y-N-l*S;(S||m)&&cm(e,a)&&(d+=m,h+=S),a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(c&&(o&&d===0||!o&&i>d)||!c&&(o&&h===0||!o&&-i>h))&&(s=!0),s},dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vd=function(e){return[e.deltaX,e.deltaY]},gd=function(e){return e&&"current"in e?e.current:e},x1=function(e,t){return e[0]===t[0]&&e[1]===t[1]},S1=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},E1=0,rr=[];function k1(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(E1++)[0],l=p.useState(function(){return sm()})[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=Wy([e.lockRef.current],(e.shards||[]).map(gd),!0).filter(Boolean);return y.forEach(function(N){return N.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(y,N){if("touches"in y&&y.touches.length===2)return!i.current.allowPinchZoom;var m=dl(y),f=n.current,v="deltaX"in y?y.deltaX:f[0]-m[0],E="deltaY"in y?y.deltaY:f[1]-m[1],k,T=y.target,$=Math.abs(v)>Math.abs(E)?"h":"v";if("touches"in y&&$==="h"&&T.type==="range")return!1;var b=hd($,T);if(!b)return!0;if(b?k=$:(k=$==="v"?"h":"v",b=hd($,T)),!b)return!1;if(!r.current&&"changedTouches"in y&&(v||E)&&(r.current=k),!k)return!0;var U=r.current||k;return w1(U,N,y,U==="h"?v:E,!0)},[]),u=p.useCallback(function(y){var N=y;if(!(!rr.length||rr[rr.length-1]!==l)){var m="deltaY"in N?vd(N):dl(N),f=t.current.filter(function(k){return k.name===N.type&&k.target===N.target&&x1(k.delta,m)})[0];if(f&&f.should){N.cancelable&&N.preventDefault();return}if(!f){var v=(i.current.shards||[]).map(gd).filter(Boolean).filter(function(k){return k.contains(N.target)}),E=v.length>0?a(N,v[0]):!i.current.noIsolation;E&&N.cancelable&&N.preventDefault()}}},[]),s=p.useCallback(function(y,N,m,f){var v={name:y,delta:N,target:m,should:f};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(E){return E!==v})},1)},[]),c=p.useCallback(function(y){n.current=dl(y),r.current=void 0},[]),d=p.useCallback(function(y){s(y.type,vd(y),y.target,a(y,e.lockRef.current))},[]),h=p.useCallback(function(y){s(y.type,dl(y),y.target,a(y,e.lockRef.current))},[]);p.useEffect(function(){return rr.push(l),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,nr),document.addEventListener("touchmove",u,nr),document.addEventListener("touchstart",c,nr),function(){rr=rr.filter(function(y){return y!==l}),document.removeEventListener("wheel",u,nr),document.removeEventListener("touchmove",u,nr),document.removeEventListener("touchstart",c,nr)}},[]);var w=e.removeScrollBar,S=e.inert;return p.createElement(p.Fragment,null,S?p.createElement(l,{styles:S1(o)}):null,w?p.createElement(f1,{gapMode:"margin"}):null)}const C1=qy(am,k1);var fm=p.forwardRef(function(e,t){return p.createElement(ki,Tt({},e,{ref:t,sideCar:C1}))});fm.classNames=ki.classNames;const b1=fm;var N1=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},or=new WeakMap,fl=new WeakMap,pl={},fa=0,pm=function(e){return e&&(e.host||pm(e.parentNode))},_1=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pm(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$1=function(e,t,n,r){var o=_1(t,Array.isArray(e)?e:[e]);pl[n]||(pl[n]=new WeakMap);var l=pl[n],i=[],a=new Set,u=new Set(o),s=function(d){!d||a.has(d)||(a.add(d),s(d.parentNode))};o.forEach(s);var c=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var w=h.getAttribute(r),S=w!==null&&w!=="false",y=(or.get(h)||0)+1,N=(l.get(h)||0)+1;or.set(h,y),l.set(h,N),i.push(h),y===1&&S&&fl.set(h,!0),N===1&&h.setAttribute(n,"true"),S||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return c(t),a.clear(),fa++,function(){i.forEach(function(d){var h=or.get(d)-1,w=l.get(d)-1;or.set(d,h),l.set(d,w),h||(fl.has(d)||d.removeAttribute(r),fl.delete(d)),w||d.removeAttribute(n)}),fa--,fa||(or=new WeakMap,or=new WeakMap,fl=new WeakMap,pl={})}},T1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||N1(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),$1(r,o,n,"aria-hidden")):function(){return null}};const mm="Dialog",[hm,vm]=nm(mm),[P1,Ot]=hm(mm),R1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:i=!0}=e,a=p.useRef(null),u=p.useRef(null),[s=!1,c]=Ey({prop:r,defaultProp:o,onChange:l});return p.createElement(P1,{scope:t,triggerRef:a,contentRef:u,contentId:la(),titleId:la(),descriptionId:la(),open:s,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(d=>!d),[c]),modal:i},n)},gm="DialogPortal",[D1,ym]=hm(gm,{forceMount:void 0}),O1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,l=Ot(gm,t);return p.createElement(D1,{scope:t,forceMount:n},p.Children.map(r,i=>p.createElement(Ei,{present:n||l.open},p.createElement(Fy,{asChild:!0,container:o},i))))},hs="DialogOverlay",A1=p.forwardRef((e,t)=>{const n=ym(hs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Ot(hs,e.__scopeDialog);return l.modal?p.createElement(Ei,{present:r||l.open},p.createElement(L1,J({},o,{ref:t}))):null}),L1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(hs,n);return p.createElement(b1,{as:wi,allowPinchZoom:!0,shards:[o.contentRef]},p.createElement(_n.div,J({"data-state":Sm(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Dr="DialogContent",M1=p.forwardRef((e,t)=>{const n=ym(Dr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Ot(Dr,e.__scopeDialog);return p.createElement(Ei,{present:r||l.open},l.modal?p.createElement(j1,J({},o,{ref:t})):p.createElement(I1,J({},o,{ref:t})))}),j1=p.forwardRef((e,t)=>{const n=Ot(Dr,e.__scopeDialog),r=p.useRef(null),o=Gn(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return T1(l)},[]),p.createElement(wm,J({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sn(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:Sn(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&l.preventDefault()}),onFocusOutside:Sn(e.onFocusOutside,l=>l.preventDefault())}))}),I1=p.forwardRef((e,t)=>{const n=Ot(Dr,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return p.createElement(wm,J({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,l),!l.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),l.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:l=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}}))}),wm=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...i}=e,a=Ot(Dr,n),u=p.useRef(null),s=Gn(t,u);return Hy(),p.createElement(p.Fragment,null,p.createElement(Oy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l},p.createElement(Py,J({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Sm(a.open)},i,{ref:s,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),xm="DialogTitle",z1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(xm,n);return p.createElement(_n.h2,J({id:o.titleId},r,{ref:t}))}),F1="DialogDescription",U1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(F1,n);return p.createElement(_n.p,J({id:o.descriptionId},r,{ref:t}))}),B1="DialogClose",H1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(B1,n);return p.createElement(_n.button,J({type:"button"},r,{ref:t,onClick:Sn(e.onClick,()=>o.onOpenChange(!1))}))});function Sm(e){return e?"open":"closed"}const W1="DialogTitleWarning",[V1,Iw]=yy(W1,{contentName:Dr,titleName:xm,docsSlug:"dialog"}),Y1=R1,Q1=O1,G1=A1,K1=M1,X1=z1,Z1=U1,Em=H1,J1="AlertDialog",[q1,zw]=nm(J1,[vm]),$n=vm(),ew=e=>{const{__scopeAlertDialog:t,...n}=e,r=$n(t);return p.createElement(Y1,J({},r,n,{modal:!0}))},tw=e=>{const{__scopeAlertDialog:t,...n}=e,r=$n(t);return p.createElement(Q1,J({},r,n))},nw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(G1,J({},o,r,{ref:t}))}),km="AlertDialogContent",[rw,ow]=q1(km),lw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,l=$n(n),i=p.useRef(null),a=Gn(t,i),u=p.useRef(null);return p.createElement(V1,{contentName:km,titleName:iw,docsSlug:"alert-dialog"},p.createElement(rw,{scope:n,cancelRef:u},p.createElement(K1,J({role:"alertdialog"},l,o,{ref:a,onOpenAutoFocus:Sn(o.onOpenAutoFocus,s=>{var c;s.preventDefault(),(c=u.current)===null||c===void 0||c.focus({preventScroll:!0})}),onPointerDownOutside:s=>s.preventDefault(),onInteractOutside:s=>s.preventDefault()}),p.createElement(Up,null,r),!1)))}),iw="AlertDialogTitle",aw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(X1,J({},o,r,{ref:t}))}),sw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(Z1,J({},o,r,{ref:t}))}),uw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(Em,J({},o,r,{ref:t}))}),cw="AlertDialogCancel",dw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=ow(cw,n),l=$n(n),i=Gn(t,o);return p.createElement(Em,J({},l,r,{ref:i}))}),fw=ew,pw=tw,Cm=nw,bm=lw,Nm=uw,_m=dw,$m=aw,Tm=sw,Pm=fw,mw=pw,Rm=p.forwardRef(({className:e,...t},n)=>x.jsx(Cm,{className:dt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Rm.displayName=Cm.displayName;const vu=p.forwardRef(({className:e,...t},n)=>x.jsxs(mw,{children:[x.jsx(Rm,{}),x.jsx(bm,{ref:n,className:dt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));vu.displayName=bm.displayName;const gu=({className:e,...t})=>x.jsx("div",{className:dt("flex flex-col space-y-2 text-center sm:text-left",e),...t});gu.displayName="AlertDialogHeader";const yu=({className:e,...t})=>x.jsx("div",{className:dt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yu.displayName="AlertDialogFooter";const wu=p.forwardRef(({className:e,...t},n)=>x.jsx($m,{ref:n,className:dt("text-lg font-semibold",e),...t}));wu.displayName=$m.displayName;const hw=p.forwardRef(({className:e,...t},n)=>x.jsx(Tm,{ref:n,className:dt("text-sm text-muted-foreground",e),...t}));hw.displayName=Tm.displayName;const xu=p.forwardRef(({className:e,...t},n)=>x.jsx(Nm,{ref:n,className:dt(pu(),e),...t}));xu.displayName=Nm.displayName;const Su=p.forwardRef(({className:e,...t},n)=>x.jsx(_m,{ref:n,className:dt(pu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Su.displayName=_m.displayName;const vw=p.forwardRef((e,t)=>p.createElement(_n.label,J({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),Dm=vw,gw=Hp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lt=p.forwardRef(({className:e,...t},n)=>x.jsx(Dm,{ref:n,className:dt(gw(),e),...t}));lt.displayName=Dm.displayName;function yw({newConversation:e,open:t,close:n}){const[r,o]=p.useState({message:"Hello world!",phoneNumber:""}),l=async()=>{const a=await(await yi("/api/conversations",{phoneNumber:r.phoneNumber,message:r.message})).json();e(a),o({message:"Hello world!",phoneNumber:""})};return x.jsx(Pm,{open:t,onOpenChange:()=>n(),children:x.jsxs(vu,{children:[x.jsx(gu,{children:x.jsx(wu,{children:"Create a new conversation"})}),x.jsx(lt,{htmlFor:"phoneNumber",children:"Source phone number"}),x.jsx(xt,{value:r.phoneNumber,onChange:i=>o(a=>({...a,phoneNumber:i.target.value})),type:"text",id:"phoneNumber",placeholder:"+31600000000"}),x.jsx(lt,{htmlFor:"message",children:"Message"}),x.jsx(xt,{value:r.message,onChange:i=>o(a=>({...a,message:i.target.value})),type:"text",id:"message",placeholder:"Hello world!"}),x.jsxs(yu,{children:[x.jsx(Su,{children:"Cancel"}),x.jsx(xu,{onClick:l,children:"Start"})]})]})})}function ww(e){return new Intl.DateTimeFormat("en-US",{timeStyle:"short"}).format(e)}function xw({message:e}){var r;const{updateConversation:t}=Si(),n=async o=>{const l=await yi(`/api/conversations/${e.conversationId}/btnQuickReply/${o.ID}`,{});t(await l.json())};return x.jsxs("div",{"p-2":"",flex:"","flex-col":"",items:e.direction==="out"?"start":"end",children:[x.jsxs("div",{style:{maxWidth:"70%"},"inline-block":"","py-1":"","px-2":"","bg-zinc-800":"",rounded:"",children:[e.headerMessage?x.jsx("div",{"font-bold":"",children:x.jsx(pa,{text:e.headerMessage})}):void 0,x.jsxs("div",{children:[x.jsxs("span",{"text-xs":"",children:[ww(new Date(e.timestamp))," - "]}),e.message.trim().split(` +`)},E1=0,rr=[];function k1(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(E1++)[0],l=p.useState(function(){return sm()})[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=Wy([e.lockRef.current],(e.shards||[]).map(gd),!0).filter(Boolean);return y.forEach(function(N){return N.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(y,N){if("touches"in y&&y.touches.length===2)return!i.current.allowPinchZoom;var m=dl(y),f=n.current,v="deltaX"in y?y.deltaX:f[0]-m[0],E="deltaY"in y?y.deltaY:f[1]-m[1],k,T=y.target,$=Math.abs(v)>Math.abs(E)?"h":"v";if("touches"in y&&$==="h"&&T.type==="range")return!1;var b=hd($,T);if(!b)return!0;if(b?k=$:(k=$==="v"?"h":"v",b=hd($,T)),!b)return!1;if(!r.current&&"changedTouches"in y&&(v||E)&&(r.current=k),!k)return!0;var U=r.current||k;return w1(U,N,y,U==="h"?v:E,!0)},[]),u=p.useCallback(function(y){var N=y;if(!(!rr.length||rr[rr.length-1]!==l)){var m="deltaY"in N?vd(N):dl(N),f=t.current.filter(function(k){return k.name===N.type&&k.target===N.target&&x1(k.delta,m)})[0];if(f&&f.should){N.cancelable&&N.preventDefault();return}if(!f){var v=(i.current.shards||[]).map(gd).filter(Boolean).filter(function(k){return k.contains(N.target)}),E=v.length>0?a(N,v[0]):!i.current.noIsolation;E&&N.cancelable&&N.preventDefault()}}},[]),s=p.useCallback(function(y,N,m,f){var v={name:y,delta:N,target:m,should:f};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(E){return E!==v})},1)},[]),c=p.useCallback(function(y){n.current=dl(y),r.current=void 0},[]),d=p.useCallback(function(y){s(y.type,vd(y),y.target,a(y,e.lockRef.current))},[]),h=p.useCallback(function(y){s(y.type,dl(y),y.target,a(y,e.lockRef.current))},[]);p.useEffect(function(){return rr.push(l),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,nr),document.addEventListener("touchmove",u,nr),document.addEventListener("touchstart",c,nr),function(){rr=rr.filter(function(y){return y!==l}),document.removeEventListener("wheel",u,nr),document.removeEventListener("touchmove",u,nr),document.removeEventListener("touchstart",c,nr)}},[]);var w=e.removeScrollBar,S=e.inert;return p.createElement(p.Fragment,null,S?p.createElement(l,{styles:S1(o)}):null,w?p.createElement(f1,{gapMode:"margin"}):null)}const C1=qy(am,k1);var fm=p.forwardRef(function(e,t){return p.createElement(ki,Tt({},e,{ref:t,sideCar:C1}))});fm.classNames=ki.classNames;const b1=fm;var N1=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},or=new WeakMap,fl=new WeakMap,pl={},fa=0,pm=function(e){return e&&(e.host||pm(e.parentNode))},_1=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=pm(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$1=function(e,t,n,r){var o=_1(t,Array.isArray(e)?e:[e]);pl[n]||(pl[n]=new WeakMap);var l=pl[n],i=[],a=new Set,u=new Set(o),s=function(d){!d||a.has(d)||(a.add(d),s(d.parentNode))};o.forEach(s);var c=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var w=h.getAttribute(r),S=w!==null&&w!=="false",y=(or.get(h)||0)+1,N=(l.get(h)||0)+1;or.set(h,y),l.set(h,N),i.push(h),y===1&&S&&fl.set(h,!0),N===1&&h.setAttribute(n,"true"),S||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return c(t),a.clear(),fa++,function(){i.forEach(function(d){var h=or.get(d)-1,w=l.get(d)-1;or.set(d,h),l.set(d,w),h||(fl.has(d)||d.removeAttribute(r),fl.delete(d)),w||d.removeAttribute(n)}),fa--,fa||(or=new WeakMap,or=new WeakMap,fl=new WeakMap,pl={})}},T1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||N1(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),$1(r,o,n,"aria-hidden")):function(){return null}};const mm="Dialog",[hm,vm]=nm(mm),[P1,Ot]=hm(mm),R1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:i=!0}=e,a=p.useRef(null),u=p.useRef(null),[s=!1,c]=Ey({prop:r,defaultProp:o,onChange:l});return p.createElement(P1,{scope:t,triggerRef:a,contentRef:u,contentId:la(),titleId:la(),descriptionId:la(),open:s,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(d=>!d),[c]),modal:i},n)},gm="DialogPortal",[D1,ym]=hm(gm,{forceMount:void 0}),O1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,l=Ot(gm,t);return p.createElement(D1,{scope:t,forceMount:n},p.Children.map(r,i=>p.createElement(Ei,{present:n||l.open},p.createElement(Fy,{asChild:!0,container:o},i))))},hs="DialogOverlay",A1=p.forwardRef((e,t)=>{const n=ym(hs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Ot(hs,e.__scopeDialog);return l.modal?p.createElement(Ei,{present:r||l.open},p.createElement(L1,J({},o,{ref:t}))):null}),L1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(hs,n);return p.createElement(b1,{as:wi,allowPinchZoom:!0,shards:[o.contentRef]},p.createElement(_n.div,J({"data-state":Sm(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Dr="DialogContent",M1=p.forwardRef((e,t)=>{const n=ym(Dr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Ot(Dr,e.__scopeDialog);return p.createElement(Ei,{present:r||l.open},l.modal?p.createElement(j1,J({},o,{ref:t})):p.createElement(I1,J({},o,{ref:t})))}),j1=p.forwardRef((e,t)=>{const n=Ot(Dr,e.__scopeDialog),r=p.useRef(null),o=Gn(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return T1(l)},[]),p.createElement(wm,J({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sn(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:Sn(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&l.preventDefault()}),onFocusOutside:Sn(e.onFocusOutside,l=>l.preventDefault())}))}),I1=p.forwardRef((e,t)=>{const n=Ot(Dr,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return p.createElement(wm,J({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,l),!l.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),l.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:l=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}}))}),wm=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...i}=e,a=Ot(Dr,n),u=p.useRef(null),s=Gn(t,u);return Hy(),p.createElement(p.Fragment,null,p.createElement(Oy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l},p.createElement(Py,J({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Sm(a.open)},i,{ref:s,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),xm="DialogTitle",z1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(xm,n);return p.createElement(_n.h2,J({id:o.titleId},r,{ref:t}))}),F1="DialogDescription",U1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(F1,n);return p.createElement(_n.p,J({id:o.descriptionId},r,{ref:t}))}),B1="DialogClose",H1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ot(B1,n);return p.createElement(_n.button,J({type:"button"},r,{ref:t,onClick:Sn(e.onClick,()=>o.onOpenChange(!1))}))});function Sm(e){return e?"open":"closed"}const W1="DialogTitleWarning",[V1,Iw]=yy(W1,{contentName:Dr,titleName:xm,docsSlug:"dialog"}),Y1=R1,Q1=O1,G1=A1,K1=M1,X1=z1,Z1=U1,Em=H1,J1="AlertDialog",[q1,zw]=nm(J1,[vm]),$n=vm(),ew=e=>{const{__scopeAlertDialog:t,...n}=e,r=$n(t);return p.createElement(Y1,J({},r,n,{modal:!0}))},tw=e=>{const{__scopeAlertDialog:t,...n}=e,r=$n(t);return p.createElement(Q1,J({},r,n))},nw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(G1,J({},o,r,{ref:t}))}),km="AlertDialogContent",[rw,ow]=q1(km),lw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,l=$n(n),i=p.useRef(null),a=Gn(t,i),u=p.useRef(null);return p.createElement(V1,{contentName:km,titleName:iw,docsSlug:"alert-dialog"},p.createElement(rw,{scope:n,cancelRef:u},p.createElement(K1,J({role:"alertdialog"},l,o,{ref:a,onOpenAutoFocus:Sn(o.onOpenAutoFocus,s=>{var c;s.preventDefault(),(c=u.current)===null||c===void 0||c.focus({preventScroll:!0})}),onPointerDownOutside:s=>s.preventDefault(),onInteractOutside:s=>s.preventDefault()}),p.createElement(Up,null,r),!1)))}),iw="AlertDialogTitle",aw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(X1,J({},o,r,{ref:t}))}),sw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(Z1,J({},o,r,{ref:t}))}),uw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=$n(n);return p.createElement(Em,J({},o,r,{ref:t}))}),cw="AlertDialogCancel",dw=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=ow(cw,n),l=$n(n),i=Gn(t,o);return p.createElement(Em,J({},l,r,{ref:i}))}),fw=ew,pw=tw,Cm=nw,bm=lw,Nm=uw,_m=dw,$m=aw,Tm=sw,Pm=fw,mw=pw,Rm=p.forwardRef(({className:e,...t},n)=>x.jsx(Cm,{className:dt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Rm.displayName=Cm.displayName;const vu=p.forwardRef(({className:e,...t},n)=>x.jsxs(mw,{children:[x.jsx(Rm,{}),x.jsx(bm,{ref:n,className:dt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));vu.displayName=bm.displayName;const gu=({className:e,...t})=>x.jsx("div",{className:dt("flex flex-col space-y-2 text-center sm:text-left",e),...t});gu.displayName="AlertDialogHeader";const yu=({className:e,...t})=>x.jsx("div",{className:dt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yu.displayName="AlertDialogFooter";const wu=p.forwardRef(({className:e,...t},n)=>x.jsx($m,{ref:n,className:dt("text-lg font-semibold",e),...t}));wu.displayName=$m.displayName;const hw=p.forwardRef(({className:e,...t},n)=>x.jsx(Tm,{ref:n,className:dt("text-sm text-muted-foreground",e),...t}));hw.displayName=Tm.displayName;const xu=p.forwardRef(({className:e,...t},n)=>x.jsx(Nm,{ref:n,className:dt(pu(),e),...t}));xu.displayName=Nm.displayName;const Su=p.forwardRef(({className:e,...t},n)=>x.jsx(_m,{ref:n,className:dt(pu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Su.displayName=_m.displayName;const xt=p.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:dt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));xt.displayName="Input";const vw=p.forwardRef((e,t)=>p.createElement(_n.label,J({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),Dm=vw,gw=Hp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lt=p.forwardRef(({className:e,...t},n)=>x.jsx(Dm,{ref:n,className:dt(gw(),e),...t}));lt.displayName=Dm.displayName;function yw({newConversation:e,open:t,close:n}){const[r,o]=p.useState({message:"Hello world!",phoneNumber:""}),l=async()=>{const a=await(await yi("/api/conversations",{phoneNumber:r.phoneNumber,message:r.message})).json();e(a),o({message:"Hello world!",phoneNumber:""})};return x.jsx(Pm,{open:t,onOpenChange:()=>n(),children:x.jsxs(vu,{children:[x.jsx(gu,{children:x.jsx(wu,{children:"Create a new conversation"})}),x.jsx(lt,{htmlFor:"phoneNumber",children:"Source phone number"}),x.jsx(xt,{value:r.phoneNumber,onChange:i=>o(a=>({...a,phoneNumber:i.target.value})),type:"text",id:"phoneNumber",placeholder:"+31600000000"}),x.jsx(lt,{htmlFor:"message",children:"Message"}),x.jsx(xt,{value:r.message,onChange:i=>o(a=>({...a,message:i.target.value})),type:"text",id:"message",placeholder:"Hello world!"}),x.jsxs(yu,{children:[x.jsx(Su,{children:"Cancel"}),x.jsx(xu,{onClick:l,children:"Start"})]})]})})}function ww(e){return new Intl.DateTimeFormat("en-US",{timeStyle:"short"}).format(e)}function xw({message:e}){var r;const{updateConversation:t}=Si(),n=async o=>{const l=await yi(`/api/conversations/${e.conversationId}/btnQuickReply/${o.ID}`,{});t(await l.json())};return x.jsxs("div",{"p-2":"",flex:"","flex-col":"",items:e.direction==="out"?"start":"end",children:[x.jsxs("div",{style:{maxWidth:"70%"},"inline-block":"","py-1":"","px-2":"","bg-zinc-800":"",rounded:"",children:[e.headerMessage?x.jsx("div",{"font-bold":"",children:x.jsx(pa,{text:e.headerMessage})}):void 0,x.jsxs("div",{children:[x.jsxs("span",{"text-xs":"",children:[ww(new Date(e.timestamp))," - "]}),e.message.trim().split(` `).map(o=>o.trim()).map((o,l)=>x.jsxs("span",{children:[l>0?x.jsx("br",{}):void 0,x.jsx(pa,{text:o})]},l))]}),e.footerMessage?x.jsx("div",{"font-bold":"","text-sm":"","text-zinc-400":"","mt-1":"",children:x.jsx(pa,{text:e.footerMessage})}):void 0]}),(r=e.buttons)!=null&&r.length?x.jsx("div",{flex:"","gap-2":"","flex-wrap":"","mt-2":"",style:{maxWidth:"70%"},justify:"end",children:e.buttons.map(o=>x.jsx(Dt,{onClick:()=>n(o),variant:"secondary",children:o.text},o.ID))}):void 0]})}function ml(e){return e===" "||e===` -`}function pa({text:e}){const t=[{bold:!1,italic:!1,text:""}];for(let r=0;r1&&console.log(t),t.map((r,o)=>x.jsx("span",{style:{fontWeight:r.bold?600:400,fontStyle:r.italic?"italic":"normal"},children:r.text},o))}function Sw(){const[e,t]=p.useState(!0),[n,r]=p.useState(!1),{conversations:o,setConversations:l,newConversation:i}=Si(),a=async()=>{const u=await Do("/api/conversations");l(await u.json())};return p.useEffect(()=>{a()},[]),x.jsxs(x.Fragment,{children:[x.jsxs("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:[x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:e,setOpen:t})," Conversations"]}),x.jsx(Dt,{onClick:()=>r(!0),children:"New conversation!"})]}),o&&e?x.jsx("div",{flex:"","flex-wrap":"","gap-4":"","p-4":"",children:o.map(u=>x.jsx(Ew,{conversation:u},u.phoneNumberId))}):void 0,x.jsx(yw,{open:n,newConversation:i,close:()=>r(!1)})]})}function Ew({conversation:e}){const{updateConversation:t}=Si(),[n,r]=p.useState(0),o=p.useRef(null),l=async i=>{i.preventDefault();const a=i.target,u=new FormData(a),s=Object.fromEntries(u).message;if(s==="")return;a.reset();const c=await yi(`/api/conversations/${e.ID}`,{message:s});t(await c.json())};return p.useEffect(()=>{if(n===e.messages.length)return;const i=n>0;r(e.messages.length),o.current&&o.current.scrollIntoView({behavior:i?"smooth":"instant"})},[n,e]),x.jsxs("div",{"bg-zinc-900":"","w-100":"",rounded:"",children:[x.jsx("h4",{"m-0":"","p-3":"","border-solid":"","border-0":"","border-b-2":"","border-zinc-700":"","text-zinc-200":"",children:e.phoneNumber}),x.jsx("div",{"h-130":"","overflow-y-auto":"",children:x.jsxs("div",{flex:"","flex-col":"","justify-end":"",children:[e.messages.map(i=>x.jsx(xw,{message:i},i.whatsappID)),x.jsx("div",{ref:o})]})}),x.jsx("form",{"bg-zinc-700":"",onSubmit:l,children:x.jsx(xt,{type:"text",name:"message",placeholder:"message"})})]},e.phoneNumber)}const Om=()=>({ID:0,CreatedAt:null,UpdatedAt:null,DeletedAt:null}),Am=p.forwardRef(({className:e,...t},n)=>x.jsx("textarea",{className:dt("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Am.displayName="Textarea";function kw(){const[e,t]=p.useState(!1),[n,r]=p.useState(),[o,l]=p.useState(!1),i=async()=>{const s=await Do("/api/templates");r(await s.json())},a=async s=>{if(!n)return;const c=n[s];await Do(`/api/templates/${c.ID}`,{method:"DELETE"}),r(d=>{if(!d)return;const h=[...d];return h.splice(s,1),h})};p.useEffect(()=>{i()},[]);const u=s=>{r(c=>{if(c)return[...c,s]})};return x.jsxs(x.Fragment,{children:[x.jsxs("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:[x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:e,setOpen:t})," Message templates"]}),x.jsx(Dt,{onClick:()=>l(!0),children:"New template"})]}),n&&e?x.jsx("div",{flex:"","flex-wrap":"","gap-4":"","p-4":"",children:n.map((s,c)=>x.jsx(Cw,{template:s,remove:()=>a(c)},s.ID))}):void 0,x.jsx(bw,{open:o,newTemplate:u,close:()=>l(!1)})]})}function Cw({template:e,remove:t}){return x.jsxs("div",{flex:"","w-full":"","gap-4":"",children:[x.jsx("div",{children:x.jsx(Dt,{onClick:t,variant:"ghost",children:x.jsx(Xp,{})})}),x.jsxs("div",{"overflow-hidden":"",children:[x.jsx("h4",{children:e.name}),x.jsxs("p",{truncate:"","text-sm":"","text-zinc-400":"",children:[e.body," ",e.body]}),x.jsxs("p",{"text-sm":"","text-zinc-500":"",children:[e.header?x.jsxs("span",{children:["Header: ",x.jsx("span",{"text-zinc-400":"",children:e.header})]}):void 0," ",e.footer?x.jsxs("span",{children:["Footer: ",x.jsx("span",{"text-zinc-400":"",children:e.footer})]}):void 0,e.templateCustomButtons.map((n,r)=>x.jsxs(p.Fragment,{children:[" ",x.jsxs("span",{children:["Button ",r+1,": ",x.jsx("span",{"text-zinc-400":"",children:n.text})]})]},r))]})]})]})}const ma=()=>({...Om(),name:"hello_world_2",header:null,body:"",footer:null,templateCustomButtons:[]});function bw({open:e,newTemplate:t,close:n}){const[r,o]=p.useState(ma()),l=async()=>{const d=await(await yi("/api/templates",r)).json();t(d),o(ma())},i=()=>o(c=>{let d="Button text";return c.templateCustomButtons.length>0&&(d+=" "+(c.templateCustomButtons.length+1)),c.templateCustomButtons.push({...Om(),templateID:c.ID,text:d}),{...c}}),a=(c,d)=>o(h=>(h.templateCustomButtons[c].text=d,{...h})),u=c=>o(d=>(d.templateCustomButtons.splice(c,1),{...d})),s=()=>{n(),o(ma())};return x.jsx(Pm,{open:e,onOpenChange:()=>s(),children:x.jsxs(vu,{children:[x.jsx(gu,{children:x.jsx(wu,{children:"Create a new conversation"})}),x.jsx(lt,{htmlFor:"header",children:"Name"}),x.jsx(xt,{value:r.name,onChange:c=>o(d=>({...d,name:c.target.value})),name:"name",id:"name",placeholder:"hello_world"}),x.jsx(lt,{htmlFor:"header",children:"Header"}),x.jsx(xt,{value:r.header??"",onChange:c=>o(d=>({...d,header:c.target.value})),name:"header",id:"header",placeholder:"Header"}),x.jsx(lt,{htmlFor:"body",children:"Body"}),x.jsx(Am,{value:r.body,onChange:c=>o(d=>({...d,body:c.target.value})),name:"body",id:"body",placeholder:"Hello world!","h-30":""}),x.jsx(lt,{htmlFor:"footer",children:"Footer"}),x.jsx(xt,{value:r.footer??"",onChange:c=>o(d=>({...d,footer:c.target.value})),name:"footer",id:"footer",placeholder:"Hello world!"}),r.templateCustomButtons.length?x.jsx(lt,{htmlFor:"footer",children:"Buttons"}):void 0,r.templateCustomButtons.map((c,d)=>x.jsxs("div",{flex:"","w-full":"","items-center":"","gap-4":"",children:[x.jsx("div",{children:x.jsx(Dt,{onClick:()=>u(d),variant:"ghost",children:x.jsx(Xp,{})})}),x.jsxs("div",{"flex-1":"",children:[x.jsxs(lt,{htmlFor:"footer",children:["Button #",d+1]}),x.jsx(xt,{value:c.text,onChange:h=>a(d,h.target.value),name:"button-"+d,id:"button-"+d,placeholder:"Hello world!"})]})]},d)),x.jsx("div",{children:x.jsx(Dt,{variant:"secondary",onClick:i,children:"New button"})}),x.jsxs(yu,{children:[x.jsx(Su,{children:"Cancel"}),x.jsx(xu,{onClick:l,children:"Create"})]})]})})}function Lm({code:e}){return x.jsxs("pre",{rounded:"","bg-zinc-800":"","p-3":"","text-sm":"","font-mono":"","overflow-x-scroll":"",children:[x.jsx("br",{}),e,x.jsx("br",{}),x.jsx("br",{})]})}function Nw({state:e}){const[t,n]=p.useState(""),r=gi(`/v18.0/${e.phoneNumberID}/messages`),o=`Bearer ${e.graphToken}`,l=JSON.stringify({messaging_product:"whatsapp",to:t,type:"template",template:{name:"hello_world",language:{code:"en_US"}}}),i=async u=>{u.preventDefault();const s=await fetch(r,{method:"POST",headers:{Authorization:o,"Content-Type":"application/json"},body:l});s.status>=400?Ro.error(await s.text()):Ro.success("Message sent check the chats below")},a=`curl -i -X POST \\ +`}function pa({text:e}){const t=[{bold:!1,italic:!1,text:""}];for(let r=0;rx.jsx("span",{style:{fontWeight:r.bold?600:400,fontStyle:r.italic?"italic":"normal"},children:r.text},o))}function Sw(e){const{updateConversation:t}=Si(),[n,r]=p.useState(0),o=p.useRef(null),l=async i=>{i.preventDefault();const a=i.target,u=new FormData(a),s=Object.fromEntries(u).message;if(s==="")return;a.reset();const c=await yi(`/api/conversations/${e.conversation.ID}`,{message:s});t(await c.json())};return p.useEffect(()=>{var u,s;if(n===e.conversation.messages.length)return;const i=n>0;r(e.conversation.messages.length);const a=(s=(u=o.current)==null?void 0:u.parentElement)==null?void 0:s.parentElement;a&&a.scroll({top:a.scrollHeight-a.getBoundingClientRect().height,behavior:i?"smooth":"instant"})},[e]),x.jsxs("div",{"bg-zinc-900":"","w-100":"",rounded:"",children:[x.jsx("h4",{"m-0":"","p-3":"","border-solid":"","border-0":"","border-b-2":"","border-zinc-700":"","text-zinc-200":"",children:e.conversation.phoneNumber}),x.jsx("div",{"h-130":"","overflow-y-auto":"",children:x.jsxs("div",{flex:"","flex-col":"","justify-end":"",children:[e.conversation.messages.map(i=>x.jsx(xw,{message:i},i.whatsappID)),x.jsx("div",{ref:o})]})}),x.jsx("form",{"bg-zinc-700":"",onSubmit:l,children:x.jsx(xt,{type:"text",name:"message",placeholder:"message"})})]},e.conversation.phoneNumber)}function Ew(){const[e,t]=p.useState(!0),[n,r]=p.useState(!1),{conversations:o,setConversations:l,newConversation:i}=Si(),a=async()=>{const u=await Do("/api/conversations");l(await u.json())};return p.useEffect(()=>{a()},[]),x.jsxs(x.Fragment,{children:[x.jsxs("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:[x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:e,setOpen:t})," Conversations"]}),x.jsx(Dt,{onClick:()=>r(!0),children:"New conversation!"})]}),o&&e?x.jsx("div",{flex:"","flex-wrap":"","gap-4":"","p-4":"",children:o.map(u=>x.jsx(Sw,{conversation:u},u.phoneNumberId))}):void 0,x.jsx(yw,{open:n,newConversation:i,close:()=>r(!1)})]})}const Om=()=>({ID:0,CreatedAt:null,UpdatedAt:null,DeletedAt:null}),Am=p.forwardRef(({className:e,...t},n)=>x.jsx("textarea",{className:dt("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Am.displayName="Textarea";function kw(){const[e,t]=p.useState(!1),[n,r]=p.useState(),[o,l]=p.useState(!1),i=async()=>{const s=await Do("/api/templates");r(await s.json())},a=async s=>{if(!n)return;const c=n[s];await Do(`/api/templates/${c.ID}`,{method:"DELETE"}),r(d=>{if(!d)return;const h=[...d];return h.splice(s,1),h})};p.useEffect(()=>{i()},[]);const u=s=>{r(c=>{if(c)return[...c,s]})};return x.jsxs(x.Fragment,{children:[x.jsxs("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:[x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:e,setOpen:t})," Message templates"]}),x.jsx(Dt,{onClick:()=>l(!0),children:"New template"})]}),n&&e?x.jsx("div",{flex:"","flex-wrap":"","gap-4":"","p-4":"",children:n.map((s,c)=>x.jsx(Cw,{template:s,remove:()=>a(c)},s.ID))}):void 0,x.jsx(bw,{open:o,newTemplate:u,close:()=>l(!1)})]})}function Cw({template:e,remove:t}){return x.jsxs("div",{flex:"","w-full":"","gap-4":"",children:[x.jsx("div",{children:x.jsx(Dt,{onClick:t,variant:"ghost",children:x.jsx(Xp,{})})}),x.jsxs("div",{"overflow-hidden":"",children:[x.jsx("h4",{children:e.name}),x.jsxs("p",{truncate:"","text-sm":"","text-zinc-400":"",children:[e.body," ",e.body]}),x.jsxs("p",{"text-sm":"","text-zinc-500":"",children:[e.header?x.jsxs("span",{children:["Header: ",x.jsx("span",{"text-zinc-400":"",children:e.header})]}):void 0," ",e.footer?x.jsxs("span",{children:["Footer: ",x.jsx("span",{"text-zinc-400":"",children:e.footer})]}):void 0,e.templateCustomButtons.map((n,r)=>x.jsxs(p.Fragment,{children:[" ",x.jsxs("span",{children:["Button ",r+1,": ",x.jsx("span",{"text-zinc-400":"",children:n.text})]})]},r))]})]})]})}const ma=()=>({...Om(),name:"hello_world_2",header:null,body:"",footer:null,templateCustomButtons:[]});function bw({open:e,newTemplate:t,close:n}){const[r,o]=p.useState(ma()),l=async()=>{const d=await(await yi("/api/templates",r)).json();t(d),o(ma())},i=()=>o(c=>{let d="Button text";return c.templateCustomButtons.length>0&&(d+=" "+(c.templateCustomButtons.length+1)),c.templateCustomButtons.push({...Om(),templateID:c.ID,text:d}),{...c}}),a=(c,d)=>o(h=>(h.templateCustomButtons[c].text=d,{...h})),u=c=>o(d=>(d.templateCustomButtons.splice(c,1),{...d})),s=()=>{n(),o(ma())};return x.jsx(Pm,{open:e,onOpenChange:()=>s(),children:x.jsxs(vu,{children:[x.jsx(gu,{children:x.jsx(wu,{children:"Create a new conversation"})}),x.jsx(lt,{htmlFor:"header",children:"Name"}),x.jsx(xt,{value:r.name,onChange:c=>o(d=>({...d,name:c.target.value})),name:"name",id:"name",placeholder:"hello_world"}),x.jsx(lt,{htmlFor:"header",children:"Header"}),x.jsx(xt,{value:r.header??"",onChange:c=>o(d=>({...d,header:c.target.value})),name:"header",id:"header",placeholder:"Header"}),x.jsx(lt,{htmlFor:"body",children:"Body"}),x.jsx(Am,{value:r.body,onChange:c=>o(d=>({...d,body:c.target.value})),name:"body",id:"body",placeholder:"Hello world!","h-30":""}),x.jsx(lt,{htmlFor:"footer",children:"Footer"}),x.jsx(xt,{value:r.footer??"",onChange:c=>o(d=>({...d,footer:c.target.value})),name:"footer",id:"footer",placeholder:"Hello world!"}),r.templateCustomButtons.length?x.jsx(lt,{htmlFor:"footer",children:"Buttons"}):void 0,r.templateCustomButtons.map((c,d)=>x.jsxs("div",{flex:"","w-full":"","items-center":"","gap-4":"",children:[x.jsx("div",{children:x.jsx(Dt,{onClick:()=>u(d),variant:"ghost",children:x.jsx(Xp,{})})}),x.jsxs("div",{"flex-1":"",children:[x.jsxs(lt,{htmlFor:"footer",children:["Button #",d+1]}),x.jsx(xt,{value:c.text,onChange:h=>a(d,h.target.value),name:"button-"+d,id:"button-"+d,placeholder:"Hello world!"})]})]},d)),x.jsx("div",{children:x.jsx(Dt,{variant:"secondary",onClick:i,children:"New button"})}),x.jsxs(yu,{children:[x.jsx(Su,{children:"Cancel"}),x.jsx(xu,{onClick:l,children:"Create"})]})]})})}function Lm({code:e}){return x.jsxs("pre",{rounded:"","bg-zinc-800":"","p-3":"","text-sm":"","font-mono":"","overflow-x-scroll":"",children:[x.jsx("br",{}),e,x.jsx("br",{}),x.jsx("br",{})]})}function Nw({state:e}){const[t,n]=p.useState(""),r=gi(`/v18.0/${e.phoneNumberID}/messages`),o=`Bearer ${e.graphToken}`,l=JSON.stringify({messaging_product:"whatsapp",to:t,type:"template",template:{name:"hello_world",language:{code:"en_US"}}}),i=async u=>{u.preventDefault();const s=await fetch(r,{method:"POST",headers:{Authorization:o,"Content-Type":"application/json"},body:l});s.status>=400?Ro.error(await s.text()):Ro.success("Message sent check the chats below")},a=`curl -i -X POST \\ ${r} \\ -H 'Authorization: ${o}' \\ -H 'Content-Type: application/json' \\ @@ -109,4 +109,4 @@ dompurify/dist/purify.es.mjs: ${l} \\ -H 'Authorization: ${i}' \\ -H 'Content-Type: application/json' \\ - -d '${a}'`;return x.jsxs("form",{onSubmit:u,"w-full":"",children:[x.jsx("h4",{children:"Message"}),x.jsxs("div",{"my-4":"",children:[x.jsx(lt,{htmlFor:"phoneNumber",children:"Phone number"}),x.jsx(xt,{name:"phoneNumber",id:"phoneNumber",placeholder:"31612345678",value:t,onChange:c=>n(c.target.value)})]}),x.jsxs("div",{"my-4":"",children:[x.jsx(lt,{htmlFor:"message",children:"Message"}),x.jsx(xt,{name:"message",id:"message",placeholder:"Hello world!",value:r,onChange:c=>o(c.target.value)})]}),x.jsx(Lm,{code:s}),x.jsx(Dt,{"mt-3":"",type:"submit",children:"Send"})]})}function $w({state:e}){const[t,n]=p.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:t,setOpen:n})," API Examples"]})}),t?x.jsxs("div",{"p-4":"",flex:"","flex-col":"","gap-6":"",children:[x.jsx(Nw,{state:e}),x.jsx(_w,{state:e})]}):void 0]})}class Tw{constructor(t){Fo(this,"closed",!1);Fo(this,"socket",null);Fo(this,"onEvent");this.onEvent=t}async start(){if(this.socket)throw"cannot start a Websocket twice";for(;await new Promise(t=>{this.socket=new WebSocket(gi("/api/events",!0)),this.socket.onmessage=n=>{this.closed||this.onEvent(JSON.parse(n.data))},this.socket.onclose=()=>setTimeout(t,5e3)}),!this.closed;);}close(){var t;this.closed=!0,(t=this.socket)==null||t.close()}}function Pw(){const[e,t]=p.useState({graphToken:"",appSecret:"",phoneNumber:"",phoneNumberID:"",webhookURL:""}),n=async()=>{const r=await Do("/api/info");t(await r.json())};return p.useEffect(()=>{n()},[]),x.jsxs("div",{children:[x.jsxs("div",{"p-5":"","bg-zinc-900":"",children:[x.jsx("h1",{"m-0":"",children:"Whatsapp Dev"}),x.jsxs("p",{"m-0":"",children:[e.phoneNumber," ",x.jsxs("span",{italic:"","text-zinc-400":"",children:["(id: ",e.phoneNumberID,")"]})]})]}),x.jsx($w,{state:e}),x.jsx(kw,{}),x.jsx(Sw,{}),x.jsx(Rw,{})]})}function Rw(){const{addMessage:e}=Si();return p.useEffect(()=>{const t=new Tw(n=>{console.log("websocket message:",n),n.type==="message"&&e(n.message)});return t.start(),()=>t.close()},[]),x.jsx(p.Fragment,{})}var vs={},yd=vi;vs.createRoot=yd.createRoot,vs.hydrateRoot=yd.hydrateRoot;var wd=["light","dark"],Dw="(prefers-color-scheme: dark)",Ow=p.createContext(void 0),Aw={setTheme:e=>{},themes:[]},Lw=()=>{var e;return(e=p.useContext(Ow))!=null?e:Aw};p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:l,value:i,attrs:a,nonce:u})=>{let s=l==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?wd.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(S,y=!1,N=!0)=>{let m=i?i[S]:S,f=y?S+"|| ''":`'${m}'`,v="";return o&&N&&!y&&wd.includes(S)&&(v+=`d.style.colorScheme = '${S}';`),n==="class"?y||m?v+=`c.add(${f})`:v+="null":m&&(v+=`d[s](n,${f})`),v},w=e?`!function(){${c}${h(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${s})){var t='${Dw}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${s?"":"else{"+h(l,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(l,!1,!1)};}${d}}catch(t){}}();`;return p.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:w}})});const Mw=({...e})=>{const{theme:t="system"}=Lw();return x.jsx(n0,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};vs.createRoot(document.getElementById("root")).render(x.jsxs(R.StrictMode,{children:[x.jsx(Pw,{}),x.jsx(Mw,{})]})); + -d '${a}'`;return x.jsxs("form",{onSubmit:u,"w-full":"",children:[x.jsx("h4",{children:"Message"}),x.jsxs("div",{"my-4":"",children:[x.jsx(lt,{htmlFor:"phoneNumber",children:"Phone number"}),x.jsx(xt,{name:"phoneNumber",id:"phoneNumber",placeholder:"31612345678",value:t,onChange:c=>n(c.target.value)})]}),x.jsxs("div",{"my-4":"",children:[x.jsx(lt,{htmlFor:"message",children:"Message"}),x.jsx(xt,{name:"message",id:"message",placeholder:"Hello world!",value:r,onChange:c=>o(c.target.value)})]}),x.jsx(Lm,{code:s}),x.jsx(Dt,{"mt-3":"",type:"submit",children:"Send"})]})}function $w({state:e}){const[t,n]=p.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("h2",{"m-6":"","mb-0":"",flex:"","flex-wrap":"","gap-4":"","justify-between":"","items-center":"",children:x.jsxs("span",{"inline-flex":"","items-center":"",children:[x.jsx(hu,{open:t,setOpen:n})," API Examples"]})}),t?x.jsxs("div",{"p-4":"",flex:"","flex-col":"","gap-6":"",children:[x.jsx(Nw,{state:e}),x.jsx(_w,{state:e})]}):void 0]})}class Tw{constructor(t){Fo(this,"closed",!1);Fo(this,"socket",null);Fo(this,"onEvent");this.onEvent=t}async start(){if(this.socket)throw"cannot start a Websocket twice";for(;await new Promise(t=>{this.socket=new WebSocket(gi("/api/events",!0)),this.socket.onmessage=n=>{this.closed||this.onEvent(JSON.parse(n.data))},this.socket.onclose=()=>setTimeout(t,5e3)}),!this.closed;);}close(){var t;this.closed=!0,(t=this.socket)==null||t.close()}}function Pw(){const[e,t]=p.useState({graphToken:"",appSecret:"",phoneNumber:"",phoneNumberID:"",webhookURL:""}),n=async()=>{const r=await Do("/api/info");t(await r.json())};return p.useEffect(()=>{n()},[]),x.jsxs("div",{children:[x.jsxs("div",{"p-5":"","bg-zinc-900":"",children:[x.jsx("h1",{"m-0":"",children:"Whatsapp Dev"}),x.jsxs("p",{"m-0":"",children:[e.phoneNumber," ",x.jsxs("span",{italic:"","text-zinc-400":"",children:["(id: ",e.phoneNumberID,")"]})]})]}),x.jsx($w,{state:e}),x.jsx(kw,{}),x.jsx(Ew,{}),x.jsx(Rw,{})]})}function Rw(){const{addMessage:e}=Si();return p.useEffect(()=>{const t=new Tw(n=>{console.log("websocket message:",n),n.type==="message"&&e(n.message)});return t.start(),()=>t.close()},[]),x.jsx(p.Fragment,{})}var vs={},yd=vi;vs.createRoot=yd.createRoot,vs.hydrateRoot=yd.hydrateRoot;var wd=["light","dark"],Dw="(prefers-color-scheme: dark)",Ow=p.createContext(void 0),Aw={setTheme:e=>{},themes:[]},Lw=()=>{var e;return(e=p.useContext(Ow))!=null?e:Aw};p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:l,value:i,attrs:a,nonce:u})=>{let s=l==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?wd.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(S,y=!1,N=!0)=>{let m=i?i[S]:S,f=y?S+"|| ''":`'${m}'`,v="";return o&&N&&!y&&wd.includes(S)&&(v+=`d.style.colorScheme = '${S}';`),n==="class"?y||m?v+=`c.add(${f})`:v+="null":m&&(v+=`d[s](n,${f})`),v},w=e?`!function(){${c}${h(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${s})){var t='${Dw}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${s?"":"else{"+h(l,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(l,!1,!1)};}${d}}catch(t){}}();`;return p.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:w}})});const Mw=({...e})=>{const{theme:t="system"}=Lw();return x.jsx(n0,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};vs.createRoot(document.getElementById("root")).render(x.jsxs(R.StrictMode,{children:[x.jsx(Pw,{}),x.jsx(Mw,{})]})); diff --git a/dist/index.html b/dist/index.html index e3a88f2..988a561 100644 --- a/dist/index.html +++ b/dist/index.html @@ -20,7 +20,7 @@ color: white; } - +