/*! For license information please see 360.a099731dd2d16ffec72c.chunk.js.LICENSE.txt */
(self.webpackChunk_as_client=self.webpackChunk_as_client||[]).push([[360],{8360:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ProfilesPage:()=>Lo,default:()=>jo});var r={};n.r(r),n.d(r,{FILE:()=>fr,HTML:()=>yr,TEXT:()=>vr,URL:()=>mr});var o=n(4041),i=n(1879),s=n(3578),a=n(7973),l=n(9649),c=n(3580),d=n(196),u=n(8081),h=n(9192),g=n(7609);function p(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?o.createElement(e,t):e:null;var n}const f=u.Ay.td(["padding:1.5rem;border-bottom:1px solid ",";.row-selection-input + &{padding-left:0;}"],c.A.neutralLight);function m({cell:e}){const t=e.column.columnDef.cell;return o.createElement(f,{key:e.id,className:e.column.columnDef.meta?.className},t?p(t,e.getContext()):e.getValue())}var v=n(2943);function y({row:e,config:t}){return t.isRowSelectionEnabled?o.createElement(f,{className:"row-selection-input"},o.createElement(v.A,{checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),onChange:e.getToggleSelectedHandler(),"aria-label":"Select row","data-testid":`select-row-${e.id}`,name:`select-row-${e.id}`})):null}const b=u.Ay.tr(["background-color:",";&[data-selected='true']{background-color:",";}"],c.A.neutralWhite,c.A.neutralLight);function w({row:e,featuresConfig:t,className:n}){return o.createElement(b,{className:n,"data-selected":e.getIsSelected()},o.createElement(y,{row:e,config:t}),e.getVisibleCells().map((e=>o.createElement(m,{cell:e,config:t,key:e.id}))))}const S=u.Ay.div(["overflow:hidden;background-color:",";border:1px solid ",";border-radius:8px;box-shadow:0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06);"],c.A.neutralWhite,c.A.neutralLight),E=u.Ay.div(["width:100%;overflow:auto;table{min-width:100%;}"]),x=(0,u.AH)(["tbody > ",":nth-child(even):not([data-selected='true']){background-color:",";}"],b,c.A.neutralBg),T=u.Ay.table([""," .row-selection-input{width:3.75rem;padding-right:1rem;line-height:0.875rem;}td.leading{font-weight:500;}"],(0,h.A)("striped")`
        ${x}
    `),D=u.Ay.div(["display:flex;justify-content:flex-end;"]);var O=n(738);const C=(0,u.AH)(["display:flex;align-items:center;"]),I=u.Ay.div(["",";justify-content:flex-start;"],C),A=u.Ay.div(["",";justify-content:flex-end;",""],C,O.Ay.lessThen(O.nm.SM)`
        justify-content: space-between;
    `),P=u.Ay.div(["display:flex;align-items:center;justify-content:space-between;padding:",";"," "," ",""],(({padding:e})=>e||"16px 24px"),(0,h.A)("withBorder")`
        border-bottom: 1px solid ${c.A.neutralLight};
    `,O.Ay.lessThen(O.nm.SM)`
        display: block;
        padding: 1rem;
    `,(0,h.A)("fullWidth")`
        display: block;
    `),N=e=>{const{left:t,right:n,...r}=e;return o.createElement(P,r,o.createElement(I,null,t),o.createElement(A,null,n))};var k=n(7969),R=n(1976),M=n(8631);const L=u.Ay.div(["display:flex;align-items:center;width:100%;",""],O.Ay.lessThen(O.nm.LG-1)`
       justify-content: space-between;
    `),j=(0,u.AH)(["display:inline-flex;align-items:center;justify-content:center;min-width:2.5rem;height:2.5rem;padding:0.5rem;background:transparent;border:none;border-radius:0.5rem;outline:none;cursor:pointer;"]),_=u.Ay.button([""," font-weight:500;&:hover,&:active,&[data-active='true']{color:",";background:",";}&:disabled{cursor:not-allowed;&:hover{background-color:transparent;}}"],j,c.A.neutralTextSection,c.A.neutralBg),H=(0,u.Ay)(_)(["padding:0.5rem 1rem;font-weight:600;border:1px solid ",";border-radius:0.25rem;"," &[data-page=\"prev\"] > span{padding-left:0.5rem;}&[data-page='next'] > span{padding-right:0.5rem;}"],c.A.neutralBorder,O.Ay.lessThen(O.nm.LG-1)`
        padding: 0.5rem;
    `),U=u.Ay.span([""," cursor:default;"],j),z=u.Ay.div(["display:flex;align-items:center;margin:0 2rem;"]),B=u.Ay.div(["display:flex;align-items:center;margin-right:0;margin-left:auto;"]),V=u.Ay.div(["width:1px;height:36px;background:",";"],c.A.neutralLight),F=(0,u.Ay)(M.m)(["max-width:130px;.ovpn-dropdown-input-variant{min-width:85px;margin-right:0;margin-left:auto;}"]),$=[{title:"10 rows",id:10},{title:"25 rows",id:25},{title:"50 rows",id:50},{title:"75 rows",id:75},{title:"100 rows",id:100}],G=e=>{const{onPageChange:t,onPageSizeChange:n,pageSizePresets:r=$,page:i,pageSize:a,itemsShown:l,total:d=0,maxDisplayedItems:u,disabled:h,...g}=e,p=Math.ceil(d/(a||25)),f=u?Math.max(u,5):5,m=(0,o.useCallback)((e=>{const n=e.currentTarget.dataset.page||"";if("prev"===n||"next"===n)t(i+("prev"===n?-1:1));else{const e=parseInt(n,10);t(e)}}),[i,t]),v=(0,o.useMemo)((()=>{const e=[];for(let t=0;t<p;t++)e.push({text:(t+1).toString(),active:i===t+1,type:"button"});if(e.length<=f)return e;const t=Math.floor(f/2),n=e.slice(0,t),r=e.slice(e.length-t);return i<t+1||i>p-t?n.concat({text:"...",active:!1,type:"dots"}).concat(r):n.slice(0,t-1).concat([{text:"...",active:!1,type:"dots"},{text:i.toString(),active:!0,type:"button"},{text:"...",active:!1,type:"dots"}]).concat(r.slice(1))}),[p,i,f]);return o.createElement(L,g,o.createElement(H,{onClick:m,"data-page":"prev",disabled:h||1===i,"data-testid":"previous"},o.createElement(k.A,null),o.createElement("span",{className:"visible-lg"},"Previous")),o.createElement(z,{className:"visible-lg"},v.map(((e,t)=>"button"===e.type?o.createElement(_,{key:e.text,"data-page":e.text,"data-active":e.active,disabled:h,onClick:m,"data-testid":e.text},e.text):o.createElement(U,{key:e.text+t},e.text)))),o.createElement("div",{className:"hidden-lg"},"Page ",i," of ",p),o.createElement(H,{onClick:m,"data-page":"next",disabled:h||i===p,"data-testid":"next"},o.createElement("span",{className:"visible-lg"},"Next"),o.createElement(R.A,null)),o.createElement(B,{className:"visible-lg"},o.createElement(s.A,{variant:"textSm",weight:"medium",color:c.A.neutralTextSubtitle,pr:8},"Showing ",l," of ",d),o.createElement(V,null),o.createElement(s.A,{variant:"textSm",weight:"medium",color:c.A.neutralTextSection,pl:8,pr:8},"Rows to display"),o.createElement(F,{options:r,value:a,onChange:n,"data-testid":"page-size-select"})))};var W=n(9690);const X=u.Ay.div(["position:fixed;right:","px;bottom:0;left:","px;z-index:100;padding-bottom:2.25rem;"],(({$right:e})=>e),(({$left:e})=>e)),Y=(0,o.forwardRef)(((e,t)=>{const n=(0,o.useRef)(null),[r,i]=(0,o.useState)({$left:0,$right:0});return(0,o.useEffect)((()=>{if(!n.current)return;const e=new ResizeObserver((e=>{const t=e[0]?.target;if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=window.innerWidth-r-n;i({$left:n,$right:o})}));return e.observe(n.current),()=>{e.disconnect()}}),[]),o.createElement("div",{ref:n},o.createElement(X,(0,W.A)({ref:t},e,r)))}));var K=n(1930);const q=u.Ay.div(["display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin:auto;padding:1rem 1.5rem;text-transform:capitalize;background-color:#fff;border-bottom:2px solid ",";border-radius:8px;box-shadow:0px 12px 16px -4px rgba(16,24,40,0.08),0px 4px 6px -2px rgba(16,24,40,0.03);> div{display:flex;align-items:center;margin-top:0.25rem;margin-bottom:0.25rem;}"],c.A.neutralLight);let Z=function(e){return e.dismiss="dismiss",e.selectAll="select-all",e}({});const J=e=>{const{totalItems:t,selectedItems:n,itemName:r,onAction:i,children:l,isSelectAllButtonShown:c,...d}=e;return o.createElement(q,d,o.createElement("div",null,o.createElement(s.A,{variant:"textLg",weight:"semiBold",m:"0 1rem 0 0"},n," ",r," selected"),c&&o.createElement(a.A,{"aria-label":"Select all",onClick:()=>i(Z.selectAll),disabled:t===n,variant:"ghost","data-testid":"select-all"},"select all ",t," ",r)),o.createElement("div",null,l,o.createElement(a.A,{variant:"ghost","aria-label":"Dismiss",onClick:()=>i(Z.dismiss),minWidth:40,p:0,ml:16,"data-testid":"dismiss-selection"},o.createElement(K.A,null))))};var Q=n(9594),ee=n(4681),te=n(9845),ne=n(9698),re=n(4883),oe=n(7930),ie=n(8655),se=n(8805);const ae=(0,u.Ay)(se.A)(["opacity:1;transition:transform 0.15s;"]),le=u.Ay.th(["padding:0.75rem 1.5rem;color:",";font-weight:500;font-size:0.75rem;text-align:left;border-bottom:1px solid ",";&[data-sortable='true']{padding-right:0.5rem;> span{cursor:pointer;}}&[data-sorted='false']{","{opacity:0;}}&[data-sorted='desc']{","{transform:rotate(180deg);}}> span{display:flex;align-items:center;}.row-selection-input + &{padding-left:0;}"],c.A.neutralTextBody,c.A.neutralLight,ae,ae),ce=u.Ay.tr(["background-color:",";"],c.A.neutralBg);var de=n(5479),ue=n.n(de);function he({headerGroups:e,getIsSomeRowsSelected:t,getIsAllRowsSelected:n,getToggleAllRowsSelectedHandler:r,featuresConfig:{isRowSelectionEnabled:i}}){return o.createElement("thead",null,e.map((e=>o.createElement(ce,{key:e.id},i&&o.createElement(le,{"data-sortable":"false",className:"row-selection-input","data-testid":"select-all-rows"},o.createElement(v.A,{indeterminate:t(),checked:n(),onChange:r(),"aria-label":"Select all rows",name:"select-arr-rows"})),e.headers.map((e=>{const t=e.column.getCanSort(),n=e.column.getIsSorted();return o.createElement(le,(0,W.A)({key:e.id,"data-sorted":n,"data-sortable":t,className:e.column.columnDef.meta?.className},!1===(r=n)?{}:{"aria-sort":"asc"===r?"ascending":"descending"}),e.isPlaceholder?null:o.createElement("span",function(e){const t=e.column.getCanSort(),n=function(e){return"string"==typeof e.column.columnDef.header?e.column.columnDef.header:ue()(e.id)}(e),r={};if(t){const t=e.column.getToggleSortingHandler();r["aria-label"]=`Sort by ${n}`,r.tabIndex=0,r.role="button",r.onClick=t,r.onKeyDown=e=>{"Enter"===e.key&&t?.(e)}}return r}(e),p(e.column.columnDef.header,e.getContext()),t&&o.createElement(ae,{"aria-label":n,size:"sm","data-testid":"sorting-icon"})));var r}))))))}function ge({footerGroups:e,featuresConfig:{isRowSelectionEnabled:t}}){return o.createElement("tfoot",null,e.map((e=>o.createElement("tr",{key:e.id},t&&o.createElement(f,{className:"row-selection-input"}),e.headers.map((e=>o.createElement(f,{key:e.id,className:e.column.columnDef.meta?.className},e.isPlaceholder?null:p(e.column.columnDef.footer,e.getContext()))))))))}function pe({rows:e,featuresConfig:t,Row:n=w,ExpandedRow:r,columnsPerRow:i}){return o.createElement("tbody",null,e.map((e=>o.createElement(o.Fragment,{key:e.id},o.createElement(n,{row:e,featuresConfig:t}),r&&e.getIsExpanded()?o.createElement("tr",null,o.createElement("td",{colSpan:i},o.createElement(r,{featuresConfig:t,row:e}))):null))))}function fe(e){const{columns:t,isLoading:n=!1,skeletonRowsCount:r=10,actionButtons:i,hideHeader:s=!1,hideFooter:a=!0,striped:l,className:c,onActionButtonClick:d,Row:u,ExpandedRow:h,data:p,...f}=e,m=function({isLoading:e,data:t,skeletonRowsCount:n}){return(0,o.useMemo)((()=>e?Array.from({length:n}).fill({}):t),[e,t,n])}({skeletonRowsCount:r,isLoading:n,data:p}),v=function(e,t){return(0,o.useMemo)((()=>{const n=(0,g.FB)();return Array.isArray(e)&&e.length?[n.display({id:"action-buttons",cell:n=>o.createElement(D,{className:"table-action-buttons"},e.map((e=>{const{id:r,component:i}=e;return o.createElement(i,{key:r,row:n.row.original,onClick:e=>t?.(r,n.row.original,e)})}))),meta:{className:"action-buttons-cell"}})]:[]}),[e,t])}(i,d),y=(0,o.useMemo)((()=>[...t,...v].map(((e,t)=>({...e,meta:{...e.meta,className:0===t?[e.meta?.className,"leading"].join(" "):e.meta?.className},cell:n?()=>e?.skeleton||o.createElement(ie.A,{"data-testid":"table-cell-skeleton",height:"textMd"}):e.cell})))),[t,v,n]),b=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=o.useState((()=>({current:(0,g.ZR)(t)}))),[r,i]=o.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({enableSortingRemoval:!1,columns:y,getCoreRowModel:(0,g.HT)(),getSortedRowModel:(0,g.h5)(),...f,data:m}),w=(0,o.useMemo)((()=>({isRowSelectionEnabled:Boolean(f.enableRowSelection)})),[f]),S=f.enableRowSelection?y.length+1:y.length;return o.createElement(T,{striped:l,className:c},!s&&o.createElement(he,{headerGroups:b.getHeaderGroups(),getIsSomeRowsSelected:b.getIsSomeRowsSelected,getIsAllRowsSelected:b.getIsAllRowsSelected,getToggleAllRowsSelectedHandler:b.getToggleAllRowsSelectedHandler,featuresConfig:w}),o.createElement(pe,{columnsPerRow:S,Row:u,ExpandedRow:h,rows:b.getRowModel().rows,featuresConfig:w}),!a&&o.createElement(ge,{footerGroups:b.getFooterGroups(),featuresConfig:w}))}const me=(0,u.AH)(["th:nth-child(1),td:nth-child(1){position:sticky;left:0;background-color:inherit;}"]),ve=(0,u.AH)(["th:nth-child(2),td:nth-child(2){position:sticky;left:60px;background-color:inherit;}"]),ye=(0,u.Ay)(fe)([""," td,th{max-width:100%;white-space:nowrap;}.leading{color:",";font-weight:500;}.tls-crypt-v2{width:127px;min-width:127px;max-width:127px;}.profile-type{width:169px;min-width:169px;max-width:169px;}.date{width:132px;min-width:132px;max-width:132px;}.comment{width:279px;min-width:279px;max-width:279px;}.serial{width:208px;min-width:208px;max-width:208px;}"," ",""],function({withStickyLeadingColumn:e=!1,withRowSelection:t=!1}){return(0,u.AH)(["min-width:100%;color:",";font-size:14px;table-layout:fixed;border-collapse:separate;border-spacing:0;td{overflow:hidden;text-overflow:ellipsis;table-layout:fixed;}a{color:",";text-decoration:none;}"," ",""],c.A.neutralTextSubtitle,c.A.primaryBase,e?me:void 0,e&&t?ve:void 0)}({withRowSelection:!0,withStickyLeadingColumn:!0}),c.A.neutralTextTitle,O.Ay.moreThen(O.nm.SM)`
        .action-buttons-cell {
            width: 82px;
            min-width: 82px;
            max-width: 82px;
        }
    `,O.Ay.lessThen(O.nm.SM-1)`
        th:not(.leading, .row-selection-input, .action-buttons-cell),
        td:not(.leading, .row-selection-input, .action-buttons-cell) 
         {
            display: none;
        } 
        
    `);O.Ay.lessThen(O.nm.XS-1)`
        button {
            width: 100%;
            margin-bottom: 1rem;
        }
    `,O.Ay.moreThen(O.nm.XS)`
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
    `;var be=n(5417),we=n(777),Se=n(5962),Ee=n(9486),xe=n(8812),Te=n(2824);const De=u.Ay.table(["width:100%;table-layout:fixed;td{padding:18px 24px 18px 12px;font-weight:500;font-size:14px;line-height:20px;word-break:break-all;border-bottom:1px solid ",";&:first-child{padding:18px 12px 18px 24px;font-weight:500;font-size:12px;line-height:16px;}.ovpn-chip{white-space:nowrap;word-break:keep-all;}}"],c.A.neutralLight),Oe=(e,t)=>o.createElement(o.Fragment,null,o.createElement("td",null,e),o.createElement("td",null,t)),Ce=({columnOrder:e,columnVisibility:t,profile:n})=>{const r=e.filter((e=>t[e]));return o.createElement(De,null,o.createElement("tbody",null,r.map((e=>o.createElement("tr",{key:e},((e,t)=>{switch(t){case"algorithm":return Oe("Key Algorithm",e.algorithm);case"comment":return Oe("Comment",e.comment);case"created":return Oe("Added on",e.created);case"last_used":return Oe("Last Used",e.last_used);case"valid_until":return Oe("End Date",e.valid_until);case"profile_type":return Oe("Profile Type",o.createElement(xe.W,{profileType:e.profile_type}));case"serial":return Oe("Serial",e.serial);case"tls_crypt_v2":return Oe("TLS Crypt V2",o.createElement(Te.G,{checked:e.tls_crypt_v2}));default:return null}})(n,e))))))},Ie=e=>{const t=(0,Q.jL)(),{deleteSingle:n}=(0,Ee.V)(),r=()=>t((0,we.W6)(null));return o.createElement(l.A,{open:!0,onClose:r,title:"Profile",footer:o.createElement(a.A,{"aria-label":"Delete profile",fullWidth:!0,variant:"primary",onClick:async()=>{await Se.r.confirm({text:"Do you want to delete this profile?"})&&(n(e.profile.serial),r())},"data-testid":"delete-this-profile"},"Delete Profile")},o.createElement(Ce,e))};var Ae=n(8168),Pe=n(824),Ne=n(8255),ke=n(6816);const Re=u.Ay.div(["display:flex;gap:16px;align-items:center;margin-bottom:var(--spacing-sm,24px);",""],O.Ay.lessThen(O.nm.XS-1)`
        display: block;
    `),Me=u.Ay.div(["flex:0 0 160px;",""],O.Ay.lessThen(O.nm.SM-1)`
        display: block;
        flex-shrink: 1;
        margin-bottom: var(--spacing-xxxs, 4px);
    `),Le=u.Ay.div(["display:flex;gap:16px;justify-content:flex-end;width:100%;",""],O.Ay.lessThen(O.nm.XS-1)`
        flex-direction: column;
    `);var je=n(2663),_e=n(9546),He=n(9716),Ue=n(6765),ze=n(4473),Be=n(1219),Ve=n(7988),Fe=n(1676),$e=n(9344);let Ge,We,Xe=e=>e;const Ye=(0,u.Ay)(i.A)(Ge||(Ge=Xe`
    display: flex;
    flex-direction: column;
`)),Ke=(0,u.Ay)(i.A)(We||(We=Xe`
    display: flex;
    gap: 4px;

    padding: 4px;

    border: 1px solid ${0};
    border-radius: 4px;

    & > button {
        flex-grow: 1;
    }
`),c.A.neutralLight);var qe,Ze,Je,Qe=n(1085);const et=o.forwardRef((function(e,t){const{children:n,size:r="md",value:i,onChange:s,className:a,"data-testid":l,title:c,description:d,required:u,error:h=!1,success:g=!1,warning:p=!1,tooltip:f,...m}=e,[v,y]=o.useState(i),b=o.useRef(null),w=(0,Be.A)(t,b);o.useEffect((()=>{void 0!==i&&y(i)}),[i]);const S=o.useCallback((e=>{const t=e!==v?e:void 0;e!==v&&(y(t),null==s||s(t))}),[v,s]);return(0,Qe.jsxs)(Ye,{className:(0,_e.A)("ovpn-input-parent",a),"data-invalid":h||p||void 0,children:[!!c&&(0,Qe.jsxs)(Fe.i,{children:[(0,Qe.jsxs)(Fe.J,{...(0,Ve.A)(l,"input-label"),children:[c,u&&(qe||(qe=(0,Qe.jsx)(He.A,{size:15})))]}),!1===u&&"Optional"]}),(0,Qe.jsx)(Ke,{...m,ref:w,className:(0,_e.A)("ovpn-ui-switch"),$size:r,role:"group",...(0,Ve.A)(l),children:n.map(((e,t)=>{const n=t===v;return o.cloneElement(e,{size:r,variant:n?e.props.variant:"tertiary",role:"switch","aria-checked":n?"true":"false",className:(0,_e.A)("ovpn-ui-switch-button",e.props.className,{active:n,small:"sm"===r}),onClick:n=>{null==e.props.onClick||e.props.onClick(n),S(t)}})}))}),!!d&&(0,Qe.jsxs)($e.Q,{success:g,warning:p,error:!!h,children:[g&&(Ze||(Ze=(0,Qe.jsx)(Ue.A,{className:"ovpn-input-description-icon"}))),(h||p)&&(Je||(Je=(0,Qe.jsx)(ze.A,{className:"ovpn-input-description-icon"}))),(0,Qe.jsxs)($e.V,{...(0,Ve.A)(l,"description"),children:[" ",d]})]})]})}));et.Option=a.A;const tt=et;var nt=n(1509);const rt=({control:e,availableProfileTypes:t})=>{const n=(0,Pe.as)({control:e,name:"profile_type"}),r=(0,je.A)({maxWidth:O.nm.SM-1}),i=()=>["userlogin","autologin","generic"].filter((e=>t.includes(e)));return r?o.createElement(M.m,{options:i().map((e=>({id:e,title:(0,nt.P)(e)}))),value:n.field.value,onChange:n.field.onChange,"data-testid":"select-profile-type"}):o.createElement("div",null,o.createElement(tt,(()=>{const e=i();return{children:e.map((e=>o.createElement(a.A,{key:e},(0,nt.P)(e)))),value:e.indexOf(n.field.value),onChange:t=>{void 0!==t&&n.field.onChange(e[t])}}})()))};var ot=n(5506);let it=function(e){return e.OpenInApp="open-in-app",e.DownloadProfile="download-profile",e.DownloadLegacyProfile="download-legacy-profile",e.GenerateTokenUrl="generate-token-url",e}({});const st={id:it.DownloadLegacyProfile,title:"Download legacy profile \n(No TLS Crypt v2)"},at={id:it.GenerateTokenUrl,title:"Generate Token URL"},lt=({option:e})=>o.createElement("button",{autoFocus:!0,type:"button"},e.title),ct=({onActionButtonClick:e,disabled:t,isLegacyProfileDownloadAllowed:n,isTokenGenerationAllowed:r})=>{const i=(0,je.A)({maxWidth:O.nm.SM-1}),s=(({isLegacyProfileDownloadAllowed:e,isTokenGenerationAllowed:t})=>{const n=[];return e&&n.push(st),t&&n.push(at),n})({isLegacyProfileDownloadAllowed:n,isTokenGenerationAllowed:r});return i?o.createElement(o.Fragment,null,o.createElement(ot.A,{fullWidth:!0},o.createElement(a.A,{"aria-label":"Save and download",variant:"primary",onClick:()=>e(it.DownloadProfile),"data-testid":"save-and-download",disabled:t},"Save and Download"),n&&o.createElement(M.m,{variant:"button",style:{width:"auto",zIndex:3e3},placement:"bottom-end",options:[st],onChange:t=>e(t),"data-testid":"additional-options",renderOption:lt,disabled:t})),r&&o.createElement(ot.A,{fullWidth:!0},o.createElement(a.A,{"aria-label":"Open in app",variant:"ghostBlue",onClick:()=>e(it.OpenInApp),"data-testid":"open-in-app",disabled:t},"Import in App"),o.createElement(M.m,{variant:"button",style:{width:"auto",zIndex:3e3},placement:"bottom-end",options:[at],onChange:t=>e(t),"data-testid":"additional-options",renderOption:lt,disabled:t}))):o.createElement(o.Fragment,null,o.createElement(a.A,{"aria-label":"Save and download",variant:"primary",onClick:()=>e(it.DownloadProfile),"data-testid":"save-and-download",disabled:t},"Save and Download"),r&&o.createElement(a.A,{"aria-label":"Open in app",variant:"ghostBlue",onClick:()=>e(it.OpenInApp),"data-testid":"open-in-app",disabled:t},"Import in App"),s.length>0&&o.createElement(M.m,{variant:"button",style:{width:"auto",zIndex:3e3},placement:"bottom-end",options:s,onChange:t=>e(t),"data-testid":"additional-options",renderOption:lt,disabled:t}))},dt={weight:"medium",variant:"textMd",color:c.A.neutralTextTitle},ut=e=>{const{profileTypes:t,disabled:n,isTlsCryptV2Enforced:r,isTlsCryptV2Hidden:i,isProfileImportDisabled:a,onSubmit:l,onOpenInApp:c,generateTokenUrl:d}=e,{register:u,control:h,handleSubmit:g,formState:{isValid:p,errors:f},getValues:m,watch:v,setValue:y}=(0,Pe.mN)({values:{tls_crypt_v2:!i,comment:"",profile_type:t[0]},mode:"onChange"}),b="generic"===v("profile_type");(0,o.useEffect)((()=>{b&&y("comment","")}),[b,y]);const w=u("comment",{maxLength:{value:128,message:"The comment cannot exceed 128 characters."}});return o.createElement("form",{name:"create-profile",id:"create-profile",method:"POST",onSubmit:g(l),autoComplete:"off"},o.createElement(Re,null,o.createElement(Me,null,o.createElement(s.A,dt,"Profile type")),o.createElement(rt,{control:h,availableProfileTypes:t})),!b&&o.createElement(o.Fragment,null,o.createElement(Re,null,o.createElement(Me,null,o.createElement(s.A,dt,"Comment")),o.createElement(Ne.A,(0,Ae.A)({fullWidth:!0},w,{onChange:(e,t)=>w.onChange(t),id:"comment",error:Boolean(f.comment),"data-testid":"comment",autoComplete:"off"}))),Boolean(f.comment)&&o.createElement(Re,null,o.createElement(ke.A,{title:f.comment?.message,variant:"warning"}))),o.createElement(Le,null,o.createElement(ct,{onActionButtonClick:e=>{e===it.DownloadProfile&&g(l)(),e===it.OpenInApp&&c(m()),e===it.DownloadLegacyProfile&&(y("tls_crypt_v2",!1),g(l)()),e===it.GenerateTokenUrl&&d({...m()})},isLegacyProfileDownloadAllowed:!r&&!i,isTokenGenerationAllowed:!a,disabled:n||!p})))};var ht=n(6319),gt=n(730),pt=n(2978),ft=n(5765),mt=n(3444),vt=n(6350),yt=n(1850);const bt=u.Ay.div(["max-width:352px;margin:auto;padding:24px;text-align:center;"]),wt=({onAddProfileClick:e})=>o.createElement(bt,{"data-testid":"no-profiles-exists"},o.createElement(yt.A,null),o.createElement(s.A,{weight:"semiBold",variant:"textMd",color:c.A.neutralTextTitle,inline:!1,m:"16px 0 4px 0"},"No connection profiles"),e&&o.createElement(o.Fragment,null,o.createElement(s.A,{color:c.A.neutralTextPlaceholder,inline:!1,mb:24},"Start adding your first profile below."),o.createElement(a.A,{"aria-label":"Add New Profile",onClick:e,"data-testid":"empty-state-add-new-profile"},"Add New Profile")));var St=n(9078);const Et=u.Ay.div([""," ",""],O.Ay.lessThen(O.nm.XS-1)`
        button {
            width: 100%;
            margin-bottom: 1rem;
        }
    `,O.Ay.moreThen(O.nm.XS)`
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
    `),xt=({onAddProfileClick:e})=>o.createElement(Et,null,o.createElement(St.H1,{center:!1},"Connection profiles"),e&&o.createElement(a.A,{variant:"primary","aria-label":"Add New Profile",onClick:e,"data-testid":"add-new-profile"},"Add New Profile"));var Tt=n(5250),Dt=n(4369),Ot=n(7232),Ct=n(7547),It=n(2466),At=n(7300),Pt=n(4452),Nt=n(8389),kt=n(658),Rt=n(2064);let Mt;const Lt={button:"224px",input:"100%"},jt=u.Ay.div(Mt||(Mt=(e=>e)`
    position: absolute;

    z-index: 99;

    display: flex;

    flex-direction: column;

    width: ${0};

    height: 600;

    max-height: 600px;

    padding: 8px;

    overflow: hidden;

    color: ${0};

    background-color: ${0};

    border: 1px solid ${0};

    border-radius: 4px;

    box-shadow: ${0};

    transform: translateY(4px);

    ${0}

    hr {
        border: 1px solid ${0};
        border-top: none;
    }
`),(e=>{var t;return null==Lt?void 0:Lt[null!=(t=null==e?void 0:e.variant)?t:"input"]}),c.A.neutralTextSubtitle,c.A.neutralWhite,c.A.neutralLight,kt.A.sm,Rt.Ay.textSm,c.A.neutralBgHover);let _t,Ht,Ut=e=>e;const zt=u.Ay.div(_t||(_t=Ut`
    position: relative;

    width: 100%;
    max-width: 512px;

    .ovpn-input-trailing-icon {
        margin-left: -16px;

        cursor: pointer;
    }

    .ovpn-dropdown-input-variant {
        cursor: default;
    }
`)),Bt=u.Ay.div(Ht||(Ht=Ut`
    display: flex;
    align-items: center;

    max-width: 40px;

    & > svg:last-child {
        margin-left: auto;
    }
`));var Vt,Ft,$t;function Gt({title:e,description:t,placeholder:n="Search",icon:r,searchDebounceMs:i,options:s=[],disabled:a=!1,value:l,onSearch:c,"data-testid":d,inputRef:u,onKeyDown:h,className:g,style:p,error:f,warning:m,success:v,...y},b){const{options:w,showOptions:S,searchValue:E,selectedValue:x,isSelected:T,openOptions:D,closeOptions:O,useFloatingProps:C,handleSearch:I,setSelectedValue:A,handleCancel:P}=(0,At.A)({query:l,multiple:!1,placement:"bottom",searchDebounceMs:i,options:s,onSearch:c,clearSearch:!1}),N=(0,o.useRef)(null),k=(0,Dt.SV)([b,N]),{floatingProps:R,referenceProps:M}=C(N),L=(null==s?void 0:s.length)>0;(0,o.useEffect)((()=>{E&&D(),(1===E.length||x.id)&&O()}),[x,E,D,O]);const j=(0,o.useCallback)((e=>{I(e),A({title:"",id:""})}),[I,A]);return(0,Qe.jsxs)(zt,{ref:k,className:(0,_e.A)("ovpn-search",g),"data-invalid":m||f||void 0,style:p,...(0,Pt.A)(d),children:[(0,Qe.jsx)(Ne.A,{inputRef:u,type:"search",role:"searchbox",title:e,description:t,placeholder:n,disabled:a,error:f,warning:m,success:v,value:E||x.title,onChange:j,iconLeft:Vt||(Vt=(0,Qe.jsx)(Ot.A,{size:"md"})),iconRight:(0,Qe.jsxs)(Bt,{children:[E&&(0,Qe.jsx)(K.A,{size:"md",onClick:P}),L&&(S?Ft||(Ft=(0,Qe.jsx)(Ct.A,{size:"md"})):$t||($t=(0,Qe.jsx)(It.A,{size:"md"})))]}),...M,...y,onKeyDown:h}),L?S&&(0,Qe.jsx)(jt,{role:"menu",...R,children:(0,Qe.jsx)(Nt.A,{variant:"input",options:w,withSearchHighlight:!1,multiple:!1,selectAll:!1,handleSelectAll:Tt.noop,isSelected:T,handleClickItem:e=>{null==I||I(e.id),A(e),O()},checkedIcon:!0,multipleSelectedValues:w,searchValue:E,icon:r})}):null]})}const Wt=(0,o.forwardRef)(Gt);var Xt=n(4039),Yt=n(4745),Kt=n(2769),qt=n(5809),Zt=n(5271),Jt=n(8867),Qt=n(9503);function en(e,t,...n){if("undefined"!=typeof process&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;e=new Error(t.replace(/%s/g,(function(){return n[r++]}))),e.name="Invariant Violation"}throw e.framesToPop=1,e}}const tn="dnd-core/INIT_COORDS",nn="dnd-core/BEGIN_DRAG",rn="dnd-core/PUBLISH_DRAG_SOURCE",on="dnd-core/HOVER",sn="dnd-core/DROP",an="dnd-core/END_DRAG";function ln(e,t){return{type:tn,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function cn(e){return"object"==typeof e}const dn={type:tn,payload:{clientOffset:null,sourceClientOffset:null}};function un(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:i}=n,s=e.getMonitor(),a=e.getRegistry();e.dispatch(ln(o)),function(e,t,n){en(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){en(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,s,a);const l=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,s);if(null==l)return void e.dispatch(dn);let c=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){en("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),c=i(l)}e.dispatch(ln(o,c));const d=a.getSource(l).beginDrag(s,l);if(null==d)return;!function(e){en(cn(e),"Item must be an object.")}(d),a.pinSource(l);const u=a.getSourceType(l);return{type:nn,payload:{itemType:u,item:d,sourceId:l,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!r}}}}function hn(e){return function(){if(e.getMonitor().isDragging())return{type:rn}}}function gn(e,t){return null===t?null===e:Array.isArray(e)?e.some((e=>e===t)):e===t}function pn(e){return function(t,{clientOffset:n}={}){!function(e){en(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){en(t.isDragging(),"Cannot call hover while not dragging."),en(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t<e.length;t++){const r=e[t];en(e.lastIndexOf(r)===t,"Expected targetIds to be unique in the passed array."),en(n.getTarget(r),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];gn(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,o,i),{type:on,payload:{targetIds:r,clientOffset:n||null}}}}function fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fn(e,t,n[t])}))}return e}function vn(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();!function(e){en(e.isDragging(),"Cannot call drop while not dragging."),en(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);const o=function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach(((o,i)=>{const s=function(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;return function(e){en(void 0===e||cn(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:r.getDropResult()),i}(o,i,r,n),a={type:sn,payload:{dropResult:mn({},t,s)}};e.dispatch(a)}))}}function yn(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){en(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();return null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:an}}}class bn{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store,n=function(e){return{beginDrag:un(e),publishDragSource:hn(e),hover:pn(e),drop:vn(e),endDrag:yn(e)}}(this);return Object.keys(n).reduce(((r,o)=>{const i=n[o];var s;return r[o]=(s=i,(...n)=>{const r=s.apply(e,n);void 0!==r&&t(r)}),r}),{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}var wn=n(4848);const Sn=(e,t)=>e===t;function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Tn(e=xn,t){const{payload:n}=t;switch(t.type){case tn:case nn:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case on:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){En(e,t,n[t])}))}return e}({},e,{clientOffset:n.clientOffset});case an:case sn:return xn;default:return e}var r,o}const Dn="dnd-core/ADD_SOURCE",On="dnd-core/ADD_TARGET",Cn="dnd-core/REMOVE_SOURCE",In="dnd-core/REMOVE_TARGET";function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){An(e,t,n[t])}))}return e}const Nn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function kn(e=Nn,t){const{payload:n}=t;switch(t.type){case nn:return Pn({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case rn:return Pn({},e,{isSourcePublic:!0});case on:return Pn({},e,{targetIds:n.targetIds});case In:return-1===e.targetIds.indexOf(n.targetId)?e:Pn({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter((e=>e!==o)))});case sn:return Pn({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case an:return Pn({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function Rn(e=0,t){switch(t.type){case Dn:case On:return e+1;case Cn:case In:return e-1;default:return e}}const Mn=[],Ln=[];function jn(e=Mn,t){switch(t.type){case on:break;case Dn:case On:case In:case Cn:return Mn;default:return Ln}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(e,t){const n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach(((e,t)=>{1===e&&o.push(t)})),o}(n,r);if(!(o.length>0)&&function(e,t,n=Sn){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(n,r))return Mn;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function _n(e=0){return e+1}function Hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Hn(e,t,n[t])}))}return e}function zn(e={},t){return{dirtyHandlerIds:jn(e.dirtyHandlerIds,{type:t.type,payload:Un({},t.payload,{prevTargetIds:(n=e,r=[],"dragOperation.targetIds".split(".").reduce(((e,t)=>e&&e[t]?e[t]:r||null),n))})}),dragOffset:Tn(e.dragOffset,t),refCount:Rn(e.refCount,t),dragOperation:kn(e.dragOperation,t),stateId:_n(e.stateId)};var n,r}function Bn(e,t){return{x:e.x-t.x,y:e.y-t.y}}Mn.__IS_NONE__=!0,Ln.__IS_ALL__=!0;class Vn{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;en("function"==typeof e,"listener must be a function."),en(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe((()=>{const t=this.store.getState(),o=t.stateId;try{const i=o===r||o===r+1&&!function(e,t){return e!==Mn&&(e===Ln||void 0===t||(n=e,t.filter((e=>n.indexOf(e)>-1))).length>0);var n}(t.dirtyHandlerIds,n);i||e()}finally{r=o}}))}subscribeToOffsetChange(e){en("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe((()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())}))}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return en(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return en(t,`Expected to find a valid target. targetId=${e}`),!(!this.isDragging()||this.didDrop())&&(gn(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return en(t,`Expected to find a valid source. sourceId=${e}`),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!gn(r,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const s=i.indexOf(e);return n?s===i.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?Bn((i=r,{x:(o=t).x+i.x,y:o.y+i.y}),n):null;var o,i}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?Bn(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}let Fn=0;var $n;function Gn(e,t){t&&Array.isArray(e)?e.forEach((e=>Gn(e,!1))):en("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}($n||($n={}));const Wn="undefined"!=typeof global?global:self,Xn=Wn.MutationObserver||Wn.WebKitMutationObserver;function Yn(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const Kn="function"==typeof Xn?function(e){let t=1;const n=new Xn(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Yn;class qn{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const Zn=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Kn(this.flush),this.requestErrorThrow=Yn((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},Jn=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new qn(this.onError,(e=>t[t.length]=e));return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(Zn.registerPendingError);function Qn(e){switch(e[0]){case"S":return $n.SOURCE;case"T":return $n.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function er(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}class tr{addSource(e,t){Gn(e),function(e){en("function"==typeof e.canDrag,"Expected canDrag to be a function."),en("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),en("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler($n.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Dn,payload:{sourceId:e}}}(n)),n}addTarget(e,t){Gn(e,!0),function(e){en("function"==typeof e.canDrop,"Expected canDrop to be a function."),en("function"==typeof e.hover,"Expected hover to be a function."),en("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler($n.TARGET,e,t);return this.store.dispatch(function(e){return{type:On,payload:{targetId:e}}}(n)),n}containsHandler(e){return er(this.dragSources,e)||er(this.dropTargets,e)}getSource(e,t=!1){return en(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return en(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return en(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return en(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Qn(e)===$n.SOURCE}isTargetId(e){return Qn(e)===$n.TARGET}removeSource(e){var t;en(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Cn,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},Zn.enqueueTask(Jn.create(t))}removeTarget(e){en(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:In,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);en(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){en(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=function(e){const t=(Fn++).toString();switch(e){case $n.SOURCE:return`S${t}`;case $n.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}(e);return this.types.set(r,t),e===$n.SOURCE?this.dragSources.set(r,n):e===$n.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}function nr(e,t=void 0,n={},r=!1){const o=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return(0,wn.y$)(zn,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r),i=new Vn(o,new tr(o)),s=new bn(o,i),a=e(s,t,n);return s.receiveBackend(a),s}const rr=(0,o.createContext)({dragDropManager:void 0});let or=0;const ir=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var sr=(0,o.memo)((function(e){var{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children"]);const[r,i]=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];return[function(e,t=ar(),n,r){const o=t;return o[ir]||(o[ir]={dragDropManager:nr(e,t,n,r)}),o[ir]}(e.backend,e.context,e.options,e.debugMode),!e.context]}(n);return(0,o.useEffect)((()=>{if(i){const e=ar();return++or,()=>{0==--or&&(e[ir]=null)}}}),[]),(0,Qe.jsx)(rr.Provider,{value:r,children:t})}));function ar(){return"undefined"!=typeof global?global:window}function lr(e){let t=null;return()=>(null==t&&(t=e()),t)}class cr{enter(e){const t=this.entered.length;return this.entered=function(e,t){const n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);const o=[];return n.forEach((e=>o.push(e))),o}(this.entered.filter((t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e)))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var n,r;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter((e=>e!==r))),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}const dr=lr((()=>/firefox/i.test(navigator.userAgent))),ur=lr((()=>Boolean(window.safari)));class hr{interpolate(e){const{xs:t,ys:n,c1s:r,c2s:o,c3s:i}=this;let s=t.length-1;if(e===t[s])return n[s];let a,l=0,c=i.length-1;for(;l<=c;){a=Math.floor(.5*(l+c));const r=t[a];if(r<e)l=a+1;else{if(!(r>e))return n[a];c=a-1}}s=Math.max(0,c);const d=e-t[s],u=d*d;return n[s]+r[s]*d+o[s]*u+i[s]*d*u}constructor(e,t){const{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort(((t,n)=>e[t]<e[n]?-1:1));const o=[],i=[],s=[];let a,l;for(let r=0;r<n-1;r++)a=e[r+1]-e[r],l=t[r+1]-t[r],i.push(a),o.push(l),s.push(l/a);const c=[s[0]];for(let e=0;e<i.length-1;e++){const t=s[e],n=s[e+1];if(t*n<=0)c.push(0);else{a=i[e];const r=i[e+1],o=a+r;c.push(3*o/((o+r)/t+(o+a)/n))}}c.push(s[s.length-1]);const d=[],u=[];let h;for(let e=0;e<c.length-1;e++){h=s[e];const t=c[e],n=1/i[e],r=t+c[e+1]-h-h;d.push((h-t-r)*n),u.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=c,this.c2s=d,this.c3s=u}}function gr(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function pr(e){return{x:e.clientX,y:e.clientY}}const fr="__NATIVE_FILE__",mr="__NATIVE_URL__",vr="__NATIVE_TEXT__",yr="__NATIVE_HTML__";function br(e,t,n){const r=t.reduce(((t,n)=>t||e.getData(n)),"");return null!=r?r:n}const wr={[fr]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[yr]:{exposeProperties:{html:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[mr]:{exposeProperties:{urls:(e,t)=>br(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[vr]:{exposeProperties:{text:(e,t)=>br(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};class Sr{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach((e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})}))}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach((n=>{const r=this.config.exposeProperties[n];null!=r&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})})),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}function Er(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(wr).filter((e=>{const n=wr[e];return!!(null==n?void 0:n.matchesTypes)&&n.matchesTypes.some((e=>t.indexOf(e)>-1))}))[0]||null}class xr{get window(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function Tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tr(e,t,n[t])}))}return e}class Or{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;var t;void 0!==e&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(t=this.window)||void 0===t||t.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);const r=t=>this.handleDragStart(t,e),o=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",r),t.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",r),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),o=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",n),t.addEventListener("dragover",r),t.addEventListener("drop",o),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragover",r),t.removeEventListener("drop",o)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Dr({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return Dr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(r).some((t=>r[t]===e))}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const n=wr[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new Sr(n);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}clearCurrentDragSourceNode(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&gr(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag()},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const n=pr(e);this.monitor.isDragging()&&this.actions.endDrag(),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});const{dataTransfer:r}=e,o=Er(r);if(this.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),o=this.sourcePreviewNodes.get(e)||t;if(o){const{anchorX:e,anchorY:i,offsetX:s,offsetY:a}=this.getCurrentSourcePreviewNodeOptions(),l=function(e,t,n,r,o){const i="IMG"===(s=t).nodeName&&(dr()||!(null===(a=document.documentElement)||void 0===a?void 0:a.contains(s)));var s,a;const l=gr(i?e:t),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:d,offsetHeight:u}=e,{anchorX:h,anchorY:g}=r,{dragPreviewWidth:p,dragPreviewHeight:f}=function(e,t,n,r){let o=e?t.width:n,i=e?t.height:r;return ur()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(i,t,d,u),{offsetX:m,offsetY:v}=o,y=0===v||v;return{x:0===m||m?m:new hr([0,.5,1],[c.x,c.x/d*p,c.x+p-d]).interpolate(h),y:y?v:(()=>{let e=new hr([0,.5,1],[c.y,c.y/u*f,c.y+f-u]).interpolate(g);return ur()&&i&&(e+=(window.devicePixelRatio-1)*f),e})()}}(t,o,n,{anchorX:e,anchorY:i},{offsetX:s,offsetY:a});r.setDragImage(o,l.x,l.y)}}try{null==r||r.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout((()=>this.actions.publishDragSource()),0)}else if(o)this.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag()},this.handleTopDragEnterCapture=e=>{var t;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)),!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:n}=e,r=Er(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:pr(e)}),t.some((e=>this.monitor.canDropOnTarget(e)))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{var t;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=pr(e),null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame((()=>{this.monitor.isDragging()&&this.actions.hover(t||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))),(t||[]).some((e=>this.monitor.canDropOnTarget(e)))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&this.isDraggingNativeItem()&&setTimeout((()=>this.endDragNativeItem()),0)},this.handleTopDropCapture=e=>{var t;this.dropTargetIds=[],this.isDraggingNativeItem()?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Er(e.dataTransfer)&&e.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:pr(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new xr(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new cr(this.isNodeInDocument)}}const Cr=function(e,t,n){return new Or(e,t,n)};var Ir;!function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"}(Ir||(Ir={}));function Ar(e){return void 0===e.button||0===e.button}function Pr(e){return!!e.targetTouches}function Nr(e,t){return Pr(e)?function(e,t){return 1===e.targetTouches.length?Nr(e.targetTouches[0]):t&&1===e.touches.length&&e.touches[0].target===t.target?Nr(e.touches[0]):void 0}(e,t):{x:e.clientX,y:e.clientY}}const kr=(()=>{let e=!1;try{addEventListener("test",(()=>{}),Object.defineProperty({},"passive",{get:()=>(e=!0,!0)}))}catch(e){}return e})();class Rr{get delay(){var e;return null!==(e=this.args.delay)&&void 0!==e?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return null!==(e=this.args.ignoreContextMenu)&&void 0!==e&&e}get enableHoverOutsideTarget(){var e;return null!==(e=this.args.enableHoverOutsideTarget)&&void 0!==e&&e}get enableKeyboardEvents(){var e;return null!==(e=this.args.enableKeyboardEvents)&&void 0!==e&&e}get enableMouseEvents(){var e;return null!==(e=this.args.enableMouseEvents)&&void 0!==e&&e}get enableTouchEvents(){var e;return null===(e=this.args.enableTouchEvents)||void 0===e||e}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,t,n,r;return null!==(r=null!==(n=null===(e=this.args)||void 0===e?void 0:e.delayTouchStart)&&void 0!==n?n:null===(t=this.args)||void 0===t?void 0:t.delay)&&void 0!==r?r:0}get delayMouseStart(){var e,t,n,r;return null!==(r=null!==(n=null===(e=this.args)||void 0===e?void 0:e.delayMouseStart)&&void 0!==n?n:null===(t=this.args)||void 0===t?void 0:t.delay)&&void 0!==r?r:0}get window(){return this.context&&this.context.window?this.context.window:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.context)||void 0===e?void 0:e.document)?this.context.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.args)||void 0===e?void 0:e.rootElement)||this.document}constructor(e,t){this.args=e,this.context=t}}const Mr={[Ir.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Ir.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Ir.keyboard]:{keydown:"keydown"}};class Lr{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:(null===(e=this.dragOverTargetIds)||void 0===e?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(en(!Lr.isSetUp,"Cannot have two Touch backends at the same time."),Lr.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(Lr.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,t,n,r=!1){const o=kr?{capture:r,passive:!1}:r;this.listenerTypes.forEach((function(r){const i=Mr[r][t];i&&e.addEventListener(i,n,o)}))}removeEventListener(e,t,n,r=!1){const o=kr?{capture:r,passive:!1}:r;this.listenerTypes.forEach((function(r){const i=Mr[r][t];i&&e.removeEventListener(i,n,o)}))}connectDragSource(e,t){const n=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,t),this.addEventListener(t,"start",n),()=>{this.sourceNodes.delete(e),this.removeEventListener(t,"start",n)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,t){const n=this.options.rootElement;if(!this.document||!n)return()=>{};const r=r=>{if(!this.document||!n||!this.monitor.isDragging())return;let o;switch(r.type){case Mr.mouse.move:o={x:r.clientX,y:r.clientY};break;case Mr.touch.move:var i,s;o={x:(null===(i=r.touches[0])||void 0===i?void 0:i.clientX)||0,y:(null===(s=r.touches[0])||void 0===s?void 0:s.clientY)||0}}const a=null!=o?this.document.elementFromPoint(o.x,o.y):void 0,l=a&&t.contains(a);return a===t||l?this.handleMove(r,e):void 0};return this.addEventListener(this.document.body,"move",r),this.targetNodes.set(e,t),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",r))}}getTopMoveStartHandler(){return this.options.delayTouchStart||this.options.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver((()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())})),e&&e.parentElement&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,t,n){this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&function(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}(t)},this.handleTopMoveStartCapture=e=>{Ar(e)&&(this.moveStartSourceIds=[])},this.handleMoveStart=e=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(e)},this.handleTopMoveStart=e=>{if(!Ar(e))return;const t=Nr(e);t&&(Pr(e)&&(this.lastTargetTouchFallback=e.targetTouches[0]),this._mouseClientOffset=t),this.waitingForDelay=!1},this.handleTopMoveStartDelay=e=>{if(!Ar(e))return;const t=e.type===Mr.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(e,t)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(t)},this.handleTopMove=e=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:t,dragOverTargetIds:n}=this,r=this.options.enableHoverOutsideTarget,o=Nr(e,this.lastTargetTouchFallback);if(!o)return;if(this._isScrolling||!this.monitor.isDragging()&&function(e,t,n,r,o){if(!o)return!1;const i=180*Math.atan2(r-t,n-e)/Math.PI+180;for(let e=0;e<o.length;++e){const t=o[e];if(t&&(null==t.start||i>=t.start)&&(null==t.end||i<=t.end))return!0}return!1}(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,o.x,o.y,this.options.scrollAngleRanges))return void(this._isScrolling=!0);var i,s,a,l;if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&t&&(i=this._mouseClientOffset.x||0,s=this._mouseClientOffset.y||0,a=o.x,l=o.y,Math.sqrt(Math.pow(Math.abs(a-i),2)+Math.pow(Math.abs(l-s),2))>(this.options.touchSlop?this.options.touchSlop:0))&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),e.cancelable&&e.preventDefault();const d=(n||[]).map((e=>this.targetNodes.get(e))).filter((e=>!!e)),u=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(o.x,o.y,d):this.document.elementsFromPoint(o.x,o.y),h=[];for(const e in u){if(!u.hasOwnProperty(e))continue;let t=u[e];for(null!=t&&h.push(t);t;)t=t.parentElement,t&&-1===h.indexOf(t)&&h.push(t)}const g=h.filter((e=>d.indexOf(e)>-1)).map((e=>this._getDropTargetId(e))).filter((e=>!!e)).filter(((e,t,n)=>n.indexOf(e)===t));if(r)for(const e in this.targetNodes){const t=this.targetNodes.get(e);if(c&&t&&t.contains(c)&&-1===g.indexOf(e)){g.unshift(e);break}}g.reverse(),this.actions.hover(g,{clientOffset:o})},this._getDropTargetId=e=>{const t=this.targetNodes.keys();let n=t.next();for(;!1===n.done;){const r=n.value;if(e===this.targetNodes.get(r))return r;n=t.next()}},this.handleTopMoveEndCapture=e=>{this._isScrolling=!1,this.lastTargetTouchFallback=void 0,function(e){return void 0===e.buttons||!(1&e.buttons)}(e)&&(this.monitor.isDragging()&&!this.monitor.didDrop()?(e.cancelable&&e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()):this.moveStartSourceIds=void 0)},this.handleCancelOnEscape=e=>{"Escape"===e.key&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new Rr(n,t),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Ir.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Ir.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Ir.keyboard)}}const jr=function(e,t={},n={}){return new Lr(e,t,n)};var _r=n(2784),Hr=n.n(_r),Ur=n(5457),zr=n(5282);const Br=u.Ay.div(["min-width:256px;max-height:325px;padding-top:8px;overflow:auto;color:",";"],c.A.neutralTextSubtitle),Vr=u.Ay.div(["display:flex;justify-content:space-between;padding:8px 16px;background-color:#fff;&:hover{background-color:#f9fafb;}[data-testid='drag-handle']{cursor:grab;}[data-testid='toggle-item-visibility']{cursor:pointer;}"]),Fr=u.Ay.span(["flex:1;margin:0 8px;"]),$r=u.Ay.div(["&[data-dragging='true']{opacity:0.1;}"]),Gr=u.Ay.div(["position:sticky;bottom:0;padding:0 16px 8px;background:#fff;"]);function Wr(){const{dragDropManager:e}=(0,o.useContext)(rr);return en(null!=e,"Expected drag drop context"),e}const Xr="undefined"!=typeof window?o.useLayoutEffect:o.useEffect;class Yr{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Kr(e,t){const n=[...t||[]];return null==t&&"function"!=typeof e&&n.push(e),(0,o.useMemo)((()=>"function"==typeof e?e():e),n)}let qr=!1;class Zr{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;en(!qr,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return qr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{qr=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Jr(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let s=0;s<i.length;s++){const l=i[s];if(!a(l))return!1;const c=e[l],d=t[l];if(o=n?n.call(r,c,d,l):void 0,!1===o||void 0===o&&c!==d)return!1}return!0}function Qr(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const e=function(e){return(t=null,n=null)=>{if(!(0,o.isValidElement)(t)){const r=t;return e(r,n),r}const r=t;return function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}(r),function(e,t){const n=e.ref;return en("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,o.cloneElement)(e,{ref:e=>{eo(n,e),eo(t,e)}}):(0,o.cloneElement)(e,{ref:t})}(r,n?t=>e(t,n):e)}}(r);t[n]=()=>e}})),t}function eo(e,t){"function"==typeof e?e(t):e.current=t}function to(e){return null!==e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}class no{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Jr(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Qr({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,to(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}var ro=n(8792);function oo(e,t,n){return function(e,t,n){const[r,i]=function(e,t,n){const[r,i]=(0,o.useState)((()=>t(e))),s=(0,o.useCallback)((()=>{const o=t(e);ro(r,o)||(i(o),n&&n())}),[r,e,n]);return Xr(s),[r,s]}(e,t,n);return Xr((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(i,{handlerIds:[t]})}),[e,i]),r}(t,e||(()=>({})),(()=>n.reconnect()))}function io(e){return(0,o.useMemo)((()=>e.hooks.dropTarget()),[e])}function so(e,t){const n=Kr(e,t),r=function(){const e=Wr();return(0,o.useMemo)((()=>new Zr(e)),[e])}(),i=function(e){const t=Wr(),n=(0,o.useMemo)((()=>new no(t.getBackend())),[t]);return Xr((()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget())),[e]),n}(n.options);return function(e,t,n){const r=Wr(),i=function(e,t){const n=(0,o.useMemo)((()=>new Yr(e,t)),[t]);return(0,o.useEffect)((()=>{n.spec=e}),[e]),n}(e,t),s=function(e){const{accept:t}=e;return(0,o.useMemo)((()=>(en(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t])),[t])}(e);Xr((function(){const[e,o]=function(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}(s,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}),[r,t,i,n,s.map((e=>e.toString())).join("|")])}(n,r,i),[oo(n.collect,r,i),io(i)]}class ao{beginDrag(){const e=this.spec,t=this.monitor;let n=null;return n="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=n?n:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const n=this.spec,r=this.monitor,{isDragging:o}=n;return o?o(r):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}}let lo=!1,co=!1;class uo{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){en(!lo,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return lo=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{lo=!1}}isDragging(){if(!this.sourceId)return!1;en(!co,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return co=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{co=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class ho{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Jr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Jr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Qr({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,to(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,to(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}function go(e){return(0,o.useMemo)((()=>e.hooks.dragSource()),[e])}function po(e){return(0,o.useMemo)((()=>e.hooks.dragPreview()),[e])}function fo(e,t){const n=Kr(e,t);en(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=function(){const e=Wr();return(0,o.useMemo)((()=>new uo(e)),[e])}(),i=function(e,t){const n=Wr(),r=(0,o.useMemo)((()=>new ho(n.getBackend())),[n]);return Xr((()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource())),[r,e]),Xr((()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview())),[r,t]),r}(n.options,n.previewOptions);return function(e,t,n){const r=Wr(),i=function(e,t,n){const r=(0,o.useMemo)((()=>new ao(e,t,n)),[t,n]);return(0,o.useEffect)((()=>{r.spec=e}),[e]),r}(e,t,n),s=function(e){return(0,o.useMemo)((()=>{const t=e.type;return en(null!=t,"spec.type must be defined"),t}),[e])}(e);Xr((function(){if(null!=s){const[e,o]=function(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}(s,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}}),[r,t,n,i,s])}(n,r,i),[oo(n.collect,r,i),go(i),po(i)]}const mo="draggable-item",vo=e=>{const{index:t,children:n,onMove:r}=e,i=(0,o.useRef)(null),[{handlerId:s},a]=so({accept:mo,collect:e=>({handlerId:e.getHandlerId()}),hover(e,n){const o=t,s=e.index,a=s===o;if(!i.current||a)return;const l=i.current?.getBoundingClientRect(),c=((d=l).bottom-d.top)/2;var d;const u=n.getClientOffset().y-l.top,h=s>o,g=s<o&&((e,t)=>e>t)(c,u)||h&&((e,t)=>e<t)(c,u);g||(r(s,o),e.index=o)}}),[{isDragging:l},c]=fo({type:mo,item:()=>({index:t}),collect:e=>({isDragging:e.isDragging()})});return c(a(i)),o.createElement($r,{ref:i,"data-handler-id":s,"data-dragging":l,"data-testid":"draggable-item"},n)},yo=(0,zr.C)(),bo=e=>{const{columns:t,onChange:n,onReset:r}=e,{open:i,openDropdown:s,closeDropdown:l,toggleWithKeyPress:c}=(0,Xt.U)(),d=(0,o.useCallback)((e=>e?s():l()),[s,l]),u=e=>{n((t=>t.map((t=>e.id===t.id?{...t,enabled:!t.enabled}:t))))},h=(0,o.useCallback)(((e,t)=>{n((n=>{const r=n.slice();return r.splice(e,1),r.splice(t,0,n[e]),r}))}),[n]),g=(0,o.useMemo)((()=>Hr()(h,40)),[h]);return o.createElement(Yt.A,{open:i,onChange:d,trigger:o.createElement(Kt.A,{onKeyUp:c,"aria-label":yo?"":"Manage columns",variant:"ghost","data-testid":"open-columns-manager"},o.createElement(qt.A,null)),placement:"bottom-end",withOverlay:!1,zIndex:100},o.createElement(Br,null,o.createElement(sr,{backend:yo?jr:Cr},t.map(((e,t)=>o.createElement(vo,{key:e.id,index:t,onMove:g},o.createElement(Vr,{key:e.id,"data-id":t},o.createElement(Zt.A,{"data-testid":"drag-handle"}),o.createElement(Fr,null,e.name),e.enabled?o.createElement(Jt.A,{"data-testid":"toggle-item-visibility",onClick:()=>u(e)}):o.createElement(Qt.A,{"data-testid":"toggle-item-visibility",onClick:()=>u(e)})))))),o.createElement(Gr,null,o.createElement(Ur.A,null),o.createElement(a.A,{"aria-label":"Reset",variant:"ghostBlue",onClick:r,fullWidth:!0},"Reset"))))},wo=e=>{const{areControlsShown:t,searchValue:n,managerColumns:r,onColumnsChange:a,onColumnsReset:l,onSearch:c}=e;return o.createElement(N,{withBorder:!0,padding:"24px",left:o.createElement(s.A,{className:"hidden-xs",variant:"textLg",weight:"semiBold",m:0},"Overview"),right:t?o.createElement(o.Fragment,null,o.createElement(Wt,{placeholder:"Search",value:n,onSearch:e=>c({target:{value:e}}),name:"search","data-testid":"search"}),o.createElement(i.A,{m:"0 0 0 16px"},o.createElement(bo,{columns:r,onChange:a,onReset:l}))):void 0})};var So=n(994),Eo=n(1933),xo=n(9777),To=n(4955);let Do,Oo,Co=e=>e;const Io=u.Ay.div(Do||(Do=Co`
    display: inline-flex;
    align-items: center;
`)),Ao=u.Ay.button(Oo||(Oo=Co`
    margin: 0;
    padding: 0;

    background-color: transparent;

    border: none;
    border-radius: 4px;

    outline: none;

    cursor: pointer;

    &:focus {
        outline: none;

        box-shadow: ${0};
    }
`),kt.A.focusedBlue);var Po,No;const ko=o.forwardRef((function({variant:e="icon",value:t,onCopy:n,className:r,...i},s){var a;const[l,d]=o.useState(!1);o.useEffect((()=>{const e=setTimeout((()=>{d(!1)}),2e3);return()=>{clearTimeout(e)}}),[l]);const u=l?"Copied to clipboard":"Copy",h=l?Po||(Po=(0,Qe.jsx)(Eo.A,{})):No||(No=(0,Qe.jsx)(xo.A,{})),g=()=>{navigator.clipboard.writeText(t).then((()=>{null==n||n(t),d(!0)}))};return(0,Qe.jsx)(Io,{ref:s,className:(0,_e.A)("ovpn-clipboard",r),...i,children:(0,So.YW)(e).with("icon",(()=>(0,Qe.jsx)(To.A,{trigger:(0,Qe.jsx)(Ao,{type:"button","aria-label":u,onClick:g,className:"ovpn-clipboard-as-icon",children:o.cloneElement(h,{size:"lg",color:c.A.neutralTextBody,style:{strokeWidth:1.5}})}),children:u}))).with("button",(()=>a||(a=(0,Qe.jsx)(Kt.A,{"aria-label":u,role:"button",variant:"ghost",onClick:g,className:"ovpn-clipboard-as-button",children:h})))).otherwise((()=>null))})})),Ro=({tokenUrl:e,onClose:t})=>o.createElement(l.A,{open:!!e,onClose:t,title:"Token URL",description:"Only valid once and will expire in 5 minutes",footer:o.createElement(a.A,{fullWidth:!0,variant:"primary",onClick:()=>{navigator.clipboard.writeText(e||"").then((()=>{t(),ft.o.success("Token URL copied to clipboard ")}))}},"Copy To Clipboard and Close")},o.createElement(Ne.A,{fullWidth:!0,value:e,readOnly:!0,suffix:o.createElement(ko,{value:e||""})})),Mo=e=>e.serial,Lo=()=>{const e=(0,Q.jL)(),{profiles:t,total:n,isLoading:r,isEmptyPageShown:u,isTableShown:h,isNoResultsShown:g}=(0,ee.O)(),{columns:p,columnOrder:f,columnVisibility:m,managerColumns:v,onColumnsChange:y,onColumnsReset:b}=(0,te.r)(),{actionButtons:w,onActionButtonClick:x}=(0,ne.j)(),{pageNumber:T,pageSize:D,onPageChange:O,onPageSizeChange:C}=(0,re.Q)(),{onSortingChange:I,sorting:A}=(0,re.GT)(),P=(0,re.iY)(t,"serial"),{rowSelection:k,isAllSelected:R,onRowSelectionChange:M}=P,L=R?n:Object.keys(k).length,{searchValue:j,onSearch:_}=(0,re.iV)(),{onBulkAction:H}=(0,oe.x)(P),U=(0,Q.GV)(be.mp),z=n>D,B=L>0,V=(0,o.useMemo)((()=>({sorting:A,rowSelection:k,columnOrder:f,columnVisibility:m})),[A,k,f,m]),{isCreateProfileFormShown:F,availableProfileTypes:$,isLoading:W,isTlsCryptV2Enforced:X,isTlsCryptV2Hidden:K,isProfileImportDisabled:q,onSubmit:Z,onOpenInApp:ie,toggleCreateProfileFormVisibility:se,generateTokenUrl:ae,tokenUrl:le,closeTokenUrlModal:ce}=function(){const[e,t]=(0,o.useState)(!1),[n,r]=(0,o.useState)(""),{isTlsCryptV2Enforced:i,isTlsCryptV2Hidden:s,availableProfileTypes:a,isProfileImportDisabled:l}=(0,mt.z)(),[c,{isLoading:d}]=(0,vt.Jw)(),[u,{isLoading:h}]=(0,vt.Kl)(),g=(0,o.useCallback)((async e=>{(0,ht.W)(e)&&(0,gt.Z)(e.data)&&!(0,pt.H)(e)&&ft.o.error(e.data.reason)}),[]),p=(0,o.useCallback)((async e=>{try{await u(e).unwrap(),ft.o.success("Profile created."),t(!1)}catch(e){g(e)}}),[u,g]),f=(0,o.useCallback)((async e=>{try{const n=window.open(void 0,"_top"),r=await c(e).unwrap();n&&(n.location.href=r),t(!1)}catch(e){g(e)}}),[c,g]),m=(0,o.useCallback)((async e=>{try{const n=await c(e).unwrap();r(n),t(!1)}catch(e){g(e)}}),[c,g]);return{availableProfileTypes:a,isCreateProfileFormShown:e,tokenUrl:n,isLoading:d||h,isTlsCryptV2Enforced:i,isTlsCryptV2Hidden:s,isProfileImportDisabled:l,onOpenInApp:f,onSubmit:p,toggleCreateProfileFormVisibility:(0,o.useCallback)((()=>t((e=>!e))),[]),generateTokenUrl:m,closeTokenUrlModal:()=>r("")}}();(0,o.useEffect)((()=>()=>{e((0,we.Fr)())}),[]);const de=$.length?se:void 0;return o.createElement(o.Fragment,null,U&&o.createElement(Ie,{profile:U,columnOrder:f,columnVisibility:m}),o.createElement(xt,{onAddProfileClick:de}),o.createElement(S,null,o.createElement(wo,{areControlsShown:h,searchValue:j,managerColumns:v,onSearch:_,onColumnsChange:y,onColumnsReset:b}),o.createElement(E,null,u&&o.createElement(wt,{onAddProfileClick:de}),h&&o.createElement(ye,{striped:!0,isLoading:r,skeletonRowsCount:D,columns:p,data:t,actionButtons:w,enableRowSelection:!0,getRowId:Mo,state:V,manualSorting:!0,onSortingChange:I,onRowSelectionChange:M,onActionButtonClick:x}),g&&o.createElement(i.A,{p:"24px"},o.createElement(s.A,{variant:"textMd",weight:"semiBold",color:c.A.neutralTextTitle,inline:!1,center:!0},"No results"))),z&&o.createElement(N,{left:o.createElement(G,{pageSize:D,page:T,itemsShown:t.length,total:n,maxDisplayedItems:7,onPageChange:O,disabled:r,onPageSizeChange:C}),fullWidth:!0}),B&&o.createElement(Y,null,o.createElement(J,{totalItems:n,selectedItems:L,onAction:H,itemName:"Profiles",isSelectAllButtonShown:!0},o.createElement(a.A,{variant:"warning","aria-label":"Delete selected",onClick:()=>H("delete"),"data-testid":"delete-selected"},o.createElement(d.A,null)," Delete Selected")))),o.createElement(l.A,{open:F,onClose:se,title:"Add New Profile",size:"xl","data-testid":"profile-creation-form",footer:null,closeOnClickOutside:!0},o.createElement(ut,{profileTypes:$,disabled:W,isTlsCryptV2Enforced:X,isTlsCryptV2Hidden:K,isProfileImportDisabled:q,onSubmit:Z,onOpenInApp:ie,generateTokenUrl:ae})),o.createElement(Ro,{tokenUrl:le,onClose:ce}))},jo=Lo},8631:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(9690),o=n(4041),i=n(7436);const s=({value:e,options:t,multiple:n,renderOption:s,onChange:a,...l})=>{const c=(0,o.useMemo)((()=>function(e,t,n){return n&&Array.isArray(t)?e.filter((e=>t?.includes(e.id))):e.find((e=>e.id===t))}(t,e,n)),[t,e,n]),d=(0,o.useCallback)((e=>{a?.(n?e.map((e=>e.id)):e.id,e)}),[n,a]);return o.createElement(i.A,(0,r.A)({value:c,multiple:n,onChange:d,options:t,renderOption:s},l))}},9078:(e,t,n)=>{"use strict";n.d(t,{H1:()=>d});var r=n(9690),o=n(4041),i=n(3580),s=n(8081),a=n(3578),l=n(738);const c=(0,s.Ay)(a.A)(["margin-top:0;margin-bottom:var(--spacing-md,32);letter-spacing:-0.64px;",""],l.Ay.lessThen(l.nm.MD-1)`
        margin-bottom: var(--spacing-sm, 24);
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -0.48px;
    `),d=e=>o.createElement(c,(0,r.A)({color:i.A.neutralTextTitle,inline:!1,variant:"displayLg",center:!0,weight:"semiBold"},e))},8792:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},4187:e=>{e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},7165:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},1035:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},3640:(e,t,n)=>{var r=n(4187),o=n(5881),i=n(9850),s=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(s,"")),e,"")}}},9968:(e,t,n)=>{var r=n(1035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"});e.exports=r},5813:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},482:e=>{var t="\\ud800-\\udfff",n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",o="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",s="["+i+"]",a="\\d+",l="["+n+"]",c="["+r+"]",d="[^"+t+i+a+n+r+o+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="["+o+"]",p="(?:"+c+"|"+d+")",f="(?:"+g+"|"+d+")",m="(?:['’](?:d|ll|m|re|s|t|ve))?",v="(?:['’](?:D|LL|M|RE|S|T|VE))?",y="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",b="[\\ufe0e\\ufe0f]?",w=b+y+"(?:\\u200d(?:"+["[^"+t+"]",u,h].join("|")+")"+b+y+")*",S="(?:"+[l,u,h].join("|")+")"+w,E=RegExp([g+"?"+c+"+"+m+"(?="+[s,g,"$"].join("|")+")",f+"+"+v+"(?="+[s,g+p,"$"].join("|")+")",g+"?"+p+"+"+m,g+"+"+v,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",a,S].join("|"),"g");e.exports=function(e){return e.match(E)||[]}},5881:(e,t,n)=>{var r=n(9968),o=n(5243),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(s,"")}},5479:(e,t,n)=>{var r=n(3640),o=n(5485),i=r((function(e,t,n){return e+(n?" ":"")+o(t)}));e.exports=i},9850:(e,t,n)=>{var r=n(7165),o=n(5813),i=n(5243),s=n(482);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?s(e):r(e):e.match(t)||[]}}}]);