import{j as t,r as S}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab.js";import{ac as Le,n as X,F as ve,ae as he,aT as Pe,m as Te,ah as ze,af as be}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab23.js";import{u as K,a as Be,b as k}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab90.js";import{u as T,d as _e}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab20.js";import{u as re}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab34.js";import{ax as Z,s as J,av as G,bA as V,bB as $e,bC as He,bD as Qe,_ as ye,bE as Ue,I as Se,bF as qe,bG as We,au as ie,Q as se,bl as Xe}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab11.js";import{a as Ke,g as Ge,e as Ve,i as le,m as Ye,b as Ze,c as Je,d as et,f as z,h as tt,j as nt,k as je}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab191.js";import{r as ee,g as rt,m as te,o as at,c as ae,d as Ee,e as q,a as ot,b as Ce,s as we,f as ce}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab192.js";import{_ as D,f as it,r as st}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab6.js";import{i as w}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab10.js";import{d as lt}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab5.js";import{u as ct}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab126.js";import{a as dt}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab154.js";import{o as ut}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab35.js";import{a as pt}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab106.js";import{u as ft}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab47.js";function gt(){const{setActiveRender:e,setActiveCreateOrEdit:r}=K(),{variaveisWA:n}=Le(),{close:u}=X(),{createScript:o}=Be(),{language:g}=T();return t.jsx("div",{style:{position:"initial"},children:t.jsx("ul",{className:"overflow-hidden flex "+n.modalOptions.content2,children:t.jsx("div",{className:n.modalOptions.content3,children:t.jsxs("div",{className:n.listagem.content1,children:[t.jsx(Z,{content:g.respostaRapida,icon:t.jsx(J,{size:20,className:"text-[var(--icon)]"}),setFunction:()=>{u(),r({type:"create",model:"respostaRapida"})},stroke:"1"}),t.jsx(Z,{content:"Script",icon:t.jsx(G,{type:"script"}),setFunction:()=>{u(),o()},stroke:"1"}),t.jsx("div",{className:"xjm9jq1 xfw0ycb x7r5mf7 x12nagc"}),t.jsx(Z,{content:g.category,icon:t.jsx(V,{className:"w-5 h-5 text-[var(--panel-header-icon)]"}),setFunction:()=>{u(),e("categoria")},stroke:"1"})]})})})})}const de="flex gap-1 cursor-pointer items-center h-9 py-2 rounded-lg hover:bg-[var(--dropdown-background-hover)] px-2";function ue({model:e}){const{categories:r}=re(),{setFilter:n}=k(),{close:u}=X(),{language:o}=T(),d=["txt","image","video","audio","doc","contact","script","automation","pix","groupInvite","linkPreview","sticker"].map((s,m)=>t.jsxs("div",{className:de,onClick:()=>{u(),n("model",{id:"type",parm:s})},children:[t.jsx(G,{type:s}),t.jsx("span",{className:"truncate max-w-80",children:o[s]})]},m)),p=r.map((s,m)=>t.jsxs("div",{className:de,onClick:()=>{u(),n("model",{id:"cat",parm:s.id})},children:[t.jsx(V,{size:20,style:{color:s.hexColor}}),t.jsx("span",{className:"truncate max-w-80",children:s.name})]},m));return t.jsxs("div",{className:"px-2 min-w-60 overflow-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[t.jsx("div",{className:"truncate max-w-80 font-bold text-lg first-letter:uppercase",children:e==="cat"?"Selecione uma Categoria":"Selecione um tipo"}),t.jsx("hr",{}),t.jsx("div",{className:"flex flex-col gap-1 mt-[2px]",children:e==="cat"?p:d})]})}function mt(){const{categories:e}=re(),{language:r}=T(),{open:n}=X(),{filter:u,setFilter:o}=k(),g=[{id:"all",name:r.tab_all,action:()=>o("model",{id:"all"})},{id:"type",name:r.filterQuickReplyPerType,action:i=>n(t.jsx(ue,{model:"type"}),{placement:"left-end"},i.target)},{id:"not_cat",name:r.filterQuickReplyNotPerCategorie,action:()=>o("model",{id:"not_cat"})},{id:"cat",name:r.filterQuickReplyPerCategorie,action:i=>n(t.jsx(ue,{model:"cat"}),{placement:"left-end"},i.target)},{id:"most_used",name:r.filterQuickReplyMostUsed,action:()=>o("model",{id:"most_used"})}],d=t.jsxs("div",{className:"flex justify-center gap-2",children:[t.jsx($e,{value:u.search,setValue:i=>o("search",i),placeholder:r.searchQuickReply}),t.jsx("span",{className:"cursor-pointer pulse lg:tooltip lg:tooltip-left","data-tip":r.createQuickReply,onClick:i=>n(t.jsx(gt,{}),{placement:"bottom-end"},i.target,5),children:t.jsx(He,{className:"!w-[30px] !h-[30px] text-[var(--primaria)]"})})]}),p=t.jsx("div",{className:"flex gap-1 flex-wrap",children:g.map(i=>t.jsxs("div",{className:`flex gap-1 badge border border-[var(--secundaria)] border-solid  font-medium rounded-lg shadow-lg text-nowrap pulse cursor-pointer 
                            ${u.model.id===i.id?"bg-label-gradient text-[var(--letra)]":"text-[var(--primaria)]"}`,onClick:s=>i.action(s),children:[i.id==="type"&&u.model.id===i.id&&t.jsx(G,{type:u.model.parm,style:"w-4 h-4 text-[var(--letra)]"}),i.id==="cat"&&u.model.id===i.id&&t.jsx(V,{size:18,color:e.find(s=>s.id===u.model.parm)?.hexColor}),t.jsx("span",{children:i.name}),(i.id==="type"||i.id==="cat")&&t.jsx("span",{children:t.jsx(Qe,{size:15})})]}))});return t.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[d,p]})}function xt(e){var r=e.list,n=e.startIndex,u=e.closestEdgeOfTarget,o=e.indexOfTarget,g=e.axis;return ee({list:r,startIndex:n,finishIndex:rt({closestEdgeOfTarget:u,startIndex:n,indexOfTarget:o,axis:g})})}function B(e){var r=e.axis,n=e.side;return function(o){var g,d,p=o.clientRect,i=o.overflow,s=o.config,m=Ke[r],a=m.mainAxis,c=m.crossAxis,f=a[n],x=i[f],l=Ge[f]({clientRect:p,config:s}),h=DOMRect.fromRect((g={},D(g,a.point,l[a.point]),D(g,a.size,l[a.size]),D(g,c.point,l[c.point]-x[c.start]),D(g,c.size,l[c.size]+x[c.start]+x[c.end]),g)),b=DOMRect.fromRect((d={},D(d,a.point,n==="start"?p[a.point]-x[a.start]:p[a.end]),D(d,c.point,p[c.point]-x[c.start]),D(d,a.size,n==="start"?x[a.start]:x[a.end]),D(d,c.size,x[c.start]+p[c.size]+x[c.end]),d));return{insideOfEdge:h,outsideOfEdge:b}}}var vt={top:B({axis:"vertical",side:"start"}),right:B({axis:"horizontal",side:"end"}),bottom:B({axis:"vertical",side:"end"}),left:B({axis:"horizontal",side:"start"})};function _(e){return e.type==="inside-of-edge"}function $(e){var r,n,u,o;return{top:(r=e?.top)!==null&&r!==void 0?r:0,right:(n=e?.right)!==null&&n!==void 0?n:0,bottom:(u=e?.bottom)!==null&&u!==void 0?u:0,left:(o=e?.left)!==null&&o!==void 0?o:0}}function ht(e){return{top:$(e.fromTopEdge),right:$(e.fromRightEdge),bottom:$(e.fromBottomEdge),left:$(e.fromLeftEdge)}}function bt(e){var r=e.entry,n=e.timeSinceLastFrame,u=e.input,o=e.config,g=e.allowedAxis,d={x:u.clientX,y:u.clientY},p=r.element.getBoundingClientRect(),i=ht(r.getOverflow()),s=Ve.map(function(l){var h=vt[l]({clientRect:p,overflow:i,config:o}),b=h.insideOfEdge,y=h.outsideOfEdge;return le({client:d,clientRect:y})?{edge:l,hitbox:y,type:"outside-of-edge"}:le({client:d,clientRect:b})?{edge:l,hitbox:b,type:"inside-of-edge"}:!1}).filter(function(l){return!!l});if(!s.length)return null;var m=Ye(r.element),a=s.filter(function(l){return Ze(et[l.edge],g)&&Je[l.edge](r.element)});if(!a.length)return null;var c=new Map(a.map(function(l){return[l.edge,l]})),f=(function(){var l="horizontal",h=c.get("left");if(h)return z({client:d,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"left",axis:l,timeSinceLastFrame:n,engagement:m,config:o});var b=c.get("right");return b?z({client:d,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"right",axis:l,timeSinceLastFrame:n,engagement:m,config:o}):0})(),x=(function(){var l="vertical",h=c.get("bottom");if(h)return z({client:d,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"bottom",axis:l,timeSinceLastFrame:n,engagement:m,config:o});var b=c.get("top");return b?z({client:d,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"top",axis:l,timeSinceLastFrame:n,engagement:m,config:o}):0})();return{left:f,top:x}}function yt(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=St(e))||r){n&&(e=n);var u=0,o=function(){};return{s:o,n:function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}},e:function(s){throw s},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var g=!0,d=!1,p;return{s:function(){n=n.call(e)},n:function(){var s=n.next();return g=s.done,s},e:function(s){d=!0,p=s},f:function(){try{!g&&n.return!=null&&n.return()}finally{if(d)throw p}}}}function St(e,r){if(e){if(typeof e=="string")return pe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,r)}}function pe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,u=new Array(r);n<r;n++)u[n]=e[n];return u}function jt(e){var r=e.input,n=e.source,u=e.entries,o=e.timeSinceLastFrame,g=e.underUsersPointer,d=yt(u),p;try{for(d.s();!(p=d.n()).done;){var i,s,m,a=p.value;if(!a.element.contains(g)){var c={input:r,source:n,element:a.element};if(!(a.canScroll&&!a.canScroll(c))){var f=tt((i=a.getConfiguration)===null||i===void 0?void 0:i.call(a,c)),x=(s=(m=a.getAllowedAxis)===null||m===void 0?void 0:m.call(a,c))!==null&&s!==void 0?s:"all",l=bt({entry:a,input:r,timeSinceLastFrame:o,allowedAxis:x,config:f});l&&a.element.scrollBy(l)}}}}catch(h){d.e(h)}finally{d.f()}}function Et(e){var r=e.monitor,n=new Map;function u(g){return n.set(g.element,g),function(){return n.delete(g.element)}}function o(g){var d=g.latestArgs,p=g.underUsersPointer,i=g.timeSinceLastFrame;jt({input:d.location.current.input,source:d.source,entries:Array.from(n).map(function(s){var m=it(s,2);m[0];var a=m[1];return a}),underUsersPointer:p,timeSinceLastFrame:i})}return nt(r).onFrame(o),{unsafeOverflowAutoScroll:u}}var Ct=Et({monitor:te}),Oe=Ct.unsafeOverflowAutoScroll;function Re(e){var r=e.element,n=e.input;return function(o){var g=o.container,d=r.getBoundingClientRect(),p=g.getBoundingClientRect(),i=Math.min(n.clientX-d.x,p.width),s=Math.min(n.clientY-d.y,p.height);return{x:i,y:s}}}const wt=S.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab189.js")),[]));function Ot({card:e}){return t.jsx(S.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(wt,{card:e})})}const Rt=S.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab190.js")),[]));function At({card:e}){return t.jsx(S.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(Rt,{card:e})})}const Ae=at(function(){const{userAgent:r}=navigator;return r.includes("AppleWebKit")&&!r.includes("Chrome")}),kt=lt.div`
    -webkit-transform: perspective(1px) translateZ(0);
    transform: perspective(1px) translateZ(0);
    -webkit-transition-duration: 0.5s;
    transition-duration: 0.5s;
    -webkit-transition-property: color, background-color;
    transition-property: color, background-color;

    &:hover,
    &[activated] {
        background-color: ${e=>e.hexColor};
        border-radius: 4px;
    }
`;function W({dragging:e,hexColor:r}){return t.jsx("div",{className:"flex-shrink-0 skeleton rounded-md ",style:{height:e.height,backgroundColor:r+"40"}})}const fe=async(e,r)=>{e.stopPropagation();const{setUsedRespostaRapida:n}=K.getState(),{sendAction:u}=he.getState(),{setAcaoEnvioEmMassa:o}=ct.getState(),{setQuickReplyAction:g}=pt.getState(),d=!!document.querySelector('[data-id="eem-old"]'),p=!!document.querySelector('[data-id="eem-new"]');await ze("respostasRapidas")!==!0&&(n(r.id),d?o(r):p?g(r):u(r))};function ge({card:e,state:r,outerRef:n,innerRef:u,hexColor:o}){const{menuContent:g}=ve(),{open:d}=X(),{getAction:p}=he(),{setAcao:i}=Pe(),{open:s}=Te(),m=!!document.querySelector('[data-id="eem-old"], [data-id="eem-new"]'),a=f=>{f.stopPropagation(),close(),i(p(e.id)),s(t.jsx(At,{card:e}))},c=f=>{f.stopPropagation(),d(t.jsx(Ot,{card:e}),{placement:"left-end"},n.current,25,{mounted:()=>n.current?.parentNode?.setAttribute("activated",""),desmouted:()=>n.current?.parentNode?.removeAttribute("activated","")})};return t.jsx(kt,{hexColor:o+"70",children:t.jsxs("div",{ref:n,className:"flex flex-shrink-0 flex-col gap-2 ",onClick:f=>fe(f,e),children:[r.type==="is-over"&&r.closestEdge==="top"?t.jsx(W,{dragging:r.dragging,hexColor:o}):null,t.jsx("div",{className:"px-1 py-[5px] border-t border-solid",ref:u,style:{borderColor:`${o}60`,...r.type==="preview"&&{width:r.dragging.width,height:r.dragging.height,transform:Ae()?void 0:"rotate(4deg)",backgroundColor:`${o}60`,borderRadius:"4px"}},children:t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("div",{children:t.jsx(G,{type:e.type})}),t.jsx("div",{className:"truncate",style:{maxWidth:`calc(${g.width}px - 139px)`},children:e.titulo})]}),t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:c,children:t.jsx(Ue,{size:18})}),!m&&t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:a,children:t.jsx(ut,{size:20})}),t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:f=>fe(f,e),children:t.jsx(dt,{size:18})})]})]})}),r.type==="is-over"&&r.closestEdge==="bottom"?t.jsx(W,{dragging:r.dragging,hexColor:o}):null]})})}const ke=Symbol("card");function Dt({card:e,rect:r,columnId:n}){return{[ke]:!0,rect:r,card:e,columnId:n}}function A(e){return!!e[ke]}function I({source:e}){return!k.getState().activeFilter&&A(e.data)}const De=Symbol("card-drop-target");function Ne(e){return!!e[De]}function Nt({card:e,columnId:r}){return{[De]:!0,card:e,columnId:r}}const Fe=Symbol("column");function Ft({column:e}){return{[Fe]:!0,column:e}}function M(e){return!!e[Fe]}function U({source:e}){return!k.getState().activeFilter&&e.data.column?.id!=="not_cat"&&M(e.data)}function Ie(e,r){const n=Object.keys(e),u=Object.keys(r);return n.length!==u.length?!1:n.every(o=>Object.is(e[o],r[o]))}const H={type:"idle"};function It({card:e,columnId:r,hexColor:n}){const{activeFilter:u}=k(),{language:o}=T(),g=S.useRef(null),d=S.useRef(null),[p,i]=S.useState(H);return S.useEffect(()=>{const s=g.current,m=d.current;return w(s&&m),ae(Ce({element:m,getInitialData:({element:a})=>Dt({card:e,columnId:r,rect:a.getBoundingClientRect()}),onGenerateDragPreview({nativeSetDragImage:a,location:c,source:f}){const x=f.data;w(A(x)),we({nativeSetDragImage:a,getOffset:Re({element:m,input:c.current.input}),render({container:l}){i({type:"preview",container:l,dragging:m.getBoundingClientRect()})}})},onDragStart(){u&&Se({type:"Info",message:o.dragAndDropNotMoveInActiveFilter,position:"top-right"}),i({type:"is-dragging"})},onDrop(){i(H)}}),Ee({element:s,getIsSticky:()=>!0,canDrop:I,getData:({element:a,input:c})=>{const f=Nt({card:e,columnId:r});return ot(f,{element:a,input:c,allowedEdges:["top","bottom"]})},onDragEnter({source:a,self:c}){if(!A(a.data)||a.data.card.id===e.id)return;const f=q(c.data);f&&i({type:"is-over",dragging:a.data.rect,closestEdge:f})},onDrag({source:a,self:c}){if(!A(a.data)||a.data.card.id===e.id)return;const f=q(c.data);if(!f)return;const x={type:"is-over",dragging:a.data.rect,closestEdge:f};i(l=>Ie(x,l)?l:x)},onDragLeave({source:a}){if(A(a.data)){if(a.data.card.id===e.id){i({type:"is-dragging-and-left-self"});return}i(H)}},onDrop(){i(H)}}))},[e,r,u]),t.jsxs(t.Fragment,{children:[t.jsx(ge,{outerRef:g,innerRef:d,state:p,card:e,hexColor:n}),p.type==="preview"?st.createPortal(t.jsx(ge,{state:p,card:e,hexColor:n}),p.container):null]})}const ne="data-block-board-panning",Mt={isBoardMoreObvious:{type:"boolean",title:"Make board more obvious",description:"Add extra spacing and borders to the board scroll container to make it easier to see and play with"},isFPSPanelEnabled:{type:"boolean",title:"FPS Panel",description:"Display a panel with Frame Per Second (FPS) information"},isCPUBurnEnabled:{type:"boolean",title:"Drop FPS 🔥",description:"Start heavy process that will cause the frame rate on the page to drop"},isOverElementAutoScrollEnabled:{type:"boolean",title:"Over element auto scrolling",description:"Should elements automatically scroll when over them"},isOverflowScrollingEnabled:{type:"boolean",title:"Overflow scrolling",description:"Should overflow scrolling be enabled"},boardScrollSpeed:{type:"select",title:"Board auto scroll speed",description:"What should the max horizontal scroll speed the board be?",options:["fast","standard"]},columnScrollSpeed:{type:"select",title:"Column auto scroll speed",description:"What should the max vertical scroll speed for columns be?",options:["fast","standard"]}},Lt={isBoardMoreObvious:!1,isOverElementAutoScrollEnabled:!0,boardScrollSpeed:"fast",columnScrollSpeed:"standard",isFPSPanelEnabled:!1,isCPUBurnEnabled:!1,isOverflowScrollingEnabled:!0},Me=S.createContext({fields:Mt,settings:Lt,update:()=>{},reset:()=>{}}),Pt={idle:"","is-card-over":"","is-dragging":"","is-column-over":"skeleton"},Q={type:"idle"},me=S.memo(function({column:r}){return r.cards.map(n=>t.jsx(It,{card:n,columnId:r.id,hexColor:r.hexColor},n.id))});function Tt({column:e}){const{categoriaOpen:r,setCategoriaOpen:n}=K(),{menuContent:u}=ve(),{activeFilter:o}=k(),{language:g}=T(),d=S.useRef(null),p=S.useRef(null),i=S.useRef(null),s=S.useRef(null),{settings:m}=S.useContext(Me),[a,c]=S.useState(Q),f=!o&&r.includes(e.id);S.useEffect(()=>{const h=p.current,b=d.current,y=i.current,O=s.current;w(h),w(b),w(y),w(O);const L=Ft({column:e});function R({data:v,location:E}){const C=E.current.dropTargets[0],j=!!(C&&Ne(C.data)),P={type:"is-card-over",dragging:v.rect,isOverChildCard:j};c(N=>Ie(P,N)?N:P)}return ae(Ce({element:y,getInitialData:()=>L,onGenerateDragPreview({source:v,location:E,nativeSetDragImage:C}){const j=v.data;w(M(j)),we({nativeSetDragImage:C,getOffset:Re({element:y,input:E.current.input}),render({container:P}){const N=O.getBoundingClientRect(),F=O.cloneNode(!0);w(F instanceof HTMLElement),F.style.width=`${N.width}px`,F.style.height=`${N.height}px`,Ae()||(F.style.transform="rotate(4deg)"),P.appendChild(F)}})},onDragStart(){o&&Se({type:"Info",message:g.dragAndDropNotMoveInActiveFilter,position:"top-right"}),c({type:"is-dragging"})},onDrop(){c(Q)}}),Ee({element:h,getData:()=>L,canDrop({source:v}){return I({source:v})||U({source:v})},getIsSticky:()=>!0,onDragStart({source:v,location:E}){A(v.data)&&R({data:v.data,location:E})},onDragEnter({source:v,location:E}){if(A(v.data)){R({data:v.data,location:E});return}M(v.data)&&v.data.column.id!==e.id&&c({type:"is-column-over"})},onDropTargetChange({source:v,location:E}){if(A(v.data)){R({data:v.data,location:E});return}},onDragLeave({source:v}){M(v.data)&&v.data.column.id===e.id||c(Q)},onDrop(){c(Q)}}),je({canScroll({source:v}){return m.isOverElementAutoScrollEnabled?I({source:v}):!1},getConfiguration:()=>({maxScrollSpeed:m.columnScrollSpeed}),element:b}),Oe({element:b,getConfiguration:()=>({maxScrollSpeed:m.columnScrollSpeed}),canScroll({source:v}){return!m.isOverElementAutoScrollEnabled||!m.isOverflowScrollingEnabled?!1:I({source:v})},getOverflow(){return{forTopEdge:{top:1e3},forBottomEdge:{bottom:1e3}}}}))},[e,m]);const x=t.jsx("div",{ref:p,children:t.jsx("div",{ref:s,[ne]:!0,children:t.jsx("div",{className:`flex max-h-full flex-col ${a.type==="is-column-over"?"invisible":""}`,children:t.jsx("div",{ref:i,children:t.jsx("div",{className:`flex flex-col overflow-y-auto min-h-9 cursor-default
              ${!f&&e.cards.length!==0?"pb-2":""}  
            `,ref:d,children:t.jsxs(t.Fragment,{children:[t.jsx(me,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(W,{dragging:a.dragging,hexColor:e.hexColor})})]})})})})})}),l=t.jsx("div",{className:"flex w-full flex-shrink-0 select-none flex-col",ref:p,children:t.jsx("div",{className:`flex max-h-full flex-col rounded-lg border border-solid border-[var(--conversation-header-border)] ${Pt[a.type]}`,ref:s,style:!f||a.type==="is-column-over"?{backgroundColor:`${e.hexColor}30`,borderColor:`${e.hexColor}60`}:{},[ne]:!0,children:t.jsxs("div",{className:`flex max-h-full flex-col ${a.type==="is-column-over"?"invisible":""}`,children:[t.jsxs("div",{className:"flex flex-row items-center justify-between p-1 gap-1",ref:i,onClick:()=>n(e.id),children:[t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("div",{children:t.jsx(V,{size:20,style:{color:e.hexColor}})}),t.jsx("span",{className:"truncate font-semibold",style:{maxWidth:`calc(${u.width}px - 90px)`},children:e.name})]}),t.jsx("div",{children:t.jsx("span",{className:"text-[var(--icon)]",children:f?t.jsx(qe,{size:22,stroke:"0.3"}):t.jsx(We,{size:22,stroke:"0.3"})})})]}),t.jsx("div",{className:`flex flex-col overflow-y-auto px-1 ml-4 
              ${!f&&e.cards.length!==0?"pb-2":""}  
            `,ref:d,children:!f&&t.jsxs(t.Fragment,{children:[t.jsx(me,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(W,{dragging:a.dragging,hexColor:e.hexColor})})]})})]})})});return e.id==="not_cat"?x:l}function xe(){const{sortCategories:e,categories:r}=re(),{sortQuickReply:n,quickReplies:u}=be(),{list:o,updateFilter:g}=k();S.useEffect(g,[r,u]);const d=S.useRef(null),{settings:p}=S.useContext(Me);return S.useEffect(()=>{const i=d.current;return w(i),ae(te({canMonitor:I,onDrop({source:s,location:m}){const a=s.data;if(!A(a))return;const c=m.current.dropTargets[0];if(!c)return;const f=c.data,x=o.columns.findIndex(b=>b.id===a.columnId),l=o.columns[x];if(!l)return;const h=l.cards.findIndex(b=>b.id===a.card.id);if(Ne(f)){const b=o.columns.findIndex(j=>j.id===f.columnId),y=o.columns[b];if(l===y){const j=l.cards.findIndex(Y=>Y.id===f.card.id);if(h===-1||j===-1||h===j)return;const P=q(f),N=xt({axis:"vertical",list:l.cards,startIndex:h,indexOfTarget:j,closestEdgeOfTarget:P}),F={...l,cards:N},oe=Array.from(o.columns);oe[x]=F,n(oe.flatMap(Y=>Y.cards));return}if(!y)return;const O=y.cards.findIndex(j=>j.id===f.card.id),R=q(f)==="bottom"?O+1:O,v=Array.from(l.cards);v.splice(h,1),y.id==="not_cat"?delete a.card.categoria:a.card.categoria=y.id;const E=Array.from(y.cards);E.splice(R,0,a.card);const C=Array.from(o.columns);C[x]={...l,cards:v},C[b]={...y,cards:E},n(C.flatMap(j=>j.cards));return}if(M(f)){const b=o.columns.findIndex(v=>v.id===f.column.id),y=o.columns[b];if(!y)return;if(l===y){const v=ee({list:l.cards,startIndex:h,finishIndex:l.cards.length-1}),E={...l,cards:v},C=Array.from(o.columns);C[x]=E,n(C.flatMap(j=>j.cards));return}const O=Array.from(l.cards);O.splice(h,1),y.id==="not_cat"?delete a.card.categoria:a.card.categoria=y.id;const L=Array.from(y.cards);L.splice(y.cards.length,0,a.card);const R=Array.from(o.columns);R[x]={...l,cards:O},R[b]={...y,cards:L},n(R.flatMap(v=>v.cards));return}}}),te({canMonitor:U,onDrop({source:s,location:m}){const a=s.data;if(!M(a))return;const c=m.current.dropTargets[0];if(!c||c.data.column.id==="not_cat")return;const f=c.data;if(!M(f))return;const x=o.columns.findIndex(h=>h.id===a.column.id),l=o.columns.findIndex(h=>h.id===f.column.id);x===-1||l===-1||x!==l&&(ee({list:o.columns,startIndex:x,finishIndex:l}),e({oldIndex:x,newIndex:l}))}}),je({canScroll({source:s}){return p.isOverElementAutoScrollEnabled?I({source:s})||U({source:s}):!1},getConfiguration:()=>({maxScrollSpeed:p.boardScrollSpeed}),element:i}),Oe({element:i,getConfiguration:()=>({maxScrollSpeed:p.boardScrollSpeed}),canScroll({source:s}){return!p.isOverElementAutoScrollEnabled||!p.isOverflowScrollingEnabled?!1:I({source:s})||U({source:s})},getOverflow(){return{forLeftEdge:{top:1e3,left:1e3,bottom:1e3},forRightEdge:{top:1e3,right:1e3,bottom:1e3}}}}))},[o,p]),S.useEffect(()=>{let i=null;const s=d.current;w(s);function m({startX:c}){let f=c;const x=ce.bindAll(window,[{type:"pointermove",listener(l){const h=l.clientX,b=f-h;f=h,s?.scrollBy({left:b})}},...["pointercancel","pointerup","pointerdown","keydown","resize","click","visibilitychange"].map(l=>({type:l,listener:()=>x()}))],{capture:!0});i=x}const a=ce.bindAll(s,[{type:"pointerdown",listener(c){c.target instanceof HTMLElement&&(c.target.closest(`[${ne}]`)||m({startX:c.clientX}))}}]);return function(){a(),i?.()}},[]),t.jsx("div",{className:`flex h-full flex-col ${p.isBoardMoreObvious?"px-32 py-20":""}`,children:t.jsx("div",{className:`flex h-full flex-col gap-2 overflow-x-auto ${p.isBoardMoreObvious?"rounded border-2 border-dashed":""}`,ref:d,children:o.columns.map(i=>t.jsx(Tt,{column:i},i.id))})})}function zt({listSize:e}){const{quickReplies:r}=be(),{list:n,activeFilter:u}=k(),{language:o}=T(),{setActiveCreateOrEdit:g}=K(),{tutorial_resposta_rapida:d}=_e(ft(s=>({tutorial_resposta_rapida:s.getUrl("tutoriais","resposta_rapida")}))),p=t.jsxs("div",{className:"flex flex-col items-center justify-center content-center gap-2 mb-2 pb-4",children:[t.jsx(ie,{icon:t.jsx(J,{size:26,className:"text-[var(--primaria)]"}),title:o.quickRepltEmpty,description:o.quickReplyEmptyDes}),t.jsx(se,{name:o.createQuickReply,funcao:()=>g({type:"create",model:"respostaRapida"})}),d.active&&t.jsx(Xe,{funcao:()=>window.open(d.link,"_blank")})]}),i=t.jsxs("div",{className:"grid gap-2 mb-2 pb-4",children:[t.jsx(ie,{icon:t.jsx(J,{size:26,className:"text-[var(--primaria)]"}),title:o.noQuickReply,description:o.searchQuickReplyNotFilter}),t.jsx(se,{name:o.clear_filter,funcao:()=>k.setState({activeFilter:!1,filter:{search:"",model:{id:"all",parm:""}}})})]});return t.jsxs("div",{children:[t.jsx(mt,{}),t.jsx("div",{className:"overflow-auto pl-2 pr-1",style:{maxHeight:`calc(100vh - ${e}px)`},children:u?n.columns.length===0?i:t.jsx(xe,{}):r.length===0?p:t.jsx(xe,{})})]})}const tn=Object.freeze(Object.defineProperty({__proto__:null,default:zt},Symbol.toStringTag,{value:"Module"}));export{At as E,tn as i};
