@opencx/widget 3.0.52 → 3.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designs.cjs +1 -1
- package/dist/designs.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/{useUploadFiles-DLCRdvf1.js → useUploadFiles-Ddo3_Bdb.js} +2 -2
- package/dist/{useUploadFiles-DLCRdvf1.js.map → useUploadFiles-Ddo3_Bdb.js.map} +1 -1
- package/dist/{useUploadFiles-D4md7FH6.cjs → useUploadFiles-DezH_NSW.cjs} +2 -2
- package/dist/{useUploadFiles-D4md7FH6.cjs.map → useUploadFiles-DezH_NSW.cjs.map} +1 -1
- package/dist-embed/script.js +1 -1
- package/package.json +1 -1
package/dist/designs.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),Tt=require("react"),ZC=require("tinycolor2"),vr=require("framer-motion"),Qk=require("clsx"),Wn=require("lucide-react"),G4=require("react-dropzone"),e_=require("react-hot-toast"),ft=require("./useUploadFiles-D4md7FH6.cjs"),$4=require("@radix-ui/react-tooltip"),Uw=require("@radix-ui/react-slot"),X4=require("@radix-ui/react-dropdown-menu"),K4=require("@radix-ui/react-dialog"),J4=require("@radix-ui/react-avatar"),Px=require("zod");function zm(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const ie=zm(Tt),jm=zm($4),Qn=zm(X4),so=zm(K4),Xf=zm(J4),Z4=350,Gk=400,$k=600,Bw={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Xk=({primary:e="hsl(0, 0%, 0%)"})=>{const n=ZC(e).toHsl(),a=ZC(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${n.h} ${n.s*100}% ${n.l*100}%`,"--opencx-primary-foreground":a,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Hw="-",eI=e=>{const n=nI(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{const g=d.split(Hw);return g[0]===""&&g.length!==1&&g.shift(),Kk(g,n)||tI(d)},getConflictingClassGroupIds:(d,g)=>{const E=a[d]||[];return g&&s[d]?[...E,...s[d]]:E}}},Kk=(e,n)=>{var d;if(e.length===0)return n.classGroupId;const a=e[0],s=n.nextPart.get(a),f=s?Kk(e.slice(1),s):void 0;if(f)return f;if(n.validators.length===0)return;const h=e.join(Hw);return(d=n.validators.find(({validator:g})=>g(h)))==null?void 0:d.classGroupId},t_=/^\[(.+)\]$/,tI=e=>{if(t_.test(e)){const n=t_.exec(e)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},nI=e=>{const{theme:n,prefix:a}=e,s={nextPart:new Map,validators:[]};return aI(Object.entries(e.classGroups),a).forEach(([h,d])=>{pw(d,s,h,n)}),s},pw=(e,n,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const h=f===""?n:n_(n,f);h.classGroupId=a;return}if(typeof f=="function"){if(rI(f)){pw(f(s),n,a,s);return}n.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([h,d])=>{pw(d,n_(n,h),a,s)})})},n_=(e,n)=>{let a=e;return n.split(Hw).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},rI=e=>e.isThemeGetter,aI=(e,n)=>n?e.map(([a,s])=>{const f=s.map(h=>typeof h=="string"?n+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([d,g])=>[n+d,g])):h);return[a,f]}):e,iI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,s=new Map;const f=(h,d)=>{a.set(h,d),n++,n>e&&(n=0,s=a,a=new Map)};return{get(h){let d=a.get(h);if(d!==void 0)return d;if((d=s.get(h))!==void 0)return f(h,d),d},set(h,d){a.has(h)?a.set(h,d):f(h,d)}}},Jk="!",oI=e=>{const{separator:n,experimentalParseClassName:a}=e,s=n.length===1,f=n[0],h=n.length,d=g=>{const E=[];let b=0,C=0,S;for(let B=0;B<g.length;B++){let H=g[B];if(b===0){if(H===f&&(s||g.slice(B,B+h)===n)){E.push(g.slice(C,B)),C=B+h;continue}if(H==="/"){S=B;continue}}H==="["?b++:H==="]"&&b--}const R=E.length===0?g:g.substring(C),k=R.startsWith(Jk),D=k?R.substring(1):R,L=S&&S>C?S-C:void 0;return{modifiers:E,hasImportantModifier:k,baseClassName:D,maybePostfixModifierPosition:L}};return a?g=>a({className:g,parseClassName:d}):d},uI=e=>{if(e.length<=1)return e;const n=[];let a=[];return e.forEach(s=>{s[0]==="["?(n.push(...a.sort(),s),a=[]):a.push(s)}),n.push(...a.sort()),n},sI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...eI(e)}),lI=/\s+/,cI=(e,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=n,h=[],d=e.trim().split(lI);let g="";for(let E=d.length-1;E>=0;E-=1){const b=d[E],{modifiers:C,hasImportantModifier:S,baseClassName:R,maybePostfixModifierPosition:k}=a(b);let D=!!k,L=s(D?R.substring(0,k):R);if(!L){if(!D){g=b+(g.length>0?" "+g:g);continue}if(L=s(R),!L){g=b+(g.length>0?" "+g:g);continue}D=!1}const B=uI(C).join(":"),H=S?B+Jk:B,$=H+L;if(h.includes($))continue;h.push($);const W=f(L,D);for(let J=0;J<W.length;++J){const Z=W[J];h.push(H+Z)}g=b+(g.length>0?" "+g:g)}return g};function dI(){let e=0,n,a,s="";for(;e<arguments.length;)(n=arguments[e++])&&(a=Zk(n))&&(s&&(s+=" "),s+=a);return s}const Zk=e=>{if(typeof e=="string")return e;let n,a="";for(let s=0;s<e.length;s++)e[s]&&(n=Zk(e[s]))&&(a&&(a+=" "),a+=n);return a};function fI(e,...n){let a,s,f,h=d;function d(E){const b=n.reduce((C,S)=>S(C),e());return a=sI(b),s=a.cache.get,f=a.cache.set,h=g,g(E)}function g(E){const b=s(E);if(b)return b;const C=cI(E,a);return f(E,C),C}return function(){return h(dI.apply(null,arguments))}}const hn=e=>{const n=a=>a[e]||[];return n.isThemeGetter=!0,n},eA=/^\[(?:([a-z-]+):)?(.+)\]$/i,pI=/^\d+\/\d+$/,hI=new Set(["px","full","screen"]),mI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gI=/\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$/,vI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Iu=e=>zf(e)||hI.has(e)||pI.test(e),Gs=e=>Kf(e,"length",kI),zf=e=>!!e&&!Number.isNaN(Number(e)),Fx=e=>Kf(e,"number",zf),xm=e=>!!e&&Number.isInteger(Number(e)),bI=e=>e.endsWith("%")&&zf(e.slice(0,-1)),wt=e=>eA.test(e),$s=e=>mI.test(e),xI=new Set(["length","size","percentage"]),wI=e=>Kf(e,xI,tA),TI=e=>Kf(e,"position",tA),SI=new Set(["image","url"]),CI=e=>Kf(e,SI,RI),_I=e=>Kf(e,"",AI),wm=()=>!0,Kf=(e,n,a)=>{const s=eA.exec(e);return s?s[1]?typeof n=="string"?s[1]===n:n.has(s[1]):a(s[2]):!1},kI=e=>gI.test(e)&&!vI.test(e),tA=()=>!1,AI=e=>yI.test(e),RI=e=>EI.test(e),NI=()=>{const e=hn("colors"),n=hn("spacing"),a=hn("blur"),s=hn("brightness"),f=hn("borderColor"),h=hn("borderRadius"),d=hn("borderSpacing"),g=hn("borderWidth"),E=hn("contrast"),b=hn("grayscale"),C=hn("hueRotate"),S=hn("invert"),R=hn("gap"),k=hn("gradientColorStops"),D=hn("gradientColorStopPositions"),L=hn("inset"),B=hn("margin"),H=hn("opacity"),$=hn("padding"),W=hn("saturate"),J=hn("scale"),Z=hn("sepia"),X=hn("skew"),te=hn("space"),we=hn("translate"),Me=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",wt,n],ge=()=>[wt,n],Re=()=>["",Iu,Gs],Oe=()=>["auto",zf,wt],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],De=()=>["","0",wt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],et=()=>[zf,wt];return{cacheSize:500,separator:":",theme:{colors:[wm],spacing:[Iu,Gs],blur:["none","",$s,wt],brightness:et(),borderColor:[e],borderRadius:["none","","full",$s,wt],borderSpacing:ge(),borderWidth:Re(),contrast:et(),grayscale:De(),hueRotate:et(),invert:De(),gap:ge(),gradientColorStops:[e],gradientColorStopPositions:[bI,Gs],inset:Ee(),margin:Ee(),opacity:et(),padding:ge(),saturate:et(),scale:et(),sepia:De(),skew:et(),space:ge(),translate:ge()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...qe(),wt]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:Me()}],"overscroll-x":[{"overscroll-x":Me()}],"overscroll-y":[{"overscroll-y":Me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xm,wt]}],basis:[{basis:Ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:De()}],shrink:[{shrink:De()}],order:[{order:["first","last","none",xm,wt]}],"grid-cols":[{"grid-cols":[wm]}],"col-start-end":[{col:["auto",{span:["full",xm,wt]},wt]}],"col-start":[{"col-start":Oe()}],"col-end":[{"col-end":Oe()}],"grid-rows":[{"grid-rows":[wm]}],"row-start-end":[{row:["auto",{span:[xm,wt]},wt]}],"row-start":[{"row-start":Oe()}],"row-end":[{"row-end":Oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[B]}],mx:[{mx:[B]}],my:[{my:[B]}],ms:[{ms:[B]}],me:[{me:[B]}],mt:[{mt:[B]}],mr:[{mr:[B]}],mb:[{mb:[B]}],ml:[{ml:[B]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,n]}],"min-w":[{"min-w":[wt,n,"min","max","fit"]}],"max-w":[{"max-w":[wt,n,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[wt,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,n,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fx]}],"font-family":[{font:[wm]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",zf,Fx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Iu,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[H]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Iu,Gs]}],"underline-offset":[{"underline-offset":["auto",Iu,wt]}],"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:ge()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[H]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),TI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[H]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[H]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[Iu,wt]}],"outline-w":[{outline:[Iu,Gs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[H]}],"ring-offset-w":[{"ring-offset":[Iu,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,_I]}],"shadow-color":[{shadow:[wm]}],opacity:[{opacity:[H]}],"mix-blend":[{"mix-blend":[...at(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":at()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",$s,wt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[S]}],saturate:[{saturate:[W]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[H]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",wt]}],duration:[{duration:et()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:et()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[xm,wt]}],"translate-x":[{"translate-x":[we]}],"translate-y":[{"translate-y":[we]}],"skew-x":[{"skew-x":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ge()}],"scroll-mx":[{"scroll-mx":ge()}],"scroll-my":[{"scroll-my":ge()}],"scroll-ms":[{"scroll-ms":ge()}],"scroll-me":[{"scroll-me":ge()}],"scroll-mt":[{"scroll-mt":ge()}],"scroll-mr":[{"scroll-mr":ge()}],"scroll-mb":[{"scroll-mb":ge()}],"scroll-ml":[{"scroll-ml":ge()}],"scroll-p":[{"scroll-p":ge()}],"scroll-px":[{"scroll-px":ge()}],"scroll-py":[{"scroll-py":ge()}],"scroll-ps":[{"scroll-ps":ge()}],"scroll-pe":[{"scroll-pe":ge()}],"scroll-pt":[{"scroll-pt":ge()}],"scroll-pr":[{"scroll-pr":ge()}],"scroll-pb":[{"scroll-pb":ge()}],"scroll-pl":[{"scroll-pl":ge()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Iu,Gs,Fx]}],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-s","border-color-e","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"]}}},DI=fI(NI);function St(...e){return DI(Qk.clsx(e))}const OI="[data-opencx-widget-content-root]";function zw({fallbackHeight:e}){const n=Tt.useRef(null);return Tt.useEffect(()=>{const a=document.querySelector(OI);if(a&&n.current){const s=n.current;let f;const h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{const d=Math.max(s.offsetHeight,e);a.style.setProperty("--opencx-widget-height",`${d.toFixed(1)}px`)})});return h.observe(s),()=>{cancelAnimationFrame(f),h.unobserve(s)}}},[e]),{observedElementRef:n}}const LI=jm.Provider,II=jm.Root,MI=jm.Trigger,nA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(jm.Content,{ref:s,sideOffset:n,className:St("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));nA.displayName=jm.Content.displayName;function k1({children:e,content:n,side:a,align:s}){return n?I.jsxs(II,{children:[I.jsx(MI,{asChild:!0,children:e}),I.jsx(nA,{side:a,align:s,collisionPadding:8,avoidCollisions:!0,children:n})]}):e}const PI={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},FI={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},UI={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},BI={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},HI={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},zI={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},rA={en:UI,ar:PI,nl:HI,fr:BI,de:FI,pt:zI},jI=Object.keys(rA),VI=e=>jI.includes(e);function YI(e,n){const a=rA[n];return a&&a[e]||""}function Jf(){const{widgetCtx:{config:e}}=ft.useWidget();return Tt.useMemo(()=>{const a=VI(e.language)?e.language:"en";return{get:s=>YI(s,a),lang:a}},[e.language])}const WI=10,qI=(e,n)=>({initial:{opacity:0,x:-e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:e,...n.exit}}),QI=(e,n)=>({initial:{opacity:0,x:e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:-e,...n.exit}}),GI=(e,n)=>({initial:{opacity:0,y:e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:-e,...n.exit}}),$I=(e,n)=>({initial:{opacity:0,y:-e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:e,...n.exit}}),XI={right:qI,left:QI,up:GI,down:$I},Sn=Tt.forwardRef(({fadeIn:e="down",distance:n=WI,children:a,snapExit:s=!1,overrides:f={},...h},d)=>{const g=e?XI[e](n,f):{};return s&&g.exit&&typeof g.exit=="object"&&!Array.isArray(g.exit)&&(g.exit.transition={duration:0}),I.jsx(vr.motion.div,{ref:d,...h,...g,children:a})});Sn.displayName="MotionDiv";const r_=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,a_=Qk.clsx,KI=(e,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return a_(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:h}=n,d=Object.keys(f).map(b=>{const C=a==null?void 0:a[b],S=h==null?void 0:h[b];if(C===null)return null;const R=r_(C)||r_(S);return f[b][R]}),g=a&&Object.entries(a).reduce((b,C)=>{let[S,R]=C;return R===void 0||(b[S]=R),b},{}),E=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((b,C)=>{let{class:S,className:R,...k}=C;return Object.entries(k).every(D=>{let[L,B]=D;return Array.isArray(B)?B.includes({...h,...g}[L]):{...h,...g}[L]===B})?[...b,S,R]:b},[]);return a_(e,d,E,a==null?void 0:a.class,a==null?void 0:a.className)},i_={x:2,y:2},JI={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},el=Tt.memo(Tt.forwardRef(({children:e,className:n,scale:a="1.02",off:s=!1},f)=>{const[h,d]=Tt.useState(!1),[g,E]=Tt.useState({x:0,y:0});if(s||/translate/.test(e.props.className||""))return e;const C=D=>{var we,Me;const{clientX:L,clientY:B}=D,H=D.currentTarget.getBoundingClientRect(),$=L-(H.left+H.width/2),W=B-(H.top+H.height/2),J=Math.max(-1,Math.min(1,$/(H.width/2))),Z=Math.max(-1,Math.min(1,W/(H.height/2))),X=J*i_.x,te=Z*i_.y;E({x:X,y:te}),(Me=(we=e.props).onMouseMove)==null||Me.call(we,D)},S=()=>{var D,L;d(!0),(L=(D=e.props).onMouseEnter)==null||L.call(D)},R=()=>{var D,L;d(!1),E({x:0,y:0}),(L=(D=e.props).onMouseLeave)==null||L.call(D)},k={"--opencx-wobble-x":h?`${g.x}px`:"0px","--opencx-wobble-y":h?`${g.y}px`:"0px"};return Tt.cloneElement(e,{ref:f,onMouseMove:C,onMouseEnter:S,onMouseLeave:R,style:{...k,...e.props.style},className:St("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${JI[a]}`,n,e.props.className,"transition-all ease-out")})}));el.displayName="Wobble";const ZI=KI(St("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),si=ie.forwardRef(({className:e,variant:n,size:a,asChild:s=!1,...f},h)=>{const d=s?Uw.Slot:"button";return I.jsx(el,{ref:h,children:I.jsx(d,{className:St(ZI({variant:n,size:a,className:e})),...f})})});si.displayName="Button";const B1=()=>{const[e,n]=Tt.useState("ltr");return Tt.useEffect(()=>{const a=()=>{typeof document>"u"||n(window.getComputedStyle(document.body).direction)};a();const s=new MutationObserver(a);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),s.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",a),()=>{s.disconnect(),window.removeEventListener("languagechange",a)}},[]),e};function e5(){const{sendMessage:e}=ft.useMessages(),n=Jf(),a=[n.get("i-need-more-help"),n.get("this-was-helpful")],s=f=>{const h=f.trim();h&&e({content:h})};return I.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:a.map(f=>I.jsx(si,{onClick:()=>s(f),className:"flex-1 rounded-full",size:"sm",children:f},f))})}function t5({file:{status:e,file:n,error:a},onCancel:s}){const[f,h]=Tt.useState(null);Tt.useEffect(()=>{if(!n.type.startsWith("image/"))return;const E=new FileReader;return E.onload=()=>h(E.result),E.onerror=()=>console.error("Error reading file"),E.readAsDataURL(n),()=>E.abort()},[n]);const d=()=>{switch(e){case"uploading":return I.jsx(Wn.Loader2,{className:"size-4 animate-spin"});case"error":return I.jsx(Wn.AlertCircle,{className:"size-4 text-destructive"});default:return null}},g=()=>{const E=n.type.split("/")[0];return E==="image"&&f?I.jsx("img",{src:typeof f=="string"?f:"",className:"object-cover bg-secondary size-full",alt:n.name}):E==="audio"?I.jsx(Wn.FileAudio2Icon,{}):E==="video"?I.jsx(Wn.FileVideo2Icon,{}):I.jsx(Wn.FileIcon,{})};return I.jsx(k1,{side:"bottom",content:e==="error"?I.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",a]}):n.name,children:I.jsxs("div",{className:St(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[I.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d()}),I.jsx("button",{type:"button",className:St("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:s,children:I.jsx(Wn.XIcon,{className:"size-4 text-primary-foreground"})}),I.jsx(g,{})]})})}const o_=St("rounded-3xl");function n5(){var X;const e=Tt.useRef(null),{sendMessage:n}=ft.useMessages(),{sessionState:a}=ft.useSessions(),s=Jf(),f=B1(),[h,d]=Tt.useState(""),{allFiles:g,emptyTheFiles:E,handleCancelUpload:b,appendFiles:C,isUploading:S,successFiles:R}=ft.useUploadFiles(),k=!!((X=a.session)!=null&&X.isHandedOff),{isAwaitingBotReply:D}=ft.useIsAwaitingBotReply(),L=te=>{k&&C(te)},B=!h.trim()&&R.length===0,H=async()=>{if(D||B)return;if(S){const we="please wait for the file(s) to upload";e_.error(we),console.info(we)}const te=h.trim();n({content:te,attachments:R.flatMap(we=>we.fileUrl?[{url:we.fileUrl,type:we.file.type,name:we.file.name,id:we.id,size:we.file.size}]:[])}),d(""),E()},{getRootProps:$,getInputProps:W,open:J}=G4.useDropzone({onDrop:L,noClick:!0,onDropRejected(){if(k){const te="unsupported file type, or the file is too large";e_.error(te),console.error(te)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),Z=te=>{const we=te.clipboardData;we&&we.files.length>0&&L(Array.from(we.files))};return I.jsxs("div",{className:"p-2 relative space-y-1",...$(),children:[I.jsx("input",{...W()}),I.jsxs("div",{className:St(o_,"relative space-y-2 border transition-all shadow py-2"),children:[I.jsx("div",{className:"flex items-center gap-1 px-2",children:I.jsx(vr.AnimatePresence,{mode:"popLayout",children:g.map(te=>I.jsx(Sn,{snapExit:!0,children:I.jsx(t5,{onCancel:()=>b(te.id),file:te})},te.id))})}),I.jsx("textarea",{onPaste:Z,ref:e,id:"chat-input",dir:f,value:h,rows:3,className:St(o_,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:te=>d(te.target.value),onKeyDown:async te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),H())},placeholder:s.get("write-a-message")}),I.jsxs("div",{dir:f,className:"px-2 flex justify-between rtl:text-right",children:[I.jsx(k1,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:I.jsx(si,{onClick:()=>{k&&J()},size:"fit",variant:"outline",className:St("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!k,children:I.jsx(Wn.PaperclipIcon,{className:"size-4"})})}),I.jsx(k1,{content:"send message",side:"top",align:"end",children:I.jsx(si,{size:"fit",onClick:H,disabled:D||S||B,className:"rounded-full size-8 flex items-center justify-center p-0",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:D||S?I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function r5(){const{widgetCtx:e}=ft.useWidget(),n=Jf();return I.jsx("div",{className:"p-2",children:I.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[I.jsxs("div",{className:"flex items-center gap-1",children:[I.jsx(Wn.CheckCheckIcon,{className:"size-4 text-emerald-500"}),I.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:n.get("session-closed-lead")})]}),I.jsx("div",{children:I.jsx(si,{onClick:e.resetChat,className:"rounded-2xl w-full",children:n.get("new-conversation")})})]})})}function a5(){var d,g,E;const{sessionState:e}=ft.useSessions(),{messagesState:n,sendMessage:a}=ft.useMessages(),f=(g=(d=ft.usePreludeData().data)==null?void 0:d.data)==null?void 0:g.initialQuestions,h=n.messages.length===0;return I.jsx("footer",{children:I.jsx("div",{children:I.jsx(vr.AnimatePresence,{mode:"wait",children:e.session&&!((E=e.session)!=null&&E.isOpened)?I.jsx(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:I.jsx(r5,{})},"session-closed"):I.jsxs(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&I.jsx(e5,{}),h&&f&&I.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:f==null?void 0:f.map(b=>I.jsx(si,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{a({content:b})},children:b},b))}),I.jsx(n5,{})]},"chat-input")})})})}const i5=Qn.Root,o5=Qn.Trigger,u5=Qn.Group,s5=ie.forwardRef(({className:e,inset:n,children:a,...s},f)=>I.jsxs(Qn.SubTrigger,{ref:f,className:St("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...s,children:[a,I.jsx(Wn.ChevronRight,{className:"ml-auto"})]}));s5.displayName=Qn.SubTrigger.displayName;const l5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.SubContent,{ref:a,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));l5.displayName=Qn.SubContent.displayName;const aA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(Qn.Content,{ref:s,sideOffset:n,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));aA.displayName=Qn.Content.displayName;const iA=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Sn,{children:I.jsx(Qn.Item,{ref:s,className:St("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...a})}));iA.displayName=Qn.Item.displayName;const c5=ie.forwardRef(({className:e,children:n,checked:a,...s},f)=>I.jsxs(Qn.CheckboxItem,{ref:f,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Check,{className:"h-4 w-4"})})}),n]}));c5.displayName=Qn.CheckboxItem.displayName;const d5=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(Qn.RadioItem,{ref:s,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));d5.displayName=Qn.RadioItem.displayName;const f5=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Qn.Label,{ref:s,className:St("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));f5.displayName=Qn.Label.displayName;const p5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.Separator,{ref:a,className:St("-mx-1 my-1 h-px bg-muted",e),...n}));p5.displayName=Qn.Separator.displayName;function oA({className:e,...n}){return I.jsx("div",{className:St("animate-pulse rounded-md bg-secondary",e),...n})}function h5(){const e=Jf(),[n,a]=Tt.useState(!1),{toChatScreen:s}=ft.useWidgetRouter();return I.jsxs(i5,{open:n,onOpenChange:a,children:[I.jsx(o5,{asChild:!0,children:I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",children:I.jsx(Wn.EllipsisVerticalIcon,{className:"size-4"})})}),I.jsx(aA,{align:"end",className:"min-w-56",children:I.jsx(u5,{children:I.jsxs(iA,{onSelect:()=>{a(!1),s()},children:[I.jsx(vr.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:I.jsx(Wn.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function uA(){var h,d;const{routerState:{screen:e},toSessionsScreen:n}=ft.useWidgetRouter(),{data:a,isLoading:s}=ft.usePreludeData(),f=B1();return I.jsx("header",{className:"p-2 border-b bg-background",children:I.jsxs("div",{dir:f,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:I.jsx(Wn.ChevronLeftIcon,{className:"size-4"})}),I.jsx("div",{className:St("flex-1",e==="sessions"&&"pl-2"),children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s||!((h=a==null?void 0:a.data)!=null&&h.organizationName)?I.jsx(Sn,{snapExit:!0,children:I.jsx(oA,{className:"h-5 w-1/2"})},"skeleton"):I.jsx(Sn,{children:I.jsx("h2",{className:"font-semibold",children:(d=a==null?void 0:a.data)==null?void 0:d.organizationName})},"organization-name")})}),I.jsx(h5,{})]})})}function m5(e){const n=[];let a=null;return e.forEach(s=>{var f,h,d,g;(!a||((f=a[0])==null?void 0:f.type)!==s.type)&&(a=[],n.push(a)),((h=a[0])==null?void 0:h.type)==="FROM_AGENT"&&s.type==="FROM_AGENT"&&((d=s.agent)==null?void 0:d.id)!==((g=a[0].agent)==null?void 0:g.id)&&(a=[],n.push(a)),a.push(s)}),n}function g5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_USER"}function v5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_BOT"}function y5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_AGENT"}function u_(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,f=a.indexOf(n);for(;f!==-1;)s++,f=a.indexOf(n,f+n.length);return s}const ba=sl(/[A-Za-z]/),ra=sl(/[\dA-Za-z]/),E5=sl(/[#-'*+\--9=?A-Z^-~]/);function A1(e){return e!==null&&(e<32||e===127)}const hw=sl(/\d/),b5=sl(/[\dA-Fa-f]/),x5=sl(/[!-/:-@[-`{-~]/);function ut(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const H1=sl(new RegExp("\\p{P}|\\p{S}","u")),Rc=sl(/\s/);function sl(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function w5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const z1=function(e){if(e==null)return _5;if(typeof e=="function")return j1(e);if(typeof e=="object")return Array.isArray(e)?T5(e):S5(e);if(typeof e=="string")return C5(e);throw new Error("Expected function, string, or object as test")};function T5(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=z1(e[a]);return j1(s);function s(...f){let h=-1;for(;++h<n.length;)if(n[h].apply(this,f))return!0;return!1}}function S5(e){const n=e;return j1(a);function a(s){const f=s;let h;for(h in e)if(f[h]!==n[h])return!1;return!0}}function C5(e){return j1(n);function n(a){return a&&a.type===e}}function j1(e){return n;function n(a,s,f){return!!(k5(a)&&e.call(this,a,typeof s=="number"?s:void 0,f||void 0))}}function _5(){return!0}function k5(e){return e!==null&&typeof e=="object"&&"type"in e}const sA=[],A5=!0,mw=!1,R5="skip";function lA(e,n,a,s){let f;typeof n=="function"&&typeof a!="function"?(s=a,a=n):f=n;const h=z1(f),d=s?-1:1;g(e,void 0,[])();function g(E,b,C){const S=E&&typeof E=="object"?E:{};if(typeof S.type=="string"){const k=typeof S.tagName=="string"?S.tagName:typeof S.name=="string"?S.name:void 0;Object.defineProperty(R,"name",{value:"node ("+(E.type+(k?"<"+k+">":""))+")"})}return R;function R(){let k=sA,D,L,B;if((!n||h(E,b,C[C.length-1]||void 0))&&(k=N5(a(E,C)),k[0]===mw))return k;if("children"in E&&E.children){const H=E;if(H.children&&k[0]!==R5)for(L=(s?H.children.length:-1)+d,B=C.concat(H);L>-1&&L<H.children.length;){const $=H.children[L];if(D=g($,L,B)(),D[0]===mw)return D;L=typeof D[1]=="number"?D[1]:L+d}}return k}}}function N5(e){return Array.isArray(e)?e:typeof e=="number"?[A5,e]:e==null?sA:[e]}function D5(e,n,a){const f=z1((a||{}).ignore||[]),h=O5(n);let d=-1;for(;++d<h.length;)lA(e,"text",g);function g(b,C){let S=-1,R;for(;++S<C.length;){const k=C[S],D=R?R.children:void 0;if(f(k,D?D.indexOf(k):void 0,R))return;R=k}if(R)return E(b,C)}function E(b,C){const S=C[C.length-1],R=h[d][0],k=h[d][1];let D=0;const B=S.children.indexOf(b);let H=!1,$=[];R.lastIndex=0;let W=R.exec(b.value);for(;W;){const J=W.index,Z={index:W.index,input:W.input,stack:[...C,b]};let X=k(...W,Z);if(typeof X=="string"&&(X=X.length>0?{type:"text",value:X}:void 0),X===!1?R.lastIndex=J+1:(D!==J&&$.push({type:"text",value:b.value.slice(D,J)}),Array.isArray(X)?$.push(...X):X&&$.push(X),D=J+W[0].length,H=!0),!R.global)break;W=R.exec(b.value)}return H?(D<b.value.length&&$.push({type:"text",value:b.value.slice(D)}),S.children.splice(B,1,...$)):$=[b],B+$.length}}function O5(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const f=a[s];n.push([L5(f[0]),I5(f[1])])}return n}function L5(e){return typeof e=="string"?new RegExp(w5(e),"g"):e}function I5(e){return typeof e=="function"?e:function(){return e}}const Ux="phrasing",Bx=["autolink","link","image","label"];function M5(){return{transforms:[j5],enter:{literalAutolink:F5,literalAutolinkEmail:Hx,literalAutolinkHttp:Hx,literalAutolinkWww:Hx},exit:{literalAutolink:z5,literalAutolinkEmail:H5,literalAutolinkHttp:U5,literalAutolinkWww:B5}}}function P5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:":",before:"[ps]",after:"\\/",inConstruct:Ux,notInConstruct:Bx}]}}function F5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hx(e){this.config.enter.autolinkProtocol.call(this,e)}function U5(e){this.config.exit.autolinkProtocol.call(this,e)}function B5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function H5(e){this.config.exit.autolinkEmail.call(this,e)}function z5(e){this.exit(e)}function j5(e){D5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,V5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Y5]],{ignore:["link","linkReference"]})}function V5(e,n,a,s,f){let h="";if(!cA(f)||(/^w/i.test(n)&&(a=n+a,n="",h="http://"),!W5(a)))return!1;const d=q5(a+s);if(!d[0])return!1;const g={type:"link",title:null,url:h+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[g,{type:"text",value:d[1]}]:g}function Y5(e,n,a,s){return!cA(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function W5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function q5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],s=a.indexOf(")");const f=u_(e,"(");let h=u_(e,")");for(;s!==-1&&f>h;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),h++;return[e,a]}function cA(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Rc(a)||H1(a))&&(!n||a!==47)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}dA.peek=rM;function Q5(){return{enter:{gfmFootnoteDefinition:$5,gfmFootnoteDefinitionLabelString:X5,gfmFootnoteCall:Z5,gfmFootnoteCallString:eM},exit:{gfmFootnoteDefinition:J5,gfmFootnoteDefinitionLabelString:K5,gfmFootnoteCall:nM,gfmFootnoteCallString:tM}}}function G5(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:aM,footnoteReference:dA}}}function $5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function X5(){this.buffer()}function K5(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function J5(e){this.exit(e)}function Z5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eM(){this.buffer()}function tM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function nM(e){this.exit(e)}function dA(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteReference"),g=a.enter("reference");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),d(),h+=f.move("]"),h}function rM(){return"["}function aM(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteDefinition"),g=a.enter("label");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),h+=f.move("]:"+(e.children&&e.children.length>0?" ":"")),f.shift(4),h+=f.move(a.indentLines(a.containerFlow(e,f.current()),iM)),d(),h}function iM(e,n,a){return n===0?e:(a?"":" ")+e}const oM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fA.peek=dM;function uM(){return{canContainEols:["delete"],enter:{strikethrough:lM},exit:{strikethrough:cM}}}function sM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oM}],handlers:{delete:fA}}}function lM(e){this.enter({type:"delete",children:[]},e)}function cM(e){this.exit(e)}function fA(e,n,a,s){const f=a.createTracker(s),h=a.enter("strikethrough");let d=f.move("~~");return d+=a.containerPhrasing(e,{...f.current(),before:d,after:"~"}),d+=f.move("~~"),h(),d}function dM(){return"~"}function fM(e,n={}){const a=(n.align||[]).concat(),s=n.stringLength||hM,f=[],h=[],d=[],g=[];let E=0,b=-1;for(;++b<e.length;){const D=[],L=[];let B=-1;for(e[b].length>E&&(E=e[b].length);++B<e[b].length;){const H=pM(e[b][B]);if(n.alignDelimiters!==!1){const $=s(H);L[B]=$,(g[B]===void 0||$>g[B])&&(g[B]=$)}D.push(H)}h[b]=D,d[b]=L}let C=-1;if(typeof a=="object"&&"length"in a)for(;++C<E;)f[C]=s_(a[C]);else{const D=s_(a);for(;++C<E;)f[C]=D}C=-1;const S=[],R=[];for(;++C<E;){const D=f[C];let L="",B="";D===99?(L=":",B=":"):D===108?L=":":D===114&&(B=":");let H=n.alignDelimiters===!1?1:Math.max(1,g[C]-L.length-B.length);const $=L+"-".repeat(H)+B;n.alignDelimiters!==!1&&(H=L.length+H+B.length,H>g[C]&&(g[C]=H),R[C]=H),S[C]=$}h.splice(1,0,S),d.splice(1,0,R),b=-1;const k=[];for(;++b<h.length;){const D=h[b],L=d[b];C=-1;const B=[];for(;++C<E;){const H=D[C]||"";let $="",W="";if(n.alignDelimiters!==!1){const J=g[C]-(L[C]||0),Z=f[C];Z===114?$=" ".repeat(J):Z===99?J%2?($=" ".repeat(J/2+.5),W=" ".repeat(J/2-.5)):($=" ".repeat(J/2),W=$):W=" ".repeat(J)}n.delimiterStart!==!1&&!C&&B.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&H==="")&&(n.delimiterStart!==!1||C)&&B.push(" "),n.alignDelimiters!==!1&&B.push($),B.push(H),n.alignDelimiters!==!1&&B.push(W),n.padding!==!1&&B.push(" "),(n.delimiterEnd!==!1||C!==E-1)&&B.push("|")}k.push(n.delimiterEnd===!1?B.join("").replace(/ +$/,""):B.join(""))}return k.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),Tt=require("react"),ZC=require("tinycolor2"),vr=require("framer-motion"),Qk=require("clsx"),Wn=require("lucide-react"),G4=require("react-dropzone"),e_=require("react-hot-toast"),ft=require("./useUploadFiles-DezH_NSW.cjs"),$4=require("@radix-ui/react-tooltip"),Uw=require("@radix-ui/react-slot"),X4=require("@radix-ui/react-dropdown-menu"),K4=require("@radix-ui/react-dialog"),J4=require("@radix-ui/react-avatar"),Px=require("zod");function zm(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const ie=zm(Tt),jm=zm($4),Qn=zm(X4),so=zm(K4),Xf=zm(J4),Z4=350,Gk=400,$k=600,Bw={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Xk=({primary:e="hsl(0, 0%, 0%)"})=>{const n=ZC(e).toHsl(),a=ZC(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${n.h} ${n.s*100}% ${n.l*100}%`,"--opencx-primary-foreground":a,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Hw="-",eI=e=>{const n=nI(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{const g=d.split(Hw);return g[0]===""&&g.length!==1&&g.shift(),Kk(g,n)||tI(d)},getConflictingClassGroupIds:(d,g)=>{const E=a[d]||[];return g&&s[d]?[...E,...s[d]]:E}}},Kk=(e,n)=>{var d;if(e.length===0)return n.classGroupId;const a=e[0],s=n.nextPart.get(a),f=s?Kk(e.slice(1),s):void 0;if(f)return f;if(n.validators.length===0)return;const h=e.join(Hw);return(d=n.validators.find(({validator:g})=>g(h)))==null?void 0:d.classGroupId},t_=/^\[(.+)\]$/,tI=e=>{if(t_.test(e)){const n=t_.exec(e)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},nI=e=>{const{theme:n,prefix:a}=e,s={nextPart:new Map,validators:[]};return aI(Object.entries(e.classGroups),a).forEach(([h,d])=>{pw(d,s,h,n)}),s},pw=(e,n,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const h=f===""?n:n_(n,f);h.classGroupId=a;return}if(typeof f=="function"){if(rI(f)){pw(f(s),n,a,s);return}n.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([h,d])=>{pw(d,n_(n,h),a,s)})})},n_=(e,n)=>{let a=e;return n.split(Hw).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},rI=e=>e.isThemeGetter,aI=(e,n)=>n?e.map(([a,s])=>{const f=s.map(h=>typeof h=="string"?n+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([d,g])=>[n+d,g])):h);return[a,f]}):e,iI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,s=new Map;const f=(h,d)=>{a.set(h,d),n++,n>e&&(n=0,s=a,a=new Map)};return{get(h){let d=a.get(h);if(d!==void 0)return d;if((d=s.get(h))!==void 0)return f(h,d),d},set(h,d){a.has(h)?a.set(h,d):f(h,d)}}},Jk="!",oI=e=>{const{separator:n,experimentalParseClassName:a}=e,s=n.length===1,f=n[0],h=n.length,d=g=>{const E=[];let b=0,C=0,S;for(let B=0;B<g.length;B++){let H=g[B];if(b===0){if(H===f&&(s||g.slice(B,B+h)===n)){E.push(g.slice(C,B)),C=B+h;continue}if(H==="/"){S=B;continue}}H==="["?b++:H==="]"&&b--}const R=E.length===0?g:g.substring(C),k=R.startsWith(Jk),D=k?R.substring(1):R,L=S&&S>C?S-C:void 0;return{modifiers:E,hasImportantModifier:k,baseClassName:D,maybePostfixModifierPosition:L}};return a?g=>a({className:g,parseClassName:d}):d},uI=e=>{if(e.length<=1)return e;const n=[];let a=[];return e.forEach(s=>{s[0]==="["?(n.push(...a.sort(),s),a=[]):a.push(s)}),n.push(...a.sort()),n},sI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...eI(e)}),lI=/\s+/,cI=(e,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=n,h=[],d=e.trim().split(lI);let g="";for(let E=d.length-1;E>=0;E-=1){const b=d[E],{modifiers:C,hasImportantModifier:S,baseClassName:R,maybePostfixModifierPosition:k}=a(b);let D=!!k,L=s(D?R.substring(0,k):R);if(!L){if(!D){g=b+(g.length>0?" "+g:g);continue}if(L=s(R),!L){g=b+(g.length>0?" "+g:g);continue}D=!1}const B=uI(C).join(":"),H=S?B+Jk:B,$=H+L;if(h.includes($))continue;h.push($);const W=f(L,D);for(let J=0;J<W.length;++J){const Z=W[J];h.push(H+Z)}g=b+(g.length>0?" "+g:g)}return g};function dI(){let e=0,n,a,s="";for(;e<arguments.length;)(n=arguments[e++])&&(a=Zk(n))&&(s&&(s+=" "),s+=a);return s}const Zk=e=>{if(typeof e=="string")return e;let n,a="";for(let s=0;s<e.length;s++)e[s]&&(n=Zk(e[s]))&&(a&&(a+=" "),a+=n);return a};function fI(e,...n){let a,s,f,h=d;function d(E){const b=n.reduce((C,S)=>S(C),e());return a=sI(b),s=a.cache.get,f=a.cache.set,h=g,g(E)}function g(E){const b=s(E);if(b)return b;const C=cI(E,a);return f(E,C),C}return function(){return h(dI.apply(null,arguments))}}const hn=e=>{const n=a=>a[e]||[];return n.isThemeGetter=!0,n},eA=/^\[(?:([a-z-]+):)?(.+)\]$/i,pI=/^\d+\/\d+$/,hI=new Set(["px","full","screen"]),mI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gI=/\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$/,vI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Iu=e=>zf(e)||hI.has(e)||pI.test(e),Gs=e=>Kf(e,"length",kI),zf=e=>!!e&&!Number.isNaN(Number(e)),Fx=e=>Kf(e,"number",zf),xm=e=>!!e&&Number.isInteger(Number(e)),bI=e=>e.endsWith("%")&&zf(e.slice(0,-1)),wt=e=>eA.test(e),$s=e=>mI.test(e),xI=new Set(["length","size","percentage"]),wI=e=>Kf(e,xI,tA),TI=e=>Kf(e,"position",tA),SI=new Set(["image","url"]),CI=e=>Kf(e,SI,RI),_I=e=>Kf(e,"",AI),wm=()=>!0,Kf=(e,n,a)=>{const s=eA.exec(e);return s?s[1]?typeof n=="string"?s[1]===n:n.has(s[1]):a(s[2]):!1},kI=e=>gI.test(e)&&!vI.test(e),tA=()=>!1,AI=e=>yI.test(e),RI=e=>EI.test(e),NI=()=>{const e=hn("colors"),n=hn("spacing"),a=hn("blur"),s=hn("brightness"),f=hn("borderColor"),h=hn("borderRadius"),d=hn("borderSpacing"),g=hn("borderWidth"),E=hn("contrast"),b=hn("grayscale"),C=hn("hueRotate"),S=hn("invert"),R=hn("gap"),k=hn("gradientColorStops"),D=hn("gradientColorStopPositions"),L=hn("inset"),B=hn("margin"),H=hn("opacity"),$=hn("padding"),W=hn("saturate"),J=hn("scale"),Z=hn("sepia"),X=hn("skew"),te=hn("space"),we=hn("translate"),Me=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",wt,n],ge=()=>[wt,n],Re=()=>["",Iu,Gs],Oe=()=>["auto",zf,wt],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],De=()=>["","0",wt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],et=()=>[zf,wt];return{cacheSize:500,separator:":",theme:{colors:[wm],spacing:[Iu,Gs],blur:["none","",$s,wt],brightness:et(),borderColor:[e],borderRadius:["none","","full",$s,wt],borderSpacing:ge(),borderWidth:Re(),contrast:et(),grayscale:De(),hueRotate:et(),invert:De(),gap:ge(),gradientColorStops:[e],gradientColorStopPositions:[bI,Gs],inset:Ee(),margin:Ee(),opacity:et(),padding:ge(),saturate:et(),scale:et(),sepia:De(),skew:et(),space:ge(),translate:ge()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[$s]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...qe(),wt]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:Me()}],"overscroll-x":[{"overscroll-x":Me()}],"overscroll-y":[{"overscroll-y":Me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xm,wt]}],basis:[{basis:Ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:De()}],shrink:[{shrink:De()}],order:[{order:["first","last","none",xm,wt]}],"grid-cols":[{"grid-cols":[wm]}],"col-start-end":[{col:["auto",{span:["full",xm,wt]},wt]}],"col-start":[{"col-start":Oe()}],"col-end":[{"col-end":Oe()}],"grid-rows":[{"grid-rows":[wm]}],"row-start-end":[{row:["auto",{span:[xm,wt]},wt]}],"row-start":[{"row-start":Oe()}],"row-end":[{"row-end":Oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[R]}],"gap-x":[{"gap-x":[R]}],"gap-y":[{"gap-y":[R]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[B]}],mx:[{mx:[B]}],my:[{my:[B]}],ms:[{ms:[B]}],me:[{me:[B]}],mt:[{mt:[B]}],mr:[{mr:[B]}],mb:[{mb:[B]}],ml:[{ml:[B]}],"space-x":[{"space-x":[te]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[te]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,n]}],"min-w":[{"min-w":[wt,n,"min","max","fit"]}],"max-w":[{"max-w":[wt,n,"none","full","min","max","fit","prose",{screen:[$s]},$s]}],h:[{h:[wt,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,n,"auto","min","max","fit"]}],"font-size":[{text:["base",$s,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fx]}],"font-family":[{font:[wm]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",zf,Fx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Iu,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[H]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Iu,Gs]}],"underline-offset":[{"underline-offset":["auto",Iu,wt]}],"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:ge()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[H]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),TI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[H]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[H]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[Iu,wt]}],"outline-w":[{outline:[Iu,Gs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[H]}],"ring-offset-w":[{"ring-offset":[Iu,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$s,_I]}],"shadow-color":[{shadow:[wm]}],opacity:[{opacity:[H]}],"mix-blend":[{"mix-blend":[...at(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":at()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",$s,wt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[S]}],saturate:[{saturate:[W]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[H]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",wt]}],duration:[{duration:et()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:et()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[xm,wt]}],"translate-x":[{"translate-x":[we]}],"translate-y":[{"translate-y":[we]}],"skew-x":[{"skew-x":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ge()}],"scroll-mx":[{"scroll-mx":ge()}],"scroll-my":[{"scroll-my":ge()}],"scroll-ms":[{"scroll-ms":ge()}],"scroll-me":[{"scroll-me":ge()}],"scroll-mt":[{"scroll-mt":ge()}],"scroll-mr":[{"scroll-mr":ge()}],"scroll-mb":[{"scroll-mb":ge()}],"scroll-ml":[{"scroll-ml":ge()}],"scroll-p":[{"scroll-p":ge()}],"scroll-px":[{"scroll-px":ge()}],"scroll-py":[{"scroll-py":ge()}],"scroll-ps":[{"scroll-ps":ge()}],"scroll-pe":[{"scroll-pe":ge()}],"scroll-pt":[{"scroll-pt":ge()}],"scroll-pr":[{"scroll-pr":ge()}],"scroll-pb":[{"scroll-pb":ge()}],"scroll-pl":[{"scroll-pl":ge()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Iu,Gs,Fx]}],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-s","border-color-e","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"]}}},DI=fI(NI);function St(...e){return DI(Qk.clsx(e))}const OI="[data-opencx-widget-content-root]";function zw({fallbackHeight:e}){const n=Tt.useRef(null);return Tt.useEffect(()=>{const a=document.querySelector(OI);if(a&&n.current){const s=n.current;let f;const h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{const d=Math.max(s.offsetHeight,e);a.style.setProperty("--opencx-widget-height",`${d.toFixed(1)}px`)})});return h.observe(s),()=>{cancelAnimationFrame(f),h.unobserve(s)}}},[e]),{observedElementRef:n}}const LI=jm.Provider,II=jm.Root,MI=jm.Trigger,nA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(jm.Content,{ref:s,sideOffset:n,className:St("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));nA.displayName=jm.Content.displayName;function k1({children:e,content:n,side:a,align:s}){return n?I.jsxs(II,{children:[I.jsx(MI,{asChild:!0,children:e}),I.jsx(nA,{side:a,align:s,collisionPadding:8,avoidCollisions:!0,children:n})]}):e}const PI={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},FI={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},UI={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},BI={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},HI={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},zI={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},rA={en:UI,ar:PI,nl:HI,fr:BI,de:FI,pt:zI},jI=Object.keys(rA),VI=e=>jI.includes(e);function YI(e,n){const a=rA[n];return a&&a[e]||""}function Jf(){const{widgetCtx:{config:e}}=ft.useWidget();return Tt.useMemo(()=>{const a=VI(e.language)?e.language:"en";return{get:s=>YI(s,a),lang:a}},[e.language])}const WI=10,qI=(e,n)=>({initial:{opacity:0,x:-e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:e,...n.exit}}),QI=(e,n)=>({initial:{opacity:0,x:e,...n.initial},animate:{opacity:1,x:0,...n.animate},exit:{opacity:0,x:-e,...n.exit}}),GI=(e,n)=>({initial:{opacity:0,y:e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:-e,...n.exit}}),$I=(e,n)=>({initial:{opacity:0,y:-e,...n.initial},animate:{opacity:1,y:0,...n.animate},exit:{opacity:0,y:e,...n.exit}}),XI={right:qI,left:QI,up:GI,down:$I},Sn=Tt.forwardRef(({fadeIn:e="down",distance:n=WI,children:a,snapExit:s=!1,overrides:f={},...h},d)=>{const g=e?XI[e](n,f):{};return s&&g.exit&&typeof g.exit=="object"&&!Array.isArray(g.exit)&&(g.exit.transition={duration:0}),I.jsx(vr.motion.div,{ref:d,...h,...g,children:a})});Sn.displayName="MotionDiv";const r_=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,a_=Qk.clsx,KI=(e,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return a_(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:h}=n,d=Object.keys(f).map(b=>{const C=a==null?void 0:a[b],S=h==null?void 0:h[b];if(C===null)return null;const R=r_(C)||r_(S);return f[b][R]}),g=a&&Object.entries(a).reduce((b,C)=>{let[S,R]=C;return R===void 0||(b[S]=R),b},{}),E=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((b,C)=>{let{class:S,className:R,...k}=C;return Object.entries(k).every(D=>{let[L,B]=D;return Array.isArray(B)?B.includes({...h,...g}[L]):{...h,...g}[L]===B})?[...b,S,R]:b},[]);return a_(e,d,E,a==null?void 0:a.class,a==null?void 0:a.className)},i_={x:2,y:2},JI={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},el=Tt.memo(Tt.forwardRef(({children:e,className:n,scale:a="1.02",off:s=!1},f)=>{const[h,d]=Tt.useState(!1),[g,E]=Tt.useState({x:0,y:0});if(s||/translate/.test(e.props.className||""))return e;const C=D=>{var we,Me;const{clientX:L,clientY:B}=D,H=D.currentTarget.getBoundingClientRect(),$=L-(H.left+H.width/2),W=B-(H.top+H.height/2),J=Math.max(-1,Math.min(1,$/(H.width/2))),Z=Math.max(-1,Math.min(1,W/(H.height/2))),X=J*i_.x,te=Z*i_.y;E({x:X,y:te}),(Me=(we=e.props).onMouseMove)==null||Me.call(we,D)},S=()=>{var D,L;d(!0),(L=(D=e.props).onMouseEnter)==null||L.call(D)},R=()=>{var D,L;d(!1),E({x:0,y:0}),(L=(D=e.props).onMouseLeave)==null||L.call(D)},k={"--opencx-wobble-x":h?`${g.x}px`:"0px","--opencx-wobble-y":h?`${g.y}px`:"0px"};return Tt.cloneElement(e,{ref:f,onMouseMove:C,onMouseEnter:S,onMouseLeave:R,style:{...k,...e.props.style},className:St("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${JI[a]}`,n,e.props.className,"transition-all ease-out")})}));el.displayName="Wobble";const ZI=KI(St("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),si=ie.forwardRef(({className:e,variant:n,size:a,asChild:s=!1,...f},h)=>{const d=s?Uw.Slot:"button";return I.jsx(el,{ref:h,children:I.jsx(d,{className:St(ZI({variant:n,size:a,className:e})),...f})})});si.displayName="Button";const B1=()=>{const[e,n]=Tt.useState("ltr");return Tt.useEffect(()=>{const a=()=>{typeof document>"u"||n(window.getComputedStyle(document.body).direction)};a();const s=new MutationObserver(a);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),s.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",a),()=>{s.disconnect(),window.removeEventListener("languagechange",a)}},[]),e};function e5(){const{sendMessage:e}=ft.useMessages(),n=Jf(),a=[n.get("i-need-more-help"),n.get("this-was-helpful")],s=f=>{const h=f.trim();h&&e({content:h})};return I.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:a.map(f=>I.jsx(si,{onClick:()=>s(f),className:"flex-1 rounded-full",size:"sm",children:f},f))})}function t5({file:{status:e,file:n,error:a},onCancel:s}){const[f,h]=Tt.useState(null);Tt.useEffect(()=>{if(!n.type.startsWith("image/"))return;const E=new FileReader;return E.onload=()=>h(E.result),E.onerror=()=>console.error("Error reading file"),E.readAsDataURL(n),()=>E.abort()},[n]);const d=()=>{switch(e){case"uploading":return I.jsx(Wn.Loader2,{className:"size-4 animate-spin"});case"error":return I.jsx(Wn.AlertCircle,{className:"size-4 text-destructive"});default:return null}},g=()=>{const E=n.type.split("/")[0];return E==="image"&&f?I.jsx("img",{src:typeof f=="string"?f:"",className:"object-cover bg-secondary size-full",alt:n.name}):E==="audio"?I.jsx(Wn.FileAudio2Icon,{}):E==="video"?I.jsx(Wn.FileVideo2Icon,{}):I.jsx(Wn.FileIcon,{})};return I.jsx(k1,{side:"bottom",content:e==="error"?I.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",a]}):n.name,children:I.jsxs("div",{className:St(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[I.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d()}),I.jsx("button",{type:"button",className:St("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:s,children:I.jsx(Wn.XIcon,{className:"size-4 text-primary-foreground"})}),I.jsx(g,{})]})})}const o_=St("rounded-3xl");function n5(){var X;const e=Tt.useRef(null),{sendMessage:n}=ft.useMessages(),{sessionState:a}=ft.useSessions(),s=Jf(),f=B1(),[h,d]=Tt.useState(""),{allFiles:g,emptyTheFiles:E,handleCancelUpload:b,appendFiles:C,isUploading:S,successFiles:R}=ft.useUploadFiles(),k=!!((X=a.session)!=null&&X.isHandedOff),{isAwaitingBotReply:D}=ft.useIsAwaitingBotReply(),L=te=>{k&&C(te)},B=!h.trim()&&R.length===0,H=async()=>{if(D||B)return;if(S){const we="please wait for the file(s) to upload";e_.error(we),console.info(we)}const te=h.trim();n({content:te,attachments:R.flatMap(we=>we.fileUrl?[{url:we.fileUrl,type:we.file.type,name:we.file.name,id:we.id,size:we.file.size}]:[])}),d(""),E()},{getRootProps:$,getInputProps:W,open:J}=G4.useDropzone({onDrop:L,noClick:!0,onDropRejected(){if(k){const te="unsupported file type, or the file is too large";e_.error(te),console.error(te)}},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),Z=te=>{const we=te.clipboardData;we&&we.files.length>0&&L(Array.from(we.files))};return I.jsxs("div",{className:"p-2 relative space-y-1",...$(),children:[I.jsx("input",{...W()}),I.jsxs("div",{className:St(o_,"relative space-y-2 border transition-all shadow py-2"),children:[I.jsx("div",{className:"flex items-center gap-1 px-2",children:I.jsx(vr.AnimatePresence,{mode:"popLayout",children:g.map(te=>I.jsx(Sn,{snapExit:!0,children:I.jsx(t5,{onCancel:()=>b(te.id),file:te})},te.id))})}),I.jsx("textarea",{onPaste:Z,ref:e,id:"chat-input",dir:f,value:h,rows:3,className:St(o_,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:te=>d(te.target.value),onKeyDown:async te=>{te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),H())},placeholder:s.get("write-a-message")}),I.jsxs("div",{dir:f,className:"px-2 flex justify-between rtl:text-right",children:[I.jsx(k1,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:I.jsx(si,{onClick:()=>{k&&J()},size:"fit",variant:"outline",className:St("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!k,children:I.jsx(Wn.PaperclipIcon,{className:"size-4"})})}),I.jsx(k1,{content:"send message",side:"top",align:"end",children:I.jsx(si,{size:"fit",onClick:H,disabled:D||S||B,className:"rounded-full size-8 flex items-center justify-center p-0",children:I.jsx(vr.AnimatePresence,{mode:"wait",children:D||S?I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):I.jsx(Sn,{snapExit:!0,children:I.jsx(Wn.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function r5(){const{widgetCtx:e}=ft.useWidget(),n=Jf();return I.jsx("div",{className:"p-2",children:I.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[I.jsxs("div",{className:"flex items-center gap-1",children:[I.jsx(Wn.CheckCheckIcon,{className:"size-4 text-emerald-500"}),I.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:n.get("session-closed-lead")})]}),I.jsx("div",{children:I.jsx(si,{onClick:e.resetChat,className:"rounded-2xl w-full",children:n.get("new-conversation")})})]})})}function a5(){var d,g,E;const{sessionState:e}=ft.useSessions(),{messagesState:n,sendMessage:a}=ft.useMessages(),f=(g=(d=ft.usePreludeData().data)==null?void 0:d.data)==null?void 0:g.initialQuestions,h=n.messages.length===0;return I.jsx("footer",{children:I.jsx("div",{children:I.jsx(vr.AnimatePresence,{mode:"wait",children:e.session&&!((E=e.session)!=null&&E.isOpened)?I.jsx(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:I.jsx(r5,{})},"session-closed"):I.jsxs(Sn,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&I.jsx(e5,{}),h&&f&&I.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:f==null?void 0:f.map(b=>I.jsx(si,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{a({content:b})},children:b},b))}),I.jsx(n5,{})]},"chat-input")})})})}const i5=Qn.Root,o5=Qn.Trigger,u5=Qn.Group,s5=ie.forwardRef(({className:e,inset:n,children:a,...s},f)=>I.jsxs(Qn.SubTrigger,{ref:f,className:St("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...s,children:[a,I.jsx(Wn.ChevronRight,{className:"ml-auto"})]}));s5.displayName=Qn.SubTrigger.displayName;const l5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.SubContent,{ref:a,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));l5.displayName=Qn.SubContent.displayName;const aA=ie.forwardRef(({className:e,sideOffset:n=4,...a},s)=>I.jsx(Qn.Content,{ref:s,sideOffset:n,className:St("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));aA.displayName=Qn.Content.displayName;const iA=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Sn,{children:I.jsx(Qn.Item,{ref:s,className:St("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...a})}));iA.displayName=Qn.Item.displayName;const c5=ie.forwardRef(({className:e,children:n,checked:a,...s},f)=>I.jsxs(Qn.CheckboxItem,{ref:f,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Check,{className:"h-4 w-4"})})}),n]}));c5.displayName=Qn.CheckboxItem.displayName;const d5=ie.forwardRef(({className:e,children:n,...a},s)=>I.jsxs(Qn.RadioItem,{ref:s,className:St("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[I.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:I.jsx(Qn.ItemIndicator,{children:I.jsx(Wn.Circle,{className:"h-2 w-2 fill-current"})})}),n]}));d5.displayName=Qn.RadioItem.displayName;const f5=ie.forwardRef(({className:e,inset:n,...a},s)=>I.jsx(Qn.Label,{ref:s,className:St("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));f5.displayName=Qn.Label.displayName;const p5=ie.forwardRef(({className:e,...n},a)=>I.jsx(Qn.Separator,{ref:a,className:St("-mx-1 my-1 h-px bg-muted",e),...n}));p5.displayName=Qn.Separator.displayName;function oA({className:e,...n}){return I.jsx("div",{className:St("animate-pulse rounded-md bg-secondary",e),...n})}function h5(){const e=Jf(),[n,a]=Tt.useState(!1),{toChatScreen:s}=ft.useWidgetRouter();return I.jsxs(i5,{open:n,onOpenChange:a,children:[I.jsx(o5,{asChild:!0,children:I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",children:I.jsx(Wn.EllipsisVerticalIcon,{className:"size-4"})})}),I.jsx(aA,{align:"end",className:"min-w-56",children:I.jsx(u5,{children:I.jsxs(iA,{onSelect:()=>{a(!1),s()},children:[I.jsx(vr.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:I.jsx(Wn.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function uA(){var h,d;const{routerState:{screen:e},toSessionsScreen:n}=ft.useWidgetRouter(),{data:a,isLoading:s}=ft.usePreludeData(),f=B1();return I.jsx("header",{className:"p-2 border-b bg-background",children:I.jsxs("div",{dir:f,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&I.jsx(si,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:I.jsx(Wn.ChevronLeftIcon,{className:"size-4"})}),I.jsx("div",{className:St("flex-1",e==="sessions"&&"pl-2"),children:I.jsx(vr.AnimatePresence,{mode:"wait",children:s||!((h=a==null?void 0:a.data)!=null&&h.organizationName)?I.jsx(Sn,{snapExit:!0,children:I.jsx(oA,{className:"h-5 w-1/2"})},"skeleton"):I.jsx(Sn,{children:I.jsx("h2",{className:"font-semibold",children:(d=a==null?void 0:a.data)==null?void 0:d.organizationName})},"organization-name")})}),I.jsx(h5,{})]})})}function m5(e){const n=[];let a=null;return e.forEach(s=>{var f,h,d,g;(!a||((f=a[0])==null?void 0:f.type)!==s.type)&&(a=[],n.push(a)),((h=a[0])==null?void 0:h.type)==="FROM_AGENT"&&s.type==="FROM_AGENT"&&((d=s.agent)==null?void 0:d.id)!==((g=a[0].agent)==null?void 0:g.id)&&(a=[],n.push(a)),a.push(s)}),n}function g5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_USER"}function v5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_BOT"}function y5(e){var n;return((n=e==null?void 0:e[0])==null?void 0:n.type)==="FROM_AGENT"}function u_(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,f=a.indexOf(n);for(;f!==-1;)s++,f=a.indexOf(n,f+n.length);return s}const ba=sl(/[A-Za-z]/),ra=sl(/[\dA-Za-z]/),E5=sl(/[#-'*+\--9=?A-Z^-~]/);function A1(e){return e!==null&&(e<32||e===127)}const hw=sl(/\d/),b5=sl(/[\dA-Fa-f]/),x5=sl(/[!-/:-@[-`{-~]/);function ut(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const H1=sl(new RegExp("\\p{P}|\\p{S}","u")),Rc=sl(/\s/);function sl(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function w5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const z1=function(e){if(e==null)return _5;if(typeof e=="function")return j1(e);if(typeof e=="object")return Array.isArray(e)?T5(e):S5(e);if(typeof e=="string")return C5(e);throw new Error("Expected function, string, or object as test")};function T5(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=z1(e[a]);return j1(s);function s(...f){let h=-1;for(;++h<n.length;)if(n[h].apply(this,f))return!0;return!1}}function S5(e){const n=e;return j1(a);function a(s){const f=s;let h;for(h in e)if(f[h]!==n[h])return!1;return!0}}function C5(e){return j1(n);function n(a){return a&&a.type===e}}function j1(e){return n;function n(a,s,f){return!!(k5(a)&&e.call(this,a,typeof s=="number"?s:void 0,f||void 0))}}function _5(){return!0}function k5(e){return e!==null&&typeof e=="object"&&"type"in e}const sA=[],A5=!0,mw=!1,R5="skip";function lA(e,n,a,s){let f;typeof n=="function"&&typeof a!="function"?(s=a,a=n):f=n;const h=z1(f),d=s?-1:1;g(e,void 0,[])();function g(E,b,C){const S=E&&typeof E=="object"?E:{};if(typeof S.type=="string"){const k=typeof S.tagName=="string"?S.tagName:typeof S.name=="string"?S.name:void 0;Object.defineProperty(R,"name",{value:"node ("+(E.type+(k?"<"+k+">":""))+")"})}return R;function R(){let k=sA,D,L,B;if((!n||h(E,b,C[C.length-1]||void 0))&&(k=N5(a(E,C)),k[0]===mw))return k;if("children"in E&&E.children){const H=E;if(H.children&&k[0]!==R5)for(L=(s?H.children.length:-1)+d,B=C.concat(H);L>-1&&L<H.children.length;){const $=H.children[L];if(D=g($,L,B)(),D[0]===mw)return D;L=typeof D[1]=="number"?D[1]:L+d}}return k}}}function N5(e){return Array.isArray(e)?e:typeof e=="number"?[A5,e]:e==null?sA:[e]}function D5(e,n,a){const f=z1((a||{}).ignore||[]),h=O5(n);let d=-1;for(;++d<h.length;)lA(e,"text",g);function g(b,C){let S=-1,R;for(;++S<C.length;){const k=C[S],D=R?R.children:void 0;if(f(k,D?D.indexOf(k):void 0,R))return;R=k}if(R)return E(b,C)}function E(b,C){const S=C[C.length-1],R=h[d][0],k=h[d][1];let D=0;const B=S.children.indexOf(b);let H=!1,$=[];R.lastIndex=0;let W=R.exec(b.value);for(;W;){const J=W.index,Z={index:W.index,input:W.input,stack:[...C,b]};let X=k(...W,Z);if(typeof X=="string"&&(X=X.length>0?{type:"text",value:X}:void 0),X===!1?R.lastIndex=J+1:(D!==J&&$.push({type:"text",value:b.value.slice(D,J)}),Array.isArray(X)?$.push(...X):X&&$.push(X),D=J+W[0].length,H=!0),!R.global)break;W=R.exec(b.value)}return H?(D<b.value.length&&$.push({type:"text",value:b.value.slice(D)}),S.children.splice(B,1,...$)):$=[b],B+$.length}}function O5(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const f=a[s];n.push([L5(f[0]),I5(f[1])])}return n}function L5(e){return typeof e=="string"?new RegExp(w5(e),"g"):e}function I5(e){return typeof e=="function"?e:function(){return e}}const Ux="phrasing",Bx=["autolink","link","image","label"];function M5(){return{transforms:[j5],enter:{literalAutolink:F5,literalAutolinkEmail:Hx,literalAutolinkHttp:Hx,literalAutolinkWww:Hx},exit:{literalAutolink:z5,literalAutolinkEmail:H5,literalAutolinkHttp:U5,literalAutolinkWww:B5}}}function P5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ux,notInConstruct:Bx},{character:":",before:"[ps]",after:"\\/",inConstruct:Ux,notInConstruct:Bx}]}}function F5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hx(e){this.config.enter.autolinkProtocol.call(this,e)}function U5(e){this.config.exit.autolinkProtocol.call(this,e)}function B5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function H5(e){this.config.exit.autolinkEmail.call(this,e)}function z5(e){this.exit(e)}function j5(e){D5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,V5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Y5]],{ignore:["link","linkReference"]})}function V5(e,n,a,s,f){let h="";if(!cA(f)||(/^w/i.test(n)&&(a=n+a,n="",h="http://"),!W5(a)))return!1;const d=q5(a+s);if(!d[0])return!1;const g={type:"link",title:null,url:h+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[g,{type:"text",value:d[1]}]:g}function Y5(e,n,a,s){return!cA(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function W5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function q5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],s=a.indexOf(")");const f=u_(e,"(");let h=u_(e,")");for(;s!==-1&&f>h;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),h++;return[e,a]}function cA(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Rc(a)||H1(a))&&(!n||a!==47)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}dA.peek=rM;function Q5(){return{enter:{gfmFootnoteDefinition:$5,gfmFootnoteDefinitionLabelString:X5,gfmFootnoteCall:Z5,gfmFootnoteCallString:eM},exit:{gfmFootnoteDefinition:J5,gfmFootnoteDefinitionLabelString:K5,gfmFootnoteCall:nM,gfmFootnoteCallString:tM}}}function G5(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:aM,footnoteReference:dA}}}function $5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function X5(){this.buffer()}function K5(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function J5(e){this.exit(e)}function Z5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eM(){this.buffer()}function tM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.label=n,a.identifier=uo(this.sliceSerialize(e)).toLowerCase()}function nM(e){this.exit(e)}function dA(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteReference"),g=a.enter("reference");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),d(),h+=f.move("]"),h}function rM(){return"["}function aM(e,n,a,s){const f=a.createTracker(s);let h=f.move("[^");const d=a.enter("footnoteDefinition"),g=a.enter("label");return h+=f.move(a.safe(a.associationId(e),{...f.current(),before:h,after:"]"})),g(),h+=f.move("]:"+(e.children&&e.children.length>0?" ":"")),f.shift(4),h+=f.move(a.indentLines(a.containerFlow(e,f.current()),iM)),d(),h}function iM(e,n,a){return n===0?e:(a?"":" ")+e}const oM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fA.peek=dM;function uM(){return{canContainEols:["delete"],enter:{strikethrough:lM},exit:{strikethrough:cM}}}function sM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oM}],handlers:{delete:fA}}}function lM(e){this.enter({type:"delete",children:[]},e)}function cM(e){this.exit(e)}function fA(e,n,a,s){const f=a.createTracker(s),h=a.enter("strikethrough");let d=f.move("~~");return d+=a.containerPhrasing(e,{...f.current(),before:d,after:"~"}),d+=f.move("~~"),h(),d}function dM(){return"~"}function fM(e,n={}){const a=(n.align||[]).concat(),s=n.stringLength||hM,f=[],h=[],d=[],g=[];let E=0,b=-1;for(;++b<e.length;){const D=[],L=[];let B=-1;for(e[b].length>E&&(E=e[b].length);++B<e[b].length;){const H=pM(e[b][B]);if(n.alignDelimiters!==!1){const $=s(H);L[B]=$,(g[B]===void 0||$>g[B])&&(g[B]=$)}D.push(H)}h[b]=D,d[b]=L}let C=-1;if(typeof a=="object"&&"length"in a)for(;++C<E;)f[C]=s_(a[C]);else{const D=s_(a);for(;++C<E;)f[C]=D}C=-1;const S=[],R=[];for(;++C<E;){const D=f[C];let L="",B="";D===99?(L=":",B=":"):D===108?L=":":D===114&&(B=":");let H=n.alignDelimiters===!1?1:Math.max(1,g[C]-L.length-B.length);const $=L+"-".repeat(H)+B;n.alignDelimiters!==!1&&(H=L.length+H+B.length,H>g[C]&&(g[C]=H),R[C]=H),S[C]=$}h.splice(1,0,S),d.splice(1,0,R),b=-1;const k=[];for(;++b<h.length;){const D=h[b],L=d[b];C=-1;const B=[];for(;++C<E;){const H=D[C]||"";let $="",W="";if(n.alignDelimiters!==!1){const J=g[C]-(L[C]||0),Z=f[C];Z===114?$=" ".repeat(J):Z===99?J%2?($=" ".repeat(J/2+.5),W=" ".repeat(J/2-.5)):($=" ".repeat(J/2),W=$):W=" ".repeat(J)}n.delimiterStart!==!1&&!C&&B.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&H==="")&&(n.delimiterStart!==!1||C)&&B.push(" "),n.alignDelimiters!==!1&&B.push($),B.push(H),n.alignDelimiters!==!1&&B.push(W),n.padding!==!1&&B.push(" "),(n.delimiterEnd!==!1||C!==E-1)&&B.push("|")}k.push(n.delimiterEnd===!1?B.join("").replace(/ +$/,""):B.join(""))}return k.join(`
|
|
2
2
|
`)}function pM(e){return e==null?"":String(e)}function hM(e){return e.length}function s_(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const l_={}.hasOwnProperty;function pA(e,n){const a=n||{};function s(f,...h){let d=s.invalid;const g=s.handlers;if(f&&l_.call(f,e)){const E=String(f[e]);d=l_.call(g,E)?g[E]:s.unknown}if(d)return d.call(this,f,...h)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}function mM(e,n,a,s){const f=a.enter("blockquote"),h=a.createTracker(s);h.move("> "),h.shift(2);const d=a.indentLines(a.containerFlow(e,h.current()),gM);return f(),d}function gM(e,n,a){return">"+(a?"":" ")+e}function vM(e,n){return c_(e,n.inConstruct,!0)&&!c_(e,n.notInConstruct,!1)}function c_(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function d_(e,n,a,s){let f=-1;for(;++f<a.unsafe.length;)if(a.unsafe[f].character===`
|
|
3
3
|
`&&vM(a.stack,a.unsafe[f]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
4
4
|
`}function yM(e,n){const a=String(e);let s=a.indexOf(n),f=s,h=0,d=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===f?++h>d&&(d=h):h=1,f=s+n.length,s=a.indexOf(n,f);return d}function EM(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bM(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function xM(e,n,a,s){const f=bM(a),h=e.value||"",d=f==="`"?"GraveAccent":"Tilde";if(EM(e,a)){const S=a.enter("codeIndented"),R=a.indentLines(h,wM);return S(),R}const g=a.createTracker(s),E=f.repeat(Math.max(yM(h,f)+1,3)),b=a.enter("codeFenced");let C=g.move(E);if(e.lang){const S=a.enter(`codeFencedLang${d}`);C+=g.move(a.safe(e.lang,{before:C,after:" ",encode:["`"],...g.current()})),S()}if(e.lang&&e.meta){const S=a.enter(`codeFencedMeta${d}`);C+=g.move(" "),C+=g.move(a.safe(e.meta,{before:C,after:`
|
package/dist/designs.js
CHANGED
|
@@ -7,7 +7,7 @@ import { clsx as oA } from "clsx";
|
|
|
7
7
|
import { PaperclipIcon as mI, CircleDashed as gI, SendHorizonal as vI, CheckCheckIcon as yI, XIcon as uA, AlertCircle as EI, Loader2 as bI, FileAudio2Icon as wI, FileVideo2Icon as xI, FileIcon as TI, ChevronRight as SI, Check as CI, Circle as _I, ChevronLeftIcon as kI, EllipsisVerticalIcon as AI, MessageCirclePlusIcon as RI, X as NI, LoaderIcon as DI, SendHorizontal as OI, ChevronRightIcon as LI } from "lucide-react";
|
|
8
8
|
import { useDropzone as II } from "react-dropzone";
|
|
9
9
|
import d_ from "react-hot-toast";
|
|
10
|
-
import { u as Qm, d as qm, g as Q1, e as q1, i as MI, c as sA, h as $m, j as f_, k as PI, a as Jf, b as FI, _ as UI, l as Zs, m as lA, n as BI, W as HI } from "./useUploadFiles-
|
|
10
|
+
import { u as Qm, d as qm, g as Q1, e as q1, i as MI, c as sA, h as $m, j as f_, k as PI, a as Jf, b as FI, _ as UI, l as Zs, m as lA, n as BI, W as HI } from "./useUploadFiles-Ddo3_Bdb.js";
|
|
11
11
|
import * as Gm from "@radix-ui/react-tooltip";
|
|
12
12
|
import { Slot as Gx } from "@radix-ui/react-slot";
|
|
13
13
|
import * as Wn from "@radix-ui/react-dropdown-menu";
|
package/dist/react.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-DezH_NSW.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>i.vote({action:o==="up"?"upvote":"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useVote=a;
|
|
2
2
|
//# sourceMappingURL=react.cjs.map
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as o, _ as i } from "./useUploadFiles-
|
|
2
|
-
import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-
|
|
1
|
+
import { u as o, _ as i } from "./useUploadFiles-Ddo3_Bdb.js";
|
|
2
|
+
import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-Ddo3_Bdb.js";
|
|
3
3
|
function n(e, s, t) {
|
|
4
4
|
const {
|
|
5
5
|
widgetCtx: { api: a }
|
|
@@ -36,7 +36,7 @@ function Zt(e) {
|
|
|
36
36
|
return r;
|
|
37
37
|
}, t.Provider];
|
|
38
38
|
}
|
|
39
|
-
const en = "3.0.
|
|
39
|
+
const en = "3.0.53", [Y, tn] = Zt();
|
|
40
40
|
function Xn({
|
|
41
41
|
options: e,
|
|
42
42
|
children: t,
|
|
@@ -1333,4 +1333,4 @@ export {
|
|
|
1333
1333
|
Dt as n,
|
|
1334
1334
|
Y as u
|
|
1335
1335
|
};
|
|
1336
|
-
//# sourceMappingURL=useUploadFiles-
|
|
1336
|
+
//# sourceMappingURL=useUploadFiles-Ddo3_Bdb.js.map
|