import{j as t,_ as W,b7 as Ne,b8 as Me,ac as fe,b9 as pe,ba as Pe,bb as ze,I as ge,bc as Te,bd as _e,aa as te,n as ne,J as re}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e10.js";import{o as me,C as xe,y as ve,aD as Be,n as $e,aE as He,_ as Qe,X as he}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e22.js";import{u as D,a as Z}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e92.js";import{u as q}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e19.js";import{u as be}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e34.js";import{a as y,d as Ue}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e4.js";import{a as Xe,g as We,e as qe,i as ae,m as Ke,b as Ve,c as Ge,d as Ye,f as z,h as Ze,j as Je,k as ye}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e178.js";import{r as V,g as et,m as G,o as tt,c as J,d as Se,e as U,a as nt,b as Ee,s as je,f as oe}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e179.js";import{_ as k,e as rt,r as at}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e5.js";import{i as R}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e9.js";import{u as Ce}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e21.js";import{b as ot}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e75.js";const it=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e174.js")),[]));function st(){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(it,{})})}const lt=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e175.js")),[]));function ie({model:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(lt,{model:e})})}function ct(){const{categories:e}=be(),{language:n}=q(),{open:r}=me(),{filter:f,setFilter:o}=D(),p=[{id:"all",name:n.tab_all,action:()=>o("model",{id:"all"})},{id:"type",name:n.filterQuickReplyPerType,action:i=>r(t.jsx(ie,{model:"type"}),{placement:"left-end"},i.target)},{id:"not_cat",name:n.filterQuickReplyNotPerCategorie,action:()=>o("model",{id:"not_cat"})},{id:"cat",name:n.filterQuickReplyPerCategorie,action:i=>r(t.jsx(ie,{model:"cat"}),{placement:"left-end"},i.target)},{id:"most_used",name:n.filterQuickReplyMostUsed,action:()=>o("model",{id:"most_used"})}],u=t.jsxs("div",{className:"flex justify-center gap-2",children:[t.jsx(Ne,{value:f.search,setValue:i=>o("search",i),placeholder:n.searchQuickReply}),t.jsx("span",{className:"cursor-pointer pulse lg:tooltip lg:tooltip-left","data-tip":n.createQuickReply,onClick:i=>r(t.jsx(st,{}),{placement:"bottom-end"},i.target,5),children:t.jsx(Me,{className:"!w-[30px] !h-[30px] text-[var(--primaria)]"})})]}),g=t.jsx("div",{className:"flex gap-1 flex-wrap",children:p.map(i=>{var c;return 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 
                            ${f.model.id===i.id?"bg-label-gradient text-[var(--letra)]":"text-[var(--primaria)]"}`,onClick:x=>i.action(x),children:[i.id==="type"&&f.model.id===i.id&&t.jsx(fe,{type:f.model.parm,style:"w-4 h-4 text-[var(--letra)]"}),i.id==="cat"&&f.model.id===i.id&&t.jsx(pe,{size:18,color:(c=e.find(x=>x.id===f.model.parm))==null?void 0:c.hexColor}),t.jsx("span",{children:i.name}),(i.id==="type"||i.id==="cat")&&t.jsx("span",{children:t.jsx(Pe,{size:15})})]})})});return t.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[u,g]})}function dt(e){var n=e.list,r=e.startIndex,f=e.closestEdgeOfTarget,o=e.indexOfTarget,p=e.axis;return V({list:n,startIndex:r,finishIndex:et({closestEdgeOfTarget:f,startIndex:r,indexOfTarget:o,axis:p})})}function T(e){var n=e.axis,r=e.side;return function(o){var p,u,g=o.clientRect,i=o.overflow,c=o.config,x=Xe[n],a=x.mainAxis,l=x.crossAxis,d=a[r],m=i[d],s=We[d]({clientRect:g,config:c}),h=DOMRect.fromRect((p={},k(p,a.point,s[a.point]),k(p,a.size,s[a.size]),k(p,l.point,s[l.point]-m[l.start]),k(p,l.size,s[l.size]+m[l.start]+m[l.end]),p)),b=DOMRect.fromRect((u={},k(u,a.point,r==="start"?g[a.point]-m[a.start]:g[a.end]),k(u,l.point,g[l.point]-m[l.start]),k(u,a.size,r==="start"?m[a.start]:m[a.end]),k(u,l.size,m[l.start]+g[l.size]+m[l.end]),u));return{insideOfEdge:h,outsideOfEdge:b}}}var ut={top:T({axis:"vertical",side:"start"}),right:T({axis:"horizontal",side:"end"}),bottom:T({axis:"vertical",side:"end"}),left:T({axis:"horizontal",side:"start"})};function _(e){return e.type==="inside-of-edge"}function B(e){var n,r,f,o;return{top:(n=e==null?void 0:e.top)!==null&&n!==void 0?n:0,right:(r=e==null?void 0:e.right)!==null&&r!==void 0?r:0,bottom:(f=e==null?void 0:e.bottom)!==null&&f!==void 0?f:0,left:(o=e==null?void 0:e.left)!==null&&o!==void 0?o:0}}function ft(e){return{top:B(e.fromTopEdge),right:B(e.fromRightEdge),bottom:B(e.fromBottomEdge),left:B(e.fromLeftEdge)}}function pt(e){var n=e.entry,r=e.timeSinceLastFrame,f=e.input,o=e.config,p=e.allowedAxis,u={x:f.clientX,y:f.clientY},g=n.element.getBoundingClientRect(),i=ft(n.getOverflow()),c=qe.map(function(s){var h=ut[s]({clientRect:g,overflow:i,config:o}),b=h.insideOfEdge,S=h.outsideOfEdge;return ae({client:u,clientRect:S})?{edge:s,hitbox:S,type:"outside-of-edge"}:ae({client:u,clientRect:b})?{edge:s,hitbox:b,type:"inside-of-edge"}:!1}).filter(function(s){return!!s});if(!c.length)return null;var x=Ke(n.element),a=c.filter(function(s){return Ve(Ye[s.edge],p)&&Ge[s.edge](n.element)});if(!a.length)return null;var l=new Map(a.map(function(s){return[s.edge,s]})),d=function(){var s="horizontal",h=l.get("left");if(h)return z({client:u,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"left",axis:s,timeSinceLastFrame:r,engagement:x,config:o});var b=l.get("right");return b?z({client:u,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"right",axis:s,timeSinceLastFrame:r,engagement:x,config:o}):0}(),m=function(){var s="vertical",h=l.get("bottom");if(h)return z({client:u,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"bottom",axis:s,timeSinceLastFrame:r,engagement:x,config:o});var b=l.get("top");return b?z({client:u,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"top",axis:s,timeSinceLastFrame:r,engagement:x,config:o}):0}();return{left:d,top:m}}function gt(e,n){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=mt(e))||n){r&&(e=r);var f=0,o=function(){};return{s:o,n:function(){return f>=e.length?{done:!0}:{done:!1,value:e[f++]}},e:function(c){throw c},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 p=!0,u=!1,g;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return p=c.done,c},e:function(c){u=!0,g=c},f:function(){try{!p&&r.return!=null&&r.return()}finally{if(u)throw g}}}}function mt(e,n){if(e){if(typeof e=="string")return se(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return se(e,n)}}function se(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,f=new Array(n);r<n;r++)f[r]=e[r];return f}function xt(e){var n=e.input,r=e.source,f=e.entries,o=e.timeSinceLastFrame,p=e.underUsersPointer,u=gt(f),g;try{for(u.s();!(g=u.n()).done;){var i,c,x,a=g.value;if(!a.element.contains(p)){var l={input:n,source:r,element:a.element};if(!(a.canScroll&&!a.canScroll(l))){var d=Ze((i=a.getConfiguration)===null||i===void 0?void 0:i.call(a,l)),m=(c=(x=a.getAllowedAxis)===null||x===void 0?void 0:x.call(a,l))!==null&&c!==void 0?c:"all",s=pt({entry:a,input:n,timeSinceLastFrame:o,allowedAxis:m,config:d});s&&a.element.scrollBy(s)}}}}catch(h){u.e(h)}finally{u.f()}}function vt(e){var n=e.monitor,r=new Map;function f(p){return r.set(p.element,p),function(){return r.delete(p.element)}}function o(p){var u=p.latestArgs,g=p.underUsersPointer,i=p.timeSinceLastFrame;xt({input:u.location.current.input,source:u.source,entries:Array.from(r).map(function(c){var x=rt(c,2);x[0];var a=x[1];return a}),underUsersPointer:g,timeSinceLastFrame:i})}return Je(n).onFrame(o),{unsafeOverflowAutoScroll:f}}var ht=vt({monitor:G}),Re=ht.unsafeOverflowAutoScroll;function Oe(e){var n=e.element,r=e.input;return function(f){var o=f.container,p=n.getBoundingClientRect(),u=o.getBoundingClientRect(),g=Math.min(r.clientX-p.x,u.width),i=Math.min(r.clientY-p.y,u.height);return{x:g,y:i}}}const bt=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e176.js")),[]));function yt({card:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(bt,{card:e})})}const St=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e177.js")),[]));function Et({card:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(St,{card:e})})}const we=tt(function(){const{userAgent:n}=navigator;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),jt=Ue.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 X({dragging:e,hexColor:n}){return t.jsx("div",{className:"flex-shrink-0 skeleton rounded-md ",style:{height:e.height,backgroundColor:n+"40"}})}const le=async(e,n)=>{e.stopPropagation();const{setUsedRespostaRapida:r}=Z.getState(),{sendAction:f}=ve.getState(),{open:o,setAcaoEnvioEmMassa:p}=Ce.getState();await Qe("respostasRapidas")!==!0&&(r(n.id),o?p(n):f(n))};function ce({card:e,state:n,outerRef:r,innerRef:f,hexColor:o}){const{menuContent:p}=xe(),{open:u}=me(),{open:g}=Ce(),{getAction:i}=ve(),{setAcao:c}=Be(),{open:x}=$e(),a=d=>{d.stopPropagation(),close(),c(i(e.id)),x(t.jsx(Et,{card:e}))},l=d=>{d.stopPropagation(),u(t.jsx(yt,{card:e}),{placement:"left-end"},r.current,25,{mounted:()=>{var m,s;return(s=(m=r.current)==null?void 0:m.parentNode)==null?void 0:s.setAttribute("activated","")},desmouted:()=>{var m,s;return(s=(m=r.current)==null?void 0:m.parentNode)==null?void 0:s.removeAttribute("activated","")}})};return t.jsx(jt,{hexColor:o+"70",children:t.jsxs("div",{ref:r,className:"flex flex-shrink-0 flex-col gap-2 ",onClick:d=>le(d,e),children:[n.type==="is-over"&&n.closestEdge==="top"?t.jsx(X,{dragging:n.dragging,hexColor:o}):null,t.jsx("div",{className:"px-1 py-[5px] border-t border-solid",ref:f,style:{borderColor:`${o}60`,...n.type==="preview"&&{width:n.dragging.width,height:n.dragging.height,transform:we()?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(fe,{type:e.type})}),t.jsx("div",{className:"truncate",style:{maxWidth:`calc(${p.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:l,children:t.jsx(ze,{size:18})}),!g&&t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:a,children:t.jsx(He,{size:20})}),t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:d=>le(d,e),children:t.jsx(ot,{size:18})})]})]})}),n.type==="is-over"&&n.closestEdge==="bottom"?t.jsx(X,{dragging:n.dragging,hexColor:o}):null]})})}const Ae=Symbol("card");function Ct({card:e,rect:n,columnId:r}){return{[Ae]:!0,rect:n,card:e,columnId:r}}function A(e){return!!e[Ae]}function L({source:e}){return!D.getState().activeFilter&&A(e.data)}const ke=Symbol("card-drop-target");function De(e){return!!e[ke]}function Rt({card:e,columnId:n}){return{[ke]:!0,card:e,columnId:n}}const Ie=Symbol("column");function Ot({column:e}){return{[Ie]:!0,column:e}}function N(e){return!!e[Ie]}function Q({source:e}){var n;return!D.getState().activeFilter&&((n=e.data.column)==null?void 0:n.id)!=="not_cat"&&N(e.data)}function Fe(e,n){const r=Object.keys(e),f=Object.keys(n);return r.length!==f.length?!1:r.every(o=>Object.is(e[o],n[o]))}const $={type:"idle"};function wt({card:e,columnId:n,hexColor:r}){const{activeFilter:f}=D(),{language:o}=q(),p=y.useRef(null),u=y.useRef(null),[g,i]=y.useState($);return y.useEffect(()=>{const c=p.current,x=u.current;return R(c&&x),J(Ee({element:x,getInitialData:({element:a})=>Ct({card:e,columnId:n,rect:a.getBoundingClientRect()}),onGenerateDragPreview({nativeSetDragImage:a,location:l,source:d}){const m=d.data;R(A(m)),je({nativeSetDragImage:a,getOffset:Oe({element:x,input:l.current.input}),render({container:s}){i({type:"preview",container:s,dragging:x.getBoundingClientRect()})}})},onDragStart(){f&&ge({type:"Info",message:o.dragAndDropNotMoveInActiveFilter,position:"top-right"}),i({type:"is-dragging"})},onDrop(){i($)}}),Se({element:c,getIsSticky:()=>!0,canDrop:L,getData:({element:a,input:l})=>{const d=Rt({card:e,columnId:n});return nt(d,{element:a,input:l,allowedEdges:["top","bottom"]})},onDragEnter({source:a,self:l}){if(!A(a.data)||a.data.card.id===e.id)return;const d=U(l.data);d&&i({type:"is-over",dragging:a.data.rect,closestEdge:d})},onDrag({source:a,self:l}){if(!A(a.data)||a.data.card.id===e.id)return;const d=U(l.data);if(!d)return;const m={type:"is-over",dragging:a.data.rect,closestEdge:d};i(s=>Fe(m,s)?s:m)},onDragLeave({source:a}){if(A(a.data)){if(a.data.card.id===e.id){i({type:"is-dragging-and-left-self"});return}i($)}},onDrop(){i($)}}))},[e,n,f]),t.jsxs(t.Fragment,{children:[t.jsx(ce,{outerRef:p,innerRef:u,state:g,card:e,hexColor:r}),g.type==="preview"?at.createPortal(t.jsx(ce,{state:g,card:e,hexColor:r}),g.container):null]})}const Y="data-block-board-panning",At={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"]}},kt={isBoardMoreObvious:!1,isOverElementAutoScrollEnabled:!0,boardScrollSpeed:"fast",columnScrollSpeed:"standard",isFPSPanelEnabled:!1,isCPUBurnEnabled:!1,isOverflowScrollingEnabled:!0},Le=y.createContext({fields:At,settings:kt,update:()=>{},reset:()=>{}}),Dt={idle:"","is-card-over":"","is-dragging":"","is-column-over":"skeleton"},H={type:"idle"},de=y.memo(function({column:n}){return n.cards.map(r=>t.jsx(wt,{card:r,columnId:n.id,hexColor:n.hexColor},r.id))});function It({column:e}){const{categoriaOpen:n,setCategoriaOpen:r}=Z(),{menuContent:f}=xe(),{activeFilter:o}=D(),{language:p}=q(),u=y.useRef(null),g=y.useRef(null),i=y.useRef(null),c=y.useRef(null),{settings:x}=y.useContext(Le),[a,l]=y.useState(H),d=!o&&n.includes(e.id);y.useEffect(()=>{const h=g.current,b=u.current,S=i.current,O=c.current;R(h),R(b),R(S),R(O);const M=Ot({column:e});function w({data:v,location:j}){const C=j.current.dropTargets[0],E=!!(C&&De(C.data)),P={type:"is-card-over",dragging:v.rect,isOverChildCard:E};l(I=>Fe(P,I)?I:P)}return J(Ee({element:S,getInitialData:()=>M,onGenerateDragPreview({source:v,location:j,nativeSetDragImage:C}){const E=v.data;R(N(E)),je({nativeSetDragImage:C,getOffset:Oe({element:S,input:j.current.input}),render({container:P}){const I=O.getBoundingClientRect(),F=O.cloneNode(!0);R(F instanceof HTMLElement),F.style.width=`${I.width}px`,F.style.height=`${I.height}px`,we()||(F.style.transform="rotate(4deg)"),P.appendChild(F)}})},onDragStart(){o&&ge({type:"Info",message:p.dragAndDropNotMoveInActiveFilter,position:"top-right"}),l({type:"is-dragging"})},onDrop(){l(H)}}),Se({element:h,getData:()=>M,canDrop({source:v}){return L({source:v})||Q({source:v})},getIsSticky:()=>!0,onDragStart({source:v,location:j}){A(v.data)&&w({data:v.data,location:j})},onDragEnter({source:v,location:j}){if(A(v.data)){w({data:v.data,location:j});return}N(v.data)&&v.data.column.id!==e.id&&l({type:"is-column-over"})},onDropTargetChange({source:v,location:j}){if(A(v.data)){w({data:v.data,location:j});return}},onDragLeave({source:v}){N(v.data)&&v.data.column.id===e.id||l(H)},onDrop(){l(H)}}),ye({canScroll({source:v}){return x.isOverElementAutoScrollEnabled?L({source:v}):!1},getConfiguration:()=>({maxScrollSpeed:x.columnScrollSpeed}),element:b}),Re({element:b,getConfiguration:()=>({maxScrollSpeed:x.columnScrollSpeed}),canScroll({source:v}){return!x.isOverElementAutoScrollEnabled||!x.isOverflowScrollingEnabled?!1:L({source:v})},getOverflow(){return{forTopEdge:{top:1e3},forBottomEdge:{bottom:1e3}}}}))},[e,x]);const m=t.jsx("div",{ref:g,children:t.jsx("div",{ref:c,[Y]:!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
              ${!d&&e.cards.length!==0?"pb-2":""}  
            `,ref:u,children:t.jsxs(t.Fragment,{children:[t.jsx(de,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(X,{dragging:a.dragging,hexColor:e.hexColor})})]})})})})})}),s=t.jsx("div",{className:"flex w-full flex-shrink-0 select-none flex-col",ref:g,children:t.jsx("div",{className:`flex max-h-full flex-col rounded-lg border border-solid border-[var(--conversation-header-border)] ${Dt[a.type]}`,ref:c,style:!d||a.type==="is-column-over"?{backgroundColor:`${e.hexColor}30`,borderColor:`${e.hexColor}60`}:{},[Y]:!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:()=>r(e.id),children:[t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("div",{children:t.jsx(pe,{size:20,style:{color:e.hexColor}})}),t.jsx("span",{className:"truncate font-semibold",style:{maxWidth:`calc(${f.width}px - 90px)`},children:e.name})]}),t.jsx("div",{children:t.jsx("span",{className:"text-[var(--icon)]",children:d?t.jsx(Te,{size:22,stroke:"0.3"}):t.jsx(_e,{size:22,stroke:"0.3"})})})]}),t.jsx("div",{className:`flex flex-col overflow-y-auto px-1 ml-4 
              ${!d&&e.cards.length!==0?"pb-2":""}  
            `,ref:u,children:!d&&t.jsxs(t.Fragment,{children:[t.jsx(de,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(X,{dragging:a.dragging,hexColor:e.hexColor})})]})})]})})});return e.id==="not_cat"?m:s}function ue(){const{sortCategories:e,categories:n}=be(),{sortQuickReply:r,quickReplies:f}=he(),{list:o,updateFilter:p}=D();y.useEffect(p,[n,f]);const u=y.useRef(null),{settings:g}=y.useContext(Le);return y.useEffect(()=>{const i=u.current;return R(i),J(G({canMonitor:L,onDrop({source:c,location:x}){const a=c.data;if(!A(a))return;const l=x.current.dropTargets[0];if(!l)return;const d=l.data,m=o.columns.findIndex(b=>b.id===a.columnId),s=o.columns[m];if(!s)return;const h=s.cards.findIndex(b=>b.id===a.card.id);if(De(d)){const b=o.columns.findIndex(E=>E.id===d.columnId),S=o.columns[b];if(s===S){const E=s.cards.findIndex(K=>K.id===d.card.id);if(h===-1||E===-1||h===E)return;const P=U(d),I=dt({axis:"vertical",list:s.cards,startIndex:h,indexOfTarget:E,closestEdgeOfTarget:P}),F={...s,cards:I},ee=Array.from(o.columns);ee[m]=F,r(ee.flatMap(K=>K.cards));return}if(!S)return;const O=S.cards.findIndex(E=>E.id===d.card.id),w=U(d)==="bottom"?O+1:O,v=Array.from(s.cards);v.splice(h,1),S.id==="not_cat"?delete a.card.categoria:a.card.categoria=S.id;const j=Array.from(S.cards);j.splice(w,0,a.card);const C=Array.from(o.columns);C[m]={...s,cards:v},C[b]={...S,cards:j},r(C.flatMap(E=>E.cards));return}if(N(d)){const b=o.columns.findIndex(v=>v.id===d.column.id),S=o.columns[b];if(!S)return;if(s===S){const v=V({list:s.cards,startIndex:h,finishIndex:s.cards.length-1}),j={...s,cards:v},C=Array.from(o.columns);C[m]=j,r(C.flatMap(E=>E.cards));return}const O=Array.from(s.cards);O.splice(h,1),S.id==="not_cat"?delete a.card.categoria:a.card.categoria=S.id;const M=Array.from(S.cards);M.splice(S.cards.length,0,a.card);const w=Array.from(o.columns);w[m]={...s,cards:O},w[b]={...S,cards:M},r(w.flatMap(v=>v.cards));return}}}),G({canMonitor:Q,onDrop({source:c,location:x}){const a=c.data;if(!N(a))return;const l=x.current.dropTargets[0];if(!l||l.data.column.id==="not_cat")return;const d=l.data;if(!N(d))return;const m=o.columns.findIndex(h=>h.id===a.column.id),s=o.columns.findIndex(h=>h.id===d.column.id);m===-1||s===-1||m!==s&&(V({list:o.columns,startIndex:m,finishIndex:s}),e({oldIndex:m,newIndex:s}))}}),ye({canScroll({source:c}){return g.isOverElementAutoScrollEnabled?L({source:c})||Q({source:c}):!1},getConfiguration:()=>({maxScrollSpeed:g.boardScrollSpeed}),element:i}),Re({element:i,getConfiguration:()=>({maxScrollSpeed:g.boardScrollSpeed}),canScroll({source:c}){return!g.isOverElementAutoScrollEnabled||!g.isOverflowScrollingEnabled?!1:L({source:c})||Q({source:c})},getOverflow(){return{forLeftEdge:{top:1e3,left:1e3,bottom:1e3},forRightEdge:{top:1e3,right:1e3,bottom:1e3}}}}))},[o,g]),y.useEffect(()=>{let i=null;const c=u.current;R(c);function x({startX:l}){let d=l;const m=oe.bindAll(window,[{type:"pointermove",listener(s){const h=s.clientX,b=d-h;d=h,c==null||c.scrollBy({left:b})}},...["pointercancel","pointerup","pointerdown","keydown","resize","click","visibilitychange"].map(s=>({type:s,listener:()=>m()}))],{capture:!0});i=m}const a=oe.bindAll(c,[{type:"pointerdown",listener(l){l.target instanceof HTMLElement&&(l.target.closest(`[${Y}]`)||x({startX:l.clientX}))}}]);return function(){a(),i==null||i()}},[]),t.jsx("div",{className:`flex h-full flex-col ${g.isBoardMoreObvious?"px-32 py-20":""}`,children:t.jsx("div",{className:`flex h-full flex-col gap-2 overflow-x-auto ${g.isBoardMoreObvious?"rounded border-2 border-dashed":""}`,ref:u,children:o.columns.map(i=>t.jsx(It,{column:i},i.id))})})}function Ft({listSize:e}){const{quickReplies:n}=he(),{list:r,activeFilter:f}=D(),{language:o}=q(),{setActiveCreateOrEdit:p}=Z(),u=t.jsxs("div",{className:"grid gap-2 mb-2 pb-4",children:[t.jsx(te,{icon:t.jsx(ne,{size:26,className:"text-[var(--primaria)]"}),title:o.quickRepltEmpty,description:o.quickReplyEmptyDes}),t.jsx(re,{name:o.createQuickReply,funcao:()=>p({type:"create",model:"respostaRapida"})})]}),g=t.jsxs("div",{className:"grid gap-2 mb-2 pb-4",children:[t.jsx(te,{icon:t.jsx(ne,{size:26,className:"text-[var(--primaria)]"}),title:o.noQuickReply,description:o.searchQuickReplyNotFilter}),t.jsx(re,{name:o.clear_filter,funcao:()=>D.setState({activeFilter:!1,filter:{search:"",model:{id:"all",parm:""}}})})]});return t.jsxs("div",{children:[t.jsx(ct,{}),t.jsx("div",{className:"overflow-auto pl-2 pr-1",style:{maxHeight:`calc(100vh - ${e}px)`},children:f?r.columns.length===0?g:t.jsx(ue,{}):n.length===0?u:t.jsx(ue,{})})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:Ft},Symbol.toStringTag,{value:"Module"}));export{Et as E,Xt as i};
