dvadf
File manager - Edit - /home/centroca/public_html/wp/wp-content/plugins/nextgen-gallery/static/IGW/Block/build/block-imagely-block.min.js
Back
/*! For license information please see block-imagely-block.min.js.LICENSE.txt */ (()=>{var e,t,n={3375:(e,t,n)=>{"use strict";n.d(t,{Mp:()=>Ve,Hd:()=>mt,vL:()=>ae,uN:()=>se,Pf:()=>xe,AN:()=>fe,fp:()=>k,y$:()=>O,Sj:()=>F,Vy:()=>C,sl:()=>G,TT:()=>P,fF:()=>Je,PM:()=>Ze,zM:()=>tt,MS:()=>h,FR:()=>y});var r=n(1609),a=n.n(r),o=n(5795),i=n(4979);const l={display:"none"};function c(e){let{id:t,value:n}=e;return a().createElement("div",{id:t,style:l},n)}function s(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return a().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const u=(0,r.createContext)(null),d={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},m={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function g(e){let{announcements:t=m,container:n,hiddenTextDescribedById:l,screenReaderInstructions:g=d}=e;const{announce:f,announcement:p}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),h=(0,i.YG)("DndLiveRegion"),[y,v]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{v(!0)},[]),function(e){const t=(0,r.useContext)(u);(0,r.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,r.useMemo)(()=>({onDragStart(e){let{active:n}=e;f(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&f(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;f(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;f(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;f(t.onDragCancel({active:n,over:r}))}}),[f,t])),!y)return null;const b=a().createElement(a().Fragment,null,a().createElement(c,{id:l,value:g.draggable}),a().createElement(s,{id:h,announcement:p}));return n?(0,o.createPortal)(b,n):b}var f;function p(){}function h(e,t){return(0,r.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(f||(f={}));const v=Object.freeze({x:0,y:0});function b(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function w(e,t){const n=(0,i.e_)(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function x(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function E(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _(e){let{left:t,top:n,height:r,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+r},{x:t+a,y:n+r}]}function C(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function N(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const k=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=N(t,t.left,t.top),o=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=b(N(r),a);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(x)},O=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=_(t),o=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=_(r),i=a.reduce((e,t,r)=>e+b(n[r],t),0),l=Number((i/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:l}})}}return o.sort(x)};function A(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=a-r,l=o-n;if(r<a&&n<o){const n=t.width*t.height,r=e.width*e.height,a=i*l;return Number((a/(n+r-a)).toFixed(4))}return 0}const S=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const e of r){const{id:r}=e,o=n.get(r);if(o){const n=A(o,t);n>0&&a.push({id:r,data:{droppableContainer:e,value:n}})}}return a.sort(E)};function j(e,t){const{top:n,left:r,bottom:a,right:o}=t;return n<=e.y&&e.y<=a&&r<=e.x&&e.x<=o}const P=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const a=[];for(const e of t){const{id:t}=e,o=n.get(t);if(o&&j(r,o)){const n=_(o).reduce((e,t)=>e+b(r,t),0),i=Number((n/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:i}})}}return a.sort(x)};function T(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:v}function I(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const D=I(1);function L(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const R={ignoreTransform:!1};function F(e,t){void 0===t&&(t=R);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=L(t);if(!r)return e;const{scaleX:a,scaleY:o,x:i,y:l}=r,c=e.left-i-(1-a)*parseFloat(n),s=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=a?e.width/a:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(n,t,r))}const{top:r,left:a,width:o,height:l,bottom:c,right:s}=n;return{top:r,left:a,width:o,height:l,bottom:c,right:s}}function M(e){return F(e,{ignoreTransform:!0})}function G(e,t){const n=[];return e?function r(a){if(null!=t&&n.length>=t)return n;if(!a)return n;if((0,i.wz)(a)&&null!=a.scrollingElement&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!(0,i.sb)(a)||(0,i.xZ)(a))return n;if(n.includes(a))return n;const o=(0,i.zk)(e).getComputedStyle(a);return a!==e&&function(e,t){void 0===t&&(t=(0,i.zk)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(a,o)&&n.push(a),function(e,t){return void 0===t&&(t=(0,i.zk)(e).getComputedStyle(e)),"fixed"===t.position}(a,o)?n:r(a.parentNode)}(e):n}function Q(e){const[t]=G(e,1);return null!=t?t:null}function B(e){return i.Sw&&e?(0,i.l6)(e)?e:(0,i.Ll)(e)?(0,i.wz)(e)||e===(0,i.TW)(e).scrollingElement?window:(0,i.sb)(e)?e:null:null:null}function q(e){return(0,i.l6)(e)?e.scrollX:e.scrollLeft}function U(e){return(0,i.l6)(e)?e.scrollY:e.scrollTop}function H(e){return{x:q(e),y:U(e)}}var z;function K(e){return!(!i.Sw||!e)&&e===document.scrollingElement}function V(e){const t={x:0,y:0},n=K(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(z||(z={}));const W={x:.2,y:.2};function X(e,t,n,r,a){let{top:o,left:i,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===a&&(a=W);const{isTop:s,isBottom:u,isLeft:d,isRight:m}=V(e),g={x:0,y:0},f={x:0,y:0},p=t.height*a.y,h=t.width*a.x;return!s&&o<=t.top+p?(g.y=z.Backward,f.y=r*Math.abs((t.top+p-o)/p)):!u&&c>=t.bottom-p&&(g.y=z.Forward,f.y=r*Math.abs((t.bottom-p-c)/p)),!m&&l>=t.right-h?(g.x=z.Forward,f.x=r*Math.abs((t.right-h-l)/h)):!d&&i<=t.left+h&&(g.x=z.Backward,f.x=r*Math.abs((t.left+h-i)/h)),{direction:g,speed:f}}function Y(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Z(e){return e.reduce((e,t)=>(0,i.WQ)(e,H(t)),v)}function J(e,t){if(void 0===t&&(t=F),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);Q(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+q(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+U(t),0)}]];class ee{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=G(t),r=Z(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,a]of $)for(const o of t)Object.defineProperty(this,o,{get:()=>{const t=a(n),i=r[e]-t;return this.rect[o]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class te{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ne(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var re,ae;function oe(e){e.preventDefault()}function ie(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(re||(re={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(ae||(ae={}));const le={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},ce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class se{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new te((0,i.TW)(t)),this.windowListeners=new te((0,i.zk)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&J(n),t(v)}handleKeyDown(e){if((0,i.kx)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:a=le,coordinateGetter:o=ce,scrollBehavior:l="smooth"}=r,{code:c}=e;if(a.end.includes(c))return void this.handleEnd(e);if(a.cancel.includes(c))return void this.handleCancel(e);const{collisionRect:s}=n.current,u=s?{x:s.left,y:s.top}:v;this.referenceCoordinates||(this.referenceCoordinates=u);const d=o(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=(0,i.Re)(d,u),r={x:0,y:0},{scrollableAncestors:a}=n.current;for(const n of a){const a=e.code,{isTop:o,isRight:i,isLeft:c,isBottom:s,maxScroll:u,minScroll:m}=V(n),g=Y(n),f={x:Math.min(a===ae.Right?g.right-g.width/2:g.right,Math.max(a===ae.Right?g.left:g.left+g.width/2,d.x)),y:Math.min(a===ae.Down?g.bottom-g.height/2:g.bottom,Math.max(a===ae.Down?g.top:g.top+g.height/2,d.y))},p=a===ae.Right&&!i||a===ae.Left&&!c,h=a===ae.Down&&!s||a===ae.Up&&!o;if(p&&f.x!==d.x){const e=n.scrollLeft+t.x,o=a===ae.Right&&e<=u.x||a===ae.Left&&e>=m.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=o?n.scrollLeft-e:a===ae.Right?n.scrollLeft-u.x:n.scrollLeft-m.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(h&&f.y!==d.y){const e=n.scrollTop+t.y,o=a===ae.Down&&e<=u.y||a===ae.Up&&e>=m.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=o?n.scrollTop-e:a===ae.Down?n.scrollTop-u.y:n.scrollTop-m.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,i.WQ)((0,i.Re)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ue(e){return Boolean(e&&"distance"in e)}function de(e){return Boolean(e&&"delay"in e)}se.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=le,onActivation:a}=t,{active:o}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=o.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==a||a({event:e.nativeEvent}),0))}return!1}}];class me{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.zk)(e);return e instanceof t?e:(0,i.TW)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:a}=e,{target:o}=a;this.props=e,this.events=t,this.document=(0,i.TW)(o),this.documentListeners=new te(this.document),this.listeners=new te(n),this.windowListeners=new te((0,i.zk)(o)),this.initialCoordinates=null!=(r=(0,i.e_)(a))?r:v,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,oe),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,oe),this.documentListeners.add(re.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(de(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ue(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(re.Click,ie,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:a}=this,{onMove:o,options:{activationConstraint:l}}=a;if(!r)return;const c=null!=(t=(0,i.e_)(e))?t:v,s=(0,i.Re)(r,c);if(!n&&l){if(ue(l)){if(null!=l.tolerance&&ne(s,l.tolerance))return this.handleCancel();if(ne(s,l.distance))return this.handleStart()}return de(l)&&ne(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ge={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fe extends me{constructor(e){const{event:t}=e,n=(0,i.TW)(t.target);super(e,ge,n)}}fe.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const pe={move:{name:"mousemove"},end:{name:"mouseup"}};var he;!function(e){e[e.RightClick=2]="RightClick"}(he||(he={})),class extends me{constructor(e){super(e,pe,(0,i.TW)(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==he.RightClick&&(null==r||r({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ve,be;(class extends me{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return!(a.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ve||(ve={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(be||(be={}));const we={x:{[z.Backward]:!1,[z.Forward]:!1},y:{[z.Backward]:!1,[z.Forward]:!1}};var xe,Ee;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xe||(xe={})),function(e){e.Optimized="optimized"}(Ee||(Ee={}));const _e=new Map;function Ce(e,t){return(0,i.KG)(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Ne(e){let{callback:t,disabled:n}=e;const a=(0,i._q)(t),o=(0,r.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(a)},[n]);return(0,r.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function ke(e){return new ee(F(e),e)}function Oe(e,t,n){void 0===t&&(t=ke);const[a,o]=(0,r.useState)(null);function l(){o(r=>{if(!e)return null;var a;if(!1===e.isConnected)return null!=(a=null!=r?r:n)?a:null;const o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o})}const c=function(e){let{callback:t,disabled:n}=e;const a=(0,i._q)(t),o=(0,r.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(a)},[a,n]);return(0,r.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),s=Ne({callback:l});return(0,i.Es)(()=>{l(),e?(null==s||s.observe(e),null==c||c.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==c||c.disconnect())},[e]),a}const Ae=[];function Se(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)(()=>{n.current=null},t),(0,r.useEffect)(()=>{const t=e!==v;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?(0,i.Re)(e,n.current):v}function je(e){return(0,r.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Pe=[];function Te(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.sb)(t)?t:e}const Ie=[{sensor:fe,options:{}},{sensor:se,options:{}}],De={current:{}},Le={draggable:{measure:M},droppable:{measure:M,strategy:xe.WhileDragging,frequency:Ee.Optimized},dragOverlay:{measure:F}};class Re extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Fe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Re,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:p},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Le,measureDroppableContainers:p,windowRect:null,measuringScheduled:!1},Me={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:p,draggableNodes:new Map,over:null,measureDroppableContainers:p},Ge=(0,r.createContext)(Me),Qe=(0,r.createContext)(Fe);function Be(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Re}}}function qe(e,t){switch(t.type){case f.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case f.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case f.DragEnd:case f.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case f.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new Re(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case f.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Re(e.droppable.containers);return i.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:i}}}case f.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new Re(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Ue(e){let{disabled:t}=e;const{active:n,activatorEvent:a,draggableNodes:o}=(0,r.useContext)(Ge),l=(0,i.ZC)(a),c=(0,i.ZC)(null==n?void 0:n.id);return(0,r.useEffect)(()=>{if(!t&&!a&&l&&null!=c){if(!(0,i.kx)(l))return;if(document.activeElement===l.target)return;const e=o.get(c);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,i.ag)(e);if(t){t.focus();break}}})}},[a,t,o,c,l]),null}function He(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const ze=(0,r.createContext)({...v,scaleX:1,scaleY:1});var Ke;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ke||(Ke={}));const Ve=(0,r.memo)(function(e){var t,n,l,c;let{id:s,accessibility:d,autoScroll:m=!0,children:p,sensors:h=Ie,collisionDetection:y=S,measuring:b,modifiers:w,...x}=e;const E=(0,r.useReducer)(qe,void 0,Be),[_,N]=E,[k,O]=function(){const[e]=(0,r.useState)(()=>new Set),t=(0,r.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,r.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[A,j]=(0,r.useState)(Ke.Uninitialized),P=A===Ke.Initialized,{draggable:{active:I,nodes:L,translate:R},droppable:{containers:M}}=_,q=null!=I?L.get(I):null,U=(0,r.useRef)({initial:null,translated:null}),V=(0,r.useMemo)(()=>{var e;return null!=I?{id:I,data:null!=(e=null==q?void 0:q.data)?e:De,rect:U}:null},[I,q]),W=(0,r.useRef)(null),[Y,J]=(0,r.useState)(null),[$,te]=(0,r.useState)(null),ne=(0,i.YN)(x,Object.values(x)),re=(0,i.YG)("DndDescribedBy",s),ae=(0,r.useMemo)(()=>M.getEnabled(),[M]),oe=(ie=b,(0,r.useMemo)(()=>({draggable:{...Le.draggable,...null==ie?void 0:ie.draggable},droppable:{...Le.droppable,...null==ie?void 0:ie.droppable},dragOverlay:{...Le.dragOverlay,...null==ie?void 0:ie.dragOverlay}}),[null==ie?void 0:ie.draggable,null==ie?void 0:ie.droppable,null==ie?void 0:ie.dragOverlay]));var ie;const{droppableRects:le,measureDroppableContainers:ce,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:a,config:o}=t;const[l,c]=(0,r.useState)(null),{frequency:s,measure:u,strategy:d}=o,m=(0,r.useRef)(e),g=function(){switch(d){case xe.Always:return!1;case xe.BeforeDragging:return n;default:return!n}}(),f=(0,i.YN)(g),p=(0,r.useCallback)(function(e){void 0===e&&(e=[]),f.current||c(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=(0,r.useRef)(null),y=(0,i.KG)(t=>{if(g&&!n)return _e;if(!t||t===_e||m.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ee(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,l,n,g,u]);return(0,r.useEffect)(()=>{m.current=e},[e]),(0,r.useEffect)(()=>{g||p()},[n,g]),(0,r.useEffect)(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),(0,r.useEffect)(()=>{g||"number"!=typeof s||null!==h.current||(h.current=setTimeout(()=>{p(),h.current=null},s))},[s,g,p,...a]),{droppableRects:y,measureDroppableContainers:p,measuringScheduled:null!=l}}(ae,{dragging:P,dependencies:[R.x,R.y],config:oe.droppable}),ue=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.KG)(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(L,I),de=(0,r.useMemo)(()=>$?(0,i.e_)($):null,[$]),me=function(){const e=!1===(null==Y?void 0:Y.autoScrollEnabled),t="object"==typeof m?!1===m.enabled:!1===m,n=P&&!e&&!t;return"object"==typeof m?{...m,enabled:n}:{enabled:n}}(),ge=function(e,t){return Ce(e,t)}(ue,oe.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:a,config:o=!0}=e;const l=(0,r.useRef)(!1),{x:c,y:s}="boolean"==typeof o?{x:o,y:o}:o;(0,i.Es)(()=>{if(!c&&!s||!t)return void(l.current=!1);if(l.current||!a)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=T(n(e),a);if(c||(r.x=0),s||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Q(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,c,s,a,n])}({activeNode:null!=I?L.get(I):null,config:me.layoutShiftCompensation,initialRect:ge,measure:oe.draggable.measure});const fe=Oe(ue,oe.draggable.measure,ge),pe=Oe(ue?ue.parentElement:null),he=(0,r.useRef)({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=M.getNodeFor(null==(t=he.current.over)?void 0:t.id),Ee=function(e){let{measure:t}=e;const[n,a]=(0,r.useState)(null),o=Ne({callback:(0,r.useCallback)(e=>{for(const{target:n}of e)if((0,i.sb)(n)){a(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=(0,r.useCallback)(e=>{const n=Te(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),a(n?t(n):null)},[t,o]),[c,s]=(0,i.lk)(l);return(0,r.useMemo)(()=>({nodeRef:c,rect:n,setRef:s}),[n,c,s])}({measure:oe.dragOverlay.measure}),ke=null!=(n=Ee.nodeRef.current)?n:ue,Re=P?null!=(l=Ee.rect)?l:fe:null,Fe=Boolean(Ee.nodeRef.current&&Ee.rect),Me=T(Ve=Fe?null:fe,Ce(Ve));var Ve;const We=je(ke?(0,i.zk)(ke):null),Xe=function(e){const t=(0,r.useRef)(e),n=(0,i.KG)(n=>e?n&&n!==Ae&&e&&t.current&&e.parentNode===t.current.parentNode?n:G(e):Ae,[e]);return(0,r.useEffect)(()=>{t.current=e},[e]),n}(P?null!=ye?ye:ue:null),Ye=function(e,t){void 0===t&&(t=F);const[n]=e,a=je(n?(0,i.zk)(n):null),[o,l]=(0,r.useState)(Pe);function c(){l(()=>e.length?e.map(e=>K(e)?a:new ee(t(e),e)):Pe)}const s=Ne({callback:c});return(0,i.Es)(()=>{null==s||s.disconnect(),c(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(Xe),Ze=He(w,{transform:{x:R.x-Me.x,y:R.y-Me.y,scaleX:1,scaleY:1},activatorEvent:$,active:V,activeNodeRect:fe,containerNodeRect:pe,draggingNodeRect:Re,over:he.current.over,overlayNodeRect:Ee.rect,scrollableAncestors:Xe,scrollableAncestorRects:Ye,windowRect:We}),Je=de?(0,i.WQ)(de,R):null,$e=function(e){const[t,n]=(0,r.useState)(null),a=(0,r.useRef)(e),o=(0,r.useCallback)(e=>{const t=B(e.target);t&&n(e=>e?(e.set(t,H(t)),new Map(e)):null)},[]);return(0,r.useEffect)(()=>{const t=a.current;if(e!==t){r(t);const i=e.map(e=>{const t=B(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,H(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),a.current=e}return()=>{r(e),r(t)};function r(e){e.forEach(e=>{const t=B(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,r.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>(0,i.WQ)(e,t),v):Z(e):v,[e,t])}(Xe),et=Se($e),tt=Se($e,[fe]),nt=(0,i.WQ)(Ze,et),rt=Re?D(Re,Ze):null,at=V&&rt?y({active:V,collisionRect:rt,droppableRects:le,droppableContainers:ae,pointerCoordinates:Je}):null,ot=C(at,"id"),[it,lt]=(0,r.useState)(null),ct=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Fe?Ze:(0,i.WQ)(Ze,tt),null!=(c=null==it?void 0:it.rect)?c:null,fe),st=(0,r.useRef)(null),ut=(0,r.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==W.current)return;const a=L.get(W.current);if(!a)return;const i=e.nativeEvent,l=new n({active:W.current,activeNode:a,event:i,options:r,context:he,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=ne.current,n={id:e};null==t||t(n),k({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!L.get(e))return;const{onDragPending:a}=ne.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==a||a(o),k({type:"onDragPending",event:o})},onStart(e){const t=W.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:r}=ne.current,a={activatorEvent:i,active:{id:t,data:n.data,rect:U}};(0,o.unstable_batchedUpdates)(()=>{null==r||r(a),j(Ke.Initializing),N({type:f.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:a}),J(st.current),te(i)})},onMove(e){N({type:f.DragMove,coordinates:e})},onEnd:c(f.DragEnd),onCancel:c(f.DragCancel)});function c(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:a}=he.current;let l=null;if(t&&a){const{cancelDrop:o}=ne.current;l={activatorEvent:i,active:t,collisions:n,delta:a,over:r},e===f.DragEnd&&"function"==typeof o&&await Promise.resolve(o(l))&&(e=f.DragCancel)}W.current=null,(0,o.unstable_batchedUpdates)(()=>{N({type:e}),j(Ke.Uninitialized),lt(null),J(null),te(null),st.current=null;const t=e===f.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=ne.current[t];null==e||e(l),k({type:t,event:l})}})}}st.current=l},[L]),dt=(0,r.useCallback)((e,t)=>(n,r)=>{const a=n.nativeEvent,o=L.get(r);if(null!==W.current||!o||a.dndKit||a.defaultPrevented)return;const i={active:o};!0===e(n,t.options,i)&&(a.dndKit={capturedBy:t.sensor},W.current=r,ut(n,t))},[L,ut]),mt=function(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(h,dt);!function(e){(0,r.useEffect)(()=>{if(!i.Sw)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(h),(0,i.Es)(()=>{fe&&A===Ke.Initializing&&j(Ke.Initialized)},[fe,A]),(0,r.useEffect)(()=>{const{onDragMove:e}=ne.current,{active:t,activatorEvent:n,collisions:r,over:a}=he.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:nt.x,y:nt.y},over:a};(0,o.unstable_batchedUpdates)(()=>{null==e||e(i),k({type:"onDragMove",event:i})})},[nt.x,nt.y]),(0,r.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:a}=he.current;if(!e||null==W.current||!t||!a)return;const{onDragOver:i}=ne.current,l=r.get(ot),c=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:a.x,y:a.y},over:c};(0,o.unstable_batchedUpdates)(()=>{lt(c),null==i||i(s),k({type:"onDragOver",event:s})})},[ot]),(0,i.Es)(()=>{he.current={activatorEvent:$,active:V,activeNode:ue,collisionRect:rt,collisions:at,droppableRects:le,draggableNodes:L,draggingNode:ke,draggingNodeRect:Re,droppableContainers:M,over:it,scrollableAncestors:Xe,scrollAdjustedTranslate:nt},U.current={initial:Re,translated:rt}},[V,ue,at,rt,L,ke,Re,le,M,it,Xe,nt]),function(e){let{acceleration:t,activator:n=ve.Pointer,canScroll:a,draggingRect:o,enabled:l,interval:c=5,order:s=be.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:m,delta:g,threshold:f}=e;const p=function(e){let{delta:t,disabled:n}=e;const r=(0,i.ZC)(t);return(0,i.KG)(e=>{if(n||!r||!e)return we;const a=Math.sign(t.x-r.x),o=Math.sign(t.y-r.y);return{x:{[z.Backward]:e.x[z.Backward]||-1===a,[z.Forward]:e.x[z.Forward]||1===a},y:{[z.Backward]:e.y[z.Backward]||-1===o,[z.Forward]:e.y[z.Forward]||1===o}}},[n,t,r])}({delta:g,disabled:!l}),[h,y]=(0,i.$$)(),v=(0,r.useRef)({x:0,y:0}),b=(0,r.useRef)({x:0,y:0}),w=(0,r.useMemo)(()=>{switch(n){case ve.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case ve.DraggableRect:return o}},[n,o,u]),x=(0,r.useRef)(null),E=(0,r.useCallback)(()=>{const e=x.current;if(!e)return;const t=v.current.x*b.current.x,n=v.current.y*b.current.y;e.scrollBy(t,n)},[]),_=(0,r.useMemo)(()=>s===be.TreeOrder?[...d].reverse():d,[s,d]);(0,r.useEffect)(()=>{if(l&&d.length&&w){for(const e of _){if(!1===(null==a?void 0:a(e)))continue;const n=d.indexOf(e),r=m[n];if(!r)continue;const{direction:o,speed:i}=X(e,r,w,t,f);for(const e of["x","y"])p[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0)return y(),x.current=e,h(E,c),v.current=i,void(b.current=o)}v.current={x:0,y:0},b.current={x:0,y:0},y()}else y()},[t,E,a,y,l,c,JSON.stringify(w),JSON.stringify(p),h,d,_,m,JSON.stringify(f)])}({...me,delta:R,draggingRect:rt,pointerCoordinates:Je,scrollableAncestors:Xe,scrollableAncestorRects:Ye});const gt=(0,r.useMemo)(()=>({active:V,activeNode:ue,activeNodeRect:fe,activatorEvent:$,collisions:at,containerNodeRect:pe,dragOverlay:Ee,draggableNodes:L,droppableContainers:M,droppableRects:le,over:it,measureDroppableContainers:ce,scrollableAncestors:Xe,scrollableAncestorRects:Ye,measuringConfiguration:oe,measuringScheduled:se,windowRect:We}),[V,ue,fe,$,at,pe,Ee,L,M,le,it,ce,Xe,Ye,oe,se,We]),ft=(0,r.useMemo)(()=>({activatorEvent:$,activators:mt,active:V,activeNodeRect:fe,ariaDescribedById:{draggable:re},dispatch:N,draggableNodes:L,over:it,measureDroppableContainers:ce}),[$,mt,V,fe,N,re,L,it,ce]);return a().createElement(u.Provider,{value:O},a().createElement(Ge.Provider,{value:ft},a().createElement(Qe.Provider,{value:gt},a().createElement(ze.Provider,{value:ct},p)),a().createElement(Ue,{disabled:!1===(null==d?void 0:d.restoreFocus)})),a().createElement(g,{...d,hiddenTextDescribedById:re}))}),We=(0,r.createContext)(null),Xe="button",Ye="Draggable";function Ze(e){let{id:t,data:n,disabled:a=!1,attributes:o}=e;const l=(0,i.YG)(Ye),{activators:c,activatorEvent:s,active:u,activeNodeRect:d,ariaDescribedById:m,draggableNodes:g,over:f}=(0,r.useContext)(Ge),{role:p=Xe,roleDescription:h="draggable",tabIndex:y=0}=null!=o?o:{},v=(null==u?void 0:u.id)===t,b=(0,r.useContext)(v?ze:We),[w,x]=(0,i.lk)(),[E,_]=(0,i.lk)(),C=function(e,t){return(0,r.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:a}=n;return e[r]=e=>{a(e,t)},e},{}),[e,t])}(c,t),N=(0,i.YN)(n);return(0,i.Es)(()=>(g.set(t,{id:t,key:l,node:w,activatorNode:E,data:N}),()=>{const e=g.get(t);e&&e.key===l&&g.delete(t)}),[g,t]),{active:u,activatorEvent:s,activeNodeRect:d,attributes:(0,r.useMemo)(()=>({role:p,tabIndex:y,"aria-disabled":a,"aria-pressed":!(!v||p!==Xe)||void 0,"aria-roledescription":h,"aria-describedby":m.draggable}),[a,p,y,v,h,m.draggable]),isDragging:v,listeners:a?void 0:C,node:w,over:f,setNodeRef:x,setActivatorNodeRef:_,transform:b}}function Je(){return(0,r.useContext)(Qe)}const $e="Droppable",et={timeout:25};function tt(e){let{data:t,disabled:n=!1,id:a,resizeObserverConfig:o}=e;const l=(0,i.YG)($e),{active:c,dispatch:s,over:u,measureDroppableContainers:d}=(0,r.useContext)(Ge),m=(0,r.useRef)({disabled:n}),g=(0,r.useRef)(!1),p=(0,r.useRef)(null),h=(0,r.useRef)(null),{disabled:y,updateMeasurementsFor:v,timeout:b}={...et,...o},w=(0,i.YN)(null!=v?v:a),x=Ne({callback:(0,r.useCallback)(()=>{g.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),h.current=null},b)):g.current=!0},[b]),disabled:y||!c}),E=(0,r.useCallback)((e,t)=>{x&&(t&&(x.unobserve(t),g.current=!1),e&&x.observe(e))},[x]),[_,C]=(0,i.lk)(E),N=(0,i.YN)(t);return(0,r.useEffect)(()=>{x&&_.current&&(x.disconnect(),g.current=!1,x.observe(_.current))},[_,x]),(0,r.useEffect)(()=>(s({type:f.RegisterDroppable,element:{id:a,key:l,disabled:n,node:_,rect:p,data:N}}),()=>s({type:f.UnregisterDroppable,key:l,id:a})),[a]),(0,r.useEffect)(()=>{n!==m.current.disabled&&(s({type:f.SetDroppableDisabled,id:a,key:l,disabled:n}),m.current.disabled=n)},[a,l,n,s]),{active:c,rect:p,isOver:(null==u?void 0:u.id)===a,node:_,over:u,setNodeRef:C}}function nt(e){let{animation:t,children:n}=e;const[o,l]=(0,r.useState)(null),[c,s]=(0,r.useState)(null),u=(0,i.ZC)(n);return n||o||!u||l(u),(0,i.Es)(()=>{if(!c)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,c)).then(()=>{l(null)}):l(null)},[t,o,c]),a().createElement(a().Fragment,null,n,o?(0,r.cloneElement)(o,{ref:s}):null)}const rt={x:0,y:0,scaleX:1,scaleY:1};function at(e){let{children:t}=e;return a().createElement(Ge.Provider,{value:Me},a().createElement(ze.Provider,{value:rt},t))}const ot={position:"fixed",touchAction:"none"},it=e=>(0,i.kx)(e)?"transform 250ms ease":void 0,lt=(0,r.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:l,className:c,rect:s,style:u,transform:d,transition:m=it}=e;if(!s)return null;const g=o?d:{...d,scaleX:1,scaleY:1},f={...ot,width:s.width,height:s.height,top:s.top,left:s.left,transform:i.Ks.Transform.toString(g),transformOrigin:o&&r?w(r,s):void 0,transition:"function"==typeof m?m(r):m,...u};return a().createElement(n,{className:c,style:f,ref:t},l)}),ct=e=>t=>{let{active:n,dragOverlay:r}=t;const a={},{styles:o,className:i}=e;if(null!=o&&o.active)for(const[e,t]of Object.entries(o.active))void 0!==t&&(a[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(a))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},st={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:i.Ks.Transform.toString(t)},{transform:i.Ks.Transform.toString(n)}]},sideEffects:ct({styles:{active:{opacity:"0"}}})};let ut=0;function dt(e){return(0,r.useMemo)(()=>{if(null!=e)return ut++,ut},[e])}const mt=a().memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:l,transition:c,modifiers:s,wrapperElement:u="div",className:d,zIndex:m=999}=e;const{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:y,droppableContainers:v,dragOverlay:b,over:w,measuringConfiguration:x,scrollableAncestors:E,scrollableAncestorRects:_,windowRect:C}=Je(),N=(0,r.useContext)(ze),k=dt(null==f?void 0:f.id),O=He(s,{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:b.rect,over:w,overlayNodeRect:b.rect,scrollableAncestors:E,scrollableAncestorRects:_,transform:N,windowRect:C}),A=Ce(p),S=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:a}=e;return(0,i._q)((e,o)=>{if(null===t)return;const l=n.get(e);if(!l)return;const c=l.node.current;if(!c)return;const s=Te(o);if(!s)return;const{transform:u}=(0,i.zk)(o).getComputedStyle(o),d=L(u);if(!d)return;const m="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:a}={...st,...e};return e=>{let{active:o,dragOverlay:i,transform:l,...c}=e;if(!t)return;const s=i.rect.left-o.rect.left,u=i.rect.top-o.rect.top,d={scaleX:1!==l.scaleX?o.rect.width*l.scaleX/i.rect.width:1,scaleY:1!==l.scaleY?o.rect.height*l.scaleY/i.rect.height:1},m={x:l.x-s,y:l.y-u,...d},g=a({...c,active:o,dragOverlay:i,transform:{initial:l,final:m}}),[f]=g,p=g[g.length-1];if(JSON.stringify(f)===JSON.stringify(p))return;const h=null==r?void 0:r({active:o,dragOverlay:i,...c}),y=i.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{y.onfinish=()=>{null==h||h(),e()}})}}(t);return J(c,a.draggable.measure),m({active:{id:e,data:l.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:a.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:a,transform:d})})}({config:o,draggableNodes:y,droppableContainers:v,measuringConfiguration:x}),j=A?b.setRef:void 0;return a().createElement(at,null,a().createElement(nt,{animation:S},f&&k?a().createElement(lt,{key:k,id:f.id,ref:j,as:u,activatorEvent:g,adjustScale:t,className:d,transition:c,rect:A,style:{zIndex:m,...l},transform:O},n):null))})},3627:(e,t,n)=>{"use strict";n.d(t,{JR:()=>_,be:()=>l,gB:()=>g,gl:()=>w,kL:()=>u});var r=n(1609),a=n.n(r),o=n(3375),i=n(4979);function l(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function c(e,t){return e.reduce((e,n,r)=>{const a=t.get(n);return a&&(e[r]=a),e},Array(e.length))}function s(e){return null!==e&&e>=0}const u=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=l(t,r,n),i=t[a],c=o[a];return c&&i?{x:c.left-i.left,y:c.top-i.top,scaleX:c.width/i.width,scaleY:c.height/i.height}:null},d="Sortable",m=a().createContext({activeIndex:-1,containerId:d,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:u,disabled:{draggable:!1,droppable:!1}});function g(e){let{children:t,id:n,items:l,strategy:s=u,disabled:g=!1}=e;const{active:f,dragOverlay:p,droppableRects:h,over:y,measureDroppableContainers:v}=(0,o.fF)(),b=(0,i.YG)(d,n),w=Boolean(null!==p.rect),x=(0,r.useMemo)(()=>l.map(e=>"object"==typeof e&&"id"in e?e.id:e),[l]),E=null!=f,_=f?x.indexOf(f.id):-1,C=y?x.indexOf(y.id):-1,N=(0,r.useRef)(x),k=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(x,N.current),O=-1!==C&&-1===_||k,A=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(g);(0,i.Es)(()=>{k&&E&&v(x)},[k,x,E,v]),(0,r.useEffect)(()=>{N.current=x},[x]);const S=(0,r.useMemo)(()=>({activeIndex:_,containerId:b,disabled:A,disableTransforms:O,items:x,overIndex:C,useDragOverlay:w,sortedRects:c(x,h),strategy:s}),[_,b,A.draggable,A.droppable,O,x,C,h,w,s]);return a().createElement(m.Provider,{value:S},t)}const f=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return l(n,r,a).indexOf(t)},p=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:i,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r||l!==o&&a===i||!n&&(i===a||t!==c))},h={duration:200,easing:"ease"},y="transform",v=i.Ks.Transition.toString({property:y,duration:0,easing:"linear"}),b={roleDescription:"sortable"};function w(e){let{animateLayoutChanges:t=p,attributes:n,disabled:a,data:l,getNewIndex:c=f,id:u,strategy:d,resizeObserverConfig:g,transition:w=h}=e;const{items:x,containerId:E,activeIndex:_,disabled:C,disableTransforms:N,sortedRects:k,overIndex:O,useDragOverlay:A,strategy:S}=(0,r.useContext)(m),j=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(a,C),P=x.indexOf(u),T=(0,r.useMemo)(()=>({sortable:{containerId:E,index:P,items:x},...l}),[E,l,P,x]),I=(0,r.useMemo)(()=>x.slice(x.indexOf(u)),[x,u]),{rect:D,node:L,isOver:R,setNodeRef:F}=(0,o.zM)({id:u,data:T,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...g}}),{active:M,activatorEvent:G,activeNodeRect:Q,attributes:B,setNodeRef:q,listeners:U,isDragging:H,over:z,setActivatorNodeRef:K,transform:V}=(0,o.PM)({id:u,data:T,attributes:{...b,...n},disabled:j.draggable}),W=(0,i.jn)(F,q),X=Boolean(M),Y=X&&!N&&s(_)&&s(O),Z=!A&&H,J=Z&&Y?V:null,$=Y?null!=J?J:(null!=d?d:S)({rects:k,activeNodeRect:Q,activeIndex:_,overIndex:O,index:P}):null,ee=s(_)&&s(O)?c({id:u,items:x,activeIndex:_,overIndex:O}):P,te=null==M?void 0:M.id,ne=(0,r.useRef)({activeId:te,items:x,newIndex:ee,containerId:E}),re=x!==ne.current.items,ae=t({active:M,containerId:E,isDragging:H,isSorting:X,id:u,index:P,items:x,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:w,wasDragging:null!=ne.current.activeId}),oe=function(e){let{disabled:t,index:n,node:a,rect:l}=e;const[c,s]=(0,r.useState)(null),u=(0,r.useRef)(n);return(0,i.Es)(()=>{if(!t&&n!==u.current&&a.current){const e=l.current;if(e){const t=(0,o.Sj)(a.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==u.current&&(u.current=n)},[t,n,a,l]),(0,r.useEffect)(()=>{c&&s(null)},[c]),c}({disabled:!ae,index:P,node:L,rect:D});return(0,r.useEffect)(()=>{X&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),E!==ne.current.containerId&&(ne.current.containerId=E),x!==ne.current.items&&(ne.current.items=x)},[X,ee,E,x]),(0,r.useEffect)(()=>{if(te===ne.current.activeId)return;if(null!=te&&null==ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(e)},[te]),{active:M,activeIndex:_,attributes:B,data:T,rect:D,index:P,newIndex:ee,items:x,isOver:R,isSorting:X,isDragging:H,listeners:U,node:L,overIndex:O,over:z,setNodeRef:W,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:q,transform:null!=oe?oe:$,transition:oe||re&&ne.current.newIndex===P?v:Z&&!(0,i.kx)(G)||!w?void 0:X||ae?i.Ks.Transition.toString({...w,property:y}):void 0}}function x(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const E=[o.vL.Down,o.vL.Right,o.vL.Up,o.vL.Left],_=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:l,over:c,scrollableAncestors:s}}=t;if(E.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=a.get(n.id);if(i)switch(e.code){case o.vL.Down:r.top<i.top&&t.push(n);break;case o.vL.Up:r.top>i.top&&t.push(n);break;case o.vL.Left:r.left>i.left&&t.push(n);break;case o.vL.Right:r.left<i.left&&t.push(n)}});const m=(0,o.y$)({active:n,collisionRect:r,droppableRects:a,droppableContainers:t,pointerCoordinates:null});let g=(0,o.Vy)(m,"id");if(g===(null==c?void 0:c.id)&&m.length>1&&(g=m[1].id),null!=g){const e=l.get(n.id),t=l.get(g),c=t?a.get(t.id):null,m=null==t?void 0:t.node.current;if(m&&c&&e&&t){const n=(0,o.sl)(m).some((e,t)=>s[t]!==e),a=C(e,t),l=(d=t,!(!x(u=e)||!x(d))&&!!C(u,d)&&u.data.current.sortable.index<d.data.current.sortable.index),g=n||!a?{x:0,y:0}:{x:l?r.width-c.width:0,y:l?r.height-c.height:0},f={x:c.left,y:c.top};return g.x&&g.y?f:(0,i.Re)(f,g)}}}var u,d};function C(e,t){return!(!x(e)||!x(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}},4979:(e,t,n)=>{"use strict";n.d(t,{$$:()=>p,Es:()=>g,KG:()=>y,Ks:()=>O,Ll:()=>l,Re:()=>C,Sw:()=>o,TW:()=>m,WQ:()=>_,YG:()=>x,YN:()=>h,ZC:()=>b,_q:()=>f,ag:()=>S,e_:()=>k,jn:()=>a,kx:()=>N,l6:()=>i,lk:()=>v,sb:()=>u,wz:()=>s,xZ:()=>d,zk:()=>c});var r=n(1609);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function i(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function l(e){return"nodeType"in e}function c(e){var t,n;return e?i(e)?e:l(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function s(e){const{Document:t}=c(e);return e instanceof t}function u(e){return!i(e)&&e instanceof c(e).HTMLElement}function d(e){return e instanceof c(e).SVGElement}function m(e){return e?i(e)?e.document:l(e)?s(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}const g=o?r.useLayoutEffect:r.useEffect;function f(e){const t=(0,r.useRef)(e);return g(()=>{t.current=e}),(0,r.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function p(){const e=(0,r.useRef)(null);return[(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,r.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function h(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return g(()=>{n.current!==e&&(n.current=e)},t),n}function y(e,t){const n=(0,r.useRef)();return(0,r.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function v(e){const t=f(e),n=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,a]}function b(e){const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}let w={};function x(e,t){return(0,r.useMemo)(()=>{if(t)return t;const n=null==w[e]?0:w[e]+1;return w[e]=n,e+"-"+n},[e,t])}function E(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,a]of r){const r=t[n];null!=r&&(t[n]=r+e*a)}return t},{...t})}}const _=E(1),C=E(-1);function N(e){if(!e)return!1;const{KeyboardEvent:t}=c(e.target);return t&&e instanceof t}function k(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=c(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const O=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[O.Translate.toString(e),O.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function S(e){return e.matches(A)?e:e.querySelector(A)}},4848:(e,t,n)=>{"use strict";n.d(t,{m:()=>m});var r=n(3453),a=n(1609),o=n.n(a),i=n(5795),l=n.n(i),c=n(1313),s=n(6434),u=n(56),d=n(2887),m=function(e){var t=e.isOpen,n=e.onClose,i=e.onToggle,m=e.trigger,g=e.children,f=e.className,p=void 0===f?"":f,h=e.activeClasses,y=void 0===h?"":h,v=(0,c.L)(function(){t&&n()},t),b=(0,a.useRef)(null),w=(0,a.useRef)(null),x=(0,a.useState)(null),E=(0,r.A)(x,2),_=E[0],C=E[1],N=(0,s.K)(d.i,t);(0,a.useLayoutEffect)(function(){if(t&&b.current&&w.current){var e=b.current.getBoundingClientRect(),n=w.current.getBoundingClientRect(),r=(0,d.i)().getBoundingClientRect(),a=e.bottom-N.offsetY+5,o=e.right-n.width-N.offsetX;if(a+n.height>r.height-8){var i=e.top-N.offsetY-n.height-5;i>=8&&(a=i)}var l=r.width-8;o<8&&(o=8),o+n.width>l&&(o=l-n.width),o<0&&(o=8),C({top:a,left:o})}},[t,g,N]);var k=o().cloneElement(m,{onClick:function(){i()},className:t&&y?y:m.props.className});return o().createElement("div",{className:"relative",ref:b},k,t&&l().createPortal(o().createElement("div",{ref:function(e){v.current=e,w.current=e},style:{position:"absolute",top:_?"".concat(_.top,"px"):"0",left:_?"".concat(_.left,"px"):"0",opacity:_?1:0,zIndex:9999},className:(0,u.cn)("bg-white rounded-md shadow-lg border border-gray-200 overflow-hidden",p)},g),(0,d.i)()))}},6629:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(1609),a=n.n(r),o=n(2858),i=n(56);const l=function(e){var t=e.htmlFor,n=e.help,r=e.tooltipPlacement,l=void 0===r?"top":r,c=e.children,s=e.className,u=a().createElement("div",{className:"flex items-center"},a().createElement("span",null,c),n&&a().createElement(o.m,{text:n,placement:l}));return t?a().createElement("label",{htmlFor:t,className:(0,i.cn)("block text-sm font-medium text-gray-700 mb-1",s)},u):a().createElement("div",{className:(0,i.cn)("block text-sm font-medium text-gray-700 mb-2",s)},u)}},9292:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(1609),a=n.n(r),o=n(56);const i=function(e){var t=e.size,n=void 0===t?"lg":t,r=e.color,i=void 0===r?"green":r,l=e.className,c=void 0===l?"":l,s=e.text,u=e.centerInContainer,d=void 0===u||u,m=a().createElement("div",{className:"flex flex-col items-center gap-2"},a().createElement("div",{className:(0,o.cn)("animate-spin rounded-full border-b-2",{sm:"h-4 w-4",md:"h-8 w-8",lg:"h-16 w-16",xl:"h-32 w-32"}[n],{green:"border-green-600",blue:"border-blue-600",gray:"border-gray-600",red:"border-red-600"}[i],c)}),s&&a().createElement("div",{className:"text-sm text-gray-600 font-medium"},s));return d?a().createElement("div",{className:(0,o.cn)("flex items-center justify-center",{sm:"h-16",md:"h-32",lg:"h-48",xl:"h-64"}[n])},m):m}},7196:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(6106),a=n(1609),o=n.n(a),i=n(1313),l=n(56);const c=function(e){var t=e.isOpen,n=e.onClose,c=e.title,s=void 0===c?"":c,u=e.children,d=e.id,m=e.showHeader,g=void 0===m||m,f=e.contentClassName,p=void 0===f?"":f,h=e.modalClassName,y=void 0===h?"rounded-lg":h,v=(0,i.L)(function(){return n()},t);return(0,a.useEffect)(function(){var e=function(e){"Escape"===e.key&&t&&n()};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}},[t,n]),(0,a.useEffect)(function(){return document.body.style.overflow=t?"hidden":"unset",function(){document.body.style.overflow="unset"}},[t]),t?o().createElement("div",{className:"fixed inset-0 z-50 overflow-y-auto","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",id:d},o().createElement("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-20 transition-opacity duration-300 ease-in-out"}),o().createElement("div",{className:"flex min-h-screen items-center justify-center p-2 text-center sm:p-0"},o().createElement("div",{ref:v,className:(0,l.cn)("relative transform overflow-hidden bg-white text-left shadow-xl transition-all duration-300 ease-in-out w-full max-w-lg sm:my-8 sm:w-full sm:max-w-lg",y)},g&&o().createElement("div",{className:(0,l.cn)("flex justify-between items-center p-3 sm:p-4",s&&"border-b")},o().createElement("h2",{className:"text-base sm:text-lg font-medium text-gray-900 pr-2",id:"modal-title"},s),o().createElement("button",{onClick:n,className:"text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 flex-shrink-0","aria-label":"Close modal"},o().createElement(r.US,{className:"h-6 w-6"}))),o().createElement("div",{className:(0,l.cn)("p-3 sm:p-4",p)},u)))):null}},7899:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(1609),a=n.n(r),o=n(6629);const i=function(e){var t=e.id,n=e.name,r=e.value,i=e.onChange,l=e.children,c=e.label,s=e.help,u=e.tooltipPlacement;return a().createElement(a().Fragment,null,a().createElement(o.A,{htmlFor:t,help:s,tooltipPlacement:u,className:c?void 0:"hidden"},c||""),a().createElement("select",{id:t,name:n,value:r,onChange:i,className:"bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full max-w-full p-2.5 hover:border-green-500 border-gray-400 transition-colors"},l))}},3597:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(1609),a=n.n(r),o=n(6629);const i=function(e){var t=e.id,n=e.name,r=e.value,i=e.onChange,l=e.label,c=e.help,s=e.placeholder,u=void 0===s?"":s,d=e.rows,m=void 0===d?4:d;return a().createElement(a().Fragment,null,a().createElement(o.A,{htmlFor:null!=t?t:n,help:c,className:l?void 0:"hidden"},l||""),a().createElement("textarea",{id:null!=t?t:n,name:n,value:r,onChange:i,rows:m,className:"bg-white border border-input-border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5 hover:border-gray-400 transition-colors",placeholder:u}))}},5909:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(8168),a=n(2026),o=n(56),i=n(1609),l=n.n(i),c=n(6629);const s=function(e){var t=e.type,n=e.id,i=e.name,s=e.value,u=e.onChange,d=e.label,m=e.help,g=e.min,f=void 0===g?0:g,p=e.max,h=void 0===p?1e4:p,y=e.step,v=void 0===y?1:y,b=e.placeholder,w=void 0===b?"":b,x=e.minString,E=e.maxString,_=e.tooltipPlacement,C=e.prefix,N=null!=s?s:"";return l().createElement(l().Fragment,null,l().createElement(c.A,{htmlFor:null!=n?n:i,help:m,tooltipPlacement:_,className:d?void 0:"hidden"},d||""),l().createElement("div",{className:(0,o.cn)("relative",C&&"has-prefix")},C&&l().createElement("span",{className:(0,o.cn)("absolute inset-y-0 flex items-center text-gray-500 text-sm pointer-events-none px-2",(0,a.Di)(C))},C),l().createElement("input",(0,r.A)({type:t,id:null!=n?n:i,name:i,value:N,onChange:u,className:(0,o.cn)("bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full hover:border-green-500 border-gray-400 transition-colors",C?"".concat((0,a.LX)(C).left," pr-2.5 py-2.5"):"p-2.5")},"number"===t&&{min:f,max:h,step:v},"number"!==t&&{min:x,max:E},{placeholder:w}))))}},6415:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(9836),a=n(1609),o=n.n(a),i=n(2858);const l=function(e){var t=e.id,n=e.name,a=e.checked,l=e.onChange,c=e.label,s=e.help,u=e.disabled,d=(0,r._w)(a);return o().createElement("div",{className:"relative inline-flex items-start gap-3 w-full"},o().createElement("div",{className:"relative"},o().createElement("input",{type:"checkbox",id:t,name:n,checked:d,onChange:l,disabled:u,className:"sr-only peer"}),o().createElement("label",{htmlFor:t,className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-green-300 rounded-full inline-block peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-green-600 ".concat(u?"opacity-50 cursor-not-allowed":"cursor-pointer")})),(c||s)&&o().createElement("div",{className:"flex items-center gap-1"},c&&o().createElement("label",{htmlFor:t,className:"text-sm font-medium text-gray-900 cursor-pointer"},c),s&&o().createElement(i.m,{text:s})))}},2858:(e,t,n)=>{"use strict";n.d(t,{m:()=>m});var r=n(3453),a=n(6106),o=n(1609),i=n.n(o),l=n(5795),c=n.n(l),s=n(6434),u=n(2887),d=function(){return i().createElement("div",{className:"ml-1 w-4 h-4 text-gray-500 hover:text-gray-700"},i().createElement(a.JG,null))},m=function(e){var t=e.text,n=e.children,a=void 0===n?i().createElement(d,null):n,l=e.placement,m=void 0===l?"top":l,g=(0,o.useRef)(null),f=(0,o.useRef)(null),p=(0,o.useState)(!1),h=(0,r.A)(p,2),y=h[0],v=h[1],b=(0,o.useState)(null),w=(0,r.A)(b,2),x=w[0],E=w[1],_=(0,s.K)(u.i,y);return(0,o.useLayoutEffect)(function(){if(y&&g.current&&f.current){var e=g.current.getBoundingClientRect(),t=f.current.getBoundingClientRect(),n=(0,u.i)().getBoundingClientRect(),r=0,a=0;switch(m){case"right":r=e.top+e.height/2-t.height/2-_.offsetY,a=e.right+8-_.offsetX;break;case"bottom":r=e.bottom+8-_.offsetY,a=e.left+e.width/2-t.width/2-_.offsetX;break;default:r=e.top-t.height-8-_.offsetY,a=e.left+e.width/2-t.width/2-_.offsetX}var o=n.width-16,i=n.height-16;a<16&&(a=16),a+t.width>o&&(a=o-t.width),r<16&&(r=16),r+t.height>i&&(r=i-t.height),E({top:r,left:a})}},[y,t,m,_]),i().createElement("div",{className:"relative inline-block",ref:g},i().createElement("div",{className:"inline-block cursor-help align-middle",onMouseEnter:function(){return v(!0)},onMouseLeave:function(){return v(!1)}},a),y&&c().createPortal(i().createElement("div",{ref:f,style:{position:"absolute",top:x?"".concat(x.top,"px"):"0",left:x?"".concat(x.left,"px"):"0",opacity:x?1:0,zIndex:9999},className:"px-3 py-2 text-sm text-white bg-gray-900 rounded-lg shadow-lg min-w-[200px] sm:min-w-[280px] max-w-[calc(100vw-2rem)] sm:max-w-md whitespace-normal break-words pointer-events-none transition-opacity duration-200"},t),(0,u.i)()))}},6106:(e,t,n)=>{"use strict";n.d(t,{$$:()=>Et,$C:()=>Ve,$O:()=>yt,AR:()=>ut,B8:()=>Be,BK:()=>je,Cg:()=>Pt,D3:()=>we,F:()=>ot,F4:()=>wt,GG:()=>Oe,GR:()=>$e,IJ:()=>Te,IP:()=>vt,JG:()=>Ue,JM:()=>tt,Jp:()=>ft,Kj:()=>ct,L6:()=>Pe,Nl:()=>qe,Nr:()=>xe,P7:()=>He,R3:()=>Se,R5:()=>Tt,R6:()=>Le,RY:()=>mt,SX:()=>Je,T9:()=>jt,US:()=>Ee,VB:()=>De,WI:()=>Fe,Xr:()=>Ct,YG:()=>Re,Yw:()=>At,ZH:()=>Qe,aP:()=>Ye,b4:()=>et,c1:()=>_e,c2:()=>It,cw:()=>Ot,eZ:()=>it,fN:()=>st,gX:()=>pt,ho:()=>St,ic:()=>gt,ik:()=>at,it:()=>We,kA:()=>nt,m:()=>Xe,mb:()=>Nt,mo:()=>Ae,nb:()=>Ne,oE:()=>Ie,oW:()=>kt,qP:()=>xt,qU:()=>Ce,qX:()=>ht,s3:()=>ze,sj:()=>Ge,sq:()=>lt,uc:()=>Me,wl:()=>rt,xK:()=>ke,xe:()=>bt,xy:()=>Ke,xz:()=>Ze,yz:()=>dt});var r=n(8168),a=n(45),o=n(1609),i=n.n(o),l=["className"],c=["className"],s=["className"],u=["className"],d=["className"],m=["className","width","height"],g=["className"],f=["className"],p=["className"],h=["className"],y=["className"],v=["className"],b=["className"],w=["className"],x=["className"],E=["className"],_=["className"],C=["className"],N=["className"],k=["className"],O=["className"],A=["className"],S=["className"],j=["className"],P=["className"],T=["className"],I=["className"],D=["className"],L=["className"],R=["className"],F=["className"],M=["className"],G=["className"],Q=["className"],B=["className"],q=["className"],U=["className"],H=["className"],z=["className"],K=["className"],V=["className"],W=["className"],X=["className"],Y=["className"],Z=["className"],J=["className"],$=["className"],ee=["className"],te=["className"],ne=["className"],re=["className"],ae=["className"],oe=["className"],ie=["className"],le=["className"],ce=["className"],se=["className"],ue=["className"],de=["className"],me=["className"],ge=["className"],fe=["className"],pe=["className"],he=["className"],ye=["className"],ve=["className"],be=["className"],we=function(e){var t=e.className,n=(0,a.A)(e,l);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",className:t,viewBox:"0 0 20 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))},xe=function(e){var t=e.className,n=(0,a.A)(e,c);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",className:t,viewBox:"0 0 20 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"}))},Ee=function(e){var t=e.className,n=(0,a.A)(e,s);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))},_e=function(e){var t=e.className,n=(0,a.A)(e,u);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"}))},Ce=function(e){var t=e.className,n=(0,a.A)(e,d);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))},Ne=function(e){var t=e.className,n=e.width,o=void 0===n?8:n,l=e.height,c=void 0===l?8:l,s=(0,a.A)(e,m);return i().createElement("svg",(0,r.A)({width:o,height:c,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},s),i().createElement("path",{d:"M7.5 0.500151C7.63132 0.368829 7.78722 0.264659 7.9588 0.193588C8.13038 0.122517 8.31428 0.0859375 8.5 0.0859375C8.68572 0.0859375 8.86962 0.122517 9.0412 0.193588C9.21278 0.264659 9.36868 0.36883 9.5 0.500151C9.63132 0.631473 9.73549 0.787375 9.80656 0.958955C9.87763 1.13054 9.91421 1.31443 9.91421 1.50015C9.91421 1.68587 9.87763 1.86977 9.80656 2.04135C9.73549 2.21293 9.63132 2.36883 9.5 2.50015L2.75 9.25015L0 10.0002L0.75 7.25015L7.5 0.500151Z",fill:"currentColor"}))},ke=function(e){var t=e.className,n=(0,a.A)(e,g);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))},Oe=function(e){var t=e.className,n=(0,a.A)(e,f);return i().createElement("svg",(0,r.A)({width:"20",height:"20",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M14.7461 17.2533H8.32279L9.70145 18.6005C9.95211 18.8512 10.0774 19.154 10.0774 19.5091C10.0774 19.8642 9.95211 20.1671 9.70145 20.4177C9.45078 20.6684 9.1479 20.7937 8.79279 20.7937C8.43768 20.7937 8.13479 20.6684 7.88413 20.4177L4.34349 16.8773C4.21816 16.752 4.12917 16.6162 4.07653 16.47C4.02389 16.3238 3.99841 16.1671 4.00008 16C4.00175 15.8329 4.02807 15.6762 4.07904 15.53C4.13001 15.3838 4.21857 15.248 4.34474 15.1227L7.88538 11.5823C8.13605 11.3316 8.43392 11.2063 8.779 11.2063C9.12408 11.2063 9.42154 11.3316 9.67137 11.5823C9.9212 11.8329 10.0465 12.1308 10.0474 12.4758C10.0482 12.8209 9.92287 13.1183 9.67137 13.3681L8.29146 14.7467H14.7461V8.29244L13.3361 9.70236C13.0854 9.95301 12.793 10.0733 12.4588 10.0633C12.1245 10.0533 11.8321 9.92252 11.5814 9.67103C11.3308 9.41954 11.2054 9.1221 11.2054 8.77871C11.2054 8.43531 11.3308 8.13745 11.5814 7.88513L15.1221 4.34467C15.2474 4.21934 15.3832 4.13036 15.5294 4.07772C15.6756 4.02508 15.8323 3.99918 15.9994 4.00002C16.1665 4.00086 16.3232 4.02676 16.4694 4.07772C16.6156 4.12869 16.7514 4.21767 16.8767 4.34467L20.4487 7.91646C20.6994 8.16711 20.8247 8.45954 20.8247 8.79375C20.8247 9.12795 20.6994 9.42038 20.4487 9.67103C20.198 9.92168 19.9002 10.047 19.5551 10.047C19.21 10.047 18.9125 9.92168 18.6627 9.67103L17.2527 8.29244V14.7467H23.676L22.2974 13.3995C22.0467 13.1488 21.9214 12.846 21.9214 12.4909C21.9214 12.1358 22.0467 11.8329 22.2974 11.5823C22.548 11.3316 22.8509 11.2063 23.206 11.2063C23.5611 11.2063 23.864 11.3316 24.1147 11.5823L27.6553 15.1227C27.7806 15.248 27.8696 15.3838 27.9223 15.53C27.9749 15.6762 28.0008 15.8329 28 16C27.9991 16.1671 27.9732 16.3238 27.9223 16.47C27.8713 16.6162 27.7823 16.752 27.6553 16.8773L24.0833 20.4491C23.8327 20.6997 23.5402 20.82 23.206 20.81C22.8718 20.8 22.5794 20.6692 22.3287 20.4177C22.078 20.1663 21.9527 19.8688 21.9527 19.5254C21.9527 19.182 22.078 18.8842 22.3287 18.6318L23.7073 17.2533H17.2527V23.6762L18.6 22.2976C18.8507 22.047 19.1536 21.9217 19.5087 21.9217C19.8638 21.9217 20.1667 22.047 20.4174 22.2976C20.668 22.5483 20.7934 22.8512 20.7934 23.2063C20.7934 23.5613 20.668 23.8642 20.4174 24.1149L16.8767 27.6553C16.7514 27.7807 16.6156 27.8696 16.4694 27.9223C16.3232 27.9749 16.1665 28.0008 15.9994 28C15.8323 27.9991 15.6756 27.9732 15.5294 27.9223C15.3832 27.8713 15.2474 27.7823 15.1221 27.6553L11.5501 24.0835C11.2994 23.8329 11.1795 23.5354 11.1904 23.1912C11.2013 22.847 11.3316 22.5491 11.5814 22.2976C11.8313 22.0462 12.1291 21.9208 12.4751 21.9217C12.821 21.9225 13.1184 22.0478 13.3674 22.2976L14.7461 23.7076V17.2533Z",fill:"currentColor"}))},Ae=function(e){var t=e.className,n=(0,a.A)(e,p);return i().createElement("svg",(0,r.A)({className:t,fill:"#EBAD35",viewBox:"0 0 18 18"},n),i().createElement("path",{d:"M8.167 4.833h1.666V6.5H8.167V4.833zm0 3.333h1.666v5H8.167v-5zM9 .666A8.336 8.336 0 00.667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667zm0 15A6.676 6.676 0 012.333 9 6.676 6.676 0 019 2.333 6.675 6.675 0 0115.667 9 6.675 6.675 0 019 15.666z"}))},Se=function(e){var t=e.className,n=(0,a.A)(e,h);return i().createElement("svg",(0,r.A)({className:t,fill:"none",viewBox:"0 0 20 20"},n),i().createElement("path",{fill:"#D99B3D",d:"M6.25 9.167a2.81 2.81 0 01-2.063-.854 2.81 2.81 0 01-.854-2.063c0-.805.285-1.493.854-2.062a2.81 2.81 0 012.063-.854 2.81 2.81 0 012.062.854c.57.57.855 1.257.855 2.062a2.81 2.81 0 01-.855 2.063 2.81 2.81 0 01-2.062.854zm0-1.667c.347 0 .642-.121.885-.364s.365-.539.365-.886-.122-.642-.365-.885A1.205 1.205 0 006.25 5c-.347 0-.642.122-.886.365A1.205 1.205 0 005 6.25c0 .347.121.643.364.886.244.243.539.364.886.364zm7.5 9.167a2.81 2.81 0 01-2.063-.854 2.81 2.81 0 01-.854-2.063c0-.805.285-1.493.854-2.062a2.81 2.81 0 012.063-.854 2.81 2.81 0 012.062.854c.57.57.855 1.257.855 2.062a2.81 2.81 0 01-.855 2.063 2.81 2.81 0 01-2.062.854zm0-1.667c.347 0 .642-.121.885-.364s.365-.539.365-.886-.122-.642-.365-.885a1.206 1.206 0 00-.885-.365c-.347 0-.642.122-.886.365a1.205 1.205 0 00-.364.885c0 .347.121.643.364.886.244.243.539.364.886.364zM4.5 16.667L3.333 15.5 15.5 3.334 16.667 4.5 4.5 16.667z"}))},je=function(e){var t=e.className,n=(0,a.A)(e,y);return i().createElement("svg",(0,r.A)({className:t,fill:"#37993B",viewBox:"0 0 21 20"},n),i().createElement("path",{d:"M10.5 1.667A8.336 8.336 0 002.167 10c0 4.6 3.733 8.333 8.333 8.333S18.833 14.6 18.833 10 15.1 1.667 10.5 1.667zm0 15A6.676 6.676 0 013.833 10 6.676 6.676 0 0110.5 3.333 6.675 6.675 0 0117.167 10a6.675 6.675 0 01-6.667 6.666zm3.825-10.35l-5.492 5.491-2.158-2.15L5.5 10.833l3.333 3.333L15.5 7.5l-1.175-1.184z"}))},Pe=function(e){var t=e.className,n=(0,a.A)(e,v);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",fillOpacity:"0.7",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M16.252 10a6.5 6.5 0 01-.058.816l1.758 1.375c.158.125.2.35.1.534l-1.667 2.883a.413.413 0 01-.358.208.47.47 0 01-.15-.025l-2.075-.833a6.4 6.4 0 01-1.409.817l-.316 2.208c-.025.2-.2.35-.409.35H8.335a.406.406 0 01-.408-.35l-.317-2.208a6.088 6.088 0 01-1.408-.817l-2.075.833a.416.416 0 01-.508-.183l-1.667-2.883a.42.42 0 01.1-.534l1.758-1.375A6.61 6.61 0 013.752 10c0-.275.025-.55.058-.817L2.052 7.808a.41.41 0 01-.1-.533L3.618 4.39a.413.413 0 01.359-.208c.05 0 .1.008.15.025l2.075.833c.433-.325.9-.608 1.408-.816l.317-2.208c.025-.2.2-.35.408-.35h3.333c.209 0 .384.15.409.35l.316 2.208c.509.208.975.483 1.409.817l2.075-.834a.416.416 0 01.508.183l1.667 2.884a.42.42 0 01-.1.533l-1.759 1.375a6.5 6.5 0 01.059.817zm-1.667 0c0-.175-.008-.35-.042-.608l-.116-.942.742-.583.891-.709-.583-1.008-1.059.425-.883.358-.758-.583a4.726 4.726 0 00-1.025-.592l-.884-.358-.133-.942-.158-1.125H9.418l-.166 1.125-.134.942-.883.358a4.881 4.881 0 00-1.042.609l-.75.566-.866-.35-1.059-.425-.583 1.008.9.7.742.584-.117.942c-.025.25-.042.441-.042.608 0 .166.017.358.042.617l.117.941-.742.584-.9.7.583 1.008 1.059-.425.883-.359.758.584c.334.25.667.441 1.025.591l.884.359.133.941.158 1.125h1.167l.167-1.125.133-.941.883-.358a4.886 4.886 0 001.042-.609l.75-.566.867.35 1.058.425.584-1.009-.9-.7-.742-.583.117-.942c.024-.25.041-.433.041-.608zm-4.583-3.333A3.332 3.332 0 1013.335 10a3.332 3.332 0 00-3.333-3.333zM8.335 10c0 .916.75 1.666 1.667 1.666.916 0 1.666-.75 1.666-1.666 0-.917-.75-1.667-1.666-1.667-.917 0-1.667.75-1.667 1.667z",clipRule:"evenodd"}))},Te=function(e){var t=e.className,n=(0,a.A)(e,b);return i().createElement("svg",(0,r.A)({className:t,viewBox:"0 0 20 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))},Ie=function(e){var t=e.className,n=(0,a.A)(e,w);return i().createElement("svg",(0,r.A)({className:t,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.5286 0.195262C3.78894 -0.0650874 4.21106 -0.0650874 4.4714 0.195262L7.80474 3.5286C8.06509 3.78894 8.06509 4.21106 7.80474 4.4714C7.54439 4.73175 7.12228 4.73175 6.86193 4.4714L4 1.60948L1.13807 4.4714C0.877722 4.73175 0.455612 4.73175 0.195262 4.4714C-0.0650874 4.21106 -0.0650874 3.78894 0.195262 3.5286L3.5286 0.195262ZM0.195262 7.5286C0.455612 7.26825 0.877722 7.26825 1.13807 7.5286L4 10.3905L6.86193 7.5286C7.12228 7.26825 7.54439 7.26825 7.80474 7.5286C8.06509 7.78895 8.06509 8.21106 7.80474 8.4714L4.4714 11.8047C4.21106 12.0651 3.78894 12.0651 3.5286 11.8047L0.195262 8.4714C-0.0650874 8.21106 -0.0650874 7.78895 0.195262 7.5286Z",fill:"#B7B7B7"}))},De=function(e){var t=e.className,n=(0,a.A)(e,x);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"}))},Le=function(e){var t=e.className,n=(0,a.A)(e,E);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"}))},Re=function(e){var t=e.className,n=(0,a.A)(e,_);return i().createElement("svg",(0,r.A)({width:"16",height:"18",viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 0.833374C11.1269 0.833374 11.5 1.20647 11.5 1.66671V2.50004H16.5C16.9603 2.50004 17.3334 2.87314 17.3334 3.33337C17.3334 3.79361 16.9603 4.16671 16.5 4.16671H11.5V5.00004C11.5 5.46028 11.1269 5.83337 10.6667 5.83337C10.2064 5.83337 9.83335 5.46028 9.83335 5.00004V1.66671C9.83335 1.20647 10.2064 0.833374 10.6667 0.833374ZM0.666687 3.33337C0.666687 2.87314 1.03978 2.50004 1.50002 2.50004H7.33335C7.79359 2.50004 8.16669 2.87314 8.16669 3.33337C8.16669 3.79361 7.79359 4.16671 7.33335 4.16671H1.50002C1.03978 4.16671 0.666687 3.79361 0.666687 3.33337ZM5.66669 7.50004C6.12692 7.50004 6.50002 7.87314 6.50002 8.33337V11.6667C6.50002 12.1269 6.12692 12.5 5.66669 12.5C5.20645 12.5 4.83335 12.1269 4.83335 11.6667V10.8334H1.50002C1.03978 10.8334 0.666687 10.4603 0.666687 10C0.666687 9.5398 1.03978 9.16671 1.50002 9.16671H4.83335V8.33337C4.83335 7.87314 5.20645 7.50004 5.66669 7.50004ZM8.16669 10C8.16669 9.5398 8.53978 9.16671 9.00002 9.16671H16.5C16.9603 9.16671 17.3334 9.5398 17.3334 10C17.3334 10.4603 16.9603 10.8334 16.5 10.8334H9.00002C8.53978 10.8334 8.16669 10.4603 8.16669 10ZM12.3334 14.1667C12.7936 14.1667 13.1667 14.5398 13.1667 15V15.8334H16.5C16.9603 15.8334 17.3334 16.2065 17.3334 16.6667C17.3334 17.1269 16.9603 17.5 16.5 17.5H13.1667V18.3334C13.1667 18.7936 12.7936 19.1667 12.3334 19.1667C11.8731 19.1667 11.5 18.7936 11.5 18.3334V15C11.5 14.5398 11.8731 14.1667 12.3334 14.1667ZM0.666687 16.6667C0.666687 16.2065 1.03978 15.8334 1.50002 15.8334H9.00002C9.46026 15.8334 9.83335 16.2065 9.83335 16.6667C9.83335 17.1269 9.46026 17.5 9.00002 17.5H1.50002C1.03978 17.5 0.666687 17.1269 0.666687 16.6667Z",fill:"black",fillOpacity:"0.6"}))},Fe=function(e){var t=e.className,n=(0,a.A)(e,C);return i().createElement("svg",(0,r.A)({width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.33334 2.66634C4.75601 2.66634 2.66668 4.75568 2.66668 7.33301C2.66668 9.91034 4.75601 11.9997 7.33334 11.9997C9.91067 11.9997 12 9.91034 12 7.33301C12 4.75568 9.91067 2.66634 7.33334 2.66634ZM1.33334 7.33301C1.33334 4.0193 4.01963 1.33301 7.33334 1.33301C10.6471 1.33301 13.3333 4.0193 13.3333 7.33301C13.3333 8.74968 12.8424 10.0517 12.0213 11.0781L14.4714 13.5283C14.7318 13.7886 14.7318 14.2107 14.4714 14.4711C14.2111 14.7314 13.789 14.7314 13.5286 14.4711L11.0785 12.0209C10.052 12.842 8.75002 13.333 7.33334 13.333C4.01963 13.333 1.33334 10.6467 1.33334 7.33301Z",fill:"black"}))},Me=function(e){var t=e.className,n=(0,a.A)(e,N);return i().createElement("svg",(0,r.A)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M6 7V19C6 20.1046 6.89543 21 8 21H16C17.1046 21 18 20.1046 18 19V7M6 7H5M6 7H8M18 7H19M18 7H16M10 11V17M14 11V17M8 7V5C8 3.89543 8.89543 3 10 3H14C15.1046 3 16 3.89543 16 5V7M8 7H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},Ge=function(e){var t=e.className,n=(0,a.A)(e,k);return i().createElement("svg",(0,r.A)({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.59306 2.74482C5.49465 2.69241 5.38466 2.66552 5.27316 2.66662L5.26663 2.66668L2.66663 2.66665C2.48981 2.66665 2.32025 2.73689 2.19522 2.86191C2.0702 2.98694 1.99996 3.1565 1.99996 3.33332V12C1.99996 12.1768 2.0702 12.3464 2.19522 12.4714C2.32025 12.5964 2.48982 12.6666 2.66663 12.6666H12.3045C12.453 12.6677 12.5977 12.619 12.7154 12.5284C12.8332 12.4378 12.9173 12.3105 12.9545 12.1667L13.9811 8.16665C14.0066 8.06804 14.0091 7.96491 13.9885 7.86517C13.9679 7.76543 13.9248 7.67173 13.8623 7.59127C13.7999 7.51081 13.7198 7.44573 13.6283 7.40101C13.5368 7.35629 13.4363 7.33314 13.3345 7.33331L13.3333 7.33332H6.169C6.05041 7.3372 5.93496 7.37267 5.83461 7.43612C5.73244 7.50071 5.64976 7.59185 5.5954 7.6998L5.59214 7.70628L4.5921 9.6396C4.42295 9.96663 4.02071 10.0946 3.69368 9.92546C3.36664 9.75631 3.23866 9.35407 3.40781 9.02703L4.40631 7.09661C4.56941 6.7743 4.81676 6.50216 5.12213 6.30911C5.42862 6.11535 5.78201 6.00856 6.14452 6.00016L6.15996 5.99998H12.6666V5.33332C12.6666 5.15651 12.5964 4.98694 12.4714 4.86191C12.3463 4.73689 12.1768 4.66665 12 4.66665H8.04663C7.71552 4.6666 7.38949 4.58434 7.09802 4.42725C6.80777 4.27083 6.56072 4.0451 6.37883 3.77015L5.83646 2.96664C5.77514 2.87352 5.69148 2.79723 5.59306 2.74482ZM14 6.11354C14.0727 6.13916 14.1441 6.16903 14.2138 6.20307C14.4883 6.33721 14.7284 6.53247 14.9157 6.77385C15.103 7.01523 15.2325 7.29632 15.2943 7.59554C15.3561 7.8946 15.3485 8.20384 15.2722 8.49953L14.2455 12.5C14.134 12.9315 13.8817 13.3135 13.5284 13.5853C13.1758 13.8565 12.7428 14.0024 12.298 14H12.3L12.2955 14L12.298 14H2.66663C2.13619 14 1.62748 13.7893 1.25241 13.4142C0.87734 13.0391 0.666626 12.5304 0.666626 12V3.33332C0.666626 2.80288 0.87734 2.29418 1.25241 1.9191C1.62749 1.54403 2.13619 1.33332 2.66663 1.33332H5.26369L5.26009 1.33335L5.26663 1.33332H5.26369C5.59694 1.33065 5.9256 1.4113 6.21979 1.56797C6.5138 1.72454 6.76403 1.95206 6.94778 2.22985L7.4901 3.03329C7.55081 3.12547 7.63341 3.20116 7.73057 3.25352C7.8277 3.30586 7.93629 3.33328 8.04663 3.33332H12C12.5304 3.33332 13.0391 3.54403 13.4142 3.9191C13.7892 4.29418 14 4.80288 14 5.33332V6.11354Z",fill:"black",fillOpacity:"0.6"}))},Qe=function(e){var t=e.className,n=(0,a.A)(e,O);return i().createElement("svg",(0,r.A)({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.00008 2.33341C5.63189 2.33341 5.33342 2.63189 5.33342 3.00008V12.0001C5.33342 12.3683 5.63189 12.6667 6.00008 12.6667H7.9049L12.3828 8.18883C12.8781 7.69366 13.5498 7.41544 14.2501 7.41544C14.7558 7.41544 15.2466 7.5605 15.6667 7.82757V3.00008C15.6667 2.63189 15.3683 2.33341 15.0001 2.33341H6.00008ZM17.3334 3.00008C17.3334 1.71142 16.2887 0.666748 15.0001 0.666748H6.00008C4.71142 0.666748 3.66675 1.71142 3.66675 3.00008V12.0001C3.66675 13.2887 4.71142 14.3334 6.00008 14.3334H8.2495C8.24989 14.3334 8.25027 14.3334 8.25066 14.3334H15.0001C16.2887 14.3334 17.3334 13.2887 17.3334 12.0001V3.00008ZM15.6667 10.0953L14.9389 9.36738C14.9389 9.36737 14.9389 9.3674 14.9389 9.36738C14.7562 9.18475 14.5084 9.08211 14.2501 9.08211C13.9918 9.08211 13.744 9.1847 13.5613 9.36734C13.5613 9.36735 13.5614 9.36732 13.5613 9.36734L10.2619 12.6667H15.0001C15.3683 12.6667 15.6667 12.3683 15.6667 12.0001V10.0953ZM1.50008 3.66675C1.96032 3.66675 2.33341 4.03984 2.33341 4.50008V15.0001C2.33341 15.1769 2.40365 15.3465 2.52868 15.4715C2.6537 15.5965 2.82327 15.6667 3.00008 15.6667H13.5001C13.9603 15.6667 14.3334 16.0398 14.3334 16.5001C14.3334 16.9603 13.9603 17.3334 13.5001 17.3334H3.00008C2.38124 17.3334 1.78775 17.0876 1.35017 16.65C0.912581 16.2124 0.666748 15.6189 0.666748 15.0001V4.50008C0.666748 4.03984 1.03984 3.66675 1.50008 3.66675ZM9.00008 5.33342C8.63189 5.33342 8.33342 5.63189 8.33342 6.00008C8.33342 6.36827 8.63189 6.66675 9.00008 6.66675C9.36827 6.66675 9.66675 6.36827 9.66675 6.00008C9.66675 5.63189 9.36827 5.33342 9.00008 5.33342ZM6.66675 6.00008C6.66675 4.71142 7.71142 3.66675 9.00008 3.66675C10.2887 3.66675 11.3334 4.71142 11.3334 6.00008C11.3334 7.28875 10.2887 8.33342 9.00008 8.33342C7.71142 8.33342 6.66675 7.28875 6.66675 6.00008Z",fill:"#374151"}))},Be=function(e){var t=e.className,n=(0,a.A)(e,A);return i().createElement("svg",(0,r.A)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3C12.5523 3 13 3.44772 13 4V12.1331L14.9029 10.283C15.2989 9.89802 15.932 9.90694 16.317 10.3029C16.702 10.6989 16.6931 11.332 16.2971 11.717L12.6971 15.217C12.309 15.5943 11.691 15.5943 11.3029 15.217L7.70292 11.717C7.30694 11.332 7.29802 10.6989 7.683 10.3029C8.06799 9.90694 8.70109 9.89802 9.09708 10.283L11 12.1331V4C11 3.44772 11.4477 3 12 3ZM2.83013 5.54557C3.35726 5.03308 4.06634 4.75 4.8 4.75H8.4C8.95228 4.75 9.4 5.19772 9.4 5.75C9.4 6.30228 8.95228 6.75 8.4 6.75H4.8C4.57888 6.75 4.37229 6.83566 4.22429 6.97956C4.07724 7.12252 4 7.31032 4 7.5V16.25C4 16.4397 4.07724 16.6275 4.22429 16.7704C4.37229 16.9143 4.57888 17 4.8 17H19.2C19.4211 17 19.6277 16.9143 19.7757 16.7704C19.9228 16.6275 20 16.4397 20 16.25V7.5C20 7.31032 19.9228 7.12252 19.7757 6.97956C19.6277 6.83566 19.4211 6.75 19.2 6.75H15.6C15.0477 6.75 14.6 6.30228 14.6 5.75C14.6 5.19772 15.0477 4.75 15.6 4.75H19.2C19.9337 4.75 20.6427 5.03308 21.1699 5.54557C21.698 6.05898 22 6.76142 22 7.5V16.25C22 16.9886 21.698 17.691 21.1699 18.2044C20.6427 18.7169 19.9337 19 19.2 19H4.8C4.06634 19 3.35725 18.7169 2.83013 18.2044C2.30205 17.691 2 16.9886 2 16.25V7.5C2 6.76142 2.30205 6.05898 2.83013 5.54557Z",fill:"#374151"}))},qe=function(e){var t=e.className,n=(0,a.A)(e,S);return i().createElement("svg",(0,r.A)({className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n),i().createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i().createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}))},Ue=function(e){var t=e.className,n=(0,a.A)(e,j);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t},n),i().createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))},He=function(e){var t=e.className,n=(0,a.A)(e,P);return i().createElement("svg",(0,r.A)({width:"188",height:"188",viewBox:"0 0 188 188",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("g",{clipPath:"url(#clip0_2670_9370)"},i().createElement("g",{filter:"url(#filter0_f_2670_9370)"},i().createElement("circle",{cx:"92",cy:"96",r:"64",fill:"#CEEDCB"})),i().createElement("rect",{x:"8",y:"50",width:"48",height:"56",rx:"12",fill:"white"}),i().createElement("rect",{x:"68",y:"74",width:"48",height:"48",rx:"12",fill:"white"}),i().createElement("rect",{x:"128",y:"50",width:"48",height:"56",rx:"12",fill:"white"}),i().createElement("rect",{x:"8",y:"118",width:"48",height:"48",rx:"12",fill:"white"}),i().createElement("rect",{x:"68",y:"134",width:"48",height:"56",rx:"12",fill:"white"}),i().createElement("rect",{x:"128",y:"118",width:"48",height:"48",rx:"12",fill:"white"}),i().createElement("path",{d:"M90.1857 22.6128C90.4395 20.4624 93.5606 20.4624 93.8144 22.6128C94.0287 24.429 96.4828 24.8385 97.2753 23.1903C98.2135 21.2388 101.166 22.2523 100.707 24.3686C100.32 26.1559 102.509 27.3401 103.793 26.0385C105.314 24.4974 107.777 26.4145 106.657 28.2673C105.71 29.8322 107.395 31.6627 109.033 30.8488C110.972 29.8851 112.679 32.498 111.018 33.8866C109.615 35.0594 110.614 37.3379 112.427 37.0998C114.574 36.818 115.34 39.8436 113.318 40.6175C111.61 41.2711 111.816 43.7506 113.608 44.1142C115.73 44.5447 115.472 47.6552 113.308 47.7305C111.48 47.7942 110.87 50.206 112.447 51.1319C114.314 52.2281 113.06 55.0864 110.989 54.455C109.24 53.9217 107.879 56.0046 109.07 57.3924C110.48 59.0355 108.366 61.3318 106.612 60.0621C105.131 58.9897 103.168 60.5179 103.844 62.2172C104.644 64.2292 101.899 65.7147 100.652 63.9443C99.5993 62.449 97.2461 63.2568 97.3336 65.0835C97.4372 67.2464 94.3587 67.7601 93.7544 65.6808C93.244 63.9247 90.756 63.9247 90.2457 65.6808C89.6414 67.7601 86.5628 67.2464 86.6665 65.0835C86.754 63.2568 84.4008 62.449 83.3478 63.9443C82.1011 65.7147 79.3562 64.2292 80.1565 62.2172C80.8324 60.5179 78.869 58.9897 77.3876 60.0621C75.6336 61.3318 73.5197 59.0355 74.93 57.3924C76.121 56.0046 74.7602 53.9217 73.0109 54.455C70.9396 55.0864 69.6859 52.2281 71.5532 51.1319C73.1303 50.206 72.5196 47.7942 70.6919 47.7305C68.5279 47.6552 68.2701 44.5447 70.3922 44.1142C72.1845 43.7506 72.39 41.2711 70.682 40.6175C68.6597 39.8436 69.4259 36.818 71.5728 37.0998C73.386 37.3379 74.3854 35.0594 72.9822 33.8866C71.3208 32.498 73.0279 29.8851 74.9669 30.8488C76.6046 31.6627 78.2897 29.8322 77.3433 28.2673C76.2228 26.4145 78.6858 24.4974 80.2069 26.0385C81.4916 27.3401 83.6797 26.1559 83.2927 24.3686C82.8345 22.2523 85.7865 21.2388 86.7248 23.1903C87.5173 24.8385 89.9713 24.429 90.1857 22.6128Z",fill:"#BAE0B5"}),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M105.333 44.0003C105.333 51.3641 99.3638 57.3337 92.0001 57.3337C84.6363 57.3337 78.6667 51.3641 78.6667 44.0003C78.6667 36.6365 84.6363 30.667 92.0001 30.667C99.3638 30.667 105.333 36.6365 105.333 44.0003ZM97.3738 39.9599C97.7643 40.3504 97.7643 40.9836 97.3738 41.3741L90.7071 48.0407C90.3166 48.4313 89.6835 48.4313 89.293 48.0407L86.6263 45.3741C86.2358 44.9835 86.2358 44.3505 86.6263 43.9599C87.0168 43.5694 87.65 43.5694 88.0405 43.9599L90.0001 45.9194L92.9798 42.9397L95.9597 39.9599C96.3502 39.5694 96.9833 39.5694 97.3738 39.9599Z",fill:"#11A800"})),i().createElement("defs",null,i().createElement("filter",{id:"filter0_f_2670_9370",x:"-32",y:"-28",width:"248",height:"248",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},i().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i().createElement("feGaussianBlur",{stdDeviation:"30",result:"effect1_foregroundBlur_2670_9370"})),i().createElement("clipPath",{id:"clip0_2670_9370"},i().createElement("rect",{width:"188",height:"188",fill:"white"}))))},ze=function(e){var t=e.className,n=(0,a.A)(e,T);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",className:t,viewBox:"0 0 24 24",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C13.1046 2 14 2.89543 14 4V11.5858L16.2929 9.29289C16.6834 8.90237 17.3166 8.90237 17.7071 9.29289C18.0976 9.68342 18.0976 10.3166 17.7071 10.7071L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L6.29289 10.7071C5.90237 10.3166 5.90237 9.68342 6.29289 9.29289C6.68342 8.90237 7.31658 8.90237 7.70711 9.29289L10 11.5858V4C10 2.89543 10.8954 2 12 2ZM5 16C5.55228 16 6 16.4477 6 17V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V17C18 16.4477 18.4477 16 19 16C19.5523 16 20 16.4477 20 17V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V17C4 16.4477 4.44772 16 5 16Z"}))},Ke=function(e){var t=e.className,n=(0,a.A)(e,I);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,fill:"currentColor"},n),i().createElement("path",{fill:"currentColor",d:"M17 17h-2.025q-.425 0-.7-.288T14 16t.288-.712T15 15h2v-2q0-.425.288-.712T18 12t.713.288T19 13v2h2q.425 0 .713.288T22 16t-.288.713T21 17h-2v2q0 .425-.288.713T18 20t-.712-.288T17 19zm-7 0H7q-2.075 0-3.537-1.463T2 12t1.463-3.537T7 7h3q.425 0 .713.288T11 8t-.288.713T10 9H7q-1.25 0-2.125.875T4 12t.875 2.125T7 15h3q.425 0 .713.288T11 16t-.288.713T10 17m-1-4q-.425 0-.712-.288T8 12t.288-.712T9 11h6q.425 0 .713.288T16 12t-.288.713T15 13zm13-1h-2q0-1.25-.875-2.125T17 9h-3.025q-.425 0-.7-.288T13 8t.288-.712T14 7h3q2.075 0 3.538 1.463T22 12"}))},Ve=function(e){var t=e.className,n=(0,a.A)(e,D);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))},We=function(e){var t=e.className,n=(0,a.A)(e,L);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"}))},Xe=function(e){var t=e.className,n=(0,a.A)(e,R);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}))},Ye=function(e){var t=e.className,n=(0,a.A)(e,F);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))},Ze=function(e){var t=e.className,n=(0,a.A)(e,M);return i().createElement("svg",(0,r.A)({className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4C4.44772 4 4 4.44772 4 5V19C4 19.5523 4.44771 20 5 20H5.58579L14.3789 11.2069C14.9415 10.6445 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V5C20 4.44771 19.5523 4 19 4H5ZM22 14.999V5C22 3.34315 20.6569 2 19 2H5C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H5.99902C5.99967 22 6.00033 22 6.00098 22H19C20.6569 22 22 20.6569 22 19V15.001C22 15.0003 22 14.9997 22 14.999ZM20 15.4142L17.207 12.6212C17.207 12.6212 17.207 12.6212 17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211C15.7931 12.6211 15.7931 12.6211 15.7931 12.6211L8.41421 20H19C19.5523 20 20 19.5523 20 19V15.4142ZM9 8C8.44772 8 8 8.44772 8 9C8 9.55228 8.44772 10 9 10C9.55228 10 10 9.55228 10 9C10 8.44772 9.55228 8 9 8ZM6 9C6 7.34315 7.34315 6 9 6C10.6569 6 12 7.34315 12 9C12 10.6569 10.6569 12 9 12C7.34315 12 6 10.6569 6 9Z"}))},Je=function(e){var t=e.className,n=(0,a.A)(e,G);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",className:t,viewBox:"0 0 24 24",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8769 3.00024C19.7295 3.00024 19.5835 3.02928 19.4473 3.08571C19.3111 3.14213 19.1873 3.22483 19.083 3.32909L15.064 7.34809C14.7827 7.62929 14.4012 7.78737 14.0034 7.78737C13.6057 7.78737 13.2242 7.6294 12.9429 7.34819L11.9989 6.40414C11.7344 6.13976 11.3758 5.99123 11.0019 5.99123C10.628 5.99123 10.2694 6.13976 10.005 6.40414L9.41466 6.99446L17.0064 14.5853L17.5968 13.9949C17.5967 13.9949 17.5968 13.9949 17.5968 13.9949C17.8611 13.7305 18.0097 13.3719 18.0097 12.998C18.0097 12.6241 17.8611 12.2655 17.5968 12.001L16.6528 11.0571C16.3716 10.7758 16.2135 10.3942 16.2135 9.99648C16.2135 9.59873 16.3715 9.21727 16.6527 8.93598L20.6707 4.91696C20.775 4.8127 20.8578 4.68885 20.9142 4.55263C20.9706 4.41642 20.9997 4.27042 20.9997 4.12298C20.9997 3.97554 20.9706 3.82954 20.9142 3.69333C20.8578 3.55711 20.7751 3.43334 20.6708 3.32909C20.5666 3.22483 20.4428 3.14213 20.3066 3.08571C20.1704 3.02928 20.0244 3.00024 19.8769 3.00024ZM14.9361 15.3435L9.11337 9.52147C8.31287 10.4827 7.43798 11.1765 6.48488 11.6882C5.50406 12.2149 4.4692 12.5328 3.41064 12.7669L4.51148 14.1028L14.2092 16.7479C14.349 16.5378 14.4739 16.334 14.5816 16.1393C14.7635 15.8103 14.8745 15.5452 14.9361 15.3435ZM15.3971 18.5292C15.4153 18.5068 15.4326 18.4836 15.449 18.4596C15.7849 18.0068 16.0869 17.5501 16.3319 17.107C16.4022 16.9798 16.4704 16.8493 16.5346 16.7162C16.6854 16.7662 16.8446 16.7924 17.0064 16.7924C17.4042 16.7924 17.7856 16.6344 18.0669 16.3532L19.011 15.4091C19.6504 14.7696 20.0097 13.9023 20.0097 12.998C20.0097 12.0937 19.6505 11.2264 19.0111 10.5869L18.4206 9.99644L22.085 6.33109C22.085 6.33111 22.0851 6.33106 22.085 6.33109C22.375 6.04113 22.605 5.69683 22.762 5.318C22.9189 4.93913 22.9997 4.53306 22.9997 4.12298C22.9997 3.7129 22.9189 3.30683 22.762 2.92796C22.605 2.54909 22.375 2.20484 22.085 1.91487C21.7951 1.6249 21.4508 1.39488 21.0719 1.23795C20.6931 1.08102 20.287 1.00024 19.8769 1.00024C19.4668 1.00024 19.0608 1.08102 18.6819 1.23795C18.303 1.39488 17.9588 1.6249 17.6688 1.91487L14.0034 5.58027L13.413 4.98987C12.7735 4.35048 11.9062 3.99123 11.0019 3.99123C10.0976 3.99123 9.23035 4.35043 8.59087 4.98982L7.64681 5.93387C7.36561 6.21516 7.20753 6.59673 7.20753 6.99448C7.20753 7.39223 7.3655 7.77369 7.64671 8.05498L7.69182 8.10009C7.01435 8.95034 6.29888 9.51802 5.53871 9.92621C4.5816 10.4402 3.50727 10.727 2.23479 10.9647C1.97809 11.012 1.73806 11.1252 1.53824 11.2932C1.33775 11.4617 1.18466 11.6796 1.09404 11.9254C1.00343 12.1711 0.978422 12.4362 1.02149 12.6946C1.06457 12.9529 1.17423 13.1956 1.33966 13.3986L3.16744 15.6167C3.16959 15.6193 3.17175 15.622 3.17392 15.6246L8.66319 22.2859C8.67719 22.3029 8.69175 22.3194 8.70685 22.3355C9.00421 22.6513 9.39618 22.8619 9.82368 22.9355C10.2512 23.0091 10.691 22.9417 11.0769 22.7435C11.1143 22.7243 11.1504 22.7027 11.1851 22.6789C12.3371 21.8897 13.7491 20.5544 14.8741 19.1924C15.0545 18.9739 15.2298 18.7521 15.3971 18.5292ZM12.8708 18.4559L6.71505 16.7769L10.1591 20.9563C10.9668 20.3843 11.9732 19.463 12.8708 18.4559Z"}))},$e=function(e){var t=e.className,n=(0,a.A)(e,Q);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",className:t,viewBox:"0 0 24 24",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5579 3.02796C16.0749 2.97339 15.5839 2.9892 15.1002 3.07733C14.1003 3.25952 13.1796 3.74211 12.4609 4.46081C11.7422 5.1795 11.2596 6.10016 11.0774 7.10009C10.8953 8.10001 11.0221 9.13172 11.4412 10.0577C11.6128 10.4369 11.5315 10.8828 11.2372 11.1771L4.32721 18.0871C4.11692 18.2974 3.99878 18.5826 3.99878 18.88C3.99878 19.1774 4.11692 19.4626 4.32721 19.6729C4.5375 19.8832 4.82271 20.0013 5.1201 20.0013C5.41749 20.0013 5.7027 19.8832 5.91299 19.6729L12.823 12.7629C13.1173 12.4686 13.5632 12.3873 13.9424 12.5589C14.8684 12.978 15.9001 13.1048 16.9 12.9226C17.8999 12.7404 18.8206 12.2578 19.5393 11.5392C20.258 10.8205 20.7406 9.8998 20.9228 8.89987C21.0109 8.41622 21.0267 7.92514 20.9721 7.44218L18.4001 10.0142C18.0263 10.3806 17.5236 10.5858 17.0001 10.5858C16.4766 10.5858 15.974 10.3806 15.6001 10.0141L15.593 10.0071L13.9859 8.40002C13.6195 8.02616 13.4142 7.52349 13.4142 6.99998C13.4142 6.47647 13.6195 5.97384 13.986 5.59998L13.993 5.59284L16.5579 3.02796ZM14.7417 1.10972C16.1416 0.854655 17.586 1.03228 18.8824 1.61892C19.1815 1.75426 19.3951 2.02777 19.4539 2.35073C19.5127 2.67369 19.4093 3.00496 19.1772 3.23709L15.4143 6.99998L17.0001 8.58577L20.763 4.82287C20.9951 4.59075 21.3264 4.48733 21.6493 4.54618C21.9723 4.60502 22.2458 4.81863 22.3812 5.11771C22.9678 6.41409 23.1454 7.85848 22.8904 9.25838C22.6353 10.6583 21.9597 11.9472 20.9535 12.9534C19.9473 13.9595 18.6584 14.6352 17.2585 14.8902C16.091 15.103 14.8927 15.0147 13.775 14.6393L7.32721 21.0871C6.74185 21.6724 5.94793 22.0013 5.1201 22.0013C4.29227 22.0013 3.49835 21.6724 2.91299 21.0871C2.32763 20.5017 1.99878 19.7078 1.99878 18.88C1.99878 18.0522 2.32763 17.2582 2.91299 16.6729L9.36075 10.2251C8.98534 9.10743 8.89713 7.90903 9.10984 6.74158C9.3649 5.34169 10.0405 4.05277 11.0467 3.0466C12.0529 2.04042 13.3418 1.36478 14.7417 1.10972Z"}))},et=function(e){var t=e.className,n=(0,a.A)(e,B);return i().createElement("svg",(0,r.A)({width:"34",height:"43",viewBox:"0 0 34 43",fill:"none",className:t},n),i().createElement("ellipse",{cx:"16.9999",cy:"41.3026",rx:"11.3158",ry:"1.69737",fill:"black",fillOpacity:"0.15"}),i().createElement("path",{d:"M5.68408 7.78931H28.3157V33.0788C28.3157 34.7356 26.9725 36.0788 25.3157 36.0788H8.68408C7.02723 36.0788 5.68408 34.7356 5.68408 33.0788V7.78931Z",fill:"#FF7366"}),i().createElement("path",{d:"M1.15771 8.22485H32.8419M5.40114 8.22485H28.5985L27.4669 33.2937C27.4669 34.0324 27.1689 34.7409 26.6383 35.2633C26.1078 35.7856 25.3883 36.0791 24.638 36.0791H9.36166C8.61138 36.0791 7.89182 35.7856 7.36129 35.2633C6.83076 34.7409 6.53271 34.0324 6.53271 33.2937L5.40114 8.22485Z",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M12.4741 14.6578V29.6577M21.5258 14.6578V29.6577M11.3425 3.06577H22.6572C23.1749 3.06577 23.6315 3.37946 23.8152 3.85263L25.5731 8.22485H8.42651L10.1844 3.85263C10.3681 3.37946 10.8247 3.06577 11.3425 3.06577Z",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},tt=function(e){var t=e.className,n=(0,a.A)(e,q);return i().createElement("svg",(0,r.A)({width:"41",height:"40",viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("circle",{cx:"20.5",cy:"20",r:"20",fill:"#EBF6EA"}),i().createElement("g",{clipPath:"url(#clip0_upload_icon)"},i().createElement("path",{d:"M24 24L20 20L16 24",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M20 20V29",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M28.39 26.39C29.3654 25.8583 30.1359 25.0169 30.5799 23.9986C31.0239 22.9804 31.1162 21.8432 30.8422 20.7667C30.5682 19.6901 29.9435 18.7355 29.0667 18.0534C28.1899 17.3714 27.1109 17.0007 26 17H24.74C24.4373 15.8292 23.8732 14.7423 23.09 13.821C22.3068 12.8996 21.3249 12.1678 20.2181 11.6806C19.1114 11.1933 17.9086 10.9633 16.7001 11.0079C15.4917 11.0524 14.3091 11.3703 13.2412 11.9376C12.1733 12.505 11.2479 13.3071 10.5346 14.2836C9.82135 15.26 9.33871 16.3855 9.123 17.5754C8.90729 18.7652 8.96413 19.9885 9.28923 21.1532C9.61434 22.318 10.1993 23.3938 11 24.3",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M24 24L20 20L16 24",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),i().createElement("defs",null,i().createElement("clipPath",{id:"clip0_upload_icon"},i().createElement("rect",{width:"24",height:"24",fill:"white",transform:"translate(8 8)"}))))},nt=function(e){var t=e.className,n=(0,a.A)(e,U);return i().createElement("svg",(0,r.A)({className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"}))},rt=function(e){var t=e.className,n=(0,a.A)(e,H);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))},at=function(e){var t=e.className,n=(0,a.A)(e,z);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))},ot=function(e){var t=e.className,n=(0,a.A)(e,K);return i().createElement("svg",(0,r.A)({className:t,fill:"currentColor",viewBox:"0 0 20 20"},n),i().createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"}))},it=function(e){var t=e.className,n=(0,a.A)(e,V);return i().createElement("svg",(0,r.A)({className:t,viewBox:"0 0 20 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.33301 3.33329C2.87277 3.33329 2.49967 3.70639 2.49967 4.16663V12.5C2.49967 12.9602 2.87277 13.3333 3.33301 13.3333H16.6663C17.1266 13.3333 17.4997 12.9602 17.4997 12.5V4.16663C17.4997 3.70639 17.1266 3.33329 16.6663 3.33329H3.33301ZM10.833 15H16.6663C18.0471 15 19.1663 13.8807 19.1663 12.5V4.16663C19.1663 2.78591 18.0471 1.66663 16.6663 1.66663H3.33301C1.9523 1.66663 0.833008 2.78591 0.833008 4.16663V12.5C0.833008 13.8807 1.9523 15 3.33301 15H9.16634V16.6666H6.66634C6.2061 16.6666 5.83301 17.0397 5.83301 17.5C5.83301 17.9602 6.2061 18.3333 6.66634 18.3333H13.333C13.7932 18.3333 14.1663 17.9602 14.1663 17.5C14.1663 17.0397 13.7932 16.6666 13.333 16.6666H10.833V15Z"}))},lt=function(e){var t=e.className,n=(0,a.A)(e,W);return i().createElement("svg",(0,r.A)({className:t,viewBox:"0 0 14 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.83301 2.50004C2.37277 2.50004 1.99967 2.87314 1.99967 3.33337V16.6667C1.99967 17.1269 2.37277 17.5 2.83301 17.5H11.1663C11.6266 17.5 11.9997 17.1269 11.9997 16.6667V3.33337C11.9997 2.87314 11.6266 2.50004 11.1663 2.50004H2.83301ZM0.333008 3.33337C0.333008 1.95266 1.4523 0.833374 2.83301 0.833374H11.1663C12.5471 0.833374 13.6663 1.95266 13.6663 3.33337V16.6667C13.6663 18.0474 12.5471 19.1667 11.1663 19.1667H2.83301C1.4523 19.1667 0.333008 18.0474 0.333008 16.6667V3.33337ZM6.16634 15C6.16634 14.5398 6.53944 14.1667 6.99967 14.1667H7.00801C7.46825 14.1667 7.84134 14.5398 7.84134 15C7.84134 15.4603 7.46825 15.8334 7.00801 15.8334H6.99967C6.53944 15.8334 6.16634 15.4603 6.16634 15Z"}))},ct=function(e){var t=e.className,n=(0,a.A)(e,X);return i().createElement("svg",(0,r.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:t},n),i().createElement("path",{d:"M15.8333 10H4.16663",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M9.99996 15.8332L4.16663 9.99984L9.99996 4.1665",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},st=function(e){var t=e.className,n=(0,a.A)(e,Y);return i().createElement("svg",(0,r.A)({className:t,viewBox:"0 0 20 20",fill:"currentColor"},n),i().createElement("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"}))},ut=function(e){var t=e.className,n=(0,a.A)(e,Z);return i().createElement("svg",(0,r.A)({className:t,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M1.5 3H2.5H10.5",stroke:"#374151",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M9.5 3V10C9.5 10.2652 9.39464 10.5196 9.20711 10.7071C9.01957 10.8946 8.76522 11 8.5 11H3.5C3.23478 11 2.98043 10.8946 2.79289 10.7071C2.60536 10.5196 2.5 10.2652 2.5 10V3M4 3V2C4 1.73478 4.10536 1.48043 4.29289 1.29289C4.48043 1.10536 4.73478 1 5 1H7C7.26522 1 7.51957 1.10536 7.70711 1.29289C7.89464 1.48043 8 1.73478 8 2V3",stroke:"#374151",strokeLinecap:"round",strokeLinejoin:"round"}))},dt=function(e){var t=e.className,n=(0,a.A)(e,J);return i().createElement("svg",(0,r.A)({className:t,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1",stroke:"#374151",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M8 4V2C8 1.44772 7.55228 1 7 1H2C1.44772 1 1 1.44772 1 2V7C1 7.55228 1.44772 8 2 8H4",stroke:"#374151",strokeLinecap:"round",strokeLinejoin:"round"}))},mt=function(e){var t=e.className,n=(0,a.A)(e,$);return i().createElement("svg",(0,r.A)({className:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n),i().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))},gt=function(e){var t=e.className,n=(0,a.A)(e,ee);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 240 240",width:"240.0pt",height:"240.0pt",className:t},n),i().createElement("path",{d:"M 0.00 0.00 L 240.00 0.00 L 240.00 240.00 L 0.00 240.00 L 0.00 0.00 Z",fill:"#ffffff"}),i().createElement("path",{d:"M 116.97 3.45 C 155.78 2.17 194.29 21.78 215.90 54.07 C 226.92 70.43 234.08 89.34 236.07 109.00 C 239.08 140.20 228.61 172.42 208.14 196.12 C 191.73 215.41 168.66 228.79 143.97 234.16 C 125.25 238.08 105.37 237.44 87.04 231.86 C 67.00 226.07 48.82 214.65 34.69 199.32 C 14.08 177.26 2.88 147.13 3.50 117.00 C 4.36 95.58 10.72 74.49 22.55 56.55 C 35.03 37.69 52.63 22.36 73.52 13.50 C 87.07 6.87 101.94 3.80 116.97 3.45 Z",fill:"#9fbb1a"}),i().createElement("path",{d:"M 69.17 61.47 C 70.78 61.56 72.37 61.91 73.97 62.05 C 80.30 62.27 86.66 62.04 93.00 62.14 C 96.81 62.23 100.65 61.35 104.18 62.75 C 108.45 64.30 111.62 68.44 111.67 73.03 C 111.78 81.35 111.66 89.68 111.72 98.00 C 111.65 101.03 111.87 104.65 110.30 107.35 C 108.22 110.91 104.17 113.41 100.02 113.40 C 90.68 113.43 81.33 113.42 71.99 113.40 C 65.66 113.41 59.85 108.54 59.66 102.04 C 59.55 92.36 59.70 82.67 59.58 72.99 C 59.41 67.44 63.60 62.15 69.17 61.47 Z",fill:"#ffffff"}),i().createElement("path",{d:"M 138.98 61.27 C 148.33 61.42 157.69 61.22 167.04 61.37 C 173.28 61.31 178.81 66.69 178.70 72.96 C 178.72 82.65 178.75 92.34 178.68 102.02 C 178.48 108.28 173.18 112.96 167.02 113.04 C 157.69 113.25 148.33 113.02 138.99 113.15 C 132.77 113.56 126.76 108.35 126.66 102.04 C 126.55 94.37 126.67 86.68 126.62 79.00 C 126.63 76.33 126.42 73.60 126.72 70.94 C 127.60 65.24 133.25 60.88 138.98 61.27 Z",fill:"#ffffff"}),i().createElement("path",{d:"M 70.97 72.97 C 80.41 72.70 89.87 72.92 99.31 72.86 C 99.39 82.36 99.34 91.87 99.34 101.38 C 89.85 101.36 80.36 101.42 70.87 101.35 C 70.90 91.90 70.70 82.42 70.97 72.97 Z",fill:"#9fbb1a"}),i().createElement("path",{d:"M 138.39 72.91 C 147.80 72.79 157.23 72.85 166.65 72.88 C 166.65 82.41 166.85 91.97 166.55 101.49 C 157.18 101.27 147.79 101.39 138.41 101.42 C 138.30 91.92 138.36 82.41 138.39 72.91 Z",fill:"#9fbb1a"}),i().createElement("path",{d:"M 69.96 128.72 C 77.95 128.35 86.00 128.68 94.00 128.66 C 97.84 128.75 101.40 128.12 104.93 129.93 C 109.12 131.86 111.63 136.43 111.39 141.00 C 111.31 150.34 111.48 159.70 111.31 169.04 C 111.25 175.45 105.33 180.72 99.01 180.44 C 90.00 180.43 81.00 180.42 71.99 180.44 C 67.16 180.64 62.37 177.99 60.28 173.57 C 59.04 171.04 59.32 167.76 59.27 165.00 C 59.38 156.70 59.15 148.39 59.37 140.10 C 59.59 134.25 64.10 129.27 69.96 128.72 Z",fill:"#ffffff"}),i().createElement("path",{d:"M 137.96 128.68 C 146.96 128.36 156.00 128.45 165.00 128.61 C 167.68 128.64 170.26 129.00 172.61 130.36 C 176.44 132.46 178.51 136.68 178.41 140.99 C 178.39 150.33 178.47 159.67 178.37 169.01 C 178.48 174.84 173.95 180.48 167.95 180.68 C 159.31 180.89 150.65 180.67 142.00 180.78 C 139.64 180.74 137.05 180.91 134.76 180.27 C 129.71 178.66 126.48 173.17 126.62 168.01 C 126.61 161.01 126.64 154.00 126.62 147.00 C 126.71 143.40 126.11 139.00 127.75 135.73 C 129.57 131.70 133.51 128.85 137.96 128.68 Z",fill:"#ffffff"}),i().createElement("path",{d:"M 70.98 140.01 C 80.41 139.71 89.87 139.94 99.31 139.89 C 99.40 149.41 99.33 158.93 99.35 168.45 C 89.85 168.43 80.36 168.47 70.86 168.42 C 70.91 158.96 70.69 149.47 70.98 140.01 Z",fill:"#9fbb1a"}),i().createElement("path",{d:"M 138.45 140.41 C 147.84 140.29 157.27 140.44 166.67 140.35 C 166.70 149.82 166.71 159.29 166.67 168.77 C 157.24 168.71 147.81 168.71 138.38 168.77 C 138.39 159.32 138.24 149.85 138.45 140.41 Z",fill:"#9fbb1a"}))},ft=function(e){var t=e.className,n=(0,a.A)(e,te);return i().createElement("svg",(0,r.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M15.8327 10H4.16602",stroke:"#374151",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M9.99935 15.8332L4.16602 9.99984L9.99935 4.1665",stroke:"#374151",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},pt=function(e){var t=e.className,n=(0,a.A)(e,ne);return i().createElement("svg",(0,r.A)({width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M4.6665 10.625H16.3332",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M10.5 4.79175L16.3333 10.6251L10.5 16.4584",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},ht=function(e){var t=e.className,n=(0,a.A)(e,re);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none",className:t},n),i().createElement("g",{clipPath:"url(#empty_state_clip)"},i().createElement("ellipse",{cx:"32",cy:"57",fill:"#000",fillOpacity:".1",rx:"20",ry:"2"}),i().createElement("path",{fill:"#F1F1F1",d:"M49.492 35.1c-.297 1.419-1.74 2.563-3.182 2.563H17.569c-1.442 0-2.885-1.144-3.182-2.564L9.1 10.564C8.78 9.144 9.718 8 11.16 8h41.558c1.443 0 2.381 1.145 2.06 2.564z"}),i().createElement("path",{fill:"#D2D2D2",d:"M38.775 13.742c-1.443 0-3.022 1.122-3.526 2.473l-1.443 4.075c-.48 1.374-2.06 2.496-3.525 2.496H9.608c-1.442 0-2.313 1.122-1.946 2.519l5.836 24.967c.366 1.397 1.854 2.542 3.297 2.542h30.383c1.442 0 2.93-1.145 3.297-2.542l5.836-24.967c.389-1.397 1.076-3.64 1.58-5.015l1.442-4.075c.48-1.35-.298-2.473-1.74-2.473z"}),i().createElement("path",{fill:"#000",fillOpacity:".7",d:"M30.024 34.394c0 1.512-.893 2.748-1.992 2.748-1.077 0-1.97-1.236-1.97-2.748 0-1.534.893-2.77 1.97-2.77 1.099 0 1.991 1.236 1.991 2.77M41.002 34.394c0 1.512-.893 2.748-1.992 2.748s-1.969-1.236-1.969-2.748c0-1.534.87-2.77 1.97-2.77 1.098 0 1.991 1.236 1.991 2.77"}),i().createElement("path",{fill:"#000",fillOpacity:".7",fillRule:"evenodd",d:"M39.017 41.093a.547.547 0 0 1-.244.733c-2.673 1.336-7.896 1.15-10.189.047a.547.547 0 0 1 .214-1.072c3.172 1.083 6.963 1.083 9.478.05l.008-.003a.547.547 0 0 1 .733.245",clipRule:"evenodd"}),i().createElement("path",{fill:"#000",fillOpacity:".7",d:"M4.253 35.736a1.043 1.043 0 0 1-1.487-1.464l6.507-6.61 1.447 1.504z"}),i().createElement("path",{fill:"#000",fillOpacity:".7",fillRule:"evenodd",d:"M22.248 29.01c-3.866 3.686-9.99 3.548-13.69-.313-3.701-3.86-3.562-9.985.298-13.685s10-3.567 13.7.293c3.686 3.866 3.552 10.005-.308 13.706m-1.455-1.526c3.023-2.899 3.122-7.696.237-10.724-2.895-3.008-7.697-3.122-10.72-.222-3.012 2.88-3.126 7.682-.226 10.705 2.884 3.027 7.681 3.126 10.709.242",clipRule:"evenodd"}),i().createElement("path",{fill:"#fff",fillOpacity:".8",d:"M10.084 27.243c-2.9-3.023-2.786-7.825.227-10.705 3.023-2.9 7.825-2.786 10.72.222 2.884 3.028 2.785 7.825-.238 10.724-3.027 2.885-7.825 2.786-10.71-.241"})),i().createElement("defs",null,i().createElement("clipPath",{id:"empty_state_clip"},i().createElement("path",{fill:"#fff",d:"M0 0h64v64H0z"}))))},yt=function(e){var t=e.className,n=(0,a.A)(e,ae);return i().createElement("svg",(0,r.A)({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M25.3333 14.6667H6.66667C5.19391 14.6667 4 15.8607 4 17.3334V26.6667C4 28.1395 5.19391 29.3334 6.66667 29.3334H25.3333C26.8061 29.3334 28 28.1395 28 26.6667V17.3334C28 15.8607 26.8061 14.6667 25.3333 14.6667Z",stroke:"#0D0E11",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i().createElement("path",{d:"M9.3335 14.6667V9.33341C9.3335 7.5653 10.0359 5.86961 11.2861 4.61937C12.5364 3.36913 14.2321 2.66675 16.0002 2.66675C17.7683 2.66675 19.464 3.36913 20.7142 4.61937C21.9644 5.86961 22.6668 7.5653 22.6668 9.33341V14.6667",stroke:"#0D0E11",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},vt=function(e){var t=e.className,n=(0,a.A)(e,oe);return i().createElement("svg",(0,r.A)({width:"35",height:"63",viewBox:"0 0 35 63",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M29.2576 53.2228C23.969 53.4453 20.1738 51.2042 17.4501 46.8813C16.741 45.7589 15.6984 44.8617 15.0777 43.5826C13.4649 40.4019 13.4307 40.2794 13.3431 36.4086C14.7597 36.2771 15.9893 36.66 17.3415 37.0086C21.3198 38.0103 25.7084 36.4546 27.8892 33.1388C28.7635 31.7723 29.6037 30.2833 30.0863 28.6961C31.0072 25.6001 30.4067 23.9192 27.8412 22.0608C26.2501 20.8547 24.5464 19.4818 22.4285 19.9412C19.9088 20.3808 17.7164 21.5213 15.8172 23.24C13.8738 25.0371 12.1997 27.089 10.9514 29.4843C10.5092 30.2679 10.1314 30.5715 9.32378 29.8067C7.20433 27.8899 5.7862 25.6451 5.24628 22.759C5.17801 22.514 5.15396 22.1906 5.00734 21.9014C3.3464 18.0739 4.20913 14.532 5.6405 10.8973C6.98342 7.41939 8.90894 4.37289 11.8089 1.97858C9.88026 0.272487 9.88022 0.272513 7.95703 1.66784C2.57533 5.34938 0.538852 10.6055 0.382867 16.9209C0.279658 20.5808 1.27965 23.9327 3.10351 26.9224C4.52164 29.1672 6.17485 31.5444 8.6822 32.9568C9.38739 33.3541 9.68059 33.9324 9.64025 34.7359C9.40672 36.9798 9.54092 39.1209 10.4005 41.2576C11.8264 44.9527 13.7084 48.3883 16.5912 51.1483C18.8573 53.3544 21.256 55.3253 24.5733 55.8514C25.4111 56.0135 25.5477 56.5035 24.9488 57.1989C24.3941 57.816 23.6043 58.3006 22.9713 58.8735C22.4267 59.2897 21.8379 59.7842 21.5624 60.4553C21.287 61.1264 21.3351 61.7731 22.2412 62.1803C23.6958 62.8964 24.8673 62.8334 26.2459 61.8542C28.2917 60.4246 30.4158 59.0392 32.4616 57.6097C34.8409 55.9549 35.2451 54.3236 33.5477 52.0248C32.8728 51.0249 32.1978 50.025 31.8565 48.8C31.7541 48.4324 31.6075 48.1433 31.3383 47.8883C30.4182 46.9569 28.5958 46.3435 28.0412 46.9605C27.187 47.9253 27.7394 48.9594 28.0908 49.9836C28.4422 51.0078 28.9946 52.0419 29.2576 53.2228ZM25.5231 28.914C25.2376 29.786 24.928 30.3346 24.4618 30.7949C23.9955 31.2552 23.5293 31.7155 23.1073 32.0975C21.2865 33.8603 17.3059 34.5098 15.1461 33.3964C14.0491 32.7785 13.9808 32.5334 14.4432 31.348C15.1267 29.7707 16.2803 28.4583 17.4339 27.1458C19.0538 25.373 21.0212 23.8993 23.4967 23.5381C25.6046 23.2796 26.7155 24.4218 26.4921 26.4648C26.3974 27.5476 25.9552 28.3312 25.5231 28.914Z",fill:"#B5CBA8"}))},bt=function(e){var t=e.className,n=(0,a.A)(e,ie);return i().createElement("svg",(0,r.A)({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M28.4468 19.8349C28.1951 20.4465 29.8965 22.7846 28.9876 24.0004C27.9727 25.3564 25.5245 25.1503 25.1101 25.6088C24.5757 26.1996 24.8802 28.7067 23.501 29.4862C22.0476 30.1862 19.9453 28.7209 19.3365 28.9465C18.2732 29.362 17.711 31.4941 16.0005 31.4941C14.2901 31.4941 13.7281 29.362 12.6646 28.9465C11.939 28.757 10.0703 30.1791 8.50002 29.4862C7.12064 28.7062 7.42533 26.1996 6.89089 25.6088C6.47658 25.1503 4.02808 25.3559 3.01345 24.0004C2.10402 22.7851 3.8057 20.4467 3.55373 19.8349C3.18484 18.9367 1.00586 18.1401 1.00586 16.5002C1.00586 14.8604 3.1848 14.0637 3.55398 13.1653C3.80593 12.5542 2.1043 10.2156 3.0137 9C4.02858 7.64406 6.47683 7.84987 6.89114 7.39162C7.42557 6.8008 7.12063 4.29375 8.50027 3.51418C9.89039 2.81106 11.9407 4.21831 12.6648 4.05349C13.7278 3.63772 14.2901 1.50562 16.0005 1.50562C17.711 1.50562 18.273 3.63768 19.3365 4.05324C19.9873 4.27614 22.1685 2.82668 23.501 3.51393C24.8801 4.2935 24.5757 6.80056 25.1101 7.39137C25.5244 7.84987 27.9729 7.64382 28.9876 8.99975C29.897 10.2151 28.1953 12.5537 28.4468 13.1651C28.8159 14.0635 30.9949 14.8601 30.9949 16.5C30.9947 18.1401 28.8157 18.9367 28.4468 19.8349Z",fill:"#69BC85"}),i().createElement("path",{d:"M13.3293 16.3186C11.8489 16.3186 10.8765 15.2736 10.8765 13.9238C10.8765 12.5595 11.8489 11.5 13.3293 11.5C14.8242 11.5 15.7966 12.5595 15.7966 13.9238C15.7966 15.2736 14.8242 16.3186 13.3293 16.3186ZM13.4744 21.3258H12.3859L18.5688 11.6451H19.6718L13.4744 21.3258ZM18.6559 21.5C17.1754 21.5 16.203 20.455 16.203 19.1052C16.203 17.7409 17.1754 16.6669 18.6559 16.6669C20.1363 16.6669 21.1232 17.7409 21.1232 19.1052C21.1232 20.455 20.1363 21.5 18.6559 21.5ZM13.3293 15.1865C13.9969 15.1865 14.4904 14.693 14.4904 13.9238C14.4904 13.1255 13.9969 12.6321 13.3293 12.6321C12.6762 12.6321 12.1827 13.1255 12.1827 13.9238C12.1827 14.693 12.6762 15.1865 13.3293 15.1865ZM18.6559 20.3679C19.3235 20.3679 19.817 19.889 19.817 19.1052C19.817 18.307 19.3235 17.8135 18.6559 17.8135C17.9882 17.8135 17.5093 18.307 17.5093 19.1052C17.5093 19.889 17.9882 20.3679 18.6559 20.3679Z",fill:"white"}))},wt=function(e){var t=e.className,n=(0,a.A)(e,le);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",className:t},n),i().createElement("rect",{width:"48",height:"48",fill:"#F0F1F3",rx:"8"}),i().createElement("g",{clipPath:"url(#whcc_clip)"},i().createElement("path",{fill:"#374151",d:"M14 30.26q0 1.56 1.1 2.64t2.66 1.1h12.5q1.54 0 2.64-1.1t1.1-2.64v-12.5q0-1.56-1.1-2.66T30.26 14h-12.5q-1.56 0-2.66 1.1a3.62 3.62 0 0 0-1.1 2.66zm2.5 0v-12.5q0-.52.36-.88t.9-.38h12.5q.5 0 .88.38t.36.88v12.5q0 .52-.36.88t-.88.36h-12.5q-.52 0-.9-.36a1.1 1.1 0 0 1-.36-.88M17.76 29q0 .52.36.9t.88.36h10q.52 0 .88-.36t.38-.9v-.58q-.14-.28-.7-1.68t-1-2.24-.8-1.32q-.34-.36-.7-.38t-.72.24-.72.7-.74.98-.72 1.06-.72 1-.68.74-.68.28q-.36 0-1.04-.9-.1-.12-.3-.38-.7-.94-1-1.14-.48-.32-.74.22-.14.32-.58 1.4t-.66 1.6zm0-9.36q0 .78.54 1.32t1.32.54 1.34-.54.54-1.32a1.98 1.98 0 0 0-.54-1.34q-.52-.56-1.34-.54t-1.32.54-.54 1.34"})),i().createElement("defs",null,i().createElement("clipPath",{id:"whcc_clip"},i().createElement("path",{fill:"#fff",d:"M14 14h20v20H14z"}))))},xt=function(e){var t=e.className,n=(0,a.A)(e,ce);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",className:t},n),i().createElement("rect",{width:"48",height:"48",fill:"#F0F1F3",rx:"8"}),i().createElement("g",{clipPath:"url(#manual_clip)"},i().createElement("path",{fill:"#374151",d:"M14 30.26v-12.5q0-1.56 1.1-2.66a3.62 3.62 0 0 1 2.66-1.1h12.5q1.54 0 2.64 1.1t1.1 2.66v12.5q0 1.56-1.1 2.64a3.7 3.7 0 0 1-2.64 1.1h-12.5a3.62 3.62 0 0 1-2.66-1.1Q14 31.8 14 30.26m2.5 0q0 .52.36.88t.9.36h12.5q.5 0 .88-.36t.36-.88v-12.5q0-.52-.36-.88a1.27 1.27 0 0 0-.88-.38h-12.5a1.23 1.23 0 0 0-.9.38 1.14 1.14 0 0 0-.36.88zM19 29v-2.5h2.5V29zm0-3.74v-2.5h2.5v2.5zm0-3.76V19h2.5v2.5zm3.76 7.5v-2.5H29V29zm0-3.74v-2.5H29v2.5zm0-3.76V19H29v2.5z"})),i().createElement("defs",null,i().createElement("clipPath",{id:"manual_clip"},i().createElement("path",{fill:"#fff",d:"M14 14h20v20H14z"}))))},Et=function(e){var t=e.className,n=(0,a.A)(e,se);return i().createElement("svg",(0,r.A)({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"none",className:t},n),i().createElement("rect",{width:"48",height:"48",fill:"#F0F1F3",rx:"8"}),i().createElement("g",{fill:"#374151",clipPath:"url(#digital_clip)"},i().createElement("path",{d:"M31.5 23.583v7.5h-3.333v-7.5zm.833-1.666h-5a.833.833 0 0 0-.833.833v9.167a.833.833 0 0 0 .833.833h5a.834.834 0 0 0 .834-.834V22.75a.833.833 0 0 0-.834-.834"}),i().createElement("path",{d:"M29.834 16.917H16.917a.833.833 0 0 0-.833.833v9.167a.833.833 0 0 0 .833.833h7.917v-1.667h-7.083v-7.5H29v1.667h1.666v-2.5a.833.833 0 0 0-.833-.834M24.834 29.417v1.666h-9.167a.833.833 0 1 1 0-1.666z"})),i().createElement("defs",null,i().createElement("clipPath",{id:"digital_clip"},i().createElement("path",{fill:"#fff",d:"M14 14h20v20H14z"}))))},_t=function(e){var t;return("undefined"!=typeof window&&null!==(t=window.imagelyApp)&&void 0!==t&&t.assetsURL?"".concat(window.imagelyApp.assetsURL):"")+e},Ct=function(e){var t=e.className,n=(0,a.A)(e,ue);return i().createElement("img",(0,r.A)({src:_t("/images/icons/google-photos.svg"),alt:"Google Photos",className:t},n))},Nt=function(e){var t=e.className,n=(0,a.A)(e,de);return i().createElement("img",(0,r.A)({src:_t("/images/icons/g-icon.svg"),alt:"Google Photos",className:t},n))},kt=function(e){var t=e.className,n=(0,a.A)(e,me);return i().createElement("svg",(0,r.A)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z",fill:"#374151"}))},Ot=function(e){var t=e.className,n=(0,a.A)(e,ge);return i().createElement("svg",(0,r.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M10.4101 0.643066C11.4332 0.627441 12.4488 0.635566 13.4638 0.627441C13.4976 1.89682 14.0126 3.03932 14.8319 3.88557L14.8307 3.88432C15.7126 4.67869 16.8601 5.19369 18.1251 5.28119L18.1426 5.28244V8.42994C16.9476 8.39994 15.8238 8.12432 14.8107 7.65057L14.8619 7.67182C14.3719 7.43619 13.9576 7.19432 13.5638 6.92432L13.5963 6.94557C13.5888 9.22619 13.6038 11.5068 13.5807 13.7793C13.5163 14.9374 13.1313 15.9937 12.5138 16.8756L12.5263 16.8562C11.4938 18.3349 9.82131 19.3056 7.91944 19.3631H7.91069C7.83382 19.3668 7.74319 19.3687 7.65194 19.3687C6.57069 19.3687 5.56007 19.0674 4.69882 18.5443L4.72382 18.5587C3.15632 17.6156 2.07507 16.0018 1.87507 14.1249L1.87257 14.0993C1.85694 13.7087 1.84944 13.3181 1.86507 12.9356C2.17132 9.94869 4.67382 7.63807 7.71569 7.63807C8.05757 7.63807 8.39257 7.66744 8.71819 7.72307L8.68319 7.71807C8.69881 8.87369 8.65194 10.0299 8.65194 11.1856C8.38757 11.0899 8.08257 11.0343 7.76444 11.0343C6.59694 11.0343 5.60382 11.7806 5.23632 12.8224L5.23069 12.8412C5.14757 13.1081 5.09944 13.4149 5.09944 13.7324C5.09944 13.8612 5.10757 13.9887 5.12257 14.1137L5.12132 14.0987C5.32882 15.3774 6.42507 16.3424 7.74694 16.3424C7.78507 16.3424 7.82257 16.3418 7.86007 16.3399H7.85444C8.76882 16.3124 9.56256 15.8206 10.0113 15.0937L10.0176 15.0824C10.1844 14.8499 10.2988 14.5687 10.3369 14.2631L10.3376 14.2543C10.4157 12.8562 10.3844 11.4662 10.3919 10.0681C10.3994 6.92057 10.3844 3.78057 10.4076 0.641191L10.4101 0.643066Z",fill:"#374151"}))},At=function(e){var t=e.className,n=(0,a.A)(e,fe);return i().createElement("svg",(0,r.A)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM5.14386 17.8201C3.81099 16.2515 3.00683 14.2197 3.00683 12V11.9978C6.61307 11.9618 9.57567 11.4838 12.2422 10.5779C12.4668 11.0605 12.6847 11.5534 12.8956 12.0564C12.5555 12.1691 12.221 12.2949 11.8918 12.4335C9.24177 13.5489 7.00538 15.4612 5.14386 17.8201ZM6.60614 19.1967C8.10884 20.3248 9.97636 20.9932 12 20.9932C13.2188 20.9932 14.3809 20.7507 15.4409 20.3114C14.9668 18.0368 14.352 15.907 13.6265 13.9217C13.3003 14.0264 12.9807 14.1451 12.6677 14.2768C10.356 15.2499 8.33843 16.9649 6.60614 19.1967ZM15.5924 13.4765C16.2479 15.3019 16.8129 17.2399 17.267 19.2902C19.048 18.0013 20.338 16.0757 20.8032 13.8473C18.9143 13.3589 17.1821 13.2604 15.5924 13.4765ZM14.8575 11.5662C16.754 11.2412 18.7996 11.3067 20.9917 11.8332C20.9578 9.97415 20.3599 8.25291 19.3619 6.8334C17.6358 8.0531 15.9276 9.06168 14.1111 9.85398C14.3687 10.4121 14.6177 10.9829 14.8575 11.5662ZM11.3457 8.76846C8.99734 9.53429 6.39047 9.94463 3.2312 9.9948C3.85725 7.24565 5.74294 4.97565 8.24906 3.82401C9.34941 5.31262 10.3933 6.96064 11.3457 8.76846ZM13.2302 8.05623C14.8876 7.34152 16.4466 6.43089 18.0282 5.32624C16.4333 3.88469 14.3192 3.00683 12 3.00683C11.4014 3.00683 10.8165 3.06531 10.2506 3.17688C11.3103 4.66337 12.3129 6.28992 13.2302 8.05623Z",fill:"#374151"}))},St=function(e){return e.className,(0,a.A)(e,pe),i().createElement("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",xlinkHref:"http://www.w3.org/1999/xlink"},i().createElement("rect",{width:"104",height:"104",fill:"url(#pattern0_9002_292)"}),i().createElement("defs",null,i().createElement("pattern",{id:"pattern0_9002_292",patternContentUnits:"objectBoundingBox",width:"1",height:"1"},i().createElement("use",{xlinkHref:"#image0_9002_292",transform:"scale(0.00480769)"})),i().createElement("image",{id:"image0_9002_292",width:"208",height:"208",preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANAAAADQCAYAAAB2pO90AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABR5SURBVHgB7Z1NbB3XeYa/M6REStQPVTlpXaAViWwKFAklFGjRwIWkFkUXDWC5SBPABSJLrRfOIpbbTbuS1FU2gaQs6kWKWuoiQIwWkoAYaBAgkhCjRQu0EuMG6CYg3RYOgsQhZeuPku5M5j2XRxoOz8ydmTND3TnnfYTre3n5Y17e8873e76jpCIrydKsDLYdi9TE4UTFByVRc+nTs0JI/1kVlSyrJLqlIrk+kAdX96n51SrfqEZ9wUry4zl5PDiloui4UDAkEJSoi3EkZ/ep55fLv64AWJxIpk4nsZwSQgIltUjnY1k7W2SRrAKC1VFxci19OCeEkOUkUkdt1ijKP7Hy8P8PUjyEbEAbFGgj/4kNFoiWh5BSNlmiDQJaHXywJBQPIWWkIlo7ZGKiJy7c7eSDc0LxEDKKOSTXzAfaAq27bktCCKlE6srNw5UbWqBBfEYIIdVJa6O4U6j3qHhqRQghdVhNY6H5SAbTx4QQUpdha5tIfEQIIbVBX2iklFoQQkhtEpUcRBJhTggh9UmQ0maHNSFNmY2EENIYCogQByggQhyggAhxgAIixAEKiBAHKCBCHKCACHGAAiLEAQqIEAcoIEIcoIAIccBLAb23+EN598a/CiFd46WA3rzwDXnnyneEkK5Rq4MPEvGMz3zqd+T26m35wY/+Q/bO7hFCusI7C/TNS2/L/y7/Xyqgj+Td63TjSLd4KKBvPXn85te/IYR0iVcuHCwP3Lcs73/4P3TjSGd4ZYHgvuVBQoGQrvDKAsH6wAplgfWBFSKkC7yxQEgY5MUDdDKBNSHSEd4I6Jv/+Hbh57569mtCSBd4ISB0HtjiH8O7N/6NVoh0Qu8FBNftz/7k5Miv+/LJN7TQCGmT3iYRIJyv/u3XtHWpw8vHvygvf+lP5YUjnxVCXOmVgJAQQFoaBVI8duHX534tFdIXUkF9QT8mpAljLyDTkgPR1LU2VXnh8O8OLVMqJkLqMLYCgmjeufqdNLv2LWdrUxVYohcOf1Ze+8pfyKcP/qYQMoqxTSLs3bdHbt++nRZC98pWgQ7uvXuH/19CqtCLGAgpajSJdunCvfb6q9r6sG+O1KFXSQR0GqBgarYsuAChQDSvfeVVioY0pr9p7LQwOrRMb9f6Plibvz79V9raEOJK75tJ31v877SQ+ucjLRISBH/3D+d6JZxIJmS7mklvO0Wl/1xJ0n+PkgeylnwssQyEuONFNzas0ed+//OlX/P9//qufHqhP5k1iGcm2q/v2wbiuRt/SBG1gBe9cLAqcM2KQI2nT+IBO9SsFs/169dlfn5elFLON/ycK1eu6J+Ln0/c8WY/UJkV+vb3/qlXrptKl/ie6JdldXVVDh06JMvLy9IWs7OzsrS0pO8/in+SOnWxkOZMiieYFHS+6GqKo+OGSq3AhGyTSA3vlZbNhP6vUkPHAAJqUzzmZ+IGAUkLcVXoeLWlGynpPOh3GwfSdIBMqd0yo/an1uVX0tsn0xhnX+pK7UmTBDtkm5qWCTUUlOp4YRtRTnQQX4WGNxYIoK6DDu0sVfvbkMVD10NbNSFYkij98yKDBnG0JYq5uTl9qwrEkrdisEDmtyRueCUgLH4kE0zHAh5X7bR+5+q/6HuI0AVYGgimrdRznldeeUVOnz5d+esvXrwoJ06c2PCcaVWKVPr2J2tCmuPdXLisAJB9q8qbX//7JyJqAtwwuGe70tTzVFq7UWNydT948OCm527duqXvI7pwznhlgYBJJsAdq+q+mYEkuL1364e1OrEhHMQ247oYbe6eEdCk2o7qKnHAOwsE8bz8pS/WyrxlB5JUtUJw1XaniQBTrxlXkG3LiwgCQhyE7B9ew7b0IkCa4eXpDH987I/0np4q6AbVTD/dqHHAukNg3VXriwt05MiRDR9DPFk3bmd6EcBroktXHy8FBOtT1Q3Lb5EomyMHVw1XbO369IjDhw9veu7SpUsbPsZrwmvDayTVCfqEOliffNobYIJPtiCLK/Ou6DmZVrukjxw7dmy9cPoUtPQ8TWc/Ba8RQqI1qkaQAjLDST73B5+3dnHjud/7rT/Urh26oXdFn9DxQl+BePLZOIjnwoUL1q83Fwy8dlJOUAJCtu3LJ0/JZz712/I3f3m6dAsEPoev/dVfOiAnT5zUTZ19xlY7On/+vNUKARSC0SUxrbjZsAzvBQRrg9G+B/b/hrY4sCp1hpRggaEYefToUd3NjNih7f60rQCJBFsy4ezZs6Xfh5rWLvUcXboCgrBA6EZoYzsD0sEHDhzYFE/0hSIrNMq6okdvpkdZx63EewHpulBaUP329/5ZfvCjf689SBFiwcJbWVmRa9eu6at4XwVks0IArT5Frpyhyw1+fSaoGGi4rfu8FhLuy4SEhQbBQDhnzpzprWjyvPXWW5teC1zSfL+cDYpoM8GmsWGJvv+f37WKCK6asTa+gddmc+WQ1n7jjTdGfj9FtJGg60B6tJWlYwFXaZ85deqU9eKAeGhUUgEYEamwl48m+L/Aqyde2+DS4Arto+XJc/nyZWujKdzVl156qVJMtFPtk9AJWkCoceyf/YTeY2PIPvYZXDTgptpEBHeuyiwGtP+EXicKVkCosk+tV9pffPHFJ88fP35cQsHEejYRQTyoe8GlK7NGU3puXbgdC0EKCO7HdKZp0qR3cauzXdoHykQE4NLBGuWbT7Ogfy7Sg1HCSywEKaBhALxxxyjEE4r7lmdU1hHWCH8bWCSku/OFVyQTdkfP6UEpe6Pn9S2U7RHezIWrCtr1bV3VT0c9jQ/GjcoCi1BnJkJd8POrZOIgOjSoQnQLCwv6b5ffvIeZc3fjn8tAHomvBGWBhq6bfUuCL4VSVyAgDF4c5cpC3Eg2ICWOPkG4eWaCqukZhGXyPckQlIA4zrYaEA9EhHpYk5gQ4oKwYNWRqfM5NgpGQBj+0bedpM8axD1GSHVrY9lt4z4PcAxGQNyq3BwICUmGrJjo8g7xbqyVDVgf9m65A3cOYjLZSlgYuGuLi4s6HjIWJySCEBCtTzcgC4cbZi6AEAXkvQtH60O6JAAB9XOSTtsYd4u0i9cCwvTQiTC81EKQDcvWaaoUSUl1vBYQTkgIHQT32dYbFEohJFqjdvBaQDhmJHRu3Lix6blspzVxw1sBTbZ4qJWvGGtU1mndDv6+D94KaJvQ+lQh22ndlZB89gS8jbCf1ZtmDgZG1gsnwaF6b06EM6Cbetz2HRkhwSrhhoH0bf2OeC/uJ7fFR7wUELJvW+W+QTCmCn/16tVKwTl2vT5LAaENp2iXqRESwD1267q27qjhabHyWB6Kb3gpoK6bRrH4kNnCcPY+zsy+efOmHlc8akwxvgY3YHbswjKh+6CuoCbS9+RxQgH1gkmZki4wJxqUDWXvC3DTYGGqCAngQpG9WJgTH8yp4aMuJHhP1uSO+IafLpxq9ygSn4STBQvfCAkCQFq7an3IWOGqTOgTwcU7vBPQhB5u0V78g0WCOQBVF5ZpsDQxTv7KPY5ku6wRz+HWdkYOcRA21iUyEJ/wTkBKtdM4iissRt2aGKAIuDLoRkZsYDsJDvQpTsJrwM2c2gAxoRjbpHMhnyhBW9VjCmi8aaPzGhk1TOcsWzQIqLHQkFHzcXOZuTBktyqYG/b/mJO+i3j99dc3CSjSbtya+AQFlAOui9nPbwOLoskW575jXNM8uMiYCw3+ZrgVjUf2sbHXyxioKQiiEVTbMOcEQVzkKSYLVwUfh9F7GAM1e5PKxIOradMJNeQpEeJTzzJx3l0SmmTgysQDX75s9C2pjo8WyEMB1XtJyDIViefcuXM6G0XawcfueP9cuBpvUtnRhnDZQp2V3RW0QB5htjrbsm0UD6lKsAIqaluB20bxkKoEKSB0F9hiG6apSV28i4GS9N+oOMg2C8A0VrYBLBv2BqFajyQFGYLjTnzDQwHFpacBFLluSFW7ArH0dY/QVpB42I7tpQUqAsKxNYe6brGGYNB4GuJo2zr4aIG8i4Hi5HHh52wbxyAcl7gHwkE2r6p4zMluIUIXrgeUvUk264O4p0k3tUmDVxEORGOOP4S1C/VokEHJxa2veCeggdjfJIjHZn2aHGsP8WBUbtF2BwgELUDooWsyP8BXYs/2AgHvBFT0JtmyYU23JMDy2MRjhAOXkKLZTEwLNP7EySPrIEzbiNsmp10ji2dz22BpLl++zKbTEphE6AGwQPlMHLJk+ZYdWJ+6ix1Wx1Yrwq5NdmyXk+h3xr/j7r3sRBgkG98om/UxW5XrYGs8NTtU6bKV46N4gJcCeiwb993bCpsYAlIH23QdiAaWh+IZjY9DFYGnFmjjm5WPWcxQwDp0UYANiQEF1B8wg9nEQWbQRZYmhUz0tmVxLcCGBOIfH+diA2+7sR8l9/W9Ld1c12oUJSFINR4lD8RX/BXQehxk2zBXV0C2JESTAmyoUEA9JFovBrVhgWw/I9R+troM3Te/hilmCXZHah3yAkISgpm3avhsfYC3AjJ7gt5///1Nnztw4IC4QPFUx8SivuKtgMwpADax2EQ1jvT9KHoUT33NvhnowlUgHzP1fWFvFWvxXfGdIAVU95Asm8u2FbtPbdm/hYUFqUNR13jXDDvf/HbfgLcCGiRDF67oRIE62BatbXG3ja0FqY3Oh60Q0IP4YwkB72Mg22KpKyBb42nX03bwO+YF1GQ7eN5SbkX6PRTrA7wVkNnWYLZTZ6nrfuH7850HXR/daNs2Ubf7wXYI1lb07oVifYDXMZDZnZq/6uLqXjcOslmhornaruD3s51RWncDoC3b2LUFQtE0FOsDvBaQ6QC2LZp8c+gobEc5YqFjKk+bmGEleZpsAMQO2Tx1t3HU5X58W0LCbwGt1yBsrk9d98ucUJcHI4Jtk06bAkHaYjRs2quLLdHRpQVaSz72cnBIGV4L6NH6gba2qy6SAHXdOGxfsIkR8YqriPC74GDjtvYd4QKRFyJ+964ycBDOg+SOhIbXAtKNjKkbZ0sCYME2SQIUHfUIEY062bsI/B4Yk2XL7DWd2W0TYlenTiBZczf+UELE+0Kq6QS2JQEwx7ouWNCILWxXcghgfn5eJxdGZfqMgBHvFI3Jwv+rycxuM9w+T1fxT4ium0GtDj7wb+J3Bhx7vzv6pF6wWNx5tw0LtMnmOAik6IAug6nbZOOOlZUVWVxctKaY89/bdNIPrE8+Q4jX2MYA/TwPk7tyP/lIQsV7AYEZtV8m1XbrYcIuCwtX+iLr4YLLqeBFvxOsZpNJRGWgXHon/pmETBC9cHAxgG0XqUtBFAv85s2brc1GgFuIE/JcZswVDdBvWzxw2e7FKxI6QQgILfV4w4tmYcPdqZuRM5hFv7S01Hibt0mR42e4iLFo8GNbB4cZ8LdE0iDUuCdLEC4c2C47ZEc0qxcZMl55wWDhQgiumB42WIKyOAeigVVAYI/7NtLLiPFs1gfCbAuKZyPBCAiUxUKgaUKhDCzo7KI2x5y0XY8pek0QT1v9bxTPZoIS0GRqh2ai/fqx7WqNRY2YZisaLtsE6XPUoPLgpAjbYcpNoHjsBCUgMK32yJSa0e4VXLk8LunjZ0FROt0kONqwdKil3YtXvTxdwZXgdqSuJXf0VRS1GVvM01VqugvKalFtzexGnedu/HOKp4DgBISFYNKvSBzYMmd9EFGZeHBhcLWgaM95kBZIQy6SViHImQgoAD6IhwsDMULRtu9xFREyfEXiQTrctS41LJD+NLXW/g8FcSXYqTxrclcXWM0RJUUiQpzUpGeuCyAYbHdAU2iReFxrPviboLuAyYJqBJdEyLNTzco2tWPkqdtYtM/yOBPUllDwLbKIruJBogCb4SicegQ/F+5esqqnZxpLVNTyggZNCKzNzXNVMFanzJ10EY9JTyNRQPHUJ3gLZDDpbTBqg5zZo4Mugq4sEoQD1xExWlk3AxIGTfb56A1w8cdBzS/oAgoow7TalYpot34MiwMRlSURTDsOMnltdDBAKCiKIkkwqsG16angcNUexvcpnJaggHKgZ24q2q33EZnmTNuEnDxm1ytuGMSIBT6qDoOfj5gL03MgnFF7hAwm01a1zoOU9MPknjxOHng/q3qroYAsQDxo+YnWT3ioYo1s2PrezJGTtqMnRwFxwmWrMhgEooGVeZRam0EqGxZCu4ECKmFKZmR7NOMsJFcgHFidMjcx0bNYH+pRXpgDQUuzNVBAI4B4ptLYaLva+eQ5CKlKnOICrBZiK8RYRjjJ+nlvw6mr6X/jx1o2KHwyg/ZsoIAqYhNSdu9PG2Iq2iM0jGHupEXOe3TFxgwKqCYQErZFmERDFogIA0OwBwf3ZoRw0XxqxDI4AAz3tsmjekxuPByVS+GMJxSQAxDSpJrWm/QmZJu4YuIYiqY/TAppDAJ1BOzpShe1bpuiVEiT0fb04+EzSt/Uhu9DHAOQHYuTgb7pBEAqG9IvKKCWGIb3yHw9TAuV7GIOBZ6RSogDFBAhDlBAhDhAARHiAAVEiAMUECEOUECEOEABEeIABUSIAxQQIQ5QQIQ4QAER4gAFRIgDFBAhDlBAhDhAARHiAAVEiAMUECEOUECEOEABEeIABUSIAxQQIQ5QQIQ4QAER4gAFRIgDFBAhDlBAhDhAARHiAAVEiAMUECEOUECEOEABEeIABLQqhJAmrEJAy0IIqY+S5ShJkkUhhNRGJepWaoGi60IIqY2K5LpaSZZmVTy1lH48K4SQyiTR2r5on5pfTeL4khBCKqNEXYR2FD5YSX48p+JkSQghlUgiNb9PPb+s60B4kFqhC0IIGQm0As3gsTJPrsdCN9OHc0IIKWI5jX0OwX3DB086EXQsFKmjwroQIUUsQyNGPGBDK4925QbxS0IREZJHa8O4bgZl+8r1pMI1oTtHCFi3PBvFA6zNpNoSpX4eEwskdKCBYcyzWTxAjfoBsEYyiM8opY4LIWEwrI1OTpwvEo5hpIAMyNLJYPqYSHwkFdOCDN07di8QH0BSYDktjt6Kk8ENmXh0JZsoKOMXxoHCKDgHwXMAAAAASUVORK5CYII="})))},jt=function(e){return e.className,(0,a.A)(e,he),i().createElement("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},i().createElement("path",{d:"M0 0H104V104H0V0Z",fill:"url(#pattern0_5156_186)"}),i().createElement("defs",null,i().createElement("pattern",{id:"pattern0_5156_186",patternContentUnits:"objectBoundingBox",width:"1",height:"1"},i().createElement("use",{xlinkHref:"#image0_5156_186",transform:"scale(0.00480769)"})),i().createElement("image",{id:"image0_5156_186",width:"208",height:"208",preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANAAAADQCAYAAAB2pO90AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABUGSURBVHgB7Z1bbFVXese/fYAAmU5s1IdkWmIbVarSAgFaKU2CEdB2RIVRuLSTKCDVyVSVIPMQCC/2PHDpQ2AeZoA+MEiRCFRjklaZCVQJoYm4FWaaVurExqGtKo18wYW2o5FtMiTh4nPm/Dcsz/bxXmvvfdY+t73+P+no2OccH9/2b3/f+ta31vYkJqOFgWaZmLUh581YWfDyS6XgtRUfbhZCGp8x8QqDXiHX6+XkwoR8eWqet2Aszhd6US8YLdxok3sT271crlMoDHEET7xj+Zzsned9bdD8Og2IODmZvbuQl+1CiKMUI9LBvNzeq4tIoQIh6nj5wvnih21CCBks5LzVYdEoV/rA6J2RpZSHkCn4AQVulD4xJQIx8hBiZFokmiLQ2MT1AaE8hJgoSnR7mRoTTaZw44XrB4TyEBJFG4pr6hM/Aj1I3QaEEBKLYiq3AKnc/Qg0kd8jhJD4FOdGcedhvsfLzx4VQkgSxopjoQU5mZizQQghSbnf2iaSXyWEkMSgLzTned4SIYQkpuAVlqKI0CaEkOQUUNJmhzUh5dKcE0JI2VAgQiygQIRYQIEIsYACEWIBBSLEAgpEiAUUiBALKBAhFlAgQiygQIRYQIEIsYACEWIBBSLEAgpEiAUUiBALKBAhFlAgQiygQIRYQIEIsYACEWIBBSLEAgpEiAUUiBALKBAhFlAgQiygQIRYQIEIsYACEWIBBSLEAgpEiAUUiBALKBAhFlAgQiygQIRYQIEIsYACEWIBBSLEAgpEiAUUiBALZgqpCeNjN2V48Jr0912V/t6rMj4+/uD+ZvG5cf/5IE3NjxRvTdLSOt//uKW1RVra5sviJQtl8dJF/mOk+nhjE9cLQioOhLh84Sdy+eK/FG8/8cVJEyVSx3NrpH3VsxSqSlCgCgJpThz/e3n/1BlfnGrSvvIZ2dz5gn/f0va4kMpAgSoAIs33//YNX5rSVKwWQKTNf/kNPzKRdKFAKfL+yTOT4tQjiERdu3YWhXpeSDpQoBSAON07d/tFgUaAIqUHBbIAqdr+v/lu2RGnra1Nli5dKq2trf49PsdNPRdkbGzMvw0ODvr3fX190tvb63+O+3KASD0/PFosPiwUUh4UqAwwrtm/97t+upaE5uZm2bBhg6xcudK/x+dpoCQ6efKkXLx40f88CRgjde16jcWGMqBACUHUeeWvdiRK11599VVfmFWrVkk1uHDhghw7diyRTJBn3/f2Ssf6PxMSH3YiJKB7x25Z9yd/kXis43le1eQB+F4QaGBgQN58881p6WAY+J22bPqmH1lJfBiBYoCUbcuml62qaxjjvPvuu7EO5koAofbu3RsrImFStudHR5nSxYACRYAzc5yog/EMBvcmIM/58+drJhGIKxLkee/sO5QoAqZwBtBus+IPvx4pD8Y4SJcOHDhgfB0O2mXLlvmD/Vrx0ksvySeffCLbt283vg6/85O/80dy4vg/CNHDCKQB7TevfHO7sZMAkQRjjOD4BpKsXr068gx/8OBBX7xaEvdnPXz0IOeMNDAChQB5MKA2yYOqGs7kpcUBSIXH8bwJRACkUrVE/aydnZ3G1+FEwkgUDiNQCUjb1v3xnxvl2b17t+zZs0eiwGuiJMFr8H61Zt68eZFjuPfOvSPtK9lPF4QRKIBfMDDIg0IBUrY48gC8LmpcFEeySoPvHyUPQFROexlGo8MI9ICoahvkQQUN5eikoGjw8ssvGw/SWkUiVOXws8WF1bmpUKAHrPiDr2vPrjbyKNBqs3HjRuOAvdqFBVUVjBN9gmCe6NJPPxLCFM4Hs++VlAfg66PmgFBYOH78uFQDVYHTyYPiiK5XD38rdGUQRiC/tw2pmw6MeTB3khZRpeO0hDUBafAz6Lq41YQveupM6R2LCo5HIBQL0BiqA2OSNOUB6uDUnd1xcEelerZACtMSCBUp8bubxmVRpX4XcFogpG66ogEOnrjVtqRESRSVXtkAeUydEKgaBtNM/A10c1qQp/s1t1M5Z1M41aoSRrV61pAiQRQdOHDRgJoWkAdVNx26+S2IjGKDLiq6nMo5G4Gixj3VaPjEQN00T4RIkdYcUZQ86EbQRVw1/6XD5YLCjK7dO/eIY6AtRdeagjLy1q1bpVo8/fTT/j0Wv4WBKAXRyhUa0ePFF1+Ut99+W/saFCzOnDljfB98f2z++PHHH0977v//7+f+vJCLS8OdTOGQuoWNfWq53ACFA93YRPWsJV0CjpQL72sqGKjyepz3NqVy2Mjxys/+zbkNHZ1L4RB5dIUDpDC1WqtjShuVCEmANKZSNcD3wxgrrph4na4qpzaRdA3nIpAp+mBNTy2J6gyI26mAyVhMypqqeDYrZCEmUstSkMZd+dm/iks4FYEwaWqKPrUGB7Np3gU/o2l+CMLs2LHDL8FHyWOTqup+Rvxtse+3Szgl0Im/Cy8c4ECKWhNTLRA5dKtFIYWuM0ClbIhSJvB7xh3z6EBRQ7dJimubkjgj0P0cPVygeog+QXCG10UHpE6l/XIodSP1i9pgEekfStlp7Eenm1ytl/3Aq4UzAmGVaRg4mNavXy/1RNS8ixrfQCaIE+cEgPmmqOiUBEQynYguFROcEUj3T01zh9A0QYpkSuWQrkVV2YAqzUdtIpIU/M10fYK6k1UWcaIKh5Si9TefCH0OB1c1Nz1MQlQLTRT4vSrZVWFqRRr6xX85MSfkRATSbYiIA6te5QFRqZwJpGyVnhQ2rRlyJQq5IdCF8NJqPcsD1IbxSUCJOs6+b2mhS+Pq9RpJaeOEQP19n4Y+Xm/FA4C07dChQ35qhPQNH8dBdQlAnkouxitFdxJyZT7IiTFQ84zfCn0cnQe1at0JAmnUpUlwn3QdUC333cbPii2xwnBhHJT5y9zr9joIXsyqFmAAjotkQZiwtpgkIPrU6ndR3zus0IHUuWNDti+XknmBhgdHQh9XfWeqkICrxKkrxqWJuqocxjO4qSvLpbnaFAKqZQ+1QF1OpZThoca45KUN2Y9AvZ9qn1MHdelAHWdVJVIwUuHxpqam0PcaGhry79UlGHGvPk4LHKg6+dCNUCuBdCed/r7/kKzjbApnQs3y1wOQFmKgDQf3ECWs86CWUUh3UhmvwJ4O9Ubmq3DjY+PSiEAEtN6g0IECgRIDIunmXk6dOiW1wOUIlHmBhodGpFGAJChFQxpMgobJgs91czwYh4zV4Kxfj61Q1SLzZWy08NRrd7AqYCS9arepdFyLPbZNP0/x+JIsk3mBdHNAOMPjH6+qYpUY9AdRsiDdQcXP1AYTBwgXlrLhffG7VRtcSDkMCtTg6AQqFMJ/bQikKl2orOF+dHTU35EGH+sEU5U6DKgXLFjg36sKXiXmaEyNnHEaZNXvok4cQP2OUahqJO7VDVMCod+HAjU2SQVqJHSL6DBGQjOpmn/CiUCdFFS0rRYUqMHJskC6kjaIc9XwapB1gTJfhdP1YlXzLFwJIIdu/kU9X2tcWA+U+YnUpuamzKzRx7gHDadq0rTewd8+62RfIP8sPb0nCxGoHjqxo1DSYI6n0aJmS+t8yTqZF6ilbX7oeiDVu1aPIP3CzjtpdGqbwAlEVdGCVUTdnI5Ciazudf15TOEyQEtr+MVw6/FsDlkgDeRJawyjOswx94R73NJe/qArZrS0tkjWcSIChVFPAkEcHIRpR5tqTapiFWwYur99lsh8FU53yY16GISryVDdXtNRqK2ldKXsqC2v0gLdHGG4cLmTzM8Dmba0QodBLRohbSKO2oa4dHtdjFvC0r5Kb9uFSI7OizBcWNLtxDwQrhoQRrXb/9W1T5NGHEiOzmzIgE5tRJxSKXRLCnTRIS200WfJQu4LlxXaVz4T+ni1UhxEBkQcnKmTiKPGMIiUWBtkiiS6vaornarqruG6eOkicQFHBAq/AK7pmqFpkWT/aqC2p1JrguKmX0uWLAl9vNInCd2lKTueWyMuwK19KzRGUJciibsxokrT0AhazrjMtCanUmM9bu3rSATCP1KXxlViHKSiThx5ghEHUarcA900t1OpKKSL4Phbu3KtVGeuztCxPnx/srSXQeMKcTgrx5lnSkOcILpIWqlCgi5929z5grhCQ06kXhsekdde6ZKr/f8pN8c/i/U1pgV0jz32mDz00ENiQz6fly+++MK/j6JSV02oZgQy9ebpon0WaTiBIM+aFetji6PAkuMZM2bIxMTEtOfu3btnJRC+/ssvv4xcY4QDHAvddBUzW9CuE0YlljagqhgGoo9u2iCLNFwKt6f79cTyKB6aHS4JpAoTKw537tzxI0+UPBD0iSeeqJg8QDcXlHYEMkWfzZ3fEJdouCrc/ObfFRtu/fJW6MGO6PTwww9LEhB17t69a3wNIt/cuXP990en87Vrldvu1lSJS3MFLuazwgTiZe4dQJeqIQJFyaDAwRhHHiUl7gE27agkamlCGGk1z5qiT9euneIazgk0c9ZM7RZMt2/fjjxT4/nPP/88Up7Zs2f78uRy1f0T6woJaYyDVEdFGIg+mzufF9dwTiDIoxsLQQ5IpEPJY6q04f0hjm1Vr1x0hYQ0StmQh9FnKs4JBGbNmqWNDIgsYQWFOPLgPYMpWy2IWk1aLhAH/XhhuBp9gJMCgdlzZmufKy1Jx5UHxYJqp2ylVGIMhNRN17IDen50VFzFWYEQJWbODJ8GgyiQSIG0ziSPKhbUWh5QiZ439Ofpy9Yv+EsXXCXzS7qDtLe3y4oVK2RF+wp58sknJ/dVUzt2YpyANAUHCyZH1XjIVDBAOjhnzhypF9KOQBj3YI+GMJC6de16TVzGCYEgzre7v+3LE4a6iJW6kBWaQdFJHXXQ1Zs8wLTZYlLQDGtahoHCgUtdB2FkPoXbv3+/fHD6A608YUAkNHmaLhOC9K/e5EkTRGScRHR07d7pbOEgSGYFwpn49Pun5VuvfEvKBWffsBWXGOtkXR4UDXRzRxjzuFq2LiWzAh35/pHQqHPp0iXZunWrLFq0SL76yFf92/Lly/3HLv7z9PZ89K6hc1qhqm26ydh6Je4YKEoepGwuV91KyaRA3d3dsm7duimPYSfStWvXytqOtdJzokeGhn+9M+mV/iv+Y3h+06ZN0w42bB2lLquI1K0eqm2VAGMekzxYJPfe2XecH/cEydyR0NLS4hcMgvjyFMW5dPmS8WshxukPTocuiMN4CMUGdF+buhXqlai1R4cOHZKNGzcaW34QeSjPVDInkE6e4eHhWF+PytqN/70x7UwcvLivWsIQZ/FcvaP2btBduFhx+OhB7eYsLpM5gUpTt3379sWWR6EkKm2cRBRCVwK2sn3jjTfkqaeeKnsdUT2g9m6I2p0I8rDiFk7mBArOgyD6YGxTDpDorbffCl2CgIVrGBedO3dOenp6/CXh9RKN4iyZQNSJs3eDP+Y59w7lMZDpeaDLly+LDbdu3ZIf9PzA+BpU6T788EN59NFHY68nqiRRF0FGtEHU0TWGKjDWee/cD5m2RZBpgVBds+Xw4cNy5Yr5fXBwnj171p8bgnT1IFIpqjwdp8MC8zyotrnc4xaXTAuUZAXoli1bZOTaiFz99Kps2bxl8nGMn5a3L/fni7COCPM/OBBL93yDRBgjqUZUJVK1L2askyPuxbq2vfrXcumnH7HaFpPM7Ynw2c1fbziyddtWf4wSB4iDEjiAePMfD7+2DaS4c/uOLwbSIPTOBSmdYMXnmDtSt5s3K3u91nIvlQJhDh89wJQtIZmOQIsXL479WiUPMDVkorgw9+G5/tJwU5u/AqJBOpS9EZXUdr9pXuAL74WxDd67nB14/Kjz7x9RnjLIdARC2w7mgOIQ/DqAlC0KLHno7uqWXbt2TT6WpMVHXX4RN2wOr7bnDdscJHhdUtwgCqqMuC9XRmyAiKZQilM+mV7OoNb+RHUglAtSsus3rku5KBnibkCfFkjX9n1vr3a7YxKfzKVwiDpB0BdXSUrTvXpuMkXEwaQo9m6jPOmQOYHQeRAEUeg7+78z5TEc9Js3b54y7tGB13Z0dGhfiwgX5Cu/8RWZM3eOdrl4tcFkaMf6Nf6EKOZ1OCmaLpncmfStE29NaekJVtUgAhbYKSGwjAHdCmFjIJS2sSwCoJz97PJnp5TGg88Hv06BkjZafe7dvVfVlh9IgzkcRBnsWeDKpUZqQSbHQChf/3jxjyf3SAvOzmMvhGA0OXLkSOh7lMqBr4GUqiyO50sjW2n6iO5u3FC5g0y4bXr+OenvvSr9fVclTSAMigEdG9YUP15EaapEZvfGDi5reH3f65MNpUjJMGFaDgsXLfTfR/ce6nkTI2P/7d/jqnn9fZ/6Mg0Pjsjw0LD/2PDQSPF+3P84CIRoam4qfu9H/MvH42fA/eKlvy8trS0UpkY4t7k8QKeBLvLo2LZt22RfHOTExGsQjL0gahRKIJINnNwXDmMejH3iEpQHIMqoYgXSw66urljykOzhZARSxIlEpfIEUSXsJD13jEDZwqmNFUtRa4V0EpnkAZW+XAmpf5zd2lehS+ei5CEEOC8QUBKhtwxjGspD4uL0GKgWcAyULRiBCLGAAhFiAQUixAIKRIgFFIgQCxpOoEeaopdaE1ItGk6ghYt/TxqVNR1/KiRbNNw80LXh/5E1K56Tm+OfSSOByPlPl/5RHm/5bSHZoeEiEA5AHIiNcjaHOM+0P0V5MkrDRSBC6glW4QixgAIRYgEFIsQCCkSIBRSIEAsoECEWUCBCLKBAhFhAgQixgAIRYgEFIsQCCkSIBRSIEAsoECEWUCBCLKBAhFhAgQixgAIRYgEFIsQCCkSIBRSIEAsoECEWUCBCLKBAhFgAgcaEEFIOYxBoUAghyfFkMFcoFPqEEJIYr+D1FiNQ7oIQQhLj5eSCN1oYaPbysweKnzcLISQ2hdztebl53oKxQj5/XAghsfHEOwZ3PHwyWrjR5uULA0IIiUUh5y2Y531t0J8HwgfFKHRICCGRwBU4g4899eCDsdAnxQ/bhBCiY7A49lmG9A2fTHYi+GOhnLdaOC9EiI5BOKLkAVNaefxUbiK/USgRIaX4bqjUTeGFvfJBUeG8MJ0jBDyIPFPlAaHNpH4kKuZ5LCwQ14ED98c80+UBXtQbIBrJRH6P53mdQogb3J8bnTnjoE4cRaRAClTpZGLOBpH8qqJMS+R+esfuBZIFUBQYLE6O9uYLExdlxt2TwUKBiV8BytTjiypUmqUAAAAASUVORK5CYII="})))},Pt=function(e){var t=e.className,n=(0,a.A)(e,ye);return i().createElement("svg",(0,r.A)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("path",{d:"M23.6839 9.95997L20.3085 7.73438L23.6839 5.50878C23.8859 5.37566 24.005 5.14785 23.9998 4.90598C23.9942 4.6641 23.8648 4.44192 23.6567 4.31817L16.5787 0.0994794C16.3457 -0.0397375 16.0542 -0.0322375 15.8287 0.118229L12 2.67054L8.1713 0.118229C7.94583 -0.0322375 7.65427 -0.0392687 7.42131 0.0994794L0.343281 4.31817C0.135159 4.44192 0.00578582 4.6641 0.000160893 4.90598C-0.00499529 5.14785 0.114066 5.37566 0.316094 5.50878L3.69152 7.73438L0.316094 9.95997C0.114066 10.0931 -0.00499529 10.3209 0.000160893 10.5628C0.00578582 10.8046 0.135159 11.0268 0.343281 11.1506L4.26573 13.4887V16.1375C4.25542 16.3705 4.35854 16.6166 4.60697 16.7746C4.60979 16.7764 4.6126 16.7778 4.61541 16.7797C4.61822 16.7811 4.62104 16.783 4.62432 16.7849L11.6381 20.9933C11.7516 21.0612 11.8795 21.0936 12 21.0936C12.1303 21.0936 12.2583 21.0556 12.3619 20.9933L19.393 16.7746C19.6049 16.6475 19.7343 16.4188 19.7343 16.1718V13.4887L23.6567 11.1506C23.8648 11.0268 23.9942 10.8046 23.9998 10.5628C24.005 10.3209 23.8859 10.0931 23.6839 9.95997ZM16.2398 1.5343L21.9739 4.95191L19.0133 6.90376C17.9455 6.26299 14.8842 4.42598 13.3144 3.48428L16.2398 1.5343ZM2.02607 4.95191L7.76021 1.5343L10.6856 3.48428L4.98666 6.90376L2.02607 4.95191ZM5.22665 12.4246L2.02607 10.5168L4.98666 8.56499L10.6856 11.9845L7.76021 13.9344L5.42165 12.5409C5.36399 12.4921 5.29837 12.4527 5.22665 12.4246ZM11.2969 19.1487C9.67643 18.1765 6.68257 16.3803 5.67196 15.7738V14.3267L7.42131 15.3692C7.5324 15.4358 7.65709 15.4686 7.7813 15.4686C7.91724 15.4686 8.05364 15.4292 8.1713 15.3505L11.2969 13.2669V19.1487ZM12 11.1332L6.33523 7.73438L12 4.33552L17.6648 7.73438L12 11.1332ZM18.328 15.7738L12.7031 19.1487V13.2669L15.8287 15.3505C15.9463 15.4292 16.0823 15.4686 16.2187 15.4686C16.3429 15.4686 16.4676 15.4358 16.5787 15.3692L18.328 14.3267V15.7738ZM18.7733 12.4246C18.7016 12.4527 18.636 12.4921 18.5783 12.5409L16.2398 13.9344L13.3144 11.9845L19.0133 8.56499L21.9739 10.5168L18.7733 12.4246Z",fill:"#374151"}))},Tt=function(e){return e.className,(0,a.A)(e,ve),i().createElement("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none"},i().createElement("path",{d:"M0 0H104V104H0V0Z",fill:"url(#www)"}),i().createElement("defs",null,i().createElement("pattern",{id:"www",patternContentUnits:"objectBoundingBox",width:"1",height:"1"},i().createElement("use",{xlinkHref:"#aaa",transform:"scale(0.00480769)"})),i().createElement("image",{id:"aaa",width:"208",height:"208",preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANAAAADQCAYAAAB2pO90AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABHmSURBVHgB7Z1NbJzFHcbn3bQKvRBbnFKpxVYuSDSJ00qgIlASEKJRIsUJUCRHikmAQ6KKxOHQ5BLHXOgF7PQQDkj5QCISFYVEClLTCGIrCOgBYjdQcanstBWckO2eQlvvdp/XGfR6s+/ufL1fM89PQlmH3ex4d575P/Of/8xEQpH5xmyPWPrhYC1atbkR1QdEI+pr/nWPIKT6LIioMRc1atNRTUwuiVsXe6P+BZUXRt2eMN/4pk/8b+lwVKsNCwqGBEIkorP1mhjrjdbOdX5eCog4NbF6tFEXhwUhgdKMSBN18d1YWkRqKyBEnajeuNp82CcIIXONWrS1XTSqtf7F/H/+NUDxELKCOKBAG63/Y0UEYuQhpCN3RKIVAlpY+npWUDyEdKIpou82yTnR9xZusfH1uKB4COlGH5Jr8oc4At22brOCEKJE08r1w8otR6Cl+glBCFGnuTaKPyKs90T11fOCEKLDQnMu1F8TS3cNCkKILsulbULUtwhCiDaoC61FUbRREEK0aUSNASQR+gQhRJ8GUtqssCbElJ6aIIQYQwERYgEFRIgFFBAhFlBAhFhAARFiAQVEiAUUECEWUECEWEABEWIBBUSIBRQQIRZQQIRYQAERYgEFRIgFFBAhFlBAhFhAARFiAQVEiAUUECEWUECEWEABEWJB8AI6f+4PghBTghbQ4sK/xbEjx8WN6S8FISYELaD3L/4pFhH+JMSEaGHp64YIlB2PPik+mvpErOm5W9z89itBiC7BRqB/zP0zFg9AFPpo6mNBiC7BCuh3L7+68uexVwUhugQpoOWI88mKv8PPiEqE6BCcgGTmrZ1Y9uzeTxERLYJJItyY/qKZbbssXv/9G7GI0kBCYfvObWJo79Pi4S0PCUI64bWAIJTz596O09Stlk2Fn/b9RBw9/pJ4ePMv48eEtOKtgCCag/sPd4w2Opw6PSGGhn8tCEnidQTCfAbZNtMEAezc0N5nxPbBJ5pRiHaO3EkwcyBEpGU7d7nrc2HZDhx6IRYNRERIGsFVIiASIdt2Y+bO+jfMc06dHme0IcoEWcoDET3yi8fvmB/99e9/YbKAaBHkQipEgrlNEmbaiAnBlvIgMZBkaPgZYUtc4TBZzpo6tA3bNrhQ7JZgBYR5DqIOiCOSRYoanRKV3ffec5/Y8dhTYsO6B8XrJ98QZQFt2bDugdi2om0H949QSI4Iej+QTBaYJg0wqqMIFR0zuVCLznnsyGgsqiI7qhQ22pKc7yEbCSGxgNaeoPcDoVMhalz77IpYP3C/1mth1Q4+130kRxoc1QxIi+cJog7WwLotJMtqCy4SmxG0gMCxkVHxyviY8vMhGFQ46JYGwS6imiHrRIVp+zAHPHr8CBMpmgQvIFUwkmNU71aM2omso5Fq1OkE2nd09CVB1KCAFFC1a6q4jkamUScN2jp1KKAOuO6YSVxFIxdRJw3auu7wYMU2pGXXOtHT0yPOnj0rZmdnRV9fX9fnL2/sM8/UpWXY0tiyZUvctjNnzii1DzBb1x0KqAUUnUI4OqP6oUOH4s45PDwcd048Hh0dVXotBIr301k3wnNVxQ1hj4+Pi6tXr8Zte/bZZ+PHhw8fFqrgs4CQeAjlndDC3cbErmFUR+ccGBho+//n5ubE1q1b4z9V6DY30m0j2tcp4qBdu3btEtPT00KV7TufEK+89jJt3W2Cj0DSrmGEVe2Y6JDvvfdePJKniUc+z1U0sok6ndp3/fp1LVuH7SDS1mUx76oaQUcgWBLYE505CMQA+4NOqoNpNAIuo04aCwsLYmJiQoyNqa+JMVsXqICwF+jYyHFtu2bSMVs5ceKEcieVm/lURnoIWorbBggc/8bFixeVX7N+4/3irXdPB2nrghKQtGtYDFUFgoEdGhwcFK7QjUbdcCXuJMgoQug6bTzw4gvNtPzzQQkpmDkQ7BoqklXFI0d0zBFcigfozo3SUJ3rmIBsnW4b8dmiGj2kbJ33EQhVBPJgEVWyGNHTMI1GebcR1vPcuXPKrwnF1nkbgeKFypHReETUya5hNM9iRO/2vrroJjFsQPtg6XQEi3lmCHuPvIxAuuUt6IxYDDXJrpmCrNfJkyfjkd0GvB5tz1NQOokQ4HO2zisBld2uSS5cuCBGRkacJRHQdnRqVELkhYmtg5AuffCOV7bOCwGZZtcgHAgoL9Dp9u3bJyYnJ0UWINmBpEKeg4FJts6nItXKz4HkEVUm2bW8xAO7hk7W39+vLB45H9OJjohseA+8F94zD0yydShSxdzUh7lR5SOQvKZRhSJGaF27ljYf0513VMHWodri0od/FFWm8gLqWfXjrs+pil1TKf7UnXeUfdBo9j9RZSpv4VTOroadmZmZEXlgY9dUij9108lF2LqbN28qvRfnQCVAZf8+vkxYIpflM+1AZ920aZNyatp0PmYy70Cb0Dad6KWLXBTGZ60iIB/S2l5k4ZC61tk1ic5kW0aTJAu7pvPeZbB1ck1LNcrhJCTUzlUdb9aB4i3OGpkdaZtsOpHJYmhW8zGTdLKLRVjdwQMlPqfOTMR/+oA3pTzw07hdQfVIJnzxcm5gQl52TZUibB0GD7xeVTz4bq59fsUb8QAvS3myjEZF2jVVsrZ1up9BXodKFoGXxaRZRKMss2uuyTJbp/MZIEOKuQ7WenytyvZ+O4OLaORqMbQoXCzC4uARRB3VA0h8jjpJgtmRikwdqrRVK7RlByq7XVPFxtbhNapzvfjAyGbk9yHDpkJQW7qzPGm0iGoHE0yydaqEEnWSBHWsVVxO3/Tj8OWubt8uojjVBpNsXTdCmOukEeyxVi6iUVntmiomtq6VEKNOkmAPVpTRCF++bjQqKrvmGpNsXZJQo06SoE8mjS8FnvpY+4RNjNw4Ny3Lurq8kIW2Jr/Ljem/BX/XarAWDofIw8LZHE/bV8CeG5cg+iA9b1OlHfrppMEJCIKBcCAgV+B8bJyVXRU7h7UcCMfl1vJQ7xIKysJBNDhcUVU8qoug6JBYnXd5UEgWINKgjTr1a6qfgdymHdoVKEEISF5GtWf3fiXLJpME8/PzWuleHM6O/TBZ7rkxBXYNIkcbVZDpeaS8VZMlMrPp+1lwSby3cLpnxKEEB/Oa5Mhrku4ti60zsWvt0vOyFlBVgKHMjbwVkO46j0olgckqPurhIMq8haTb4YHKZwAhorxJ9TPwfW7kpYXTuYwKoIOrVBKYrOIXYetM7ZrKZyDvWlX9DHyfG3kVgbKIOmmU0da5smuquL7Csop4E4GyijppmKziZ5WtM8muuaim6MvhQuWyU/kIhOTAnt37lIWDKIASfdeFn0UdfKi7GJrVXiWTaPTWu2ecFfUWReUj0LEj6lc1Zlk1DTHIq+5VQEfDnApRwyQaIZqhw2JCryoe/N74/VuzjC4wiUbHjrirCC+Kykege++5r2uKGlEHVqvTjdouyTJbl1V2zSWq0QjR5+a3X4kqE8RCKkZrnUtzbckqW5dlds0VEDh+h7xOQS2aygto+85fKT0PtgWdL890sitbVza7lgYSGPKoL5V2bt+5TVSd4JIIoCr36Mgr68ts14DJUV++JBG8WQfCQh1KdnRqsFyczKmLbrZOlapcUxlv/37tZW9KfLxaSEU0wkVbOudkF7Gnx8VW6iRVuaZSntZT9aiTxNuTSZEi1dnzUxVbl6QIu2ZS7cCTSSsGvqi33j2t9aXJkznz3NMjs3VyrqP72ryza7rVDvJ78PnchFXNsHpCeMr6gfvjauC7frRaOcnw6aefxinv3t7eXNaNMIdAkuDWrVtar0OHXrt2bS5tRKTctm2bsnBg0UZ++5t4AMN34DPBbOmGrUOSQacqOMviT5PMVTsQibDWk0Ub0TZYTNq1dILZ0o0vFF+szpcriz919r+ooHstSCcQHVxvl5B2Df+ujl279OE7wR1zFeypPLq32rnI1rmKOmm4iEa6N83Brh049IJ32TVVghUQMLF17W5vUEG3Y5piKnTaNTOCPljRxNbJu4RUbZ3uxbudFkFVFkhlOZBq+2jX7AhaQBKsiutcyAVU5h66cx3YLyQt0sD/Uy1QVW2fTnEqgF279tmVZvR5SBAKaAVDe/XKS+Roj06YHO11ow6yfbLwsxuyQFX1KsZ20QiC1mlfkgMvPh/kXCcNCsgBSVuHeYRu1IF4dNZzdDevJaORrl0jnfmBIM5AR1XFxSY/RCNEGJXNazIaEbcwAinicqHSJOqkoRuNVCjDva5VgQJSBKO3bVWCzlxHF525URoyRW9SmxcqFJAGqNhGJzWp2nYZddIwjUaIOPid8NoqXFNZJiggAzBCY6RWWazMMuqkoRONbCrCCQVkjDxYEeJI66h5RJ00ukUjtAmDABIZnPOYQwFZgo6IjiozauiMyQM9ikZGI2nNICzYtarcKl52mMZ2BKxQWdPEMjlA3MMIpAgWHvPaqVokqEzANg4bbsx8GV/eHAIUkCKy/KWMt8+5QtbGYXu7DTg8/v0Ll0UIUEAapNW+VR2d2rg1PWtEN7B9/vybb1vdgF4VKKAEKM1fv7H7Hn7dLQ1lRXcrAz6fboWk2FuFfVYQz0eT/ts4CqiFU2fGlfe4ZLGdOi90tzJAODhhpxu4kU6CM/p8hwJqYf3Gn4lLH7yjfHJm1WydyVYGnD+OPUDdojMiT/L0Izz23cZRQG2QO1Ux4ma1UzVvbHaeqn4O7bbG+3QbXTsooA5g5JU7VVU3kZXR1pnYNfzO+N11dp6ef7ONgDy3cRSQAkePvxRbmKrZOhu7ht9ZByQM2h3sHycTPF4TooAUqZKty8OutdIu+kh0jg+rGhSQJmW3dXnZtSSoPOh0NBiSCb5GIQrIkLLZujztWhJYtz2793d93sH9I7HQfIMCsqAMtq4IuwYgnB2PPil2PPaU0qVmeM4jP388FpJPC6wUkAOKsnV52zUkBDCfwc3oEI7OtZoSLLTitRvWPRj/Wzo3CpaRoI/2zQLb44KlFWsHnoM9PCbH8ELkr7w2ph1xZEkO0tEmglEBRwTjGpoqXvtIAWUEbsfDLXk6IyzmSJs3b47tXTtwqMnU1JTWSaLLNnNcO+JANO9fvJxrUSjainbi8Maq3CtEC5cRprYO85k0du3alZtdW9N7t1hcXFSqvnbF4kLz/dYsv29VYATKARNbZ4OpXUsD7cbcJUsLhzO3IfSqHRtMAeWIia3TwdSuqYJ2Y8FUblmwwZd7hSigAkA0QpGlq7mF7Iw26zm6YGF0OTLpRVVEG1hLX253oIAKwpWtc23XdLkx80VzIfW5rhEp6+hYFBRQwZjaujJ1SESjHY8+1fE51z6/orTbt2owC1cwutk6F7VrrkE7YM3SwBqPj+IBFFBJUKmtc1G7lhWdbvcbGn5a+AotXAlptXVVmT+gxKc1MYK2I1r6CiNQCZG27trnf47/K5Nd6wRS0q3oXptZNRiBiDMQfRCFkkD8Pt/kzQhEnIEERzKZgMc+iwdQQMQpWNCVIPvmO7RwxCmwcRvWPRAXofqcPJDwehPiFNi4ob3PiMVF/8/FBhQQcc72wSfEmjX5bYMoElo4QixgEoEQCyggQiyggAixgAIixAIKiBALKCBCLKCACLGAAiLEAgqIEAsoIEIsoIAIsYACIsQCCogQCyggQiyggAixgAIixAIKiBALKCBCLKCACLGAAiLEAgqIEAsoIEIsoIAIsYACIsQCCogQCyggQiyggAixgAIixAIKiBALKCBCLKCACLGAAiLEAghoQRBCTFiAgOYEIUSfSMzVGo3GjCCEaBM1oulmBKpNCkKINlFNTEbzjdmeqL56tvlzjyCEKNOofddb6436Fxr1+jlBCFEmEtFZaCfCD/ONb/qiemNWEEKUaNSi/t5o7Vy8DoQHzSh0UhBCugKtQDN4HMm/vD0Xut582CcIIWnMNec+m2Df8MP3lQjxXKgWbRVcFyIkjTloRIoHrCjlia3cUn2XoIgIaSXWhrRukqjdM28nFa4K2jlCwO3Is1I8oG0xaRyJmj6PiQUSOtDA8pznTvGAqNs/gGgkluonoigaFoSEwfLa6A9WTaQJR9JVQBJk6cTSXYNC1Lc0xbRRLNs7Vi8QH0BSYK65ODpdbyxNiVX/vZBMFHTi/2gCuD0FrzebAAAAAElFTkSuQmCC"})))},It=function(e){var t=e.className,n=(0,a.A)(e,be);return i().createElement("svg",(0,r.A)({width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},n),i().createElement("rect",{width:"104",height:"104",rx:"8",fill:"#F0FDE6"}),i().createElement("path",{d:"M64.4269 23.8569C64.5463 23.8423 64.8138 23.8423 64.9456 23.8414L71.8625 23.8399L73.9938 23.8404C74.7069 23.8407 75.5669 23.8 76.2538 23.9805C78.6928 24.6216 80.1478 26.6444 80.1588 29.1128L80.1581 61.5291L80.1591 71.0813L80.1597 73.8507C80.1597 74.4822 80.1878 75.1947 80.0991 75.8151C79.7894 77.9819 78.006 79.7697 75.8441 80.0969C75.2944 80.1801 74.6938 80.1597 74.1369 80.1597L72.0703 80.1585L65.011 80.1582L39.6403 80.1585L32.0494 80.1591L29.8818 80.1604C29.2943 80.1604 28.5927 80.1791 28.0251 80.0726C27.1626 79.9088 26.3565 79.5269 25.6833 78.9632C24.6684 78.1079 23.9516 76.8226 23.8635 75.4916C23.816 74.7729 23.84 73.9782 23.8404 73.2538L23.8405 69.4823L23.8398 66.2447C23.8398 65.5176 23.8025 64.4816 23.9408 63.7969C24.1143 62.9326 24.51 62.1285 25.0889 61.4635C25.7911 60.6466 26.7329 60.0713 27.7806 59.8204C28.6398 59.6122 30.5726 59.6829 31.5574 59.6832L38.3462 59.6819L40.5158 59.6832C40.8651 59.6835 41.3867 59.6982 41.7263 59.6729L41.7575 59.6704L41.7561 48.5477C41.7548 46.4515 41.6346 44.8862 43.2857 43.248C43.9866 42.5499 44.8753 42.0707 45.8436 41.8686C46.5232 41.7265 47.3628 41.755 48.0698 41.7555L50.5174 41.7577L59.6819 41.7564L59.6816 32.5576L59.6803 30.025C59.6803 29.3922 59.656 28.6107 59.7697 28.0015C59.9356 27.1415 60.3185 26.338 60.8822 25.6674C61.7891 24.5874 63.0288 23.974 64.4269 23.8569Z",fill:"black"}),i().createElement("path",{d:"M46.855 44.3258C47.1217 44.2959 47.8575 44.3164 48.1674 44.3167L50.8515 44.318L59.682 44.3191V77.5969L39.2967 77.5972L31.9667 77.5975L29.9967 77.5982C29.4792 77.5982 28.8279 77.6313 28.3353 77.5225C27.2656 77.2728 26.4496 76.2957 26.4134 75.1941C26.39 74.4791 26.4008 73.7735 26.4015 73.0635L26.4023 69.0713L26.4008 66.1144C26.4004 65.0322 26.2609 63.9775 27.0275 63.1107C27.8711 62.1569 28.7858 62.2422 29.9411 62.2419L31.9836 62.2416H39.497L41.7114 62.2447C43.0596 62.25 44.3615 62.4628 44.3221 60.616C44.309 60.0022 44.3169 59.3322 44.3172 58.7144L44.3161 50.3819L44.3164 48.0381C44.3165 47.5293 44.2886 46.9574 44.367 46.4579C44.5721 45.1511 45.5703 44.3983 46.855 44.3258Z",fill:"white"}))}},8881:(e,t,n)=>{"use strict";n.d(t,{A:()=>Ie});var r=n(3140),a=n(6106),o=n(1609),i=n.n(o),l={google_photos:{id:"google_photos",name:"Google Photos",subtitle:"Easily import your images from Google Photos into your WordPress gallery.",description:"Import your images from Google Photos account into your WordPress gallery and show off your portfolio website.",icon:i().createElement(a.Xr,{className:"w-full h-full"}),showInAddonsPage:!0},dribbble:{id:"dribbble",name:"Dribbble",subtitle:"Easily import your images from Dribbble into your WordPress gallery.",description:"Easily import your images from Dribbble account into your WordPress gallery and show off your portfolio website.",icon:i().createElement(a.T9,{className:"w-full h-full"}),showInAddonsPage:!0,minPlan:"pro"},tiktok:{id:"tiktok",name:"TikTok",subtitle:"Easily import your videos from TikTok into your WordPress gallery.",description:"Import your images from TikTok account into your WordPress gallery and show off your portfolio website.",icon:i().createElement(a.ho,{className:"w-full h-full"}),showInAddonsPage:!0,minPlan:"pro"},google_analytics:{id:"google_analytics",name:"Google Analytics",subtitle:"Easily track gallery and image engagement in Google Analytics 4.",description:"Enable GA4 tracking for your galleries to gain insights into which galleries and images resonate with visitors.",icon:i().createElement(a.c2,{className:"w-full h-full"}),showInAddonsPage:!0,minPlan:"starter"},dropbox:{id:"dropbox",name:"Dropbox",subtitle:"Easily import your images from Dropbox into your WordPress gallery.",description:"Import your images from Dropbox into your WordPress gallery and organize your media library effortlessly.",icon:i().createElement(a.R5,{className:"w-full h-full"}),showInAddonsPage:!0},instagram:{id:"instagram",name:"Instagram",subtitle:"Easily import your images from Instagram into your WordPress gallery.",description:"Import your images from Instagram account into your WordPress gallery and show off your portfolio website.",icon:null,showInAddonsPage:!1}},c=function(e){var t;return(null===(t=l[e])||void 0===t?void 0:t.name)||e},s=n(7723),u=function(e){var t,n=e.addonName;return i().createElement("div",{className:"p-6 bg-gray-50 border border-gray-200 rounded-lg text-center"},i().createElement("p",{className:"text-gray-600 mb-2"},(0,s.__)("The","nggallery")," ",i().createElement("strong",null,n)," ",(0,s.__)("feature is not activated.","nggallery")),i().createElement("p",{className:"text-sm text-gray-500"},(0,s.__)("Please enable it from the","nggallery")," ",i().createElement("a",{href:"".concat((null===(t=window.imagelyApp)||void 0===t?void 0:t.adminUrl)||"/wp-admin/","admin.php?page=imagely-addons"),className:"text-green-600 hover:text-green-700 underline"},(0,s.__)("Features page","nggallery"))," ",(0,s.__)("to use this feature.","nggallery")))};const d=function(e){var t=e.addonId,n=e.children,a=e.fallback,o=e.loadingFallback,l=e.hideWhenDisabled,s=void 0!==l&&l,d=(0,r.xT)(t),m=d.isEnabled;return d.isLoading?o||null:m?n:s?null:a||i().createElement(u,{addonName:c(t)})};var m=n(4467),g=n(3453),f=n(6629),p=n(7899),h=n(5909),y=n(6415),v=n(467),b=n(4540),w=n(7286),x=n(1455),E=n.n(x);function _(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return C(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(C(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,C(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,C(d,"constructor",s),C(s,"constructor",c),c.displayName="GeneratorFunction",C(s,a,"GeneratorFunction"),C(d),C(d,a,"Generator"),C(d,r,function(){return this}),C(d,"toString",function(){return"[object Generator]"}),(_=function(){return{w:o,m}})()}function C(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}C=function(e,t,n,r){function o(t,n){C(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},C(e,t,n,r)}var N={dribbbleOAuthUrl:function(e){return["dribbble","oauth-url",e]},dribbbleAccounts:["dribbble","accounts"],dribbbleImageSizes:function(e){return["dribbble","image-sizes",e]}},k=n(443);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){(0,m.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const S=function(e){var t,n,r=e.integrationType,a=e.integrationName,l=e.externalSource,c=void 0===l?{}:l,u=e.defaultSettings,d=void 0===u?{}:u,m=e.onUpdate,x=(0,k.r)().navigateTo,C=(0,o.useMemo)(function(){return"custom"===c.settings_mode?"custom":"default"},[c.settings_mode]),O=(0,o.useState)(C),S=(0,g.A)(O,2),j=S[0],P=S[1];(0,o.useEffect)(function(){P(C)},[C]);var T="default",I=function(e,t){return void 0!==c[e]?c[e]:"default"===j&&void 0!==d[e]?d[e]:t},D=(0,o.useState)(I("".concat(r,"_account"),"")),L=(0,g.A)(D,2),R=L[0],F=L[1],M=(0,o.useState)(String(I("".concat(r,"_number"),5))),G=(0,g.A)(M,2),Q=G[0],B=G[1],q=(0,o.useState)(String(I("".concat(r,"_link"),0))),U=(0,g.A)(q,2),H=U[0],z=U[1],K=(0,o.useState)(I("".concat(r,"_image_size"),T)),V=(0,g.A)(K,2),W=V[0],X=V[1],Y=(0,o.useState)(1===I("".concat(r,"_link_target"),0)),Z=(0,g.A)(Y,2),J=Z[0],$=Z[1],ee=(0,o.useState)(1===I("".concat(r,"_caption"),1)),te=(0,g.A)(ee,2),ne=te[0],re=te[1],ae=(0,o.useState)(String(I("".concat(r,"_caption_length"),999))),oe=(0,g.A)(ae,2),ie=oe[0],le=oe[1],ce=(0,o.useState)(1===I("".concat(r,"_cache"),1)),se=(0,g.A)(ce,2),ue=se[0],de=se[1];(0,o.useEffect)(function(){F(I("".concat(r,"_account"),"")),B(String(I("".concat(r,"_number"),5))),z(String(I("".concat(r,"_link"),0))),X(I("".concat(r,"_image_size"),T)),$(1===I("".concat(r,"_link_target"),0)),re(1===I("".concat(r,"_caption"),1)),le(String(I("".concat(r,"_caption_length"),999))),de(1===I("".concat(r,"_cache"),1))},[j,c,d,r]);var me=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,w.I)({queryKey:N.dribbbleAccounts,queryFn:(e=(0,v.A)(_().m(function e(){var t;return _().w(function(e){for(;;)switch(e.n){case 0:return t=(0,b.m9)(),e.n=1,E()({path:"/nggpro/v1/dribbble/accounts",method:"GET",headers:{"X-WP-Nonce":t}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),enabled:t,staleTime:3e4,gcTime:3e5})}(!0),ge=(null===(t=me.data)||void 0===t?void 0:t.accounts)||[],fe=ge.length>0,pe=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,w.I)({queryKey:N.dribbbleImageSizes(t),queryFn:(e=(0,v.A)(_().m(function e(){var n,r;return _().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.m9)(),r="/nggpro/v1/dribbble/image-sizes".concat(t?"?core_only=1":""),e.n=1,E()({path:r,method:"GET",headers:{"X-WP-Nonce":n}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),enabled:n,staleTime:3e5,gcTime:6e5})}(!1,!0),he=(null===(n=pe.data)||void 0===n?void 0:n.sizes)||[],ye=function(e){if(P(e),m){var t=A(A({},c),{},{settings_mode:e});if("custom"===e){var n="".concat(r,"_account"),a=t[n];if(null==a||""===a){var o=null==d?void 0:d[n];null!=o&&""!==o&&(t[n]=o,F(String(o)))}}if("default"===e){var i=Object.fromEntries(Object.entries(t).filter(function(e){var t=(0,g.A)(e,1)[0];return"type"===t||"settings_mode"===t}));m(i)}else m(t)}},ve=function(e,t){if("custom"===j){var n=A(A({},c),{},{settings_mode:"custom"}),a={account:"".concat(r,"_account"),numPhotos:"".concat(r,"_number"),overridingLink:"".concat(r,"_link"),imageSize:"".concat(r,"_image_size"),openInNewTab:"".concat(r,"_link_target"),usePhotoTitle:"".concat(r,"_caption"),limitCaptionLength:"".concat(r,"_caption_length"),cacheData:"".concat(r,"_cache")}[e];a&&(n[a]="openInNewTab"===e||"usePhotoTitle"===e||"cacheData"===e?t?1:0:"numPhotos"===e||"limitCaptionLength"===e?parseInt(t)||0:t,m&&m(n))}},be=ge.map(function(e){return{value:e.username||"slot-".concat(e.slot),label:e.username||(0,s.__)("Account","nggallery")+" #".concat(e.slot)}}),we=[{value:"0",label:(0,s.__)("No link (Use Lightbox If Enabled)","nggallery")},{value:"1",label:(0,s.__)("Original Page at","nggallery")+" ".concat(a)},{value:"2",label:(0,s.__)("Direct Full Sized Image On Site","nggallery")}],xe=(0,o.useMemo)(function(){var e=[];return Array.isArray(he)&&he.length>0&&he.forEach(function(t){e.push({value:String(t.value),label:String(t.label)})}),e},[he]);return i().createElement("div",{className:"space-y-6"},fe?i().createElement(i().Fragment,null,i().createElement("div",{className:"mb-6"},i().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(a," ").concat((0,s.__)("Settings","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},(0,s.__)("The settings below adjust the","nggallery")," ",a," ",(0,s.__)("options for the gallery.","nggallery")),i().createElement("p",{className:"text-sm text-gray-600"},(0,s.__)("Need some help?","nggallery")," ",i().createElement("a",{href:"https://www.imagely.com/docs/".concat(r.toLowerCase(),"-integration/"),target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Read the Documentation","nggallery"))," ",(0,s.__)("or","nggallery")," ",i().createElement("a",{href:"https://www.imagely.com/docs/".concat(r.toLowerCase(),"-integration/#video"),target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Watch a Video","nggallery")))),i().createElement("hr",{className:"border-gray-200 my-6"}),i().createElement("div",{className:"mb-6"},i().createElement("div",{className:"mt-2 flex gap-[10px]"},i().createElement("label",{className:"flex items-center"},i().createElement("input",{type:"radio",name:"".concat(r,"-settings-mode"),checked:"default"===j,onChange:function(){return ye("default")},className:"mr-2"}),i().createElement("span",{className:"text-sm text-gray-700"},(0,s.__)("Default Settings","nggallery"))),i().createElement("label",{className:"flex items-center"},i().createElement("input",{type:"radio",name:"".concat(r,"-settings-mode"),checked:"custom"===j,onChange:function(){return ye("custom")},className:"mr-2"}),i().createElement("span",{className:"text-sm text-gray-700"},(0,s.__)("Custom Settings","nggallery")))),"default"===j&&i().createElement("div",{className:"mt-2"},"Use"," ",i().createElement("a",{href:"#",onClick:function(e){e.preventDefault(),x("imagely-settings","integrations")},className:"text-sm text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Default Settings","nggallery"))," ","to quickly apply the standard configuration.")),"custom"===j&&i().createElement("hr",{className:"border-gray-200 my-6"}),"custom"===j&&i().createElement("div",{className:"space-y-6"},i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-account")},"".concat(a," ").concat((0,s.__)("Account","nggallery")))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(r,"-account"),name:"".concat(r,"-account"),value:R,onChange:function(e){F(e.target.value),ve("account",e.target.value)}},be.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Choose from any of the","nggallery")," ",i().createElement("a",{href:"#",className:"underline font-semibold text-[#11A800]"},(0,s.__)("Authenticated","nggallery")," ",a," ",(0,s.__)("accounts","nggallery")),"."))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-num-photos")},"".concat((0,s.__)("Number of","nggallery")," ").concat(a," ").concat((0,s.__)("Photos","nggallery")))),i().createElement("div",null,i().createElement(h.A,{type:"number",id:"".concat(r,"-num-photos"),name:"".concat(r,"-num-photos"),value:Q,onChange:function(e){B(e.target.value),ve("numPhotos",e.target.value)},min:1}),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Choose images to fetch; non-images (For e.g. Videos) won't be included.","nggallery")))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-overriding-link")},(0,s.__)("Overriding Link?","nggallery"))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(r,"-overriding-link"),name:"".concat(r,"-overriding-link"),value:H,onChange:function(e){z(e.target.value),ve("overridingLink",e.target.value)}},we.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})))),"0"===H&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-image-size")},(0,s.__)("Image Size","nggallery"))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(r,"-image-size"),name:"".concat(r,"-image-size"),value:W,onChange:function(e){X(e.target.value),ve("imageSize",e.target.value)}},xe.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})))),"0"!==H&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-open-new-tab"),help:"".concat((0,s.__)("Open the link to","nggallery")," ").concat(a," ").concat((0,s.__)("in a new browser tab.","nggallery"))},(0,s.__)("Open in New Tab?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(r,"-open-new-tab"),name:"".concat(r,"-open-new-tab"),checked:J,onChange:function(e){$(e.target.checked),ve("openInNewTab",e.target.checked)},label:""}))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-use-photo-title"),help:"".concat((0,s.__)("Display the photo caption from","nggallery")," ").concat(a," ").concat((0,s.__)("on the slide.","nggallery"))},(0,s.__)("Use Photo Title?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(r,"-use-photo-title"),name:"".concat(r,"-use-photo-title"),checked:ne,onChange:function(e){re(e.target.checked),ve("usePhotoTitle",e.target.checked)},label:""}))),ne&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-limit-caption")},(0,s.__)("Limit Caption Length","nggallery"))),i().createElement("div",null,i().createElement(h.A,{type:"text",id:"".concat(r,"-limit-caption"),name:"".concat(r,"-limit-caption"),value:ie,onChange:function(e){le(e.target.value),ve("limitCaptionLength",e.target.value)},placeholder:(0,s.__)("For e.g. 999","nggallery")}),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Limits the number of words to display for each caption.","nggallery")))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(r,"-cache-data"),help:"".concat((0,s.__)("Caches the data from","nggallery")," ").concat(a," ").concat((0,s.__)("to improve performance (recommended).","nggallery"))},"".concat((0,s.__)("Cache Data from","nggallery")," ").concat(a,"?"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(r,"-cache-data"),name:"".concat(r,"-cache-data"),checked:ue,onChange:function(e){de(e.target.checked),ve("cacheData",e.target.checked)},label:""}))))):i().createElement("div",null,i().createElement("h2",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(a," ").concat((0,s.__)("Authorization Setup","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},"Before you can create ".concat(a," galleries, you need to authenticate Imagely with your ").concat(a," account.")),i().createElement("p",{className:"text-sm text-gray-600"},i().createElement("a",{href:"#",onClick:function(e){e.preventDefault(),x("imagely-settings","integrations")},className:"button button-primary"},(0,s.__)("Click Here to Authenticate Imagely with ".concat(a),"nggallery")))))};var j=n(2416),P=n(2549),T=n(7143);function I(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return D(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(D(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,D(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,D(d,"constructor",s),D(s,"constructor",c),c.displayName="GeneratorFunction",D(s,a,"GeneratorFunction"),D(d),D(d,a,"Generator"),D(d,r,function(){return this}),D(d,"toString",function(){return"[object Generator]"}),(I=function(){return{w:o,m}})()}function D(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,n,r){function o(t,n){D(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},D(e,t,n,r)}var L="https://us-central1-envira-gallery-instagram.cloudfunctions.net/dropbox-iframe";const R=function(e){var t=e.galleryId,n=e.galleryTitle,r=e.onSuccess,a=(0,o.useRef)(null),l=(0,o.useState)(!1),c=(0,g.A)(l,2),u=c[0],d=c[1],m=(0,T.useDispatch)(P.EF),f=(0,j.E)(),p=f.showSuccess,h=f.showError,y=i().useCallback(function(e){a.current=e,d(!!e)},[]);return(0,o.useEffect)(function(){if(u){var e=a.current;if(e&&!e.querySelector("iframe")){var t=document.createElement("iframe");t.src=L,t.style.cssText="width:100%;height:36px;border:none",e.appendChild(t)}}},[u]),(0,o.useEffect)(function(){var e=function(){var e=(0,v.A)(I().m(function e(a){var o,i,l,c,u,d,g;return I().w(function(e){for(;;)switch(e.p=e.n){case 0:if(a.origin===new URL(L).origin){e.n=1;break}return e.a(2);case 1:if("dropbox-chooser-success"!==(null===(o=a.data)||void 0===o?void 0:o.type)){e.n=12;break}if(i=a.data.files,t||n){e.n=2;break}return h((0,s.__)("Please provide a gallery title before importing images.","nggallery")),e.a(2);case 2:if(0!==(l=i.map(function(e){return e.link}).filter(Boolean)).length){e.n=3;break}return h((0,s.__)("No valid image links found in selected files.","nggallery")),e.a(2);case 3:return c={image_links:l},t?c.gallery_id=t:n&&(c.gallery_title=n),m.setPageLoading(!0),e.p=4,e.n=5,E()({path:"/nggpro/v1/dropbox/save-dropbox-image",method:"POST",headers:(0,b.kX)(),data:c});case 5:if(null==(u=e.v)||!u.error){e.n=6;break}throw new Error(u.error);case 6:if(null==u||!u.gallery_id){e.n=8;break}if(p((0,s.__)("Images imported from Dropbox successfully!","nggallery")),!r){e.n=7;break}return e.n=7,r(u.gallery_id);case 7:e.n=9;break;case 8:throw new Error((0,s.__)("No gallery ID returned from the import.","nggallery"));case 9:e.n=11;break;case 10:e.p=10,g=e.v,console.error("Error importing Dropbox images:",g),d=(null==g?void 0:g.message)||(0,s.__)("Failed to import images from Dropbox. Please try again.","nggallery"),h(d);case 11:return e.p=11,m.setPageLoading(!1),e.f(11);case 12:return e.a(2)}},e,null,[[4,10,11,12]])}));return function(t){return e.apply(this,arguments)}}();return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}},[m,t,n,r,p,h]),i().createElement("div",{className:"space-y-2"},i().createElement("p",{className:"text-sm text-gray-600"},(0,s.__)("Click the button below to select images from Dropbox","nggallery")),i().createElement("div",{ref:y,id:"imagely-dropbox-chooser-container","aria-label":(0,s.__)("Import from Dropbox","nggallery")}))};var F=n(9292),M=n(5458),G=n(7665),Q=n(7097);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){(0,m.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return H(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return K(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(K(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,K(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,K(d,"constructor",s),K(s,"constructor",c),c.displayName="GeneratorFunction",K(s,a,"GeneratorFunction"),K(d),K(d,a,"Generator"),K(d,r,function(){return this}),K(d,"toString",function(){return"[object Generator]"}),(z=function(){return{w:o,m}})()}function K(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}K=function(e,t,n,r){function o(t,n){K(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},K(e,t,n,r)}var V={oauthUrl:function(e,t){return["google-photos","oauth-url",e,t]},accounts:["google-photos","accounts"],pickerSession:function(e){return["google-photos","picker","session",e]},pickerMediaItems:function(e){return["google-photos","picker","media-items",e]}},W=["refresh_token_expired","not_authenticated","ngg_google_photos_not_authenticated","ngg_google_photos_api_client_init_failed"],X=n(6418);function Y(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Z(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Z(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Z(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Z(d,"constructor",s),Z(s,"constructor",c),c.displayName="GeneratorFunction",Z(s,a,"GeneratorFunction"),Z(d),Z(d,a,"Generator"),Z(d,r,function(){return this}),Z(d,"toString",function(){return"[object Generator]"}),(Y=function(){return{w:o,m}})()}function Z(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Z=function(e,t,n,r){function o(t,n){Z(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Z(e,t,n,r)}var J="ngg_google_photos_pending";function $(e){if(!e||/\/autoclose(\?|#|$)/.test(e))return e;try{var t=new URL(e);return t.pathname.endsWith("/autoclose")?e:(t.pathname="".concat(t.pathname.replace(/\/$/,""),"/autoclose"),t.toString())}catch(t){return e}}const ee=function(e){var t,n,r,a,l,c,u,d,m,f=e.integrationName,h=e.galleryId,y=(0,k.r)().navigateTo,x=(0,T.useDispatch)(P.EF),_=(0,j.E)(),C=_.showSuccess,N=_.showError,O=function(){var e,t=(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&"pro"===P.WA;return(0,w.I)({queryKey:V.accounts,queryFn:(e=(0,v.A)(z().m(function e(){var t;return z().w(function(e){for(;;)switch(e.n){case 0:return t=(0,b.m9)(),e.n=1,E()({path:"/nggpro/v1/google-photos/accounts",method:"GET",headers:{"X-WP-Nonce":t}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),enabled:t,staleTime:3e4,gcTime:3e5})}(!0),A=O.data,S=null!==(t=null==A?void 0:A.accounts)&&void 0!==t?t:[],I=S.length>0,D=(0,o.useState)(1),L=(0,g.A)(D,2),R=L[0],B=L[1];(0,o.useEffect)(function(){S.length>0&&B(S[0].slot)},[A]);var H=(0,o.useRef)(null);(0,o.useEffect)(function(){null!==H.current?H.current!==R&&(H.current=R,sessionStorage.removeItem(J),ne(null),ie(R)):H.current=R},[R]);var K,Z=(0,o.useState)(function(){if("undefined"==typeof window||!h)return null;try{var e=sessionStorage.getItem(J);if(!e)return null;var t=JSON.parse(e),n=t.sessionId;return t.galleryId===h?n:null}catch(e){return null}}),ee=(0,g.A)(Z,2),te=ee[0],ne=ee[1],re=(0,o.useState)(function(){if("undefined"==typeof window||!h)return 1;try{var e=sessionStorage.getItem(J);if(!e)return 1;var t=JSON.parse(e),n=t.sessionId,r=t.galleryId,a=t.accountSlot;return r===h&&n&&"number"==typeof a&&a>=1&&a<=3?a:1}catch(e){return 1}}),ae=(0,g.A)(re,2),oe=ae[0],ie=ae[1],le=(0,G.jE)(),ce=function(){var e,t=(0,G.jE)();return(0,Q.n)({mutationFn:(e=(0,v.A)(z().m(function e(t){var n,r;return z().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.m9)(),r=void 0!==t?"/nggpro/v1/google-photos/picker/create-session?account_id=".concat(t):"/nggpro/v1/google-photos/picker/create-session",e.n=1,E()({path:r,method:"POST",headers:{"X-WP-Nonce":n,"Content-Type":"application/json"},data:{}});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var n,r=null!==(n=e.sessionId)&&void 0!==n?n:e.session_id;r&&t.invalidateQueries({queryKey:V.pickerSession(r)})},onError:function(e){var n,r,a=null!==(n=null==e?void 0:e.code)&&void 0!==n?n:"",o=(null!==(r=null==e?void 0:e.message)&&void 0!==r?r:"").toLowerCase();(W.includes(a)||o.includes("session has expired")||o.includes("reconnect"))&&t.invalidateQueries({queryKey:V.accounts})}})}(),se=(0,Q.n)({mutationFn:(K=(0,v.A)(z().m(function e(t){var n,r,a,o,i,l,c,s,u,d,m,g,f,p,h,y,v,w;return z().w(function(e){for(;;)switch(e.n){case 0:if(n=t.galleryId,r=t.mediaItems,a=t.accountId,o=void 0===a?1:a,i=(0,b.m9)(),0!==(l=r.length)){e.n=1;break}return e.a(2,{success:!1,imported:[],failed:[],summary:{total:0,imported:0,failed:0}});case 1:c={success:!1,imported:[],failed:[],summary:{total:l,imported:0,failed:0}},u=0,d=0;case 2:if(!(d<l)){e.n=5;break}return f=r.slice(d,d+10),e.n=3,E()({path:"/nggpro/v1/google-photos/import",method:"POST",headers:{"X-WP-Nonce":i,"Content-Type":"application/json"},data:{gallery_id:n,media_items:f,account_id:o}});case 3:if(p=e.v,null!==(m=p.imported)&&void 0!==m&&m.length&&(h=c.imported).push.apply(h,(0,M.A)(p.imported)),null!==(g=p.failed)&&void 0!==g&&g.length){y=U(p.failed);try{for(y.s();!(v=y.n()).done;)w=v.value,c.failed.push(q(q({},w),{},{index:"number"==typeof w.index?w.index+u:w.index}))}catch(e){y.e(e)}finally{y.f()}}p.success&&(c.success=!0),!s&&p.first_failure_reason&&(s=p.first_failure_reason),u+=f.length;case 4:d+=10,e.n=2;break;case 5:return c.summary={total:l,imported:c.imported.length,failed:c.failed.length},s&&(c.first_failure_reason=s),e.a(2,c)}},e)})),function(e){return K.apply(this,arguments)})}),ue=!!te&&("undefined"==typeof window||null!==sessionStorage.getItem(J)),de=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return(0,w.I)({queryKey:V.pickerSession(e),queryFn:(t=(0,v.A)(z().m(function t(){var n,a,o;return z().w(function(t){for(;;)switch(t.n){case 0:return n=(0,b.m9)(),a=encodeURIComponent(e),o=void 0!==r?"?account_id=".concat(r):"",t.n=1,E()({path:"/nggpro/v1/google-photos/picker/session/".concat(a).concat(o),method:"GET",headers:{"X-WP-Nonce":n}});case 1:return t.a(2,t.v)}},t)})),function(){return t.apply(this,arguments)}),enabled:n&&!!e,refetchInterval:function(e){var t,n,r=e.state.data;return!((null==r?void 0:r.media_items_set)||(null==r?void 0:r.mediaItemsSet)||(null==r||null===(t=r.session)||void 0===t?void 0:t.media_items_set)||(null==r||null===(n=r.session)||void 0===n?void 0:n.mediaItemsSet))&&1e3},refetchIntervalInBackground:!0,refetchOnWindowFocus:!0,staleTime:0,gcTime:0})}(te,ue,oe),me=de.data,ge=null!==(n=null!==(r=null!==(a=null!==(l=null==me?void 0:me.media_items_set)&&void 0!==l?l:null==me?void 0:me.mediaItemsSet)&&void 0!==a?a:null==me||null===(c=me.session)||void 0===c?void 0:c.media_items_set)&&void 0!==r?r:null==me||null===(u=me.session)||void 0===u?void 0:u.mediaItemsSet)&&void 0!==n&&n,fe=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return(0,w.I)({queryKey:V.pickerMediaItems(e),queryFn:(t=(0,v.A)(z().m(function t(){var n,a,o;return z().w(function(t){for(;;)switch(t.n){case 0:return n=(0,b.m9)(),a=encodeURIComponent(e),o=void 0!==r?"?account_id=".concat(r):"",t.n=1,E()({path:"/nggpro/v1/google-photos/picker/session/".concat(a,"/media-items").concat(o),method:"GET",headers:{"X-WP-Nonce":n}});case 1:return t.a(2,t.v)}},t)})),function(){return t.apply(this,arguments)}),enabled:n&&!!e,staleTime:0,gcTime:0})}(te,ue&&ge,oe),pe=fe.data,he=null!==(d=null!==(m=null==pe?void 0:pe.media_items)&&void 0!==m?m:null==pe?void 0:pe.mediaItems)&&void 0!==d?d:[],ye=(0,o.useRef)(!1),ve=(0,o.useRef)(null),be=(0,X.q2)().setNextDisabled;(0,o.useEffect)(function(){return be(ce.isPending||se.isPending||!!te),function(){return be(!1)}},[ce.isPending,se.isPending,te]),(0,o.useEffect)(function(){if(h&&"undefined"!=typeof window){var e=function(){try{var e=sessionStorage.getItem(J);if(!e)return;var t=JSON.parse(e);if(t.galleryId!==h||!t.sessionId)return;ne(t.sessionId);var n=t.accountSlot;"number"==typeof n&&n>=1&&n<=3&&ie(n),le.refetchQueries({queryKey:V.pickerSession(t.sessionId)})}catch(e){}};return window.addEventListener("focus",e),function(){return window.removeEventListener("focus",e)}}},[h,le]),(0,o.useEffect)(function(){return function(){var e=ve.current;if(e&&"boolean"==typeof e.closed&&!e.closed)try{e.close()}catch(e){}ve.current=null}},[]),(0,o.useEffect)(function(){if(ge){var e=ve.current;if(e&&"boolean"==typeof e.closed&&!e.closed)try{e.close()}catch(e){}ve.current=null}},[ge]),(0,o.useEffect)(function(){h&&te&&ge&&0!==he.length&&!ye.current&&(ye.current=!0,se.mutateAsync({galleryId:h,mediaItems:he,accountId:oe}).then(function(e){sessionStorage.removeItem(J),ne(null),ie(1),ye.current=!1,y("imagely-add-new","images",h),x.setActiveModal(null),le.refetchQueries({queryKey:["galleries"],type:"all"}),le.invalidateQueries({queryKey:["gallery",h]}),le.invalidateQueries({queryKey:["gallery",h,"images"]});var t,n=e.summary,r=n.imported,a=n.failed;0===r?N(null!==(t=e.first_failure_reason)&&void 0!==t?t:(0,s.__)("No photos could be imported from Google Photos. Please try again.","nggallery")):C(a>0?(0,s.sprintf)((0,s.__)("%1$d photo(s) imported from Google Photos. %2$d could not be imported.","nggallery"),r,a):(0,s.__)("Photos imported from Google Photos.","nggallery"))}).catch(function(e){var t;sessionStorage.removeItem(J),ne(null),ie(1),ye.current=!1,N(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:(0,s.__)("Failed to import from Google Photos. Please try again.","nggallery"))}))},[h,te,ge,he.length,oe]);var we=function(){var e=(0,v.A)(Y().m(function e(){var t,n,r,a,o,i,l,c;return Y().w(function(e){for(;;)switch(e.p=e.n){case 0:if("pro"===P.WA){e.n=1;break}return x.setActiveModal("upgrade",{feature:"Google Photos"}),e.a(2);case 1:if(h){e.n=2;break}return e.a(2);case 2:return e.p=2,e.n=3,ce.mutateAsync(R);case 3:if(o=e.v,i=null!==(t=null==o?void 0:o.pickerUri)&&void 0!==t?t:null==o?void 0:o.picker_uri){e.n=4;break}return N((0,s.__)("Could not open Google Photos Picker. Please try again.","nggallery")),e.a(2);case 4:if(l=$(i),ie(R),sessionStorage.setItem(J,JSON.stringify({sessionId:null!==(n=o.sessionId)&&void 0!==n?n:o.session_id,galleryId:h,accountSlot:R})),ne(null!==(r=null!==(a=o.sessionId)&&void 0!==a?a:o.session_id)&&void 0!==r?r:null),c=window.open(l,"_blank")){e.n=5;break}return sessionStorage.removeItem(J),ne(null),N((0,s.__)("Your browser blocked the Google Photos window. Allow popups for this site and try again.","nggallery")),e.a(2);case 5:try{c.opener=null}catch(e){}c.focus(),ve.current=c,e.n=7;break;case 6:e.p=6,e.v,N((0,s.__)("Failed to open Google Photos Picker. Please try again.","nggallery"));case 7:return e.a(2)}},e,null,[[2,6]])}));return function(){return e.apply(this,arguments)}}();return i().createElement("div",{className:"space-y-6"},I?i().createElement(i().Fragment,null,i().createElement("h2",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(f," ").concat((0,s.__)("Settings","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},(0,s.__)("You are connected to Google Photos.","nggallery")," ",(0,s.__)("Add photos from your Google Photos library using the Picker.","nggallery")),te&&!se.isPending&&i().createElement("p",{className:"text-sm text-blue-600 mb-3",role:"status"},(0,s.__)("Select photos in the Picker. When you confirm, the Picker tab will close and your photos will import here automatically.","nggallery")),se.isPending&&i().createElement("div",{className:"flex items-center gap-3 mb-3",role:"status"},i().createElement(F.A,{size:"sm",color:"blue",centerInContainer:!1}),i().createElement("p",{className:"text-sm text-blue-600"},(0,s.__)("Importing photos from Google Photos…","nggallery"))),h&&i().createElement(i().Fragment,null,S.length>0&&i().createElement("div",{className:"mb-3 max-w-xs"},i().createElement("label",{htmlFor:"google-photos-account-select",className:"block text-sm text-gray-700 mb-1"},(0,s.__)("Google Photos Account","nggallery")),i().createElement(p.A,{id:"google-photos-account-select",name:"google-photos-account-select",value:String(R),onChange:function(e){return B(Number(e.target.value))}},S.map(function(e){return i().createElement("option",{key:e.slot,value:String(e.slot)},e.user_email||e.user_name||"".concat((0,s.__)("Account","nggallery")," #").concat(e.slot))}))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},i().createElement("button",{type:"button",onClick:we,disabled:ce.isPending||se.isPending||!!te,className:"button button-primary"},ce.isPending?(0,s.__)("Opening Picker…","nggallery"):(0,s.__)("Add photos from Google Photos","nggallery")))),i().createElement("p",{className:"text-sm text-gray-600"},i().createElement("button",{type:"button",onClick:function(){return y("imagely-settings","integrations")},className:"text-green-600 hover:text-green-700 underline"},(0,s.sprintf)((0,s.__)("Manage %s connection in Settings","nggallery"),f)))):i().createElement("div",null,i().createElement("h2",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(f," ").concat((0,s.__)("Authorization Setup","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},"Before you can create ".concat(f," galleries, you need to authenticate Imagely with your ").concat(f," account.")),i().createElement("p",{className:"text-sm text-gray-600"},i().createElement("a",{href:"#",onClick:function(e){e.preventDefault(),y("imagely-settings","integrations")},className:"button button-primary"},(0,s.__)("Click Here to Authenticate Imagely with ".concat(f),"nggallery")))))};function te(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return ne(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ne(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ne(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,ne(d,"constructor",s),ne(s,"constructor",c),c.displayName="GeneratorFunction",ne(s,a,"GeneratorFunction"),ne(d),ne(d,a,"Generator"),ne(d,r,function(){return this}),ne(d,"toString",function(){return"[object Generator]"}),(te=function(){return{w:o,m}})()}function ne(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ne=function(e,t,n,r){function o(t,n){ne(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ne(e,t,n,r)}var re={tiktokOAuthUrl:function(e){return["tiktok","oauth-url",e]},tiktokAccounts:["tiktok","accounts"]},ae=function(e){var t=e.integrationName,n=(0,k.r)().navigateTo;return i().createElement("div",null,i().createElement("h2",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(t," ").concat((0,s.__)("Authorization Setup","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},"Before you can create ".concat(t," galleries, you need to authenticate Imagely with your ").concat(t," account.")),i().createElement("p",{className:"text-sm text-gray-600"},i().createElement("a",{href:"#",onClick:function(e){e.preventDefault(),n("imagely-settings","integrations")},className:"button button-primary"},(0,s.__)("Click Here to Authenticate Imagely with ".concat(t),"nggallery"))))},oe={showAccount:!0,showNumber:!0,showLink:!0,showImageSize:!0,showLinkTarget:!0,showCaption:!0,showCaptionLength:!0,showCache:!0,showPlayButton:!0,defaultNumber:10,defaultLink:0,defaultImageSize:"default",defaultLinkTarget:0,defaultCaption:1,defaultCaptionLength:999,defaultCache:1,defaultShowPlayButton:1},ie=[{value:"default",label:(0,s.__)("Default","nggallery")},{value:"thumbnail",label:(0,s.__)("Thumbnail","nggallery")},{value:"medium",label:(0,s.__)("Medium","nggallery")},{value:"large",label:(0,s.__)("Large","nggallery")},{value:"full",label:(0,s.__)("Full Size","nggallery")}],le={account:"_account",numPhotos:"_number",overridingLink:"_link",imageSize:"_image_size",openInNewTab:"_link_target",usePhotoTitle:"_caption",limitCaptionLength:"_caption_length",cacheData:"_cache",showPlayButton:"_show_play_button"},ce=function(e){var t=e.integrationType,n=e.integrationName,r=e.config,a=e.state,o=e.accountOptions,l=e.onUpdateField,c=function(e){return[{value:"0",label:(0,s.__)("No link (Use Lightbox If Enabled)","nggallery")},{value:"1",label:(0,s.__)("Original Page at","nggallery")+" ".concat(e)},{value:"2",label:(0,s.__)("Direct Full Sized Video On Site","nggallery")}]}(n);return i().createElement("div",{className:"space-y-6"},r.showAccount&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-account")},"".concat(n," ").concat((0,s.__)("Account","nggallery")))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(t,"-account"),name:"".concat(t,"-account"),value:a.account,onChange:function(e){return l("account",e.target.value)}},o.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Choose from any of the","nggallery")," ",i().createElement("a",{href:"#",className:"underline font-semibold text-[#11A800]"},(0,s.__)("Authenticated","nggallery")," ",n," ",(0,s.__)("accounts","nggallery")),"."))),r.showNumber&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-num-photos")},"".concat((0,s.__)("No. of","nggallery")," ").concat(n," ").concat((0,s.__)("Videos","nggallery")))),i().createElement("div",null,i().createElement(h.A,{type:"number",id:"".concat(t,"-num-photos"),name:"".concat(t,"-num-photos"),value:a.numPhotos,onChange:function(e){return l("numPhotos",e.target.value)},min:1}),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Choose the number of videos to fetch from TikTok.","nggallery")))),r.showLink&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-overriding-link")},(0,s.__)("Overriding Link?","nggallery"))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(t,"-overriding-link"),name:"".concat(t,"-overriding-link"),value:a.overridingLink,onChange:function(e){return l("overridingLink",e.target.value)}},c.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})))),r.showImageSize&&"0"===a.overridingLink&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-image-size")},(0,s.__)("Image Size","nggallery"))),i().createElement("div",null,i().createElement(p.A,{id:"".concat(t,"-image-size"),name:"".concat(t,"-image-size"),value:a.imageSize,onChange:function(e){return l("imageSize",e.target.value)}},ie.map(function(e){return i().createElement("option",{key:e.value,value:e.value},e.label)})))),r.showLinkTarget&&"0"!==a.overridingLink&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-open-new-tab"),help:"".concat((0,s.__)("Open the link to","nggallery")," ").concat(n," ").concat((0,s.__)("in a new browser tab.","nggallery"))},(0,s.__)("Open in New Tab?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-open-new-tab"),name:"".concat(t,"-open-new-tab"),checked:a.openInNewTab,onChange:function(e){return l("openInNewTab",e.target.checked)},label:""}))),r.showCaption&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-use-photo-title"),help:"".concat((0,s.__)("Display the photo caption from","nggallery")," ").concat(n," ").concat((0,s.__)("on the slide.","nggallery"))},(0,s.__)("Use Photo Title?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-use-photo-title"),name:"".concat(t,"-use-photo-title"),checked:a.usePhotoTitle,onChange:function(e){return l("usePhotoTitle",e.target.checked)},label:""}))),r.showCaptionLength&&a.usePhotoTitle&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-limit-caption")},(0,s.__)("Limit Caption Length","nggallery"))),i().createElement("div",null,i().createElement(h.A,{type:"text",id:"".concat(t,"-limit-caption"),name:"".concat(t,"-limit-caption"),value:a.limitCaptionLength,onChange:function(e){return l("limitCaptionLength",e.target.value)},placeholder:(0,s.__)("For e.g. 999","nggallery")}),i().createElement("p",{className:"text-sm text-gray-600 mt-1"},(0,s.__)("Limits the number of words to display for each caption.","nggallery")))),r.showCache&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-cache-data"),help:"".concat((0,s.__)("Caches the data from","nggallery")," ").concat(n," ").concat((0,s.__)("to improve performance (recommended).","nggallery"))},"".concat((0,s.__)("Cache Data from","nggallery")," ").concat(n,"?"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-cache-data"),name:"".concat(t,"-cache-data"),checked:a.cacheData,onChange:function(e){return l("cacheData",e.target.checked)},label:""}))),r.showPlayButton&&i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-show-play-button"),help:(0,s.__)("Shows a play button overlay on TikTok thumbnails in the gallery.","nggallery")},(0,s.__)("Show Play Button?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-show-play-button"),name:"".concat(t,"-show-play-button"),checked:a.showPlayButton,onChange:function(e){return l("showPlayButton",e.target.checked)},label:""}))))},se=function(e){var t=e.integrationType,n=e.integrationName;return i().createElement("div",{className:"mb-6"},i().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(n," ").concat((0,s.__)("Settings","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},(0,s.__)("The settings below adjust the","nggallery")," ",n," ",(0,s.__)("options for the gallery.","nggallery")),i().createElement("p",{className:"text-sm text-gray-600"},(0,s.__)("Need some help?","nggallery")," ",i().createElement("a",{href:"https://www.imagely.com/docs/".concat(t.toLowerCase(),"-integration/"),target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Read the Documentation","nggallery"))," ",(0,s.__)("or","nggallery")," ",i().createElement("a",{href:"https://www.imagely.com/docs/".concat(t.toLowerCase(),"-integration/#video"),target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Watch a Video","nggallery"))))},ue=function(e){var t=e.integrationType,n=e.settingsMode,r=e.onModeChange,a=(0,k.r)().navigateTo;return i().createElement("div",{className:"mb-6"},i().createElement("div",{className:"mt-2 flex gap-[10px]"},i().createElement("label",{className:"flex items-center"},i().createElement("input",{type:"radio",name:"".concat(t,"-settings-mode"),checked:"default"===n,onChange:function(){return r("default")},className:"mr-2"}),i().createElement("span",{className:"text-sm text-gray-700"},(0,s.__)("Default Settings","nggallery"))),i().createElement("label",{className:"flex items-center"},i().createElement("input",{type:"radio",name:"".concat(t,"-settings-mode"),checked:"custom"===n,onChange:function(){return r("custom")},className:"mr-2"}),i().createElement("span",{className:"text-sm text-gray-700"},(0,s.__)("Custom Settings","nggallery")))),"default"===n&&i().createElement("div",{className:"mt-2"},"Use"," ",i().createElement("a",{href:"#",onClick:function(e){e.preventDefault(),a("imagely-settings","integrations")},className:"text-sm text-blue-600 hover:text-blue-800 underline"},(0,s.__)("Default Settings","nggallery"))," ","to quickly apply the standard configuration."))};function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach(function(t){(0,m.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const ge=function(e){var t,n=e.integrationType,r=e.integrationName,a=e.externalSource,l=void 0===a?{}:a,c=e.defaultSettings,u=void 0===c?{}:c,d=e.onUpdate,f=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,w.I)({queryKey:re.tiktokAccounts,queryFn:(e=(0,v.A)(te().m(function e(){var t;return te().w(function(e){for(;;)switch(e.n){case 0:return t=(0,b.m9)(),e.n=1,E()({path:"/nggpro/v1/tiktok/accounts",method:"GET",headers:{"X-WP-Nonce":t}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),enabled:t,staleTime:3e4,gcTime:3e5})}(!0),p=(null===(t=f.data)||void 0===t?void 0:t.accounts)||[],h=p.length>0,y=function(e){var t=e.integrationType,n=e.externalSource,r=e.defaultSettings,a=e.onUpdate,i=oe,l=(0,o.useMemo)(function(){return"custom"===n.settings_mode?"custom":"default"},[n.settings_mode]),c=(0,o.useState)(l),s=(0,g.A)(c,2),u=s[0],d=s[1];(0,o.useEffect)(function(){d(l)},[l]);var f=(0,o.useCallback)(function(e,t){return void 0!==n[e]?n[e]:"default"===u&&void 0!==r[e]?r[e]:t},[n,r,u]),p=(0,o.useState)(function(){return{account:f("".concat(t,"_account"),""),numPhotos:String(f("".concat(t,"_number"),i.defaultNumber)),overridingLink:String(f("".concat(t,"_link"),i.defaultLink)),imageSize:f("".concat(t,"_image_size"),i.defaultImageSize),openInNewTab:1===f("".concat(t,"_link_target"),i.defaultLinkTarget),usePhotoTitle:1===f("".concat(t,"_caption"),i.defaultCaption),limitCaptionLength:String(f("".concat(t,"_caption_length"),i.defaultCaptionLength)),cacheData:1===f("".concat(t,"_cache"),i.defaultCache),showPlayButton:1===f("".concat(t,"_show_play_button"),i.defaultShowPlayButton)}}),h=(0,g.A)(p,2),y=h[0],v=h[1];(0,o.useEffect)(function(){v({account:f("".concat(t,"_account"),""),numPhotos:String(f("".concat(t,"_number"),i.defaultNumber)),overridingLink:String(f("".concat(t,"_link"),i.defaultLink)),imageSize:f("".concat(t,"_image_size"),i.defaultImageSize),openInNewTab:1===f("".concat(t,"_link_target"),i.defaultLinkTarget),usePhotoTitle:1===f("".concat(t,"_caption"),i.defaultCaption),limitCaptionLength:String(f("".concat(t,"_caption_length"),i.defaultCaptionLength)),cacheData:1===f("".concat(t,"_cache"),i.defaultCache),showPlayButton:1===f("".concat(t,"_show_play_button"),i.defaultShowPlayButton)})},[u,n,r,t,f]);var b=(0,o.useCallback)(function(e){if(d(e),a){var o=me(me({},n),{},{settings_mode:e});if("custom"===e){var i="".concat(t,"_account");if(!o[i]){var l=null==r?void 0:r[i];l&&(o[i]=l,v(function(e){return me(me({},e),{},{account:String(l)})}))}var c="".concat(t,"_show_play_button"),s=o[c];if(null==s||""===s){var u=null==r?void 0:r[c];null!=u&&""!==u&&(o[c]=u,v(function(e){return me(me({},e),{},{showPlayButton:1===Number(u)})}))}}if("default"===e){var m=Object.fromEntries(Object.entries(o).filter(function(e){var t=(0,g.A)(e,1)[0];return"type"===t||"settings_mode"===t}));a(m)}else a(o)}},[n,r,t,a]),w=(0,o.useCallback)(function(e,r){if("custom"===u){var o=me(me({},n),{},{settings_mode:"custom"}),i=le[e];i&&(o["".concat(t).concat(i)]="openInNewTab"===e||"usePhotoTitle"===e||"cacheData"===e||"showPlayButton"===e?r?1:0:"numPhotos"===e||"limitCaptionLength"===e?parseInt(r)||0:r,null==a||a(o))}},[u,n,t,a]),x=(0,o.useCallback)(function(e,t){v(function(n){return me(me({},n),{},(0,m.A)({},e,t))}),w(e,t)},[w]);return{config:i,settingsMode:u,state:y,handleModeChange:b,updateField:x}}({integrationType:n,externalSource:l,defaultSettings:u,onUpdate:d}),x=y.config,_=y.settingsMode,C=y.state,N=y.handleModeChange,k=y.updateField,O=(0,o.useMemo)(function(){return p.map(function(e){return{value:e.username||"slot-".concat(e.slot),label:e.username||(0,s.__)("Account","nggallery")+" #".concat(e.slot)}})},[p]);return h?i().createElement("div",{className:"space-y-6"},i().createElement(se,{integrationType:n,integrationName:r}),i().createElement("hr",{className:"border-gray-200 my-6"}),i().createElement(ue,{integrationType:n,settingsMode:_,onModeChange:N}),"custom"===_&&i().createElement(i().Fragment,null,i().createElement("hr",{className:"border-gray-200 my-6"}),i().createElement(ce,{integrationType:n,integrationName:r,config:x,state:C,accountOptions:O,onUpdateField:k}))):i().createElement("div",{className:"space-y-6"},i().createElement(ae,{integrationName:r}))};var fe=n(3375),pe=n(3627),he=n(2724),ye=n(3717),ve=function(e){var t=e.integrationType,n=e.state,r=e.onUpdateField;return i().createElement("div",{className:"space-y-6"},i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-show-video-controls"),help:(0,s.__)("Display video player controls (play, pause, volume, etc.) in the lightbox.","nggallery")},(0,s.__)("Show Video Controls?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-show-video-controls"),name:"".concat(t,"-show-video-controls"),checked:n.showVideoControls,onChange:function(e){return r("showVideoControls",e.target.checked)},label:""}))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-show-play-pause-controls"),help:(0,s.__)("Display play and pause buttons on video thumbnails in the gallery.","nggallery")},(0,s.__)("Show Play/Pause Controls?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-show-play-pause-controls"),name:"".concat(t,"-show-play-pause-controls"),checked:n.showPlayPauseControls,onChange:function(e){return r("showPlayPauseControls",e.target.checked)},label:""}))),i().createElement("div",{className:"grid grid-cols-1 md:grid-cols-[30%_60%] gap-6"},i().createElement("div",{className:"flex items-start"},i().createElement(f.A,{htmlFor:"".concat(t,"-autoplay-videos"),help:(0,s.__)("Automatically start playing videos when they are displayed in the lightbox.","nggallery")},(0,s.__)("Autoplay Videos?","nggallery"))),i().createElement("div",{className:"flex items-center"},i().createElement(y.A,{id:"".concat(t,"-autoplay-videos"),name:"".concat(t,"-autoplay-videos"),checked:n.autoplayVideos,onChange:function(e){return r("autoplayVideos",e.target.checked)},label:""}))))},be=function(e){var t=e.integrationName;return i().createElement("div",{className:"mb-6"},i().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-2"},"".concat(t," ").concat((0,s.__)("Settings","nggallery"))),i().createElement("p",{className:"text-sm text-gray-600 mb-3"},(0,s.__)("The settings below adjust the","nggallery")," ",t," ",(0,s.__)("options for the gallery.","nggallery")))},we={defaultShowVideoControls:!0,defaultShowPlayPauseControls:!0,defaultAutoplayVideos:!1},xe={showVideoControls:"show_video_controls",showPlayPauseControls:"show_play_pause_controls",autoplayVideos:"autoplay_videos"};function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(n),!0).forEach(function(t){(0,m.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ce=n(9238);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach(function(t){(0,m.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Ae(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ae(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Ae(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Ae(d,"constructor",s),Ae(s,"constructor",c),c.displayName="GeneratorFunction",Ae(s,a,"GeneratorFunction"),Ae(d),Ae(d,a,"Generator"),Ae(d,r,function(){return this}),Ae(d,"toString",function(){return"[object Generator]"}),(Oe=function(){return{w:o,m}})()}function Ae(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Ae=function(e,t,n,r){function o(t,n){Ae(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Ae(e,t,n,r)}function Se(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return je(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Pe=function(e){var t=e.onClick;return i().createElement("div",{className:"relative w-full"},i().createElement("div",{className:"relative bg-gray-100 rounded-lg border-2 border-dashed border-gray-300 hover:border-gray-400 cursor-pointer transition-colors w-full h-[90px] sm:h-[100px] md:w-[130px] md:h-[90px]",onClick:t},i().createElement("div",{className:"absolute inset-0 flex flex-col items-center justify-center"},i().createElement(a.c1,{className:"w-6 h-6 sm:w-8 sm:h-8 text-gray-400 mb-1 sm:mb-2"}),i().createElement("span",{className:"text-xs sm:text-sm text-gray-500 font-medium"},(0,s.__)("Add Video Links","nggallery")))))};const Te=function(e){var t=e.integrationType,n=e.integrationName,r=e.externalSource,a=void 0===r?{}:r,l=e.defaultSettings,c=void 0===l?{}:l,u=e.onUpdate,d=function(e){var t=e.externalSource,n=e.defaultSettings,r=e.onUpdate,a=we,i=(0,o.useCallback)(function(e,r){return void 0!==t[e]?t[e]:void 0!==n[e]?n[e]:r},[t,n]),l=(0,o.useState)(function(){return{showVideoControls:i("show_video_controls",a.defaultShowVideoControls),showPlayPauseControls:i("show_play_pause_controls",a.defaultShowPlayPauseControls),autoplayVideos:i("autoplay_videos",a.defaultAutoplayVideos)}}),c=(0,g.A)(l,2),s=c[0],u=c[1];(0,o.useEffect)(function(){u({showVideoControls:i("show_video_controls",a.defaultShowVideoControls),showPlayPauseControls:i("show_play_pause_controls",a.defaultShowPlayPauseControls),autoplayVideos:i("autoplay_videos",a.defaultAutoplayVideos)})},[t,n,i]);var d=(0,o.useCallback)(function(e,n){var a=_e({},t),o=xe[e];o&&(a[o]=!!n,null==r||r(a))},[t,r]),f=(0,o.useCallback)(function(e,t){u(function(n){return _e(_e({},n),{},(0,m.A)({},e,t))}),d(e,t)},[d]);return{config:a,state:s,updateField:f}}({externalSource:a,defaultSettings:c,onUpdate:u}),f=d.state,p=d.updateField,h=(0,k.r)().currentId,y=(0,T.useDispatch)(P.EF),w=(0,G.jE)(),x=(0,j.E)(),_=x.showSuccess,C=x.showError,N=(0,he.iX)(null!=h?h:0).data,O=(0,he.gj)(null!=h?h:0,{per_page:-1,enabled:!!h}),A=O.data,S=O.isLoading,I=(null==A?void 0:A.images)||[],D=(0,o.useMemo)(function(){return I.filter(function(e){var t;return(null===(t=e.meta_data)||void 0===t?void 0:t.video_link)||"video"===(null==a?void 0:a.type)})},[I,null==a?void 0:a.type]),L=(0,o.useState)([]),R=(0,g.A)(L,2),F=R[0],M=R[1],Q=(0,o.useState)(null),B=(0,g.A)(Q,2),q=B[0],U=B[1],H=(0,o.useState)(new Set),z=(0,g.A)(H,2),K=z[0],V=z[1],W=(0,o.useState)(new Set),X=(0,g.A)(W,2),Y=X[0],Z=X[1],J=(0,he.TG)(),$=(0,ye.yr)(),ee=(0,fe.FR)((0,fe.MS)(fe.AN,{activationConstraint:{distance:8,delay:100,tolerance:10}}),(0,fe.MS)(fe.uN,{coordinateGetter:pe.JR}));(0,o.useEffect)(function(){M(D)},[D]);var te=(0,o.useMemo)(function(){return F.map(function(e){return e.pid})},[F]),ne=(0,o.useCallback)(function(){var e=(0,v.A)(Oe().m(function e(t){var n,r,a,o,i,l,c,u,d,m,g,f,p,y,v;return Oe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.active,r=t.over,U(null),!r||n.id===r.id||!h){e.n=7;break}return a=F.findIndex(function(e){return e.pid===n.id}),o=F.findIndex(function(e){return e.pid===r.id}),i=(0,pe.be)(F,a,o),M(i),e.p=1,l=(0,b.m9)(),e.n=2,E()({path:"/imagely/v1/images?gallery_id=".concat(h,"&per_page=-1&orderby=sortorder&order=asc"),method:"GET",headers:{"X-WP-Nonce":l}});case 2:if(c=e.v,Array.isArray(c)&&0!==c.length){e.n=3;break}return e.a(2);case 3:u=new Set(F.map(function(e){return e.pid})),d=[],m=0,g=Se(c);try{for(g.s();!(f=g.n()).done;)p=f.value,u.has(p.pid)?(d.push(i[m]),m++):d.push(p)}catch(e){g.e(e)}finally{g.f()}return y=d.map(function(e,t){return{id:e.pid,sortorder:t+1}}),e.n=4,J.mutateAsync({images:y});case 4:_((0,s.__)("Videos reordered successfully","nggallery")),e.n=6;break;case 5:e.p=5,v=e.v,console.error("Error reordering videos:",v),C((0,s.__)("Failed to reorder videos","nggallery")),w.invalidateQueries({queryKey:["gallery",h,"images"]});case 6:window.navigator.vibrate&&window.navigator.vibrate([50,50,50]);case 7:return e.a(2)}},e,null,[[1,5]])}));return function(t){return e.apply(this,arguments)}}(),[J,h,F,w,C,_]),re=function(e){V(function(t){var n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ae=function(e){var t;y.setActiveModal("deleteImages",{images:[e],onClose:function(){return y.setActiveModal(null)},onConfirm:(t=(0,v.A)(Oe().m(function t(){return Oe().w(function(t){for(;;)switch(t.n){case 0:return M(function(t){return t.filter(function(t){return t.pid!==e.pid})}),t.n=1,w.invalidateQueries({queryKey:["gallery",h,"images"]});case 1:y.setActiveModal(null);case 2:return t.a(2)}},t)})),function(){return t.apply(this,arguments)}),title:(0,s.__)("Delete Video","nggallery"),singularLabel:(0,s.__)("video","nggallery"),pluralLabel:(0,s.__)("videos","nggallery")})},oe=function(){var e=(0,v.A)(Oe().m(function e(t,n){var r;return Oe().w(function(e){for(;;)switch(e.p=e.n){case 0:return Z(function(e){return new Set(e).add(t.pid)}),e.p=1,e.n=2,$.mutateAsync({imageId:t.pid,data:{exclude:n}});case 2:M(function(e){return e.map(function(e){return e.pid===t.pid?ke(ke({},e),{},{exclude:n}):e})}),_(n?(0,s.__)("Video hidden successfully","nggallery"):(0,s.__)("Video shown successfully","nggallery")),e.n=4;break;case 3:e.p=3,r=e.v,console.error("Error toggling video visibility:",r),C((0,s.__)("Failed to update video visibility","nggallery"));case 4:return e.p=4,Z(function(e){var n=new Set(e);return n.delete(t.pid),n}),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t,n){return e.apply(this,arguments)}}(),ie=q?F.find(function(e){return e.pid===q}):null;return i().createElement("div",{className:"space-y-6"},i().createElement(be,{integrationName:n}),i().createElement("hr",{className:"border-gray-200 my-6"}),i().createElement(ve,{integrationType:t,state:f,onUpdateField:p}),h&&i().createElement(i().Fragment,null,i().createElement("hr",{className:"border-gray-200 my-6"}),i().createElement("div",{className:"mt-8"},i().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-4"},(0,s.__)("Videos","nggallery")," (",F.length,")"),i().createElement("div",{className:"relative ".concat(S?"opacity-50":"")},i().createElement(fe.Mp,{sensors:ee,collisionDetection:fe.fp,onDragStart:function(e){U(e.active.id),window.navigator.vibrate&&window.navigator.vibrate(50)},onDragEnd:ne,measuring:{droppable:{strategy:fe.Pf.Always}}},i().createElement(pe.gB,{items:te,strategy:pe.kL},i().createElement("div",{className:"grid gap-4 sm:gap-6 grid-cols-2 sm:grid-cols-3 md:grid-cols-[repeat(auto-fill,_130px)]"},i().createElement(Pe,{onClick:function(){"pro"===P.WA?y.setActiveModal("addVideoLinks",{galleryId:h}):y.setActiveModal("upgrade",{feature:"Video Links"})}}),S?i().createElement("div",{className:"col-span-full text-center py-8 text-gray-500"},(0,s.__)("Loading videos...","nggallery")):0===F.length?i().createElement("div",{className:"col-span-full text-center py-8 text-gray-500"},(0,s.__)('No videos added yet. Click "Add Video Links" to get started.',"nggallery")):F.map(function(e){return i().createElement(Ce.A,{key:"".concat(e.pid,"-").concat(e.reloadKey||""),image:e,gallery:N,isSelected:K.has(e.pid),onSelect:re,onDelete:ae,isProcessing:Y.has(e.pid),onToggleVisibility:oe,isVideoGallery:!0})}))),i().createElement(fe.Hd,null,ie&&i().createElement("div",{className:"transform scale-105 opacity-90 pointer-events-none"},i().createElement(Ce.A,{image:ie,gallery:N,isSelected:K.has(ie.pid),onSelect:re,onDelete:ae,isProcessing:Y.has(ie.pid),onToggleVisibility:oe,isVideoGallery:!0}))))))))},Ie=function(e){var t=e.integrationType,n=e.galleryId,r=e.galleryTitle,a=e.onSuccess,o=e.externalSource,u=void 0===o?{}:o,m=e.defaultSettings,g=void 0===m?{}:m,f=e.onUpdate,p=function(e){var t=c(e);return t!==e?t:{video:"Video",other:"Other Source"}[e.toLowerCase()]||e.charAt(0).toUpperCase()+e.slice(1)}(t),h=t.toLowerCase(),y=function(){switch(h){case"dropbox":return i().createElement(R,{galleryId:n,galleryTitle:r,onSuccess:a});case"dribbble":return i().createElement(S,{integrationType:t,integrationName:p,externalSource:u,defaultSettings:g,onUpdate:f});case"tiktok":return i().createElement(ge,{integrationType:t,integrationName:p,externalSource:u,defaultSettings:g,onUpdate:f});case"google_photos":return i().createElement(ee,{integrationType:t,integrationName:p,galleryId:n,externalSource:u,defaultSettings:g,onUpdate:f});case"video":return i().createElement(Te,{integrationType:t,integrationName:p,externalSource:u,defaultSettings:g,onUpdate:f});default:return i().createElement("div",{className:"space-y-6"},i().createElement("p",{className:"text-sm text-gray-600"},(0,s.__)("Integration settings for","nggallery")," ",p," ",(0,s.__)("are not yet implemented.","nggallery")))}};return h in l?i().createElement(d,{addonId:h},y()):y()}},6418:(e,t,n)=>{"use strict";n.d(t,{q2:()=>g,uz:()=>m});var r=n(3453),a=n(4467),o=n(1609),i=n.n(o);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,a.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s=function(e){return e?{title:e.title||"",description:e.galdesc||"",display_type:e.display_type||"",display_type_settings:e.display_type_settings||{},settings:{gallery_display_type:e.display_type,gallery_override_global_settings:!1},imageSettings:{sortBy:"sortorder",sortOrder:"asc",selectedImages:[],searchQuery:""},isDirty:!1,lastSaved:new Date,dirtyFields:new Set}:{title:"",description:"",display_type:"",display_type_settings:{},settings:{},imageSettings:{sortBy:"sortorder",sortOrder:"asc",selectedImages:[],searchQuery:""},isDirty:!1,lastSaved:null,dirtyFields:new Set}},u=function(e,t){switch(t.type){case"INIT_FROM_GALLERY":case"RESET_TO_SAVED":return s(t.payload);case"UPDATE_FIELD":var n=t.payload,r=n.path,o=function(e,t,n){for(var r=t.split("."),a=c({},e),o=a,i=0;i<r.length-1;i++){var l=r[i];o[l]=o[l]?c({},o[l]):{},o=o[l]}return o[r[r.length-1]]=n,a}(e,r,n.value),i=new Set(e.dirtyFields);return i.add(r),c(c({},o),{},{isDirty:!0,dirtyFields:i});case"UPDATE_FIELDS":var l=new Set(e.dirtyFields);return Object.keys(t.payload).forEach(function(e){return l.add(e)}),c(c(c({},e),t.payload),{},{isDirty:!0,dirtyFields:l});case"UPDATE_DISPLAY_TYPE_SETTINGS":var u=t.payload,d=u.displayType,m=u.settings,g=c(c({},e.display_type_settings),{},(0,a.A)({},d,c(c({},e.display_type_settings[d]),m))),f=new Set(e.dirtyFields);return f.add("display_type_settings.".concat(d)),c(c({},e),{},{display_type_settings:g,isDirty:!0,dirtyFields:f});case"UPDATE_GALLERY_SETTINGS":var p=new Set(e.dirtyFields);return Object.keys(t.payload).forEach(function(e){return p.add("settings.".concat(e))}),c(c({},e),{},{settings:c(c({},e.settings),t.payload),isDirty:!0,dirtyFields:p});case"UPDATE_IMAGE_SETTINGS":return c(c({},e),{},{imageSettings:c(c({},e.imageSettings),t.payload)});case"MARK_CLEAN":return c(c({},e),{},{isDirty:!1,lastSaved:new Date,dirtyFields:new Set});default:return e}},d=(0,o.createContext)(null),m=function(e){var t=e.children,n=e.initialGallery,a=void 0===n?null:n,l=(0,o.useReducer)(u,null,function(){return s(a)}),c=(0,r.A)(l,2),m=c[0],g=c[1],f=(0,o.useState)(!1),p=(0,r.A)(f,2),h=p[0],y=p[1],v=(0,o.useRef)(new Map);(0,o.useEffect)(function(){a&&a.gid&&!m.lastSaved&&g({type:"INIT_FROM_GALLERY",payload:a})},[a,m.lastSaved]);var b=(0,o.useCallback)(function(e,t){g({type:"UPDATE_FIELD",payload:{path:e,value:t}})},[]),w=(0,o.useCallback)(function(e){g({type:"UPDATE_FIELDS",payload:e})},[]),x=(0,o.useCallback)(function(e,t){g({type:"UPDATE_DISPLAY_TYPE_SETTINGS",payload:{displayType:e,settings:t}})},[]),E=(0,o.useCallback)(function(e){g({type:"UPDATE_GALLERY_SETTINGS",payload:e})},[]),_=(0,o.useCallback)(function(e){g({type:"UPDATE_IMAGE_SETTINGS",payload:e})},[]),C=(0,o.useCallback)(function(e){g({type:"INIT_FROM_GALLERY",payload:e})},[]),N=(0,o.useCallback)(function(){g({type:"MARK_CLEAN"})},[]),k=(0,o.useCallback)(function(e){g({type:"RESET_TO_SAVED",payload:e})},[]),O=(0,o.useCallback)(function(){return Array.from(m.dirtyFields)},[m.dirtyFields]),A=(0,o.useCallback)(function(e){var t=e||m.display_type;return m.display_type_settings[t]||{}},[m.display_type_settings,m.display_type]),S=(0,o.useCallback)(function(){return A()},[A]),j=(0,o.useCallback)(function(e,t){v.current.set(e,t)},[]),P=(0,o.useCallback)(function(e){v.current.delete(e)},[]),T=(0,o.useCallback)(function(){v.current.forEach(function(e){try{e()}catch(e){console.error("Error flushing pending save:",e)}})},[]),I=(0,o.useMemo)(function(){return{state:m,updateField:b,updateFields:w,updateDisplayTypeSettings:x,updateGallerySettings:E,updateImageSettings:_,initFromGallery:C,markClean:N,resetToSaved:k,getDirtyFields:O,getDisplayTypeSettings:A,getCurrentDisplayTypeSettings:S,registerFlushCallback:j,unregisterFlushCallback:P,flushAllPendingSaves:T,isNextDisabled:h,setNextDisabled:y}},[m,b,w,x,E,_,C,N,k,O,A,S,j,P,T,h,y]);return i().createElement(d.Provider,{value:I},t)},g=function(){var e=(0,o.useContext)(d);if(!e)throw new Error("useGalleryForm must be used within a GalleryFormProvider. This indicates a component structure issue that should be fixed.");return e}},9238:(e,t,n)=>{"use strict";n.d(t,{A:()=>j});var r=n(8168),a=n(4467),o=n(467),i=n(3453),l=n(3627),c=n(4979),s=n(4848),u=n(7196),d=n(7723),m=n(1609),g=n.n(m);const f=function(e){var t=e.isOpen,n=e.onClose,r=e.image;if(!r)return null;var a=r.meta_data||{},o=function(e){return null==e||""===e?"N/A":"boolean"==typeof e?e?"Yes":"No":String(e)},i=[{tag:"Image ID",value:r.pid},{tag:"Image Width",value:a.width},{tag:"Image Height",value:a.height},{tag:"md5",value:a.md5}],l=[{tag:"Orientation",value:a.Orientation},{tag:"Camera",value:a.camera},{tag:"Aperture",value:a.aperture},{tag:"Focal Length",value:a.focal_length},{tag:"ISO",value:a.iso},{tag:"Shutter Speed",value:a.shutter_speed},{tag:"Flash",value:a.flash},{tag:"Created",value:a.created_timestamp?new Date(1e3*a.created_timestamp).toLocaleString():null}].filter(function(e){return null!==e.value&&void 0!==e.value&&""!==e.value&&!1!==e.value});return g().createElement(u.A,{isOpen:t,onClose:n,title:(0,d.__)("Show meta data","nggallery")},g().createElement("div",{className:"space-y-6"},g().createElement("div",null,g().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-4"},(0,d.__)("Meta Data","nggallery")),g().createElement("div",{className:"bg-gray-50 rounded-lg overflow-hidden"},g().createElement("table",{className:"min-w-full"},g().createElement("thead",{className:"bg-gray-100"},g().createElement("tr",null,g().createElement("th",{className:"px-4 py-3 text-left text-sm font-medium text-gray-700 w-1/3"},(0,d.__)("Tag","nggallery")),g().createElement("th",{className:"px-4 py-3 text-left text-sm font-medium text-gray-700"},(0,d.__)("Value","nggallery")))),g().createElement("tbody",{className:"divide-y divide-gray-200 bg-white"},i.map(function(e,t){return g().createElement("tr",{key:t,className:"bg-white"},g().createElement("td",{className:"px-4 py-3 text-sm text-gray-900 font-medium"},e.tag),g().createElement("td",{className:"px-4 py-3 text-sm text-gray-700"},o(e.value)))}))))),l.length>0&&g().createElement("div",null,g().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-4"},(0,d.__)("EXIF Data","nggallery")),g().createElement("div",{className:"bg-gray-50 rounded-lg overflow-hidden"},g().createElement("table",{className:"min-w-full"},g().createElement("thead",{className:"bg-gray-100"},g().createElement("tr",null,g().createElement("th",{className:"px-4 py-3 text-left text-sm font-medium text-gray-700 w-1/3"},(0,d.__)("Tag","nggallery")),g().createElement("th",{className:"px-4 py-3 text-left text-sm font-medium text-gray-700"},(0,d.__)("Value","nggallery")))),g().createElement("tbody",{className:"divide-y divide-gray-200 bg-white"},l.map(function(e,t){return g().createElement("tr",{key:t,className:"bg-white"},g().createElement("td",{className:"px-4 py-3 text-sm text-gray-900 font-medium"},e.tag),g().createElement("td",{className:"px-4 py-3 text-sm text-gray-700"},o(e.value)))}))))),0===l.length&&g().createElement("div",null,g().createElement("h3",{className:"text-lg font-semibold text-gray-900 mb-4"},(0,d.__)("EXIF Data","nggallery")),g().createElement("div",{className:"bg-gray-50 rounded-lg p-4"},g().createElement("p",{className:"text-sm text-gray-600 text-center"},(0,d.__)("No EXIF data available for this image.","nggallery"))))))};var p=n(6106),h=n(2724),y=n(2416),v=n(951),b=n(56),w=n(2549),x=n(1985),E=n(7665),_=n(7143);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach(function(t){(0,a.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function k(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return O(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(O(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,O(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,O(d,"constructor",s),O(s,"constructor",c),c.displayName="GeneratorFunction",O(s,a,"GeneratorFunction"),O(d),O(d,a,"Generator"),O(d,r,function(){return this}),O(d,"toString",function(){return"[object Generator]"}),(k=function(){return{w:o,m}})()}function O(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}O=function(e,t,n,r){function o(t,n){O(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},O(e,t,n,r)}var A=function(){return g().createElement("div",{className:"absolute inset-0 bg-white bg-opacity-60 flex items-center justify-center z-20"},g().createElement(p.Nl,{className:"animate-spin h-8 w-8 -mt-[48px] text-green-500"}))},S=(0,m.memo)(function(e){var t,n=e.image,a=e.gallery,u=e.isSelected,C=e.onSelect,O=e.onDelete,S=e.onRecover,j=e.onGenerateThumbnail,P=e.isProcessing,T=e.onToggleVisibility,I=e.isVideoGallery,D=void 0!==I&&I,L=(0,m.useState)(!1),R=(0,i.A)(L,2),F=R[0],M=R[1],G=(0,m.useState)(!1),Q=(0,i.A)(G,2),B=Q[0],q=Q[1],U=(0,m.useState)(!1),H=(0,i.A)(U,2),z=H[0],K=H[1],V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,t=(0,m.useState)(!1),n=(0,i.A)(t,2),r=n[0],a=n[1];return(0,m.useEffect)(function(){var t=function(){a(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),r}(),W=(0,_.useDispatch)(w.EF),X=(0,E.jE)(),Y=(0,h.iX)((null==a?void 0:a.gid)||null).data,Z=(0,h.Fv)(),J=(0,y.E)(),$=J.showSuccess,ee=J.showError,te=(0,m.useCallback)(function(){var e=(0,v.Qr)(n);e&&window.open(e,"_blank"),M(!1)},[n]),ne=(0,m.useCallback)((0,o.A)(k().m(function e(){var t,r,o,i,l,c,s;return k().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!==(t=n.meta_data)&&void 0!==t&&t._envira_cdn_id){e.n=1;break}return e.a(2);case 1:if(r=(0,v.Xb)(),o=(0,v.e3)(),r){e.n=2;break}return ee((0,d.__)("Authentication error","nggallery")),M(!1),e.a(2);case 2:return M(!1),e.p=3,e.n=4,fetch("".concat(o,"envira-cdn/v1/ngg-remove-image/").concat(n.pid),{method:"DELETE",headers:{"X-WP-Nonce":r}});case 4:if((i=e.v).ok){e.n=6;break}return e.n=5,i.json().catch(function(e){return console.error("Error parsing error response JSON:",e),{}});case 5:return l=e.v,console.error("CDN removal error:",l),ee((0,d.__)("Failed to remove image from CDN","nggallery")),e.a(2);case 6:return e.n=7,i.json();case 7:if(!(c=e.v).success){e.n=9;break}if($((0,d.__)("Image removed from CDN successfully","nggallery")),null==a||!a.gid){e.n=8;break}return e.n=8,X.invalidateQueries({queryKey:["gallery",a.gid,"images"]});case 8:e.n=10;break;case 9:ee(c.message||(0,d.__)("Failed to remove image from CDN","nggallery"));case 10:e.n=12;break;case 11:e.p=11,s=e.v,console.error("CDN removal error:",s),ee((0,d.__)("Error removing image from CDN","nggallery"));case 12:return e.a(2)}},e,null,[[3,11]])})),[n,null==a?void 0:a.gid,X,$,ee]),re=(null==n?void 0:n.pid)||0,ae=(0,l.gl)({id:re,transition:{duration:150,easing:"cubic-bezier(0.25, 1, 0.5, 1)"}}),oe=ae.attributes,ie=ae.listeners,le=ae.setNodeRef,ce=ae.transform,se=ae.transition,ue=ae.isDragging;if(!n||null==n||!n.pid||"number"!=typeof n.pid)return null;if(null==n||!n.filename||null==a||!a.path)return null;var de={transform:c.Ks.Transform.toString(ce),transition:se,opacity:ue?.5:1,touchAction:"none",willChange:"transform, opacity",pointerEvents:P?"none":void 0},me=function(){var e=(0,o.A)(k().m(function e(){return k().w(function(e){for(;;)switch(e.n){case 0:if(!S){e.n=1;break}return e.n=1,S(n.pid);case 1:M(!1);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),ge=V||B||u,fe=function(){var e=(0,o.A)(k().m(function e(){var t;return k().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Z.mutateAsync({galleryId:a.gid,imageId:n.pid});case 1:$((0,d.__)("Gallery thumbnail updated successfully","nggallery")),e.n=3;break;case 2:e.p=2,t=e.v,console.error("Error setting gallery thumbnail:",t),ee((0,d.__)("Failed to update gallery thumbnail","nggallery"));case 3:M(!1);case 4:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),pe=(null===(t=Y||a)||void 0===t?void 0:t.previewpic)===n.pid;return g().createElement("div",{className:(0,b.cn)("relative w-full sm:w-full md:w-[130px]",P&&"opacity-50")},g().createElement("div",{ref:le,style:de,className:(0,b.cn)("relative bg-white rounded-lg will-change-transform",ue&&"z-10 shadow-xl ring-2 ring-green-500"),"data-testid":"sortable-image-".concat(n.pid),onMouseEnter:function(){return q(!0)},onMouseLeave:function(){V||(q(!1),M(!1))},onTouchStart:function(){q(!0)}},P&&g().createElement(A,null),!D&&g().createElement("div",{className:"absolute top-2 left-2 z-20"},g().createElement("input",{title:(0,d.__)("Select image","nggallery"),type:"checkbox",checked:u,onChange:function(){return C(n.pid)},onClick:function(e){return e.stopPropagation()},className:(0,b.cn)("rounded border-gray-300 w-5 h-5 md:w-4 md:h-4 text-green-600 focus:ring-green-500 focus:ring-2",P?"cursor-not-allowed":"cursor-pointer"),disabled:P})),g().createElement("div",{className:(0,b.cn)("absolute top-2 right-2 z-20",P?"cursor-not-allowed":"cursor-pointer")},g().createElement(s.m,{isOpen:F,onClose:function(){M(!1)},onToggle:function(){M(!F)},trigger:g().createElement("button",{title:(0,d.__)("Actions","nggallery"),className:(0,b.cn)("bg-transparent p-2 md:p-1 hover:bg-opacity-80 focus:outline-none",P?"cursor-not-allowed":"cursor-pointer"),onClick:function(e){e.stopPropagation(),e.preventDefault(),M(!F)},disabled:P},g().createElement("svg",{className:"w-6 h-6 md:w-5 md:h-5 text-white hover:text-gray-300",viewBox:"0 0 20 20",fill:"currentColor"},g().createElement("path",{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"})))},g().createElement("div",{className:"py-1"},g().createElement("button",{onClick:function(){W.setActiveModal("editImage",{image:n}),M(!1),q(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("Edit Details","nggallery")),!D&&g().createElement("button",{onClick:function(){W.setActiveModal("imageView",{image:{filename:n.filename,alttext:n.alttext,galleryPath:(null==a?void 0:a.path)||"",pid:n.pid,galleryid:n.galleryid,image_url:n.image_url}}),M(!1),q(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("Edit Image","nggallery")),D&&g().createElement("button",{onClick:function(){W.setActiveModal("editVideo",{image:n}),M(!1),q(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("Edit Video","nggallery")),g().createElement("button",{onClick:function(){K(!0),M(!1),q(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("View Meta","nggallery")),g().createElement("button",{onClick:function(){O(n),M(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-red-600 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},D?(0,d.__)("Delete Video","nggallery"):(0,d.__)("Delete Image","nggallery")),!D&&g().createElement("button",{onClick:me,className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("Recover from Backup","nggallery")),!D&&j&&g().createElement("button",{onClick:function(){j(n.pid),M(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},(0,d.__)("Generate Thumbnail","nggallery")),g().createElement("button",{onClick:fe,className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-100",P||pe?"cursor-not-allowed":"cursor-pointer"),disabled:P||pe},pe?(0,d.__)("Current Preview Thumbnail","nggallery"):(0,d.__)("Set as Preview Thumbnail","nggallery")),g().createElement("button",{onClick:function(e){e.stopPropagation(),T(n,!n.exclude),M(!1),q(!1)},className:(0,b.cn)("block w-full text-left px-4 py-1.5 text-sm hover:bg-gray-100",n.exclude?"text-blue-600":"text-gray-700",P?"cursor-not-allowed":"cursor-pointer"),disabled:P},n.exclude?(0,d.__)("Show Image","nggallery"):(0,d.__)("Hide Image","nggallery")),(0,v.tC)()&&(0,v.at)(n)&&g().createElement(g().Fragment,null,g().createElement("button",{onClick:te,className:"block w-full text-left px-4 py-1.5 text-sm text-blue-600 hover:bg-gray-100 cursor-pointer"},(0,d.__)("View CDN URL","nggallery")),g().createElement("button",{onClick:ne,className:"block w-full text-left px-4 py-1.5 text-sm text-orange-600 hover:bg-gray-100 cursor-pointer"},(0,d.__)("Remove from CDN","nggallery")))))),g().createElement("div",{className:"overflow-hidden rounded-lg bg-gray-100 flex items-center justify-center relative cursor-pointer w-full h-[100px] sm:h-[120px] md:w-[130px] md:h-[90px]",onClick:function(e){e.stopPropagation(),W.setActiveModal("galleryImageView",{image:{filename:n.filename,alttext:n.alttext,galleryPath:(null==a?void 0:a.path)||"",pid:n.pid},galleryId:null==a?void 0:a.gid})}},g().createElement("img",{src:(0,x.s)(n.thumb_url,n.reloadKey),alt:n.alttext||"",className:(0,b.cn)("w-full h-full object-cover cursor-pointer",n.exclude&&"opacity-50 grayscale"),loading:"lazy",draggable:!1}),n.exclude&&g().createElement("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-30"},g().createElement("div",{className:"bg-gray-600 text-white text-xs px-2 py-1 rounded font-medium shadow-lg"},(0,d.__)("Hidden","nggallery"))),ge&&g().createElement("div",{className:"absolute inset-0 bg-black bg-opacity-60 flex items-center justify-center z-10 transition-opacity"})),g().createElement("div",{className:"mt-2 px-1"},g().createElement("div",{className:"flex items-center justify-between"},g().createElement("p",{className:"text-sm text-gray-900 truncate flex-1 mr-2",title:n.alttext||n.filename},n.alttext||n.filename),g().createElement("button",(0,r.A)({},P?{}:N(N({},oe),ie),{className:(0,b.cn)("flex-shrink-0 text-gray-100 p-1 rounded hover:bg-gray-100",P?"cursor-not-allowed opacity-50":"cursor-move"),disabled:P,title:(0,d.__)("Drag to reorder","nggallery")}),g().createElement(p.GG,{className:"text-gray-500"}))),n.tags&&n.tags.length>0&&g().createElement("div",{className:"mt-1 flex flex-nowrap gap-1 overflow-hidden"},function(){for(var e=0,t=[],r=0;r<n.tags.length;r++){var a=n.tags[r],o=a.length+2;if(e+o>15)break;t.push(a),e+=o}var i=n.tags.length-t.length;return g().createElement(g().Fragment,null,t.map(function(e,t){return g().createElement("span",{key:t,className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-700 flex-shrink-0",title:e},e)}),i>0&&g().createElement("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-700 flex-shrink-0"},"+",i))}()))),g().createElement(f,{isOpen:z,onClose:function(){return K(!1)},image:n}))});S.displayName="SortableImage";const j=S},3140:(e,t,n)=>{"use strict";n.d(t,{_S:()=>d,xT:()=>m});var r=n(467),a=n(4540),o=n(7286),i=n(1455),l=n.n(i);function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,u=Object.create(c.prototype);return s(u,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),u}var i={};function l(){}function u(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),g=d.prototype=l.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e}return u.prototype=d,s(g,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,a,"GeneratorFunction"),s(g),s(g,a,"Generator"),s(g,r,function(){return this}),s(g,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:f}})()}function s(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}s=function(e,t,n,r){function o(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},s(e,t,n,r)}var u={addonStates:["addons","states"]},d=function(){return(0,o.I)({queryKey:u.addonStates,queryFn:(e=(0,r.A)(c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return t=(0,a.m9)(),e.n=1,l()({path:"/imagely/v1/addons",method:"GET",headers:{"X-WP-Nonce":t}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),staleTime:3e5,gcTime:6e5});var e},m=function(e){var t,n=d(),r=n.data,a=n.isLoading,o=n.isError;return{isEnabled:!(null==r||null===(t=r.enabled_addons)||void 0===t||!t[e]),isLoading:a,isError:o}}},3155:(e,t,n)=>{"use strict";n.d(t,{$U:()=>h,dF:()=>b,sR:()=>w,uI:()=>y,vr:()=>v,wY:()=>x});var r=n(467),a=n(7665),o=n(7286),i=n(6475),l=n(7097),c=n(1455),s=n.n(c),u=n(1609),d=n.n(u),m=n(4540);function g(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return f(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,f(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,f(d,"constructor",s),f(s,"constructor",c),c.displayName="GeneratorFunction",f(s,a,"GeneratorFunction"),f(d),f(d,a,"Generator"),f(d,r,function(){return this}),f(d,"toString",function(){return"[object Generator]"}),(g=function(){return{w:o,m}})()}function f(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}var p=function(e){return["album",e]},h=function(e){var t,n=d().useMemo(function(){return p(e)},[e]),i=(0,a.jE)().getQueryState(n),l="error"===(null==i?void 0:i.status);return(0,o.I)({queryKey:n,queryFn:(t=(0,r.A)(g().m(function t(){var n,r;return g().w(function(t){for(;;)switch(t.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,t.n=1,s()({path:"/imagely/v1/albums/".concat(e),method:"GET",headers:{"X-WP-Nonce":r}});case 1:return t.a(2,t.v)}},t)})),function(){return t.apply(this,arguments)}),enabled:!!e&&!l,staleTime:12e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!1})},y=function(e){var t,n=new URLSearchParams;return null!=e&&e.get_all?n.append("per_page","-1"):(null!=e&&e.page&&n.append("page",e.page.toString()),null!=e&&e.per_page&&n.append("per_page",e.per_page.toString())),null!=e&&e.search&&n.append("search",e.search),null!=e&&e.sort&&n.append("orderby",e.sort),null!=e&&e.order&&n.append("order",e.order),(0,o.I)({queryKey:["albums",e],queryFn:(t=(0,r.A)(g().m(function t(){var r,a,o,i,l,c,s;return g().w(function(t){for(;;)switch(t.n){case 0:return r="/imagely/v1/albums".concat(n.toString()?"?".concat(n.toString()):""),t.n=1,(0,m.RW)(r);case 1:return a=t.v,o=a.data,i=a.headers,l=(null==e?void 0:e.page)||1,c=null!=e&&e.get_all?i.total:(null==e?void 0:e.per_page)||20,s={albums:o,pagination:{total:i.total,total_pages:i.totalPages,per_page:c,current_page:l}},t.a(2,s)}},t)})),function(){return t.apply(this,arguments)}),staleTime:3e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!0,refetchOnMount:!1,placeholderData:function(e){return e}})},v=function(){var e,t,n,a,o,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=(0,i.q)({queryKey:["albums","loadMore",l,c],queryFn:(o=(0,r.A)(g().m(function e(t){var n,r,a,o,i;return g().w(function(e){for(;;)switch(e.n){case 0:return n=t.pageParam,r=c?"&search=".concat(encodeURIComponent(c)):"",e.n=1,(0,m.RW)("/imagely/v1/albums?page=".concat(n,"&per_page=").concat(l).concat(r));case 1:return a=e.v,o=a.data,i=a.headers,e.a(2,{albums:o,total_pages:i.totalPages,total:i.total})}},e)})),function(e){return o.apply(this,arguments)}),initialPageParam:1,getNextPageParam:function(e,t,n){return n<e.total_pages?n+1:void 0},staleTime:3e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!0,refetchOnMount:!1});return{albums:null!==(e=null===(t=s.data)||void 0===t||null===(t=t.pages)||void 0===t?void 0:t.flatMap(function(e){return e.albums}))&&void 0!==e?e:[],total:null!==(n=null===(a=s.data)||void 0===a||null===(a=a.pages)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.total)&&void 0!==n?n:0,isLoading:s.isLoading,isFetchingMore:s.isFetchingNextPage,hasMore:s.hasNextPage,loadMore:s.fetchNextPage}},b=function(){var e,t=(0,a.jE)();return(0,l.n)({mutationFn:(e=(0,r.A)(g().m(function e(t){var n,r,a;return g().w(function(e){for(;;)switch(e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,s()({path:"/imagely/v1/albums",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:t});case 1:return a=e.v,e.a(2,a)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["albums"]})}})},w=function(){var e,t=(0,a.jE)();return(0,l.n)({mutationFn:(e=(0,r.A)(g().m(function e(t){var n,r,a,o,i;return g().w(function(e){for(;;)switch(e.n){case 0:return r=t.id,a=t.data,o=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,s()({path:"/imagely/v1/albums/".concat(r),method:"PUT",headers:{"X-WP-Nonce":o,"Content-Type":"application/json"},data:a});case 1:return i=e.v,e.a(2,i.album)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e,n){var r=n.id;t.setQueryData(p(r),e),t.invalidateQueries({queryKey:["albums"]})}})},x=function(){var e,t=(0,a.jE)();return(0,l.n)({mutationFn:(e=(0,r.A)(g().m(function e(t){var n,r,a,o;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.p=1,e.n=2,s()({path:"/imagely/v1/albums/".concat(t),method:"DELETE",headers:{"X-WP-Nonce":r}});case 2:e.n=5;break;case 3:if(e.p=3,404!==(null==(o=e.v)?void 0:o.status)&&404!==(null==o||null===(a=o.response)||void 0===a?void 0:a.status)){e.n=4;break}return console.warn("Album ".concat(t," already deleted or doesn't exist")),e.a(2);case 4:throw o;case 5:return e.a(2)}},e,null,[[1,3]])})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["albums"]})}})}},1313:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(1609),a=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,r.useRef)(null);return(0,r.useEffect)(function(){if(t){var r=function(t){var r=null==n?void 0:n.current;r&&!r.contains((null==t?void 0:t.target)||null)&&e(t)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),function(){document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}}},[n,e,t]),n}},2026:(e,t,n)=>{"use strict";n.d(t,{aN:()=>y,LX:()=>p,Di:()=>h,f8:()=>g});var r=n(3453),a=n(1609),o=n(467),i=n(7286),l=n(1455),c=n.n(l);function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return u(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),g=d.prototype=l.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e}return c.prototype=d,u(g,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(g),u(g,a,"Generator"),u(g,r,function(){return this}),u(g,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:f}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}var d={currencies:["currencies"],countries:["countries"],currency:function(e){return["currencies",e]}},m=n(7374),g=function(){var e,t=(0,i.I)({queryKey:d.currencies,queryFn:(e=(0,o.A)(s().m(function e(){var t,n,r;return s().w(function(e){for(;;)switch(e.n){case 0:return n=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce,e.n=1,c()({path:"/imagely/v1/currencies",method:"GET",headers:{"X-WP-Nonce":n}});case 1:if((r=e.v).success){e.n=2;break}throw new Error("Failed to fetch currencies");case 2:return e.a(2,r.data)}},e)})),function(){return e.apply(this,arguments)}),staleTime:18e5,gcTime:36e5}).data,n=(0,m.UG)().data;return(0,a.useMemo)(function(){var e,r;if(!t||!n)return"$";var a=n.ecommerce_currency,o=String(a),i=t.find(function(e){return("number"==typeof e.id?e.id:Number(e.id))===Number(o)||e.id===o});return i||(i=t.find(function(e){return e.code===o})),null!==(e=i)&&void 0!==e&&e.symbol?f(i.symbol):(null===(r=i)||void 0===r?void 0:r.code)||"$"},[t,n])},f=function(e){if(!e)return"$";var t=e;if(Object.entries({"€":"€","£":"£","¥":"¥","₹":"₹","₽":"₽","₪":"₪","₩":"₩","฿":"฿","₫":"₫","₮":"₮","₭":"₭"}).forEach(function(e){var n=(0,r.A)(e,2),a=n[0],o=n[1];t=t.replace(new RegExp(a,"g"),o)}),t.includes("&#"))try{var n=document.createElement("div");n.innerHTML=t;var a=n.textContent||n.innerText||t;a!==t&&(t=a)}catch(e){console.warn("Failed to decode HTML entity:",t)}return t},p=function(e){var t=e.length;return{left:t<=1?"pl-10":t<=2?"pl-12":t<=3?"pl-14":"pl-16",right:"pr-3"}},h=function(e){var t=e.length;return t<=1||t<=2?"left-3":"left-4"},y=function(e){if("number"==typeof e)return e;var t=e;if(e.match(/^&#\d+;$/)){var n=e.match(/&#(\d+);/);if(n){var r=parseInt(n[1],10);if(r>65535)return r}}if(e.includes("&#"))try{var a=document.createElement("div");a.innerHTML=e,t=a.textContent||a.innerText||e}catch(n){t=e.replace(/&#\d+;/g,"").trim()}var o=t.match(/[\d.]+/);return o?parseFloat(o[0]):0}},2724:(e,t,n)=>{"use strict";n.d(t,{AO:()=>M,BD:()=>$,BZ:()=>S,CD:()=>Z,Fv:()=>Q,G5:()=>te,GR:()=>q,Hh:()=>X,MJ:()=>P,NK:()=>oe,PQ:()=>re,Rg:()=>z,T8:()=>Y,TG:()=>B,Vg:()=>ae,b6:()=>O,cX:()=>ne,dj:()=>ee,fZ:()=>W,gj:()=>F,hW:()=>R,iX:()=>T,jz:()=>D,ln:()=>G,mQ:()=>K,qZ:()=>L,qr:()=>J,rk:()=>A,rv:()=>j,sr:()=>V,yr:()=>I});var r=n(45),a=n(3453),o=n(2284),i=n(4467),l=n(5458),c=n(467),s=n(2416),u=n(7665),d=n(7286),m=n(6475),g=n(7097),f=n(1455),p=n.n(f),h=n(7723),y=n(1609),v=n.n(y),b=n(4540),w=["pid"];function x(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return k(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(k(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,k(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,k(d,"constructor",s),k(s,"constructor",c),c.displayName="GeneratorFunction",k(s,a,"GeneratorFunction"),k(d),k(d,a,"Generator"),k(d,r,function(){return this}),k(d,"toString",function(){return"[object Generator]"}),(N=function(){return{w:o,m}})()}function k(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}k=function(e,t,n,r){function o(t,n){k(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},k(e,t,n,r)}var O={gallery:function(e){return["gallery",e]},galleries:function(e){return["galleries",e]},galleryImages:function(e){return["gallery",e,"images"]}},A=function(e){if(!e)return!1;var t=e.external_source||{};return!(!t.tiktok_account&&"tiktok"!==t.type)},S=function(e){if(!e)return!1;var t=e.external_source||{};return!(!t.dribbble_account&&"dribbble"!==t.type)},j=function(e){return A(e)||S(e)},P=function(e){var t=(0,u.jE)();v().useEffect(function(){return function(){e&&t.refetchQueries({queryKey:["galleries"]})}},[e,t])},T=function(e){var t,n=v().useMemo(function(){return O.gallery(null!=e?e:0)},[e]),r=(0,u.jE)().getQueryState(n),a="error"===(null==r?void 0:r.status);return(0,d.I)({queryKey:n,queryFn:(t=(0,c.A)(N().m(function t(){return N().w(function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}throw new Error("Gallery ID is required");case 1:return t.n=2,p()({path:"/imagely/v1/galleries/".concat(e),method:"GET",headers:(0,b.kX)()});case 2:return t.a(2,t.v)}},t)})),function(){return t.apply(this,arguments)}),enabled:!!e&&!a,staleTime:12e4,gcTime:6e5,retry:0,throwOnError:!1})},I=function(e){var t,n=new URLSearchParams;return null!=e&&e.get_all?n.append("per_page","-1"):(null!=e&&e.page&&n.append("page",e.page.toString()),null!=e&&e.per_page&&n.append("per_page",e.per_page.toString())),null!=e&&e.search&&n.append("search",e.search),null!=e&&e.sort&&n.append("orderby",e.sort),null!=e&&e.order&&n.append("order",e.order),(0,d.I)({queryKey:["galleries",e],queryFn:(t=(0,c.A)(N().m(function t(){var r,a,o,i,l,c,s,u;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,r="/imagely/v1/galleries".concat(n.toString()?"?".concat(n.toString()):""),t.n=1,(0,b.RW)(r);case 1:return a=t.v,o=a.data,i=a.headers,l=(null==e?void 0:e.page)||1,c=null!=e&&e.get_all?i.total:(null==e?void 0:e.per_page)||20,s={galleries:o,pagination:{total:i.total,total_pages:i.totalPages,per_page:c,current_page:l}},t.a(2,s);case 2:throw t.p=2,u=t.v,console.error("Failed to fetch galleries:",u),u;case 3:return t.a(2)}},t,null,[[0,2]])})),function(){return t.apply(this,arguments)}),staleTime:3e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!0,refetchOnMount:!1,placeholderData:function(e){return e}})},D=function(){var e,t,n,r,a,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=(0,m.q)({queryKey:["galleries","loadMore",o,i],queryFn:(a=(0,c.A)(N().m(function e(t){var n,r,a,l,c;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.pageParam,r=i?"&search=".concat(encodeURIComponent(i)):"",e.n=1,(0,b.RW)("/imagely/v1/galleries?page=".concat(n,"&per_page=").concat(o).concat(r));case 1:return a=e.v,l=a.data,c=a.headers,e.a(2,{galleries:l,total_pages:c.totalPages,total:c.total})}},e)})),function(e){return a.apply(this,arguments)}),initialPageParam:1,getNextPageParam:function(e,t,n){return n<e.total_pages?n+1:void 0},staleTime:3e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!0,refetchOnMount:!1});return{galleries:null!==(e=null===(t=l.data)||void 0===t||null===(t=t.pages)||void 0===t?void 0:t.flatMap(function(e){return e.galleries}))&&void 0!==e?e:[],total:null!==(n=null===(r=l.data)||void 0===r||null===(r=r.pages)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.total)&&void 0!==n?n:0,isLoading:l.isLoading,isFetchingMore:l.isFetchingNextPage,hasMore:l.hasNextPage,loadMore:l.fetchNextPage}},L=function(e,t){var n,r=(t||{}).enabled,a=void 0===r||r;return(0,d.I)({queryKey:["galleries","batch",e.sort().join(",")],queryFn:(n=(0,c.A)(N().m(function t(){var n,r,a,o,i,c,s,u,d,m;return N().w(function(t){for(;;)switch(t.n){case 0:if(e&&0!==e.length){t.n=1;break}return t.a(2,[]);case 1:if(r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,!(e.length<=100)){t.n=3;break}return t.n=2,p()({path:"/imagely/v1/galleries/batch",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:{ids:e}});case 2:return a=t.v,t.a(2,Array.isArray(a)?a:[]);case 3:for(o=[],i=0;i<e.length;i+=100)o.push(e.slice(i,i+100));c=[],s=0,u=o;case 4:if(!(s<u.length)){t.n=7;break}return d=u[s],t.n=5,p()({path:"/imagely/v1/galleries/batch",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:{ids:d}});case 5:m=t.v,Array.isArray(m)&&c.push.apply(c,(0,l.A)(m));case 6:s++,t.n=4;break;case 7:return t.a(2,c)}},t)})),function(){return n.apply(this,arguments)}),enabled:a&&e.length>0,staleTime:12e4,gcTime:6e5,retry:0,throwOnError:!1})};function R(){var e,t,n=(0,u.jE)();return(0,g.n)({mutationFn:(t=(0,c.A)(N().m(function e(t){var n,r,a,o;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.id,r=t.data,a=C({},r),e.n=1,p()({path:"/imagely/v1/galleries/".concat(n),method:"PUT",headers:(0,b.kX)(),data:a});case 1:return o=e.v,e.a(2,o)}},e)})),function(e){return t.apply(this,arguments)}),onMutate:(e=(0,c.A)(N().m(function e(t){var r,a,o;return N().w(function(e){for(;;)switch(e.n){case 0:return r=t.id,a=t.data,e.n=1,n.cancelQueries({queryKey:O.gallery(r)});case 1:return(o=n.getQueryData(O.gallery(r)))&&n.setQueryData(O.gallery(r),C(C({},o),a)),e.a(2,{previousGallery:o})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,r){var a=t.id;null!=r&&r.previousGallery&&n.setQueryData(O.gallery(a),r.previousGallery)},onSettled:function(e,t,r){var a=r.id;n.invalidateQueries({queryKey:O.gallery(a)}),n.invalidateQueries({queryKey:["galleries"]})}})}var F=function(e,t){var n,r=t||{},a=r.per_page,i=void 0===a?-1:a,s=r.page,u=void 0===s?1:s,m=r.enabled,g=void 0===m||m,f=v().useMemo(function(){return[].concat((0,l.A)(O.galleryImages(e)),[i,u])},[e,i,u]),p=(0,d.I)({queryKey:f,queryFn:(n=(0,c.A)(N().m(function t(){var n,r,a,c,s,d;return N().w(function(t){for(;;)switch(t.n){case 0:return n=new URLSearchParams({gallery_id:e.toString(),per_page:i.toString(),page:u.toString(),orderby:"sortorder",order:"ASC"}),t.n=1,(0,b.RW)("/imagely/v1/images?".concat(n.toString()));case 1:return r=t.v,a=r.data,c=r.headers,s=Array.isArray(a)?a:a&&"object"===(0,o.A)(a)&&"images"in a&&a.images||[],d=(0,l.A)(s).sort(function(e,t){return e.sortorder-t.sortorder}).map(function(e){return C(C({},e),{},{reloadKey:e.updated_at})}),t.a(2,{images:d,pagination:{total:c.total,total_pages:c.totalPages,per_page:-1===i?c.total:i,current_page:u}})}},t)})),function(){return n.apply(this,arguments)}),enabled:!!e&&g,staleTime:6e4,gcTime:6e5,retry:0,throwOnError:!1});return p},M=function(){var e,t,n=(0,u.jE)();return(0,g.n)({mutationFn:(t=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=C(C({},t),{},{is_ecommerce_enabled:t.is_ecommerce_enabled,is_private:void 0!==t.is_private?t.is_private?1:0:void 0}),e.n=1,p()({path:"/imagely/v1/galleries",method:"POST",headers:(0,b.kX)(),data:n});case 1:return e.a(2,e.v)}},e)})),function(e){return t.apply(this,arguments)}),onMutate:(e=(0,c.A)(N().m(function e(t){var r;return N().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.cancelQueries({queryKey:["galleries"]});case 1:return r=n.getQueriesData({queryKey:["galleries"]}),n.setQueriesData({queryKey:["galleries"]},function(e){if(null!=e&&e.galleries){var n={id:Date.now(),galleryTitle:t.title||t.name||"New Gallery",thumbnail:"",shortcode:'[ngg id="'.concat(Date.now(),'"]'),count:0,eCommerce:"1"===t.is_ecommerce_enabled,is_private:t.is_private||!1,created:(new Date).toLocaleDateString(),modified:(new Date).toLocaleDateString()};return C(C({},e),{},{galleries:[n].concat((0,l.A)(e.galleries)),pagination:C(C({},e.pagination),{},{total:e.pagination.total+1})})}return e}),e.a(2,{previousGalleries:r})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,r){null!=r&&r.previousGalleries&&r.previousGalleries.forEach(function(e){var t=(0,a.A)(e,2),r=t[0],o=t[1];n.setQueryData(r,o)})},onSuccess:function(e){n.setQueriesData({queryKey:["galleries"]},function(t){return null!=t&&t.galleries?C(C({},t),{},{galleries:t.galleries.map(function(t){return t.id===e.gid||t.galleryTitle===e.title?{id:e.gid,galleryTitle:e.title,thumbnail:e.previewpic_url||"",shortcode:'[ngg id="'.concat(e.gid,'"]'),count:0,eCommerce:"1"===e.is_ecommerce_enabled,is_private:e.is_private,created:e.date_created,modified:e.date_modified}:t})}):t})},onSettled:function(){n.invalidateQueries({queryKey:["galleries"]})}})},G=function(){var e,t,n=(0,u.jE)();return(0,g.n)({mutationFn:(t=(0,c.A)(N().m(function e(t){var n,r,a;return N().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p()({path:"/imagely/v1/galleries/".concat(t),method:"DELETE",headers:(0,b.kX)()});case 1:e.n=4;break;case 2:if(e.p=2,404!==(null==(a=e.v)?void 0:a.status)&&404!==(null==a||null===(n=a.data)||void 0===n?void 0:n.status)&&404!==(null==a||null===(r=a.response)||void 0===r?void 0:r.status)){e.n=3;break}return console.warn("Gallery ".concat(t," already deleted or doesn't exist")),e.a(2);case 3:throw console.error("Error deleting gallery ".concat(t,":"),a),a;case 4:return e.a(2)}},e,null,[[0,2]])})),function(e){return t.apply(this,arguments)}),onMutate:(e=(0,c.A)(N().m(function e(t){var r;return N().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.cancelQueries({queryKey:["galleries"]});case 1:return r=n.getQueriesData({queryKey:["galleries"]}),n.setQueriesData({queryKey:["galleries"]},function(e){return null!=e&&e.galleries?C(C({},e),{},{galleries:e.galleries.filter(function(e){return e.id!==t}),pagination:C(C({},e.pagination),{},{total:Math.max(0,e.pagination.total-1)})}):e}),e.a(2,{previousGalleries:r})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,r){var o;404!==(null==e?void 0:e.status)&&404!==(null==e||null===(o=e.response)||void 0===o?void 0:o.status)&&null!=r&&r.previousGalleries&&r.previousGalleries.forEach(function(e){var t=(0,a.A)(e,2),r=t[0],o=t[1];n.setQueryData(r,o)})},onSettled:function(e,t){var r;(!t||404!==(null==t?void 0:t.status)&&404!==(null==t||null===(r=t.response)||void 0===r?void 0:r.status))&&n.invalidateQueries({queryKey:["galleries"]})}})},Q=function(){var e,t,n=(0,u.jE)();return(0,g.n)({mutationFn:(t=(0,c.A)(N().m(function e(t){var n,r;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.galleryId,r=t.imageId,e.n=1,p()({path:"/imagely/v1/galleries/".concat(n),method:"PUT",headers:(0,b.kX)(),data:{previewpic:r}});case 1:return e.a(2,e.v)}},e)})),function(e){return t.apply(this,arguments)}),onMutate:(e=(0,c.A)(N().m(function e(t){var r,a,o;return N().w(function(e){for(;;)switch(e.n){case 0:return r=t.galleryId,a=t.imageId,e.n=1,n.cancelQueries({queryKey:O.gallery(r)});case 1:return(o=n.getQueryData(O.gallery(r)))&&n.setQueryData(O.gallery(r),C(C({},o),{},{previewpic:a})),e.a(2,{previousGallery:o})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,r){var a=t.galleryId;null!=r&&r.previousGallery&&n.setQueryData(O.gallery(a),r.previousGallery)},onSettled:function(e,t,r){var a=r.galleryId;n.invalidateQueries({queryKey:O.gallery(a)}),n.invalidateQueries({queryKey:["galleries"]})}})},B=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.images,e.n=1,p()({path:"/imagely/v1/images/bulk",method:"PUT",headers:(0,b.kX)(),data:{images:n}});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSettled:function(){t.invalidateQueries({queryKey:["gallery"]})}})},q=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,a;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.pid,a=(0,r.A)(t,w),e.n=1,p()({path:"/imagely/v1/images/".concat(n,"/move"),method:"POST",headers:(0,b.kX)(),data:a});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSettled:function(e,n,r){t.invalidateQueries({queryKey:O.galleryImages(r.gallery_id)})}})},U=function(){var e=(0,c.A)(N().m(function e(t){var n,r;return N().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p()({path:"/imagely/v1/images?gallery_id=".concat(t,"&per_page=999999"),method:"GET",headers:(0,b.kX)()});case 1:return n=e.v,e.a(2,Array.isArray(n)?n.map(function(e){return e.pid}):[]);case 2:throw e.p=2,r=e.v,console.error("Error fetching image IDs for gallery ".concat(t,":"),r),new Error("Failed to fetch image IDs for gallery ".concat(t,": ").concat(r instanceof Error?r.message:String(r)));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),H=function(){var e=(0,c.A)(N().m(function e(t){var n,r,a,o,i,c,s;return N().w(function(e){for(;;)switch(e.p=e.n){case 0:n=[],r=x(t),e.p=1,r.s();case 2:if((a=r.n()).done){e.n=7;break}return o=a.value,e.p=3,e.n=4,U(o);case 4:i=e.v,n.push.apply(n,(0,l.A)(i)),e.n=6;break;case 5:e.p=5,c=e.v,console.error("Error fetching images for gallery ".concat(o,":"),c);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,s=e.v,r.e(s);case 9:return e.p=9,r.f(),e.f(9);case 10:return e.a(2,n)}},e,null,[[3,5],[1,8,9,10]])}));return function(t){return e.apply(this,arguments)}}(),z=function(){var e,t=(0,u.jE)(),n=(0,b.XJ)("create-thumbnail");return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var r,a,o,i,l,c,s,u,d,m,g;return N().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.galleryIds,a=t.width,o=t.height,i=t.fixDimension,l=t.onProgress,e.n=1,H(r);case 1:c=e.v,s=c.length,u=0,d=0,m=0;case 2:if(!(m<c.length)){e.n=8;break}return e.p=3,e.n=4,n(c[m],{width:a,height:o,fix_dimension:i});case 4:u++,e.n=6;break;case 5:e.p=5,g=e.v,console.error("Failed to generate thumbnail for image ".concat(c[m],":"),g),d++;case 6:l&&l(m+1,s);case 7:m++,e.n=2;break;case 8:return e.a(2,{successCount:u,failureCount:d,total:s})}},e,null,[[3,5]])})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["gallery"]})}})},K=function(){var e,t=(0,u.jE)(),n=(0,b.XJ)("resize");return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var r,a,o,i,l,c,s,u,d,m;return N().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=t.galleryIds,a=t.width,o=t.height,i=t.onProgress,e.n=1,H(r);case 1:l=e.v,c=l.length,s=0,u=0,d=0;case 2:if(!(d<l.length)){e.n=8;break}return e.p=3,e.n=4,n(l[d],{width:a,height:o});case 4:s++,e.n=6;break;case 5:e.p=5,m=e.v,console.error("Failed to resize image ".concat(l[d],":"),m),u++;case 6:i&&i(d+1,c);case 7:d++,e.n=2;break;case 8:return e.a(2,{successCount:s,failureCount:u,total:c})}},e,null,[[3,5]])})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["gallery"]})}})},V=function(){return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.pid,r=t.rotation,a=(0,b.XJ)("rotate"),e.n=1,a(n,{rotation:r});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)})});var e},W=function(){return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.XJ)("recover"),e.n=1,n(t);case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)})});var e},X=function(){return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.XJ)("create-thumbnail"),e.n=1,n(t);case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)})});var e},Y=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a,o,i,l;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.pid,r=t.width,a=t.height,o=t.setFixDimension,i=void 0!==o&&o,l=(0,b.XJ)("create-thumbnail"),e.n=1,l(n,{width:r,height:a,fix_dimension:i});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},Z=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.XJ)("set-watermark"),e.n=1,n(t);case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},J=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.pid,r=t.cropData,a=(0,b.XJ)("crop-thumbnail"),e.n=1,a(n,r);case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},$=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.imageIds,r=t.destinationGalleryId,a=(0,b.Vc)("bulk-copy"),e.n=1,a({image_ids:n,destination_gallery_id:r});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},ee=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.imageIds,r=t.destinationGalleryId,a=(0,b.Vc)("bulk-move"),e.n=1,a({image_ids:n,destination_gallery_id:r});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},te=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n,r,a,o,i;return N().w(function(e){for(;;)switch(e.n){case 0:return n=t.imageIds,r=t.width,a=t.height,o=(0,b.Vc)("bulk-resize"),i={image_ids:n},r&&(i.width=r),a&&(i.height=a),e.n=1,o(i);case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},ne=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){var n;return N().w(function(e){for(;;)switch(e.n){case 0:return n=(0,b.Vc)("bulk-import-metadata"),e.n=1,n({image_ids:t});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["images"]}),t.invalidateQueries({queryKey:["gallery"]})}})},re=function(e,t){return(0,d.I)({queryKey:["tiktok-preview-errors",e],queryFn:(n=(0,c.A)(N().m(function t(){return N().w(function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}return t.a(2,{has_errors:!1});case 1:return t.n=2,p()({path:"/nggpro/v1/tiktok/galleries/".concat(e,"/preview-errors"),method:"GET",headers:(0,b.kX)()});case 2:return t.a(2,t.v)}},t)})),function(){return n.apply(this,arguments)}),enabled:!!e&&t,staleTime:0,retry:0,throwOnError:!1});var n},ae=function(e,t){var n,r=(0,u.jE)(),a=(0,s.E)(),o=a.showSuccess,i=a.showError;return(0,g.n)({mutationFn:(n=(0,c.A)(N().m(function n(){return N().w(function(n){for(;;)switch(n.n){case 0:if(e&&t){n.n=1;break}throw new Error("Gallery ID and integration type are required");case 1:return n.n=2,p()({path:"/nggpro/v1/".concat(t,"/galleries/").concat(e,"/refresh-cache"),method:"POST",headers:(0,b.kX)()});case 2:return n.a(2,n.v)}},n)})),function(){return n.apply(this,arguments)}),onSuccess:function(){e&&(r.invalidateQueries({queryKey:O.gallery(e)}),r.invalidateQueries({queryKey:["galleries"]}),"tiktok"===t&&(r.invalidateQueries({queryKey:["tiktok-sync-status",e]}),r.invalidateQueries({queryKey:["tiktok-preview-errors",e]}))),o((0,h.__)("Cache refreshed successfully.","nggallery"))},onError:function(e){var t,n=(null==e?void 0:e.message)||(null==e||null===(t=e.data)||void 0===t?void 0:t.message)||(0,h.__)("Failed to refresh cache. Please try again.","nggallery");i(n)}})},oe=function(){var e,t=(0,u.jE)();return(0,g.n)({mutationFn:(e=(0,c.A)(N().m(function e(t){return N().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,p()({path:"/imagely/v1/galleries/".concat(t,"/scan-folder"),method:"POST",headers:(0,b.kX)()});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e,n){t.invalidateQueries({queryKey:O.galleryImages(n)}),t.invalidateQueries({queryKey:O.gallery(n)}),t.invalidateQueries({queryKey:["galleries"]})}})}},3717:(e,t,n)=>{"use strict";n.d(t,{IG:()=>g,PN:()=>f,Ws:()=>m,yr:()=>d});var r=n(467),a=n(2416),o=n(7665),i=n(7097),l=n(1455),c=n.n(l);function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return u(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),g=d.prototype=l.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e}return c.prototype=d,u(g,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(g),u(g,a,"Generator"),u(g,r,function(){return this}),u(g,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:f}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}var d=function(){var e,t=(0,o.jE)();return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a,o;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.imageId,a=t.data,o=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/images/".concat(r),method:"PUT",headers:{"X-WP-Nonce":o,"Content-Type":"application/json"},data:a});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){t.setQueryData(["gallery",e.galleryid,"images"],function(t){return t?t.map(function(t){return t.pid===e.pid?e:t}):[e]}),t.invalidateQueries({queryKey:["gallery",e.galleryid]})}})},m=function(){var e,t=(0,o.jE)();return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.imageId,a=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/images/".concat(r),method:"DELETE",headers:{"X-WP-Nonce":a}});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e,n){var r=n.imageId;t.setQueriesData({queryKey:["gallery"]},function(e){return Array.isArray(e)?e.filter(function(e){return e.pid!==r}):e}),t.invalidateQueries({queryKey:["gallery"]})}})},g=function(){var e,t=(0,o.jE)(),n=(0,a.E)(),l=n.showSuccess,u=n.showWarning,d=n.showError;return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a,o,i;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.imageIds,a=t.tags,o=t.append,i=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/images/bulk-add-tags",method:"POST",headers:{"X-WP-Nonce":i,"Content-Type":"application/json"},data:{image_ids:r,tags:a,append:o}});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){t.invalidateQueries({queryKey:["gallery"]}),e.success_count>0&&l(e.message),e.failure_count>0&&u("Failed to add tags to ".concat(e.failure_count," images"))},onError:function(e){console.error("Error adding tags:",e),d("Failed to add tags to images")}})},f=function(){var e,t=(0,o.jE)(),n=(0,a.E)(),l=n.showSuccess,u=n.showWarning,d=n.showError;return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a;return s().w(function(e){for(;;)switch(e.n){case 0:return r=t.imageIds,a=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/images/bulk-remove-tags",method:"POST",headers:{"X-WP-Nonce":a,"Content-Type":"application/json"},data:{image_ids:r}});case 1:return e.a(2,e.v)}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){t.invalidateQueries({queryKey:["gallery"]}),e.success_count>0&&l(e.message),e.failure_count>0&&u("Failed to remove tags from ".concat(e.failure_count," images"))},onError:function(e){console.error("Error removing tags:",e),d("Failed to remove tags from images")}})}},2416:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(4467),a=n(2549),o=n(7143),i=n(7723),l=n(1609);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(){var e=(0,o.useDispatch)(a.EF),t=(0,o.useSelect)(function(e){return e(a.EF).getNotifications()},[]),n=(0,l.useCallback)(function(t,n,r){e.showNotice(t,n,r)},[e]),s=(0,l.useCallback)(function(t){e.dismissNotice(t)},[e]),u=(0,l.useCallback)(function(){e.clearAllNotices()},[e]),d=(0,l.useCallback)(function(t,n){e.showNotice("success",t,n)},[e]),m=(0,l.useCallback)(function(t,n){e.showNotice("error",t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({duration:0},n))},[e]),g={onSuccess:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,i.__)("Changes saved successfully!","nggallery");e.showNotice("success",t)},onError:function(t,n){var r,a=n||(0,i.__)("An error occurred. Please try again.","nggallery");null!=t&&t.message?a=t.message:null!=t&&null!==(r=t.data)&&void 0!==r&&r.message?a=t.data.message:"string"==typeof t&&(a=t),e.showNotice("error",a)}};return{notifications:t,showNotification:n,dismissNotification:s,clearNotifications:u,showSuccess:d,showError:m,showWarning:(0,l.useCallback)(function(t,n){e.showNotice("warning",t,n)},[e]),showInfo:(0,l.useCallback)(function(t,n){e.showNotice("info",t,n)},[e]),mutationCallbacks:g}}},7374:(e,t,n)=>{"use strict";n.d(t,{UG:()=>h,_c:()=>p,h5:()=>y});var r=n(4467),a=n(467),o=n(9836),i=n(7286),l=n(7665),c=n(7097),s=n(1455),u=n.n(s);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return f(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,f(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,f(d,"constructor",s),f(s,"constructor",c),c.displayName="GeneratorFunction",f(s,a,"GeneratorFunction"),f(d),f(d,a,"Generator"),f(d,r,function(){return this}),f(d,"toString",function(){return"[object Generator]"}),(g=function(){return{w:o,m}})()}function f(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}var p={pluginSettings:["settings","plugin"],rolesCapabilities:["settings","roles"]},h=function(){return(0,i.I)({queryKey:p.pluginSettings,queryFn:(e=(0,a.A)(g().m(function e(){var t,n;return g().w(function(e){for(;;)switch(e.n){case 0:return n=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce,e.n=1,u()({path:"/imagely/v1/settings",method:"GET",headers:{"X-WP-Nonce":n}});case 1:return e.a(2,e.v)}},e)})),function(){return e.apply(this,arguments)}),staleTime:3e5,gcTime:6e5});var e},y=function(){var e,t,n=(0,l.jE)();return(0,c.n)({mutationFn:(t=(0,a.A)(g().m(function e(t){var n,r,a;return g().w(function(e){for(;;)switch(e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,a=(0,o.Uh)(t),e.n=1,u()({path:"/imagely/v1/settings",method:"PUT",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:a});case 1:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),onMutate:(e=(0,a.A)(g().m(function e(t){var r;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.cancelQueries({queryKey:p.pluginSettings});case 1:return r=n.getQueryData(p.pluginSettings),n.setQueryData(p.pluginSettings,function(e){return e?m(m({},e),t):void 0}),e.a(2,{previousSettings:r})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,r){null!=r&&r.previousSettings&&n.setQueryData(p.pluginSettings,r.previousSettings)},onSettled:function(){n.invalidateQueries({queryKey:p.pluginSettings})}})}},6434:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var r=n(3453),a=n(1609),o=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,a.useState)({offsetX:0,offsetY:0}),o=(0,r.A)(n,2),i=o[0],l=o[1];return(0,a.useLayoutEffect)(function(){var n=function(){var t=e();if(t){var n=t.getBoundingClientRect();l({offsetX:n.left,offsetY:n.top})}else l({offsetX:0,offsetY:0})};if(n(),t)return window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}},[t]),i}},3633:(e,t,n)=>{"use strict";n.d(t,{Eq:()=>p,O8:()=>h,_D:()=>y,dw:()=>f,hE:()=>v});var r=n(467),a=n(7286),o=n(7665),i=n(7097),l=n(1455),c=n.n(l);function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return u(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),g=d.prototype=l.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e}return c.prototype=d,u(g,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(g),u(g,a,"Generator"),u(g,r,function(){return this}),u(g,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:f}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function d(e){var t,n=null!==(t=null==e?void 0:e.ID)&&void 0!==t?t:null==e?void 0:e.id,r=(null==e?void 0:e.date)||(new Date).toISOString();return{id:Number(n),title:String((null==e?void 0:e.title)||""),date:r,settings:null==e?void 0:e.settings,digital_download_settings:null==e?void 0:e.digital_download_settings,post_author:null==e?void 0:e.post_author}}var m=function(e){return["pricelists",e]},g=function(e){return["pricelist",e]},f=function(e){return(0,a.I)({queryKey:e?g(e):["pricelist","none"],enabled:!!e,queryFn:(t=(0,r.A)(s().m(function t(){var n,r,a;return s().w(function(t){for(;;)switch(t.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,t.n=1,c()({path:"/imagely/v1/pricelists/".concat(e),method:"GET",headers:{"X-WP-Nonce":r}});case 1:return a=t.v,t.a(2,d(a))}},t)})),function(){return t.apply(this,arguments)}),staleTime:0,gcTime:6e5,retry:0,refetchOnMount:!0,refetchOnWindowFocus:!1});var t},p=function(e){var t,n=new URLSearchParams;return null!=e&&e.page&&n.append("page",String(e.page)),null!=e&&e.per_page&&n.append("per_page",String(e.per_page)),null!=e&&e.search&&n.append("search",e.search),null!=e&&e.sort&&n.append("sort",e.sort),null!=e&&e.order&&n.append("order",e.order),null!=e&&e.period&&n.append("period",e.period),(0,a.I)({queryKey:m(e||{}),enabled:!1!==(null==e?void 0:e.enabled),queryFn:(t=(0,r.A)(s().m(function e(){var t,r,a,o,i,l;return s().w(function(e){for(;;)switch(e.n){case 0:return r=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce,a="/imagely/v1/pricelists".concat(n.toString()?"?".concat(n.toString()):""),e.n=1,c()({path:a,method:"GET",headers:{"X-WP-Nonce":r}});case 1:return o=e.v,i=((null==o?void 0:o.pricelists)||[]).map(d),l=(null==o?void 0:o.pagination)||{total:0,total_pages:1,per_page:10,current_page:1},e.a(2,{pricelists:i,pagination:l})}},e)})),function(){return t.apply(this,arguments)}),staleTime:3e4,gcTime:6e5,retry:0,throwOnError:!1,refetchOnWindowFocus:!0,refetchOnMount:!1,placeholderData:function(e){return e}})},h=function(){var e,t=(0,o.jE)();return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a,o;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.p=1,e.n=2,c()({path:"/imagely/v1/pricelists/".concat(t),method:"DELETE",headers:{"X-WP-Nonce":r},parse:!1});case 2:e.n=5;break;case 3:if(e.p=3,404!==((null==(o=e.v)?void 0:o.status)||(null==o||null===(a=o.response)||void 0===a?void 0:a.status))){e.n=4;break}return e.a(2);case 4:throw o;case 5:return e.a(2)}},e,null,[[1,3]])})),function(t){return e.apply(this,arguments)}),onSettled:function(){t.invalidateQueries({queryKey:["pricelists"]})}})},y=function(){var e,t=(0,o.jE)();return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a;return s().w(function(e){for(;;)switch(e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/pricelists/duplicate",method:"POST",headers:{"X-WP-Nonce":r},data:{ids:t}});case 1:return a=e.v,e.a(2,((null==a?void 0:a.pricelists)||[]).map(d))}},e)})),function(t){return e.apply(this,arguments)}),onSettled:function(){t.invalidateQueries({queryKey:["pricelists"]})}})},v=function(){var e,t=(0,o.jE)();return(0,i.n)({mutationFn:(e=(0,r.A)(s().m(function e(t){var n,r,a;return s().w(function(e){for(;;)switch(e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,c()({path:"/imagely/v1/pricelists",method:"POST",headers:{"X-WP-Nonce":r},data:{title:t.title}});case 1:return a=e.v,e.a(2,d(a))}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(){t.invalidateQueries({queryKey:["pricelists"]})}})}},443:(e,t,n)=>{"use strict";n.d(t,{r:()=>c});var r=n(4467),a=n(2549),o=n(7143);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(){var e=(0,o.useDispatch)(a.EF);return l(l({},(0,o.useSelect)(function(e){var t=e(a.EF);return{routeParams:t.getRouteParams(),currentTab:t.getCurrentTab(),currentSubTab:t.getCurrentSubTab(),currentPage:t.getCurrentPage(),currentId:t.getCurrentId()}},[])),{},{setCurrentTab:e.setCurrentTab,setCurrentSubTab:e.setCurrentSubTab,setCurrentPage:e.setCurrentPage,setCurrentId:e.setCurrentId,navigateTo:e.navigateTo,setActiveModal:e.setActiveModal})}},2329:(e,t,n)=>{"use strict";n.d(t,{X:()=>l,h:()=>i});var r=n(1609),a=n.n(r),o=(0,r.createContext)({isEmbed:!1}),i=function(e){var t=e.children,n=e.value;return a().createElement(o.Provider,{value:n},t)},l=function(){return(0,r.useContext)(o)}},4540:(e,t,n)=>{"use strict";n.d(t,{RW:()=>g,Vc:()=>p,XJ:()=>f,kX:()=>m,m9:()=>d});var r=n(4467),a=n(467),o=n(1455),i=n.n(o);function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return c(u,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),u}var i={};function s(){}function u(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),g=d.prototype=s.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e}return u.prototype=d,c(g,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,a,"GeneratorFunction"),c(g),c(g,a,"Generator"),c(g,r,function(){return this}),c(g,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:f}})()}function c(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var d=function(){var e,t,n=window;return(null===(e=n.wpApiSettings)||void 0===e?void 0:e.nonce)||(null===(t=n.imagelyApp)||void 0===t?void 0:t.nonce)||""},m=function(){return{"X-WP-Nonce":d(),"Content-Type":"application/json"}},g=function(){var e=(0,a.A)(l().m(function e(t){var n,r,a,o,c,s,d,g,f,p,h,y,v,b,w=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:return r=(n=w.length>1&&void 0!==w[1]?w[1]:{}).method,a=void 0===r?"GET":r,o=n.data,c=n.headers,s=void 0===c?{}:c,e.n=1,i()({path:t,method:a,headers:u(u({},m()),s),data:o,parse:!1});case 1:if(d=e.v,g=parseInt(d.headers.get("X-WP-Total")||"0",10),f=parseInt(d.headers.get("X-WP-TotalPages")||"1",10),204!==d.status&&205!==d.status){e.n=2;break}p=null,e.n=7;break;case 2:if(h=d.headers.get("content-type"),!(y=d.headers.get("content-length"))||0!==parseInt(y)){e.n=3;break}p=null,e.n=7;break;case 3:if(h&&h.includes("application/json")){e.n=5;break}return e.n=4,d.text();case 4:v=e.v,p=v||null,e.n=7;break;case 5:return e.n=6,d.text();case 6:if((b=e.v)&&""!==b.trim())try{p=JSON.parse(b)}catch(e){console.warn("Failed to parse response as JSON:",b,e),p=b}else p=null;case 7:return e.a(2,{data:p,headers:{total:g,totalPages:f}})}},e)}));return function(t){return e.apply(this,arguments)}}(),f=function(e){return function(){var t=(0,a.A)(l().m(function t(n,r){return l().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,i()({path:"/imagely/v1/images/".concat(n,"/").concat(e),method:"POST",headers:m(),data:r});case 1:return t.a(2,t.v)}},t)}));return function(e,n){return t.apply(this,arguments)}}()},p=function(e){return function(){var t=(0,a.A)(l().m(function t(n){return l().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,i()({path:"/imagely/v1/images/".concat(e),method:"POST",headers:m(),data:n});case 1:return t.a(2,t.v)}},t)}));return function(e){return t.apply(this,arguments)}}()}},9836:(e,t,n)=>{"use strict";n.d(t,{Uh:()=>c,_w:()=>i,bT:()=>d,tB:()=>o,xZ:()=>l});var r=n(3453),a=n(2284);function o(e,t){return null==e?t:i(e)}function i(e){return"boolean"==typeof e?e:"string"==typeof e?"1"===e||"true"===e:"number"==typeof e&&1===e}function l(e){return e?"1":"0"}function c(e){if(!e||"object"!==(0,a.A)(e))return e;if(Array.isArray(e))return e.map(function(e){return c(e)});for(var t={},n=0,o=Object.entries(e);n<o.length;n++){var i=(0,r.A)(o[n],2),s=i[0],u=i[1];"boolean"==typeof u?t[s]=l(u):u&&"object"===(0,a.A)(u)?t[s]=c(u):t[s]=u}return t}var s=new Set(["animate_images_delay","animate_images_duration","animate_pagination_delay","animate_pagination_duration","alttext_font_size","aspect_ratio","border_size","caption_height","description_font_size","frame_size","gallery_height","height","image_max_height","image_quality","image_spacing","images_per_page","images_to_display_at_start","images_to_load_on_scroll","image_padding","interval","limit","margins","maximum_gallery_width","maximum_image_width","minimum_relevance","number","number_of_columns","padding","row_height","size","slideshow_speed","spacing","thumbnail_height","thumbnail_width","transition_speed","width"]);function u(e){return s.has(e)}function d(e){if(!e||"object"!==(0,a.A)(e))return e;if(Array.isArray(e))return e.map(function(e){return d(e)});for(var t={},n=0,o=Object.entries(e);n<o.length;n++){var l=(0,r.A)(o[n],2),c=l[0],s=l[1];"string"!=typeof s||"1"!==s&&"0"!==s||u(c)?s&&"object"===(0,a.A)(s)?t[c]=d(s):t[c]=s:t[c]=i(s)}return t}},951:(e,t,n)=>{"use strict";n.d(t,{Qr:()=>i,Xb:()=>l,at:()=>o,e3:()=>c,tC:()=>r});var r=function(){var e=a();return null!==e&&e.enabled&&e.license_valid},a=function(){var e=window.imagelyApp;return(null==e?void 0:e.enviraCdnConfig)||null},o=function(e){var t;return!(null===(t=e.meta_data)||void 0===t||!t._envira_cdn_id)},i=function(e){var t,n=null===(t=e.meta_data)||void 0===t?void 0:t._envira_cdn_id;return n?"https://images.envira-cdn.com/cdn-cgi/imagedelivery/Fcmm2_rOlMVEVM7KyY_2rw/".concat(n,"/w=original"):null},l=function(){var e=window.wpApiSettings;if(null!=e&&e.nonce)return e.nonce;var t=window.imagelyApp;return(null==t?void 0:t.nonce)||null},c=function(){var e=window.imagelyApp;return(null==e?void 0:e.restURL)||"/wp-json/"}},56:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}n.d(t,{cn:()=>ye});const a=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),o="-",i=[],l=e=>{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return s(e);const n=e.split(o),r=""===n[0]&&n.length>1?1:0;return c(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],a=n[e];return t?a?((e,t)=>{const n=new Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(a,t):t:a||i}return n[e]||i}}},c=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],a=n.nextPart.get(r);if(a){const n=c(e,t+1,a);if(n)return n}const i=n.validators;if(null===i)return;const l=0===t?e.join(o):e.slice(t).join(o),s=i.length;for(let e=0;e<s;e++){const t=i[e];if(t.validator(l))return t.classGroupId}},s=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),u=e=>{const{theme:t,classGroups:n}=e;return d(n,t)},d=(e,t)=>{const n=a();for(const r in e){const a=e[r];m(a,n,r,t)}return n},m=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const a=e[o];g(a,t,n,r)}},g=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?h(e,t,n,r):p(e,t,n,r):f(e,t,n)},f=(e,t,n)=>{(""===e?t:y(t,e)).classGroupId=n},p=(e,t,n,r)=>{v(e)?m(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},h=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){const[o,i]=a[e];m(i,y(t,o),n,r)}},y=(e,t)=>{let n=e;const r=t.split(o),i=r.length;for(let e=0;e<i;e++){const t=r[e];let o=n.nextPart.get(t);o||(o=a(),n.nextPart.set(t,o)),n=o}return n},v=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,b=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in n?n[e]=t:a(e,t)}}},w=[],x=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),E=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,a=0,o=0;const i=e.length;for(let l=0;l<i;l++){const i=e[l];if(0===r&&0===a){if(":"===i){t.push(e.slice(o,l)),o=l+1;continue}if("/"===i){n=l;continue}}"["===i?r++:"]"===i?r--:"("===i?a++:")"===i&&a--}const l=0===t.length?e:e.slice(o);let c=l,s=!1;return l.endsWith("!")?(c=l.slice(0,-1),s=!0):l.startsWith("!")&&(c=l.slice(1),s=!0),x(t,s,c,n&&n>o?n-o:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):x(w,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},_=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let a=0;a<e.length;a++){const o=e[a],i="["===o[0],l=t.has(o);i||l?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},C=/\s+/,N=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=N(e[r]))&&(n&&(n+=" "),n+=t);return n},k=[],O=e=>{const t=t=>t[e]||k;return t.isThemeGetter=!0,t},A=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,S=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j=/^\d+\/\d+$/,P=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,I=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,D=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,L=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,R=e=>j.test(e),F=e=>!!e&&!Number.isNaN(Number(e)),M=e=>!!e&&Number.isInteger(Number(e)),G=e=>e.endsWith("%")&&F(e.slice(0,-1)),Q=e=>P.test(e),B=()=>!0,q=e=>T.test(e)&&!I.test(e),U=()=>!1,H=e=>D.test(e),z=e=>L.test(e),K=e=>!W(e)&&!ee(e),V=e=>le(e,de,U),W=e=>A.test(e),X=e=>le(e,me,q),Y=e=>le(e,ge,F),Z=e=>le(e,se,U),J=e=>le(e,ue,z),$=e=>le(e,pe,H),ee=e=>S.test(e),te=e=>ce(e,me),ne=e=>ce(e,fe),re=e=>ce(e,se),ae=e=>ce(e,de),oe=e=>ce(e,ue),ie=e=>ce(e,pe,!0),le=(e,t,n)=>{const r=A.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ce=(e,t,n=!1)=>{const r=S.exec(e);return!!r&&(r[1]?t(r[1]):n)},se=e=>"position"===e||"percentage"===e,ue=e=>"image"===e||"url"===e,de=e=>"length"===e||"size"===e||"bg-size"===e,me=e=>"length"===e,ge=e=>"number"===e,fe=e=>"family-name"===e,pe=e=>"shadow"===e,he=((e,...t)=>{let n,r,a,o;const i=e=>{const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,i=[],l=e.trim().split(C);let c="";for(let e=l.length-1;e>=0;e-=1){const t=l[e],{isExternal:s,modifiers:u,hasImportantModifier:d,baseClassName:m,maybePostfixModifierPosition:g}=n(t);if(s){c=t+(c.length>0?" "+c:c);continue}let f=!!g,p=r(f?m.substring(0,g):m);if(!p){if(!f){c=t+(c.length>0?" "+c:c);continue}if(p=r(m),!p){c=t+(c.length>0?" "+c:c);continue}f=!1}const h=0===u.length?"":1===u.length?u[0]:o(u).join(":"),y=d?h+"!":h,v=y+p;if(i.indexOf(v)>-1)continue;i.push(v);const b=a(p,f);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}c=t+(c.length>0?" "+c:c)}return c})(e,n);return a(e,o),o};return o=c=>{const s=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:b(e.cacheSize),parseClassName:E(e),sortModifiers:_(e),...l(e)}))(s),r=n.cache.get,a=n.cache.set,o=i,i(c)},(...e)=>o(((...e)=>{let t,n,r=0,a="";for(;r<e.length;)(t=e[r++])&&(n=N(t))&&(a&&(a+=" "),a+=n);return a})(...e))})((Symbol.toStringTag,()=>{const e=O("color"),t=O("font"),n=O("text"),r=O("font-weight"),a=O("tracking"),o=O("leading"),i=O("breakpoint"),l=O("container"),c=O("spacing"),s=O("radius"),u=O("shadow"),d=O("inset-shadow"),m=O("text-shadow"),g=O("drop-shadow"),f=O("blur"),p=O("perspective"),h=O("aspect"),y=O("ease"),v=O("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ee,W],w=()=>[ee,W,c],x=()=>[R,"full","auto",...w()],E=()=>[M,"none","subgrid",ee,W],_=()=>["auto",{span:["full",M,ee,W]},M,ee,W],C=()=>[M,"auto",ee,W],N=()=>["auto","min","max","fr",ee,W],k=()=>["auto",...w()],A=()=>[R,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],S=()=>[e,ee,W],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",re,Z,{position:[ee,W]}],P=()=>["auto","cover","contain",ae,V,{size:[ee,W]}],T=()=>[G,te,X],I=()=>["","none","full",s,ee,W],D=()=>["",F,te,X],L=()=>[F,G,re,Z],q=()=>["","none",f,ee,W],U=()=>["none",F,ee,W],H=()=>["none",F,ee,W],z=()=>[F,ee,W],le=()=>[R,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Q],breakpoint:[Q],color:[B],container:[Q],"drop-shadow":[Q],ease:["in","out","in-out"],font:[K],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Q],shadow:[Q],spacing:["px",F],text:[Q],"text-shadow":[Q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",R,W,ee,h]}],container:["container"],columns:[{columns:[F,W,ee,l]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[M,"auto",ee,W]}],basis:[{basis:[R,"full","auto",l,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[F,R,"auto","initial","none",W]}],grow:[{grow:["",F,ee,W]}],shrink:[{shrink:["",F,ee,W]}],order:[{order:[M,"first","last","none",ee,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",n,te,X]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,Y]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G,W]}],"font-family":[{font:[ne,W,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ee,W]}],"line-clamp":[{"line-clamp":[F,"none",ee,Y]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",ee,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[F,"from-font","auto",ee,X]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[F,"auto",ee,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},M,ee,W],radial:["",ee,W],conic:[M,ee,W]},oe,J]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[F,ee,W]}],"outline-w":[{outline:["",F,te,X]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",u,ie,$]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",d,ie,$]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[F,X]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",m,ie,$]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[F,ee,W]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[F]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[ee,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[F]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,W]}],filter:[{filter:["","none",ee,W]}],blur:[{blur:q()}],brightness:[{brightness:[F,ee,W]}],contrast:[{contrast:[F,ee,W]}],"drop-shadow":[{"drop-shadow":["","none",g,ie,$]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",F,ee,W]}],"hue-rotate":[{"hue-rotate":[F,ee,W]}],invert:[{invert:["",F,ee,W]}],saturate:[{saturate:[F,ee,W]}],sepia:[{sepia:["",F,ee,W]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,W]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[F,ee,W]}],"backdrop-contrast":[{"backdrop-contrast":[F,ee,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",F,ee,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[F,ee,W]}],"backdrop-invert":[{"backdrop-invert":["",F,ee,W]}],"backdrop-opacity":[{"backdrop-opacity":[F,ee,W]}],"backdrop-saturate":[{"backdrop-saturate":[F,ee,W]}],"backdrop-sepia":[{"backdrop-sepia":["",F,ee,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[F,"initial",ee,W]}],ease:[{ease:["linear","initial",y,ee,W]}],delay:[{delay:[F,ee,W]}],animate:[{animate:["none",v,ee,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ee,W]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[ee,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,W]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[F,te,X,Y]}],stroke:[{stroke:["none",...S()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}));function ye(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return he(function(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}(t))}},2549:(e,t,n)=>{"use strict";var r;n.d(t,{Co:()=>i,EF:()=>a,WA:()=>o,ti:()=>l});var a="imagely/admin-app",o=(null===(r=window.imagelyApp)||void 0===r?void 0:r.proTypeInstalled)||"lite",i="/nggpro/v1/video/save-video",l="/nggpro/v1/video/is-hosted-video"},5300:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var r=function(e){var t=e.width,n=void 0===t?130:t,r=e.height,a=void 0===r?90:r,o=e.backgroundColor,i=void 0===o?"#e0e0e0":o,l=e.textColor,c=void 0===l?"#888888":l,s=e.fontSize,u=void 0===s?14:s,d=e.text,m=void 0===d?"":d,g='\n <svg xmlns="http://www.w3.org/2000/svg" width="'.concat(n,'" height="').concat(a,'">\n <rect width="100%" height="100%" fill="').concat(i,'"/>\n <text x="50%" y="50%" fill="').concat(c,'" dy=".3em" text-anchor="middle" font-family="sans-serif" font-size="').concat(u,'px">\n ').concat(m||"".concat(n,"×").concat(a),"\n </text>\n </svg>\n ").trim(),f=encodeURIComponent(g);return"data:image/svg+xml;charset=UTF-8,".concat(f)}},2887:(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var r=function(){var e=document.querySelectorAll(".imagely-wrap");return e.length>0?e[e.length-1]:document.body}},1985:(e,t,n)=>{"use strict";function r(e,t){return e?t?"".concat(e.split("?")[0],"?t=").concat(t):e:""}n.d(t,{s:()=>r})},1648:(e,t,n)=>{"use strict";n.d(t,{HN:()=>o,jP:()=>i}),n(7723);var r=function(){var e;return"lite"!==((null===(e=window.imagelyApp)||void 0===e?void 0:e.proTypeInstalled)||"lite")},a=function(){var e,t=null===(e=window.imagelyApp)||void 0===e?void 0:e.licenseData;return!!t&&!0===t.is_valid},o=function(){return!r()||a()},i=function(){return!r()||a()}},380:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=function(e,t){var n,r,a,o=(null===(n=window.imagelyApp)||void 0===n?void 0:n.utmVersion)||"";e?r=e:r="imagely"===(a=(new URLSearchParams(window.location.search).get("page")||"imagely").replace(/^imagely-?/,""))||""===a?"galleries":a.replace(/[-_\s]/g,"").toLowerCase();var i="".concat("https://www.imagely.com/lite","?utm_source=").concat("ngg","&utm_medium=").concat(r,"&utm_campaign=").concat("upgradetopro");if(o){var l=t?"_".concat(t.replace(/\s+/g,"").toLowerCase()):"";i+="&utm_content=".concat(encodeURIComponent(o+l))}return i}},8093:function(e,t,n){var r;r=e=>(()=>{"use strict";var t={899:t=>{t.exports=e}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{Component:()=>p,areCropsEqual:()=>l,centerCrop:()=>s,clamp:()=>i,containCrop:()=>m,convertToPercentCrop:()=>u,convertToPixelCrop:()=>d,default:()=>p,defaultCrop:()=>o,makeAspectCrop:()=>c,nudgeCrop:()=>g});var e=r(899),t=r.n(e);function n(e){var t,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=n(e[t]))&&(a&&(a+=" "),a+=r);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}const o={x:0,y:0,width:0,height:0,unit:"px"};function i(e,t,n){return Math.min(Math.max(e,t),n)}function l(e,t){return e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit}function c(e,t,n,r){const a=d(e,n,r);return e.width&&(a.height=a.width/t),e.height&&(a.width=a.height*t),a.y+a.height>r&&(a.height=r-a.y,a.width=a.height*t),a.x+a.width>n&&(a.width=n-a.x,a.height=a.width/t),"%"===e.unit?u(a,n,r):a}function s(e,t,n){const r=d(e,t,n);return r.x=(t-r.width)/2,r.y=(n-r.height)/2,"%"===e.unit?u(r,t,n):r}function u(e,t,n){return"%"===e.unit?{...o,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function d(e,t,n){return e.unit?"px"===e.unit?{...o,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...o,...e,unit:"px"}}function m(e,t,n,r,a,o=0,i=0,l=r,c=a){const s={...e};let u=Math.min(o,r),d=Math.min(i,a),m=Math.min(l,r),g=Math.min(c,a);t&&(t>1?(u=i?i*t:u,d=u/t,m=l*t):(d=o?o/t:d,u=d*t,g=c/t)),s.y<0&&(s.height=Math.max(s.height+s.y,d),s.y=0),s.x<0&&(s.width=Math.max(s.width+s.x,u),s.x=0);const f=r-(s.x+s.width);f<0&&(s.x=Math.min(s.x,r-u),s.width+=f);const p=a-(s.y+s.height);if(p<0&&(s.y=Math.min(s.y,a-d),s.height+=p),s.width<u&&("sw"!==n&&"nw"!=n||(s.x-=u-s.width),s.width=u),s.height<d&&("nw"!==n&&"ne"!=n||(s.y-=d-s.height),s.height=d),s.width>m&&("sw"!==n&&"nw"!=n||(s.x-=m-s.width),s.width=m),s.height>g&&("nw"!==n&&"ne"!=n||(s.y-=g-s.height),s.height=g),t){const e=s.width/s.height;if(e<t){const e=Math.max(s.width/t,d);"nw"!==n&&"ne"!=n||(s.y-=e-s.height),s.height=e}else if(e>t){const e=Math.max(s.height*t,u);"sw"!==n&&"nw"!=n||(s.x-=e-s.width),s.width=e}}return s}function g(e,t,n,r){const a={...e};return"ArrowLeft"===t?"nw"===r?(a.x-=n,a.y-=n,a.width+=n,a.height+=n):"w"===r?(a.x-=n,a.width+=n):"sw"===r?(a.x-=n,a.width+=n,a.height+=n):"ne"===r?(a.y+=n,a.width-=n,a.height-=n):"e"===r?a.width-=n:"se"===r&&(a.width-=n,a.height-=n):"ArrowRight"===t&&("nw"===r?(a.x+=n,a.y+=n,a.width-=n,a.height-=n):"w"===r?(a.x+=n,a.width-=n):"sw"===r?(a.x+=n,a.width-=n,a.height-=n):"ne"===r?(a.y-=n,a.width+=n,a.height+=n):"e"===r?a.width+=n:"se"===r&&(a.width+=n,a.height+=n)),"ArrowUp"===t?"nw"===r?(a.x-=n,a.y-=n,a.width+=n,a.height+=n):"n"===r?(a.y-=n,a.height+=n):"ne"===r?(a.y-=n,a.width+=n,a.height+=n):"sw"===r?(a.x+=n,a.width-=n,a.height-=n):"s"===r?a.height-=n:"se"===r&&(a.width-=n,a.height-=n):"ArrowDown"===t&&("nw"===r?(a.x+=n,a.y+=n,a.width-=n,a.height-=n):"n"===r?(a.y+=n,a.height-=n):"ne"===r?(a.y+=n,a.width-=n,a.height-=n):"sw"===r?(a.x-=n,a.width+=n,a.height+=n):"s"===r?a.height+=n:"se"===r&&(a.width+=n,a.height+=n)),a}const f={capture:!0,passive:!1};class p extends e.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=(0,e.createRef)(),this.mediaRef=(0,e.createRef)(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{const{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;const a=d(t,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const o=e.target.dataset.ord,i=Boolean(o);let l=e.clientX,c=e.clientY,s=a.x,u=a.y;if(o){const t=e.clientX-r.x,n=e.clientY-r.y;let i=0,d=0;"ne"===o||"e"==o?(i=t-(a.x+a.width),d=n-a.y,s=a.x,u=a.y+a.height):"se"===o||"s"===o?(i=t-(a.x+a.width),d=n-(a.y+a.height),s=a.x,u=a.y):"sw"===o||"w"==o?(i=t-a.x,d=n-(a.y+a.height),s=a.x+a.width,u=a.y):"nw"!==o&&"n"!=o||(i=t-a.x,d=n-a.y,s=a.x+a.width,u=a.y+a.height),l=s+r.x+i,c=u+r.y+d}this.evData={startClientX:l,startClientY:c,startCropX:s,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:i,ord:o},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{const{crop:t,disabled:n,locked:r,keepSelection:a,onChange:o}=this.props,i=this.getBox();if(n||r||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const l=e.clientX-i.x,c=e.clientY-i.y,s={unit:"px",x:l,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(d(s,i.width,i.height),u(s,i.width,i.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{const{crop:t,disabled:n,onChange:r,onDragStart:a}=this.props,o=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));const{evData:i}=this;let c;i.clientX=e.clientX,i.clientY=e.clientY,c=i.isResize?this.resizeCrop():this.dragCrop(),l(t,c)||r(d(c,o.width,o.height),u(c,o.width,o.height))},this.onComponentKeyDown=e=>{const{crop:t,disabled:n,onChange:r,onComplete:a}=this.props,o=this.getBox();if(n)return;const l=e.key;let c=!1;if(!t)return;const s=this.makePixelCrop(),m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?p.nudgeStepLarge:e.shiftKey?p.nudgeStepMedium:p.nudgeStep;if("ArrowLeft"===l?(s.x-=m,c=!0):"ArrowRight"===l?(s.x+=m,c=!0):"ArrowUp"===l?(s.y-=m,c=!0):"ArrowDown"===l&&(s.y+=m,c=!0),c){e.cancelable&&e.preventDefault(),s.x=i(s.x,0,o.width-s.width),s.y=i(s.y,0,o.height-s.height);const t=d(s,o.width,o.height),n=u(s,o.width,o.height);r(t,n),a&&a(t,n)}},this.onHandlerKeyDown=(e,t)=>{const{aspect:n=0,crop:r,disabled:a,minWidth:o=0,minHeight:i=0,maxWidth:c,maxHeight:s,onChange:f,onComplete:h}=this.props,y=this.getBox();if(a||!r)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.stopPropagation(),e.preventDefault();const v=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?p.nudgeStepLarge:e.shiftKey?p.nudgeStepMedium:p.nudgeStep,b=m(g(d(r,y.width,y.height),e.key,v,t),n,t,y.width,y.height,o,i,c,s);if(!l(r,b)){const e=u(b,y.width,y.height);f(b,e),h&&h(b,e)}},this.onDocPointerDone=e=>{const{crop:t,disabled:n,onComplete:r,onDragEnd:a}=this.props,o=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),r&&r(d(t,o.width,o.height),u(t,o.width,o.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var t;null===(t=this.componentRef.current)||void 0===t||t.scrollTo(0,0)}}get document(){return document}getBox(){const e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};const{x:t,y:n,width:r,height:a}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:a}}componentDidUpdate(e){const{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){const{width:e,height:r}=this.getBox();e&&r&&n(d(t,e,r),u(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,f),this.document.addEventListener("pointerup",this.onDocPointerDone,f),this.document.addEventListener("pointercancel",this.onDocPointerDone,f),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,f),this.document.removeEventListener("pointerup",this.onDocPointerDone,f),this.document.removeEventListener("pointercancel",this.onDocPointerDone,f),this.docMoveBound=!1)}getCropStyle(){const{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){const{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e){const{evData:t}=this,n=t.clientX-e.x,r=t.clientY-e.y<t.startCropY;return n<t.startCropX?r?"nw":"sw":r?"ne":"se"}resizeCrop(){const{evData:e}=this,t=this.getBox(),{aspect:n=0,minWidth:r=0,minHeight:a=0,maxWidth:o,maxHeight:i}=this.props,l=this.getPointRegion(t),c=this.makePixelCrop(),s=e.ord?e.ord:l,u=e.clientX-e.startClientX,d=e.clientY-e.startClientY,g={unit:"px",x:0,y:0,width:0,height:0};"ne"===l?(g.x=e.startCropX,g.width=u,n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(d),g.y=e.startCropY-g.height)):"se"===l?(g.x=e.startCropX,g.y=e.startCropY,g.width=u,g.height=n?g.width/n:d):"sw"===l?(g.x=e.startCropX+u,g.y=e.startCropY,g.width=Math.abs(u),g.height=n?g.width/n:d):"nw"===l&&(g.x=e.startCropX+u,g.width=Math.abs(u),n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(d),g.y=e.startCropY+d));const f=m(g,n,l,t.width,t.height,r,a,o,i);return n||p.xyOrds.indexOf(s)>-1?(c.x=f.x,c.y=f.y,c.width=f.width,c.height=f.height):p.xOrds.indexOf(s)>-1?(c.x=f.x,c.width=f.width):p.yOrds.indexOf(s)>-1&&(c.y=f.y,c.height=f.height),c}createCropSelection(){const{ariaLabels:e=p.defaultProps.ariaLabels,disabled:n,locked:r,renderSelectionAddon:a,ruleOfThirds:o,crop:i}=this.props,l=this.getCropStyle();if(i)return t().createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!r&&t().createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t().createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&t().createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:e=>e.stopPropagation()},a(this.state)),o&&t().createElement(t().Fragment,null,t().createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t().createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(){const e={...o,...this.props.crop||{}},t=this.getBox();return d(e,t.width,t.height)}render(){const{aspect:e,children:r,circularCrop:a,className:o,crop:i,disabled:l,locked:c,style:s,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:m}=this.state,g=i?this.createCropSelection():null,f=function(){for(var e,t,r=0,a="";r<arguments.length;)(e=arguments[r++])&&(t=n(e))&&(a&&(a+=" "),a+=t);return a}("ReactCrop",o,{"ReactCrop--active":d,"ReactCrop--disabled":l,"ReactCrop--locked":c,"ReactCrop--new-crop":m,"ReactCrop--fixed-aspect":i&&e,"ReactCrop--circular-crop":i&&a,"ReactCrop--rule-of-thirds":i&&u,"ReactCrop--invisible-crop":!this.dragStarted&&i&&!i.width&&!i.height});return t().createElement("div",{ref:this.componentRef,className:f,style:s},t().createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},r),g)}}p.xOrds=["e","w"],p.yOrds=["n","s"],p.xyOrds=["nw","ne","se","sw"],p.nudgeStep=1,p.nudgeStepMedium=10,p.nudgeStepLarge=100,p.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}}})(),a})(),e.exports=r(n(1609))},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},1455:e=>{"use strict";e.exports=window.wp.apiFetch},6427:e=>{"use strict";e.exports=window.wp.components},7143:e=>{"use strict";e.exports=window.wp.data},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},3145:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},6369:(e,t,n)=>{"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{A:()=>r})},467:(e,t,n)=>{"use strict";function r(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,o){var i=e.apply(t,n);function l(e){r(i,a,o,l,c,"next",e)}function c(e){r(i,a,o,l,c,"throw",e)}l(void 0)})}}n.d(t,{A:()=>a})},4467:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(9922);function a(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},8168:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(null,arguments)}n.d(t,{A:()=>r})},6986:(e,t,n)=>{"use strict";function r(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return l}}n.d(t,{A:()=>r})},6562:(e,t,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{A:()=>r})},45:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(8587);function a(e,t){if(null==e)return{};var n,a,o=(0,r.A)(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},8587:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},3453:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(6369),a=n(6986),o=n(7800),i=n(6562);function l(e,t){return(0,r.A)(e)||(0,a.A)(e,t)||(0,o.A)(e,t)||(0,i.A)()}},5458:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(3145),a=n(7800);function o(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,a.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},2327:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(2284);function a(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=(0,r.A)(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},9922:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2284),a=n(2327);function o(e){var t=(0,a.A)(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},2284:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},7800:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(3145);function a(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},9658:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(6500),a=n(4880),o=new class extends r.Q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!a.S$&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}}},8959:(e,t,n)=>{"use strict";n.d(t,{PL:()=>a,RQ:()=>c,rB:()=>l});var r=n(4880);function a(e){return{onFetch:(t,n)=>{const a=t.options,l=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const m=async()=>{let n=!1;const m=(0,r.ZM)(t.options,t.fetchOptions),g=async(e,a,o)=>{if(n)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?"backward":"forward",meta:t.options.meta};var r;return r=e,Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)}),e})(),l=await m(i),{maxPages:c}=t.options,s=o?r.ZZ:r.y9;return{pages:s(e.pages,l,c),pageParams:s(e.pageParams,a,c)}};if(l&&c.length){const e="backward"===l,t={pages:c,pageParams:s},n=(e?i:o)(a,t);u=await g(t,n,e)}else{const t=e??c.length;do{const e=0===d?s[0]??a.initialPageParam:o(a,u);if(d>0&&null==e)break;u=await g(u,e),d++}while(d<t)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=m}}}function o(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function i(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function l(e,t){return!!t&&null!=o(e,t)}function c(e,t){return!(!t||!e.getPreviousPageParam)&&null!=i(e,t)}},6158:(e,t,n)=>{"use strict";n.d(t,{$:()=>l,s:()=>i});var r=n(6261),a=n(1692),o=n(8904),i=class extends a.k{#r;#a;#o;#i;constructor(e){super(),this.#r=e.client,this.mutationId=e.mutationId,this.#o=e.mutationCache,this.#a=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#a.includes(e)||(this.#a.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#a=this.#a.filter(t=>t!==e),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#a.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#l({type:"continue"})},n={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,o.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#l({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#l({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)});const r="pending"===this.state.status,a=!this.#i.canStart();try{if(r)t();else{this.#l({type:"pending",variables:e,isPaused:a}),await(this.#o.config.onMutate?.(e,this,n));const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#l({type:"pending",context:t,variables:e,isPaused:a})}const o=await this.#i.start();return await(this.#o.config.onSuccess?.(o,e,this.state.context,this,n)),await(this.options.onSuccess?.(o,e,this.state.context,n)),await(this.#o.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(o,null,e,this.state.context,n)),this.#l({type:"success",data:o}),o}catch(t){try{throw await(this.#o.config.onError?.(t,e,this.state.context,this,n)),await(this.options.onError?.(t,e,this.state.context,n)),await(this.#o.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(void 0,t,e,this.state.context,n)),t}finally{this.#l({type:"error",error:t})}}finally{this.#o.runNext(this)}}#l(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.jG.batch(()=>{this.#a.forEach(t=>{t.onMutationUpdate(e)}),this.#o.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},6261:(e,t,n)=>{"use strict";n.d(t,{jG:()=>a});var r=n(2775).Zq,a=function(){let e=[],t=0,n=e=>{e()},a=e=>{e()},o=r;const i=r=>{t?e.push(r):o(()=>{n(r)})};return{batch:r=>{let i;t++;try{i=r()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{a(()=>{t.forEach(e=>{n(e)})})})})()}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{o=e}}}()},6035:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var r=n(6500),a=n(4880),o=new class extends r.Q{#c=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!a.S$&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#c!==e&&(this.#c=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#c}}},9757:(e,t,n)=>{"use strict";n.d(t,{X:()=>l,k:()=>c});var r=n(4880),a=n(6261),o=n(8904),i=n(1692),l=class extends i.k{#s;#u;#d;#r;#i;#m;#g;constructor(e){super(),this.#g=!1,this.#m=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#d=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=u(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#m,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=u(this.options);void 0!==e.data&&(this.setState(s(e.data,e.dataUpdatedAt)),this.#s=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#d.remove(this)}setData(e,t){const n=(0,r.pl)(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#l({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(r.lQ).catch(r.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==(0,r.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===r.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,r.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,r.j3)(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#d.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#g?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#d.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#i?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#g=!0,n.signal)})},i=()=>{const e=(0,r.ZM)(this.options,t),n=(()=>{const e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return a(e),e})();return this.#g=!1,this.options.persister?this.options.persister(e,n,this):e(n)},l=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return a(e),e})();this.options.behavior?.onFetch(l,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===l.fetchOptions?.meta||this.#l({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=(0,o.II)({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:e=>{e instanceof o.cc&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#l({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const e=await this.#i.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#d.config.onSuccess?.(e,this),this.#d.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof o.cc){if(e.silent)return this.#i.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#l({type:"error",error:e}),this.#d.config.onError?.(e,this),this.#d.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...c(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...s(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),a.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#d.notify({query:this,type:"updated",action:e})})}};function c(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,o.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function s(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}},1651:(e,t,n)=>{"use strict";n.d(t,{$:()=>u});var r=n(9658),a=n(6261),o=n(9757),i=n(6500),l=n(4658),c=n(4880),s=n(2775),u=class extends i.Q{constructor(e,t){super(),this.options=t,this.#r=e,this.#f=null,this.#p=(0,l.T)(),this.bindMethods(),this.setOptions(t)}#r;#h=void 0;#y=void 0;#v=void 0;#b;#w;#p;#f;#x;#E;#_;#C;#N;#k;#O=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#h.addObserver(this),d(this.#h,this.options)?this.#A():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return m(this.#h,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return m(this.#h,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#P(),this.#h.removeObserver(this)}setOptions(e){const t=this.options,n=this.#h;if(this.options=this.#r.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Eh)(this.options.enabled,this.#h))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#T(),this.#h.setOptions(this.options),t._defaulted&&!(0,c.f8)(this.options,t)&&this.#r.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#h,observer:this});const r=this.hasListeners();r&&g(this.#h,n,this.options,t)&&this.#A(),this.updateResult(),!r||this.#h===n&&(0,c.Eh)(this.options.enabled,this.#h)===(0,c.Eh)(t.enabled,this.#h)&&(0,c.d2)(this.options.staleTime,this.#h)===(0,c.d2)(t.staleTime,this.#h)||this.#I();const a=this.#D();!r||this.#h===n&&(0,c.Eh)(this.options.enabled,this.#h)===(0,c.Eh)(t.enabled,this.#h)&&a===this.#k||this.#L(a)}getOptimisticResult(e){const t=this.#r.getQueryCache().build(this.#r,e),n=this.createResult(t,e);return r=this,a=n,!(0,c.f8)(r.getCurrentResult(),a)&&(this.#v=n,this.#w=this.options,this.#b=this.#h.state),n;var r,a}getCurrentResult(){return this.#v}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#p.status||this.#p.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#O.add(e)}getCurrentQuery(){return this.#h}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#r.defaultQueryOptions(e),n=this.#r.getQueryCache().build(this.#r,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#A(e){this.#T();let t=this.#h.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c.lQ)),t}#I(){this.#j();const e=(0,c.d2)(this.options.staleTime,this.#h);if(c.S$||this.#v.isStale||!(0,c.gn)(e))return;const t=(0,c.j3)(this.#v.dataUpdatedAt,e)+1;this.#C=s.zs.setTimeout(()=>{this.#v.isStale||this.updateResult()},t)}#D(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#h):this.options.refetchInterval)??!1}#L(e){this.#P(),this.#k=e,!c.S$&&!1!==(0,c.Eh)(this.options.enabled,this.#h)&&(0,c.gn)(this.#k)&&0!==this.#k&&(this.#N=s.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||r.m.isFocused())&&this.#A()},this.#k))}#S(){this.#I(),this.#L(this.#D())}#j(){this.#C&&(s.zs.clearTimeout(this.#C),this.#C=void 0)}#P(){this.#N&&(s.zs.clearInterval(this.#N),this.#N=void 0)}createResult(e,t){const n=this.#h,r=this.options,a=this.#v,i=this.#b,s=this.#w,u=e!==n?e.state:this.#y,{state:m}=e;let p,h={...m},y=!1;if(t._optimisticResults){const a=this.hasListeners(),i=!a&&d(e,t),l=a&&g(e,n,t,r);(i||l)&&(h={...h,...(0,o.k)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:w}=h;p=h.data;let x=!1;if(void 0!==t.placeholderData&&void 0===p&&"pending"===w){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#_?.state.data,this.#_):t.placeholderData,void 0!==e&&(w="success",p=(0,c.pl)(a?.data,e,t),y=!0)}if(t.select&&void 0!==p&&!x)if(a&&p===i?.data&&t.select===this.#x)p=this.#E;else try{this.#x=t.select,p=t.select(p),p=(0,c.pl)(a?.data,p,t),this.#E=p,this.#f=null}catch(e){this.#f=e}this.#f&&(v=this.#f,p=this.#E,b=Date.now(),w="error");const E="fetching"===h.fetchStatus,_="pending"===w,C="error"===w,N=_&&E,k=void 0!==p,O={status:w,fetchStatus:h.fetchStatus,isPending:_,isSuccess:"success"===w,isError:C,isInitialLoading:N,isLoading:N,data:p,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:E,isRefetching:E&&!_,isLoadingError:C&&!k,isPaused:"paused"===h.fetchStatus,isPlaceholderData:y,isRefetchError:C&&k,isStale:f(e,t),refetch:this.refetch,promise:this.#p,isEnabled:!1!==(0,c.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===O.status?e.reject(O.error):void 0!==O.data&&e.resolve(O.data)},r=()=>{const e=this.#p=O.promise=(0,l.T)();t(e)},a=this.#p;switch(a.status){case"pending":e.queryHash===n.queryHash&&t(a);break;case"fulfilled":"error"!==O.status&&O.data===a.value||r();break;case"rejected":"error"===O.status&&O.error===a.reason||r()}}return O}updateResult(){const e=this.#v,t=this.createResult(this.#h,this.options);this.#b=this.#h.state,this.#w=this.options,void 0!==this.#b.data&&(this.#_=this.#h),(0,c.f8)(t,e)||(this.#v=t,this.#R({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#O.size)return!0;const r=new Set(n??this.#O);return this.options.throwOnError&&r.add("error"),Object.keys(this.#v).some(t=>{const n=t;return this.#v[n]!==e[n]&&r.has(n)})})()}))}#T(){const e=this.#r.getQueryCache().build(this.#r,this.options);if(e===this.#h)return;const t=this.#h;this.#h=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}#R(e){a.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#v)}),this.#r.getQueryCache().notify({query:this.#h,type:"observerResultsUpdated"})})}};function d(e,t){return function(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&m(e,t,t.refetchOnMount)}function m(e,t,n){if(!1!==(0,c.Eh)(t.enabled,e)&&"static"!==(0,c.d2)(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&f(e,t)}return!1}function g(e,t,n,r){return(e!==t||!1===(0,c.Eh)(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&f(e,n)}function f(e,t){return!1!==(0,c.Eh)(t.enabled,e)&&e.isStaleByTime((0,c.d2)(t.staleTime,e))}},1692:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var r=n(2775),a=n(4880),o=class{#F;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,a.gn)(this.gcTime)&&(this.#F=r.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.S$?1/0:3e5))}clearGcTimeout(){this.#F&&(r.zs.clearTimeout(this.#F),this.#F=void 0)}}},8904:(e,t,n)=>{"use strict";n.d(t,{II:()=>u,cc:()=>s,v_:()=>c});var r=n(9658),a=n(6035),o=n(4658),i=n(4880);function l(e){return Math.min(1e3*2**e,3e4)}function c(e){return"online"!==(e??"online")||a.t.isOnline()}var s=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){let t,n=!1,u=0;const d=(0,o.T)(),m=()=>"pending"!==d.status,g=()=>r.m.isFocused()&&("always"===e.networkMode||a.t.isOnline())&&e.canRun(),f=()=>c(e.networkMode)&&e.canRun(),p=e=>{m()||(t?.(),d.resolve(e))},h=e=>{m()||(t?.(),d.reject(e))},y=()=>new Promise(n=>{t=e=>{(m()||g())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,m()||e.onContinue?.()}),v=()=>{if(m())return;let t;const r=0===u?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if(m())return;const r=e.retry??(i.S$?0:3),a=e.retryDelay??l,o="function"==typeof a?a(u,t):a,c=!0===r||"number"==typeof r&&u<r||"function"==typeof r&&r(u,t);!n&&c?(u++,e.onFail?.(u,t),(0,i.yy)(o).then(()=>g()?void 0:y()).then(()=>{n?h(t):v()})):h(t)})};return{promise:d,status:()=>d.status,cancel:t=>{if(!m()){const n=new s(t);h(n),e.onCancel?.(n)}},continue:()=>(t?.(),d),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:f,start:()=>(f()?v():y().then(v),d)}}},6500:(e,t,n)=>{"use strict";n.d(t,{Q:()=>r});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},4658:(e,t,n)=>{"use strict";function r(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}n.d(t,{T:()=>r})},2775:(e,t,n)=>{"use strict";n.d(t,{Zq:()=>o,zs:()=>a});var r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},a=new class{#M=r;#G=!1;setTimeoutProvider(e){this.#M=e}setTimeout(e,t){return this.#M.setTimeout(e,t)}clearTimeout(e){this.#M.clearTimeout(e)}setInterval(e,t){return this.#M.setInterval(e,t)}clearInterval(e){this.#M.clearInterval(e)}};function o(e){setTimeout(e,0)}},4880:(e,t,n)=>{"use strict";n.d(t,{Cp:()=>p,EN:()=>f,Eh:()=>u,F$:()=>g,GU:()=>A,MK:()=>d,S$:()=>a,ZM:()=>O,ZZ:()=>N,Zw:()=>i,d2:()=>s,f8:()=>v,gn:()=>l,hT:()=>k,j3:()=>c,lQ:()=>o,nJ:()=>m,pl:()=>_,y9:()=>C,yy:()=>E});var r=n(2775),a="undefined"==typeof window||"Deno"in globalThis;function o(){}function i(e,t){return"function"==typeof e?e(t):e}function l(e){return"number"==typeof e&&e>=0&&e!==1/0}function c(e,t){return Math.max(e+(t||0)-Date.now(),0)}function s(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function d(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:i,stale:l}=e;if(i)if(r){if(t.queryHash!==g(i,t.options))return!1}else if(!p(t.queryKey,i))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof l&&t.isStale()!==l||a&&a!==t.state.fetchStatus||o&&!o(t))}function m(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(f(t.options.mutationKey)!==f(o))return!1}else if(!p(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function g(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>p(e[n],t[n]))}var h=Object.prototype.hasOwnProperty;function y(e,t){if(e===t)return e;const n=b(e)&&b(t);if(!(n||w(e)&&w(t)))return t;const r=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,i=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const o=n?c:a[c],s=e[o],u=t[o];if(s===u){i[o]=s,(n?c<r:h.call(e,o))&&l++;continue}if(null===s||null===u||"object"!=typeof s||"object"!=typeof u){i[o]=u;continue}const d=y(s,u);i[o]=d,d===s&&l++}return r===o&&l===r?e:i}function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!x(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return new Promise(t=>{r.zs.setTimeout(t,e)})}function _(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?y(e,t):t}function C(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function N(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==k?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function A(e,t){return"function"==typeof e?e(...t):!!e}},7665:(e,t,n)=>{"use strict";n.d(t,{Ht:()=>l,jE:()=>i});var r=n(1609),a=n(790),o=r.createContext(void 0),i=e=>{const t=r.useContext(o);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},l=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,a.jsx)(o.Provider,{value:e,children:t}))},8074:(e,t,n)=>{"use strict";n.d(t,{t:()=>v});var r=n(1609),a=n(6261),o=n(4880),i=n(7665);n(790);var l=r.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),c=()=>r.useContext(l),s=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},u=e=>{r.useEffect(()=>{e.clearReset()},[e])},d=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&void 0===e.data||(0,o.GU)(n,[e.error,r])),m=r.createContext(!1),g=()=>r.useContext(m),f=(m.Provider,e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}}),p=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,y=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function v(e,t,n){const l=g(),m=c(),v=(0,i.jE)(n),b=v.defaultQueryOptions(e);v.getDefaultOptions().queries?._experimental_beforeQuery?.(b),b._optimisticResults=l?"isRestoring":"optimistic",f(b),s(b,m),u(m);const w=!v.getQueryCache().get(b.queryHash),[x]=r.useState(()=>new t(v,b)),E=x.getOptimisticResult(b),_=!l&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{const t=_?x.subscribe(a.jG.batchCalls(e)):o.lQ;return x.updateResult(),t},[x,_]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),r.useEffect(()=>{x.setOptions(b)},[b,x]),h(b,E))throw y(b,x,m);if(d({result:E,errorResetBoundary:m,throwOnError:b.throwOnError,query:v.getQueryCache().get(b.queryHash),suspense:b.suspense}))throw E.error;if(v.getDefaultOptions().queries?._experimental_afterQuery?.(b,E),b.experimental_prefetchInRender&&!o.S$&&p(E,l)){const e=w?y(b,x,m):v.getQueryCache().get(b.queryHash)?.promise;e?.catch(o.lQ).finally(()=>{x.updateResult()})}return b.notifyOnChangeProps?E:x.trackResult(E)}},6475:(e,t,n)=>{"use strict";n.d(t,{q:()=>l});var r=n(1651),a=n(8959),o=class extends r.${constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:(0,a.PL)()})}getOptimisticResult(e){return e.behavior=(0,a.PL)(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:l,isRefetchError:c}=r,s=n.fetchMeta?.fetchMore?.direction,u=l&&"forward"===s,d=o&&"forward"===s,m=l&&"backward"===s,g=o&&"backward"===s;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,a.rB)(t,n.data),hasPreviousPage:(0,a.RQ)(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:m,isFetchingPreviousPage:g,isRefetchError:c&&!u&&!m,isRefetching:i&&!d&&!g}}},i=n(8074);function l(e,t){return(0,i.t)(e,o,t)}},7097:(e,t,n)=>{"use strict";n.d(t,{n:()=>u});var r=n(1609),a=n(6158),o=n(6261),i=n(6500),l=n(4880),c=class extends i.Q{#r;#v=void 0;#Q;#B;constructor(e,t){super(),this.#r=e,this.setOptions(t),this.bindMethods(),this.#q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#r.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#r.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#Q,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():"pending"===this.#Q?.state.status&&this.#Q.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#Q?.removeObserver(this)}onMutationUpdate(e){this.#q(),this.#R(e)}getCurrentResult(){return this.#v}reset(){this.#Q?.removeObserver(this),this.#Q=void 0,this.#q(),this.#R()}mutate(e,t){return this.#B=t,this.#Q?.removeObserver(this),this.#Q=this.#r.getMutationCache().build(this.#r,this.options),this.#Q.addObserver(this),this.#Q.execute(e)}#q(){const e=this.#Q?.state??(0,a.$)();this.#v={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#R(e){o.jG.batch(()=>{if(this.#B&&this.hasListeners()){const t=this.#v.variables,n=this.#v.context,r={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey};"success"===e?.type?(this.#B.onSuccess?.(e.data,t,n,r),this.#B.onSettled?.(e.data,null,t,n,r)):"error"===e?.type&&(this.#B.onError?.(e.error,t,n,r),this.#B.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#v)})})}},s=n(7665);function u(e,t){const n=(0,s.jE)(t),[a]=r.useState(()=>new c(n,e));r.useEffect(()=>{a.setOptions(e)},[a,e]);const i=r.useSyncExternalStore(r.useCallback(e=>a.subscribe(o.jG.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=r.useCallback((e,t)=>{a.mutate(e,t).catch(l.lQ)},[a]);if(i.error&&(0,l.GU)(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}},7286:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var r=n(1651),a=n(8074);function o(e,t){return(0,a.t)(e,r.$,t)}}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e].call(o.exports,o,o.exports,a),o.exports}a.m=n,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>e+".min.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@envira/imagely-admin-app:",a.l=(n,r,o,i)=>{if(e[n])e[n].push(r);else{var l,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var d=s[u];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+o){l=d;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",t+o),l.src=n),e[n]=[r];var m=(t,r)=>{l.onerror=l.onload=null,clearTimeout(g);var a=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach(e=>e(r)),t)return t(r)},g=setTimeout(m.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=m.bind(null,l.onerror),l.onload=m.bind(null,l.onload),c&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={39:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,a)=>r=e[t]=[n,a]);n.push(r[2]=o);var i=a.p+a.u(t),l=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,r[1](l)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,l,c]=n,s=0;if(i.some(t=>0!==e[t])){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);c&&c(a)}for(t&&t(n);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk_envira_imagely_admin_app=self.webpackChunk_envira_imagely_admin_app||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=a(4467),t=a(6106);const n=window.wp.blocks;var r=a(6087);const o=window.wp.hooks;var i=a(467),l=a(5458),c=a(3453),s=a(9292),u=a(1609),d=a.n(u),m=a(2549),g=a(7143);const f=function(){var e=(0,g.useDispatch)(m.EF),n=(0,g.useSelect)(function(e){return e(m.EF).getNotifications()},[]),r=function(e){switch(e){case"success":return"bg-green-50 border-green-200 text-green-800";case"info":return"bg-blue-50 border-blue-200 text-blue-800";case"warning":return"bg-yellow-50 border-yellow-200 text-yellow-800";case"error":return"bg-red-50 border-red-200 text-red-800";default:return"bg-gray-50 border-gray-200 text-gray-800"}},a=function(e){switch(e){case"success":return"text-green-400";case"info":return"text-blue-400";case"warning":return"text-yellow-400";case"error":return"text-red-400";default:return"text-gray-400"}};return 0===n.length?null:d().createElement("div",{className:"fixed top-10 right-4 z-50 space-y-3 max-w-sm"},n.map(function(n){return d().createElement("div",{key:n.id,className:"p-4 rounded-lg border shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 ".concat(r(n.type))},d().createElement("div",{className:"flex items-start"},d().createElement("div",{className:"flex-shrink-0 ".concat(a(n.type))},function(e){switch(e){case"success":return d().createElement(t.$C,{className:"w-5 h-5"});case"info":return d().createElement(t.it,{className:"w-5 h-5"});case"warning":return d().createElement(t.m,{className:"w-5 h-5"});case"error":return d().createElement(t.aP,{className:"w-5 h-5"});default:return null}}(n.type)),d().createElement("div",{className:"ml-3 flex-1"},d().createElement("p",{className:"text-sm font-medium"},n.message)),n.dismissible&&d().createElement("div",{className:"ml-4 flex-shrink-0"},d().createElement("button",{onClick:function(){return e.dismissNotice(n.id)},className:"inline-flex text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition ease-in-out duration-150"},d().createElement(t.US,{className:"w-4 h-4"})))))}))};var p=a(7723);const h=function(){return(0,g.useSelect)(function(e){return{isPageLoading:e(m.EF).getPageLoading()}},[]).isPageLoading?d().createElement("div",{className:"fixed inset-0 bg-white bg-opacity-75 flex items-center justify-center z-50"},d().createElement(s.A,{size:"lg",color:"green",text:(0,p.__)("Loading...","nggallery"),centerInContainer:!1})):null};var y=a(8168),v=a(7196);var b=a(2284),w=a(45),x=a(4540),E=a(1455),_=a.n(E);function C(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return N(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(N(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,N(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,N(d,"constructor",s),N(s,"constructor",c),c.displayName="GeneratorFunction",N(s,a,"GeneratorFunction"),N(d),N(d,a,"Generator"),N(d,r,function(){return this}),N(d,"toString",function(){return"[object Generator]"}),(C=function(){return{w:o,m}})()}function N(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}N=function(e,t,n,r){function o(t,n){N(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},N(e,t,n,r)}function k(e){return O.apply(this,arguments)}function O(){return(O=(0,i.A)(C().m(function e(t){var n,r,a,o;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.trim()){e.n=1;break}return e.a(2,!1);case 1:return e.p=1,r=(0,x.m9)(),e.n=2,_()({path:m.ti,method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:{video_link:n}});case 2:return a=e.v,e.a(2,!0===a.is_hosted_video);case 3:return e.p=3,o=e.v,console.warn("Failed to check if video is hosted:",o),e.a(2,!1)}},e,null,[[1,3]])}))).apply(this,arguments)}var A=function(){var e=(0,u.useState)(!1),t=(0,c.A)(e,2),n=t[0],r=t[1];return function(e){(0,u.useEffect)(function(){if(e){var t=function(e){var t=e.target;(t.closest(".media-modal")||t.closest(".media-frame")||t.closest(".media-modal-backdrop")||t.closest(".wp-core-ui"))&&(e.stopPropagation(),e.stopImmediatePropagation())};return document.addEventListener("mousedown",t,!0),document.addEventListener("touchstart",t,!0),function(){document.removeEventListener("mousedown",t,!0),document.removeEventListener("touchstart",t,!0)}}},[e])}(n),{isMediaLibraryOpen:n,openMediaFrame:(0,u.useCallback)(function(e,t){var n=e.title,a=void 0===n?(0,p.__)("Select Image","nggallery"):n,o=e.buttonText,i=void 0===o?(0,p.__)("Use this image","nggallery"):o,l=e.libraryType,c=void 0===l?"image":l,s=e.onSelect;t&&(t.stopPropagation(),t.preventDefault()),r(!0);var u=window.wp.media({title:a,button:{text:i},multiple:!1,library:{type:c}});u.on("select",function(){var e,t=u.state().get("selection").first(),n=(e=t?t.toJSON():null)&&(e.url||e.source_url||e.link)||"";n&&(s(n),u.close())}),u.on("open",function(){r(!0)}),u.on("close",function(){setTimeout(function(){r(!1)},100)}),u.open()},[])}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=["thumbnailFile"];function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return I(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(I(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,I(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,I(d,"constructor",s),I(s,"constructor",c),c.displayName="GeneratorFunction",I(s,a,"GeneratorFunction"),I(d),I(d,a,"Generator"),I(d,r,function(){return this}),I(d,"toString",function(){return"[object Generator]"}),(T=function(){return{w:o,m}})()}function I(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}I=function(e,t,n,r){function o(t,n){I(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},I(e,t,n,r)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?D(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(e){var t=function(e){if("object"!=(0,b.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,b.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,b.A)(t)?t:t+""}const F=function(n){var r=n.galleryId,a=n.galleryTitle,o=n.buttonLabel,s=n.onSuccess,g=n.onGalleryCreated,f=(0,u.useState)([{id:Date.now().toString(),videoLink:"",thumbnailImageLink:""}]),h=(0,c.A)(f,2),y=h[0],v=h[1],b=(0,u.useState)([]),E=(0,c.A)(b,2),C=E[0],N=E[1],O=(0,u.useState)(!1),I=(0,c.A)(O,2),D=I[0],F=I[1],M=(0,u.useState)({}),G=(0,c.A)(M,2),Q=G[0],B=G[1],q=(0,u.useRef)({}),U=(0,u.useRef)(new Set),H=(0,u.useRef)({}),z=A().openMediaFrame;(0,u.useEffect)(function(){return function(){U.current.forEach(function(e){URL.revokeObjectURL(e)}),U.current.clear(),Object.values(H.current).forEach(function(e){clearTimeout(e)}),H.current={}}},[]);var K=function(t,n,r){v(function(a){return a.map(function(a){return a.id===t?"thumbnailImageLink"===n&&r&&!r.startsWith("blob:")?(a.thumbnailFile,L(L({},(0,w.A)(a,j)),{},(0,e.A)({},n,r))):L(L({},a),{},(0,e.A)({},n,r)):a})}),N([]),"videoLink"===n&&(H.current[t]&&clearTimeout(H.current[t]),H.current[t]=setTimeout((0,i.A)(T().m(function n(){var a,o,i,l,c,s;return T().w(function(n){for(;;)switch(n.p=n.n){case 0:if(a=r.trim()){n.n=1;break}return B(function(e){return e[t],(0,w.A)(e,[t].map(R))}),(o=H.current)[t],i=(0,w.A)(o,[t].map(R)),H.current=i,n.a(2);case 1:return n.p=1,n.n=2,k(a);case 2:l=n.v,B(function(n){return L(L({},n),{},(0,e.A)({},t,l))}),n.n=4;break;case 3:n.p=3,n.v,B(function(e){return e[t],(0,w.A)(e,[t].map(R))});case 4:(c=H.current)[t],s=(0,w.A)(c,[t].map(R)),H.current=s;case 5:return n.a(2)}},n,null,[[1,3]])})),500))},V=function(){var e=(0,i.A)(T().m(function e(t,n){var r;return T().w(function(e){for(;;)switch(e.n){case 0:if(n.type.startsWith("image/")){e.n=1;break}return N([(0,p.__)("Please select a valid image file.","nggallery")]),e.a(2);case 1:r=URL.createObjectURL(n),U.current.add(r),v(function(e){return e.map(function(e){return e.id===t?L(L({},e),{},{thumbnailFile:n,thumbnailImageLink:r}):e})}),N([]);case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),W=function(){var e=function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;)if(!t.value.videoLink.trim())return(0,p.__)("Video Link is required","nggallery")}catch(e){n.e(e)}finally{n.f()}return""}(y);if(e)return N([e]),!1;var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return P(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}(y);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(Q[r.id]&&!r.thumbnailImageLink.trim()&&!r.thumbnailFile)return N([(0,p.__)("Thumbnail image link is required if specifying a local video URL. Please provide a thumbnail for all local video URLs.","nggallery")]),!1}}catch(e){n.e(e)}finally{n.f()}return N([]),!0},X=function(){var e=(0,i.A)(T().m(function e(){var t,n,o,i,l;return T().w(function(e){for(;;)switch(e.p=e.n){case 0:if(W()){e.n=1;break}return e.a(2);case 1:if(r||a.trim()){e.n=2;break}return N([(0,p.__)("Please provide a gallery title.","nggallery")]),e.a(2);case 2:return F(!0),N([]),e.p=3,t=y.filter(function(e){return e.videoLink.trim()||e.thumbnailImageLink.trim()}),n=new FormData,r?n.append("gallery_id",r.toString()):a.trim()&&n.append("gallery_title",a.trim()),t.forEach(function(e,t){n.append("video_links[".concat(t,"][videoLink]"),e.videoLink.trim());var r=e.thumbnailImageLink.startsWith("blob:")?"":e.thumbnailImageLink.trim();n.append("video_links[".concat(t,"][thumbnailImageLink]"),r),e.thumbnailFile&&n.append("video_links[".concat(t,"][thumbnailFileInput]"),e.thumbnailFile)}),e.n=4,_()({path:m.Co,method:"POST",headers:{"X-WP-Nonce":(0,x.m9)()},body:n});case 4:if(!(o=e.v).error){e.n=5;break}throw new Error(o.error);case 5:if(!(o.errors&&o.errors.length>0)){e.n=6;break}throw new Error(o.errors.join(", "));case 6:if(o.gallery_id){e.n=7;break}throw new Error((0,p.__)("No gallery ID returned from the API.","nggallery"));case 7:s&&s(o.gallery_id),null==g||g(o.gallery_id),e.n=9;break;case 8:e.p=8,l=e.v,i=(null==l?void 0:l.errors)||[(0,p.__)("Failed to create gallery with video links. Please try again.","nggallery")],N(i);case 9:return e.p=9,F(!1),e.f(9);case 10:return e.a(2)}},e,null,[[3,8,9,10]])}));return function(){return e.apply(this,arguments)}}(),Y=y.some(function(e){return e.videoLink.trim()});return d().createElement("div",{className:"flex flex-col h-full","data-testid":"video-links-form"},d().createElement("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col"},d().createElement("div",{className:"space-y-4 mb-4"},y.map(function(e){return d().createElement("div",{key:e.id,className:"p-3 sm:p-4 border border-gray-300 rounded-lg bg-white","data-testid":"video-link-item-".concat(e.id)},d().createElement("div",{className:"space-y-3"},d().createElement("div",null,d().createElement("div",{className:"flex items-center justify-between mb-1.5"},d().createElement("label",{htmlFor:"video-link-".concat(e.id),className:"block text-sm font-medium text-gray-700"},(0,p.__)("Video Link","nggallery")),y.length>1&&d().createElement("button",{onClick:function(){return function(e){if(y.length>1){if(v(function(t){return t.filter(function(t){return t.id!==e})}),N([]),H.current[e]){clearTimeout(H.current[e]);var t=H.current,n=(t[e],(0,w.A)(t,[e].map(R)));H.current=n}B(function(t){return t[e],(0,w.A)(t,[e].map(R))})}}(e.id)},className:"text-red-500 hover:text-red-600 transition-colors p-1",title:(0,p.__)("Remove video","nggallery"),"data-testid":"remove-video-link-".concat(e.id)},d().createElement(t.uc,{className:"w-4 h-4 sm:w-5 sm:h-5"}))),d().createElement("input",{type:"text",id:"video-link-".concat(e.id),name:"video-link-".concat(e.id),value:e.videoLink,onChange:function(t){return K(e.id,"videoLink",t.target.value)},placeholder:(0,p.__)("Enter video URL","nggallery"),className:"bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5 hover:border-green-500 border-gray-400 transition-colors","data-testid":"video-link-input-".concat(e.id)})),d().createElement("div",null,d().createElement("label",{htmlFor:"thumbnail-image-link-".concat(e.id),className:"block text-sm font-medium text-gray-700 mb-1.5"},(0,p.__)("Thumbnail Image Link","nggallery")),d().createElement("input",{type:"text",id:"thumbnail-image-link-".concat(e.id),name:"thumbnail-image-link-".concat(e.id),value:e.thumbnailImageLink.startsWith("blob:")?"":e.thumbnailImageLink,onChange:function(t){return K(e.id,"thumbnailImageLink",t.target.value)},placeholder:(0,p.__)("Enter thumbnail image URL or select from media library","nggallery"),className:"bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5 hover:border-green-500 border-gray-400 transition-colors mb-2",disabled:!!e.thumbnailFile||D,"data-testid":"thumbnail-link-input-".concat(e.id)}),d().createElement("input",{ref:function(t){q.current[e.id]=t},type:"file",accept:"image/*",onChange:function(t){return function(e,t){var n=t.target.files;n&&n.length>0&&V(e,n[0]),t.target&&(t.target.value="")}(e.id,t)},className:"hidden",disabled:D}),d().createElement("div",{className:"flex gap-4 items-start"},d().createElement("div",{className:"flex flex-col gap-2"},d().createElement("button",{type:"button",onClick:function(){return t=e.id,void((n=q.current[t])&&n.click());var t,n},disabled:D,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 border border-gray-300 rounded-lg transition-colors flex items-center justify-center gap-2 text-gray-700 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed",title:(0,p.__)("Upload from computer","nggallery"),"data-testid":"file-upload-".concat(e.id)},d().createElement(t.kA,{className:"w-5 h-5 flex-shrink-0"}),d().createElement("span",{className:"text-sm font-medium"},(0,p.__)("Select File","nggallery"))),d().createElement("button",{type:"button",onClick:function(t){return function(e,t){z({title:(0,p.__)("Select Cover Image","nggallery"),buttonText:(0,p.__)("Use this image","nggallery"),onSelect:function(t){K(e,"thumbnailImageLink",t)}},t)}(e.id,t)},disabled:D,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 border border-gray-300 rounded-lg transition-colors flex items-center justify-center gap-2 text-gray-700 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed",title:(0,p.__)("Select from Media Library","nggallery"),"data-testid":"upload-thumbnail-".concat(e.id)},d().createElement(t.ZH,{className:"w-5 h-5 flex-shrink-0"}),d().createElement("span",{className:"text-sm font-medium"},(0,p.__)("Upload","nggallery"))),e.thumbnailFile&&d().createElement("div",{className:"text-xs text-gray-600"},(0,p.__)("File selected:","nggallery")," ",e.thumbnailFile.name)),e.thumbnailImageLink.trim()&&d().createElement("div",{className:"flex-1 flex justify-end"},d().createElement("div",{className:"relative w-32 h-24 sm:w-40 sm:h-32"},d().createElement("img",{src:e.thumbnailImageLink,alt:(0,p.__)("Thumbnail preview","nggallery"),className:"w-full h-full object-cover border border-gray-300 rounded-lg",onError:function(e){e.target.style.display="none"}})))))))})),d().createElement("div",{className:"mb-4"},d().createElement("button",{onClick:function(){v(function(e){return[].concat((0,l.A)(e),[{id:Date.now().toString()+Math.random().toString(),videoLink:"",thumbnailImageLink:""}])}),N([])},className:"w-full py-2 px-4 text-sm sm:text-base border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors text-gray-700 font-medium","data-testid":"add-video-link-button"},(0,p.__)("Add Video","nggallery"))),C.length>0&&d().createElement("div",{className:"text-red-500 text-xs sm:text-sm p-2 mb-4 bg-red-50 border border-red-200 rounded-lg",role:"alert"},C.map(function(e,t){return d().createElement("p",{key:t,className:"whitespace-pre-line"},e)})),d().createElement("div",{className:"mt-auto"},d().createElement("button",{onClick:X,disabled:D,className:"w-full py-2 sm:py-3 px-3 sm:px-4 text-white rounded-lg transition-colors text-sm sm:text-base ".concat(D||!Y?"bg-green-300 cursor-not-allowed":"bg-green-500 hover:bg-green-600"),"data-testid":"video-links-submit"},D?(0,p.__)("Creating...","nggallery"):(0,p.__)(o||"Create Gallery","nggallery")))))};var M=a(2724),G=a(7665);function Q(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return B(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(B(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,B(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,B(d,"constructor",s),B(s,"constructor",c),c.displayName="GeneratorFunction",B(s,a,"GeneratorFunction"),B(d),B(d,a,"Generator"),B(d,r,function(){return this}),B(d,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:o,m}})()}function B(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}B=function(e,t,n,r){function o(t,n){B(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},B(e,t,n,r)}var q=a(3155),U=a(2416),H=a(2329),z=["isOpen","onClose","onAlbumCreated"];function K(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return V(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(V(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,V(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,V(d,"constructor",s),V(s,"constructor",c),c.displayName="GeneratorFunction",V(s,a,"GeneratorFunction"),V(d),V(d,a,"Generator"),V(d,r,function(){return this}),V(d,"toString",function(){return"[object Generator]"}),(K=function(){return{w:o,m}})()}function V(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}V=function(e,t,n,r){function o(t,n){V(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},V(e,t,n,r)}const W=function(t){var n=t.isOpen,r=t.onClose,a=t.onAlbumCreated,o=(0,w.A)(t,z),l=(0,u.useState)(""),f=(0,c.A)(l,2),h=f[0],b=f[1],x=(0,u.useState)(!1),E=(0,c.A)(x,2),_=E[0],C=E[1],N=(0,q.dF)(),k=(0,U.E)(),O=k.showSuccess,A=k.showError,S=(0,g.useDispatch)(m.EF),j=(0,H.X)(),P=(0,u.useCallback)(function(){var t=(0,i.A)(K().m(function t(n){var o,i,l,c,s,u,d,m;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:if(n.preventDefault(),h.trim()){t.n=1;break}return A((0,p.__)("Album name is required","nggallery")),t.a(2);case 1:return C(!0),t.p=2,c="photocrati-nextgen_basic_compact_album",s={open_gallery_in_lightbox:!1,gallery_display_type:"photocrati-nextgen_basic_thumbnails",galleries_per_page:20,enable_breadcrumbs:1,enable_descriptions:0,display_view:"default",template:"default",override_thumbnail_settings:1,thumbnail_width:240,thumbnail_height:160,thumbnail_crop:1,animate_images_enable:!1,animate_images_style:"wobble",animate_images_duration:1500,animate_images_delay:250,animate_pagination_enable:!1,animate_pagination_style:"flipInX",animate_pagination_duration:1500,animate_pagination_delay:250,is_ecommerce_enabled:0},u={name:h.trim(),description:"",sortorder:[],display_type:c,display_type_settings:(0,e.A)({},c,s)},t.n=3,N.mutateAsync(u);case 3:null!=(d=t.v)&&d.message&&O(d.message),b(""),a&&null!=d&&null!==(o=d.album)&&void 0!==o&&o.id?a(d.album.id):null!=j&&j.isEmbed&&null!=j&&j.onInsertAlbum&&null!=d&&null!==(i=d.album)&&void 0!==i&&i.id?j.onInsertAlbum(d.album.id):null!=d&&null!==(l=d.album)&&void 0!==l&&l.id?(S.navigateTo("imagely-albums","galleries",d.album.id),r()):r(),t.n=5;break;case 4:t.p=4,m=t.v,console.error("❌ Error details:",JSON.stringify(m,null,2)),A((0,p.__)("Failed to create album","nggallery"));case 5:return t.p=5,C(!1),t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e){return t.apply(this,arguments)}}(),[h,O,A,r,N,S,j]),T=(0,u.useCallback)(function(){b(""),r(),null!=j&&j.isEmbed&&null!=j&&j.onClose&&j.onClose()},[r,j]);return d().createElement(v.A,(0,y.A)({isOpen:n,onClose:T,title:(0,p.__)("Create New Album","nggallery")},o),d().createElement("form",{onSubmit:P,className:"space-y-6"},d().createElement("div",null,d().createElement("label",{htmlFor:"album-name",className:"block text-sm font-medium text-gray-700 mb-2"},(0,p.__)("Album Name","nggallery")," ",d().createElement("span",{className:"text-red-500"},"*")),d().createElement("input",{id:"album-name",type:"text",value:h,onChange:function(e){return b(e.target.value)},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500",placeholder:(0,p.__)("Enter album name","nggallery"),disabled:_,required:!0})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4 border-t border-gray-200"},d().createElement("button",{type:"button",onClick:T,disabled:_,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:_||!h.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-green-500 border border-transparent rounded-md hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center"},_?d().createElement("span",{className:"inline-flex items-center"},d().createElement("span",{className:"mr-2"},d().createElement(s.A,{size:"sm",color:"gray",className:"!border-white",centerInContainer:!1})),d().createElement("span",null,(0,p.__)("Creating...","nggallery"))):(0,p.__)("Create Album","nggallery")))))};function X(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Y(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Y(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Y(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Y(d,"constructor",s),Y(s,"constructor",c),c.displayName="GeneratorFunction",Y(s,a,"GeneratorFunction"),Y(d),Y(d,a,"Generator"),Y(d,r,function(){return this}),Y(d,"toString",function(){return"[object Generator]"}),(X=function(){return{w:o,m}})()}function Y(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Y=function(e,t,n,r){function o(t,n){Y(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Y(e,t,n,r)}const Z=function(e){var t=e.current,n=e.total,r=e.label,a=e.showPercentage,o=void 0===a||a,i=n>0?Math.round(t/n*100):0;return d().createElement("div",{className:"w-full"},r&&d().createElement("div",{className:"flex justify-between items-center mb-2"},d().createElement("span",{className:"text-sm font-medium text-gray-700"},r),o&&d().createElement("span",{className:"text-sm text-gray-500"},t," / ",n," (",i,"%)")),d().createElement("div",{className:"w-full bg-gray-200 rounded-full h-2.5 overflow-hidden"},d().createElement("div",{className:"bg-green-600 h-2.5 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(i,"%")}})))};var J=a(7374);function $(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return ee(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ee(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ee(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,ee(d,"constructor",s),ee(s,"constructor",c),c.displayName="GeneratorFunction",ee(s,a,"GeneratorFunction"),ee(d),ee(d,a,"Generator"),ee(d,r,function(){return this}),ee(d,"toString",function(){return"[object Generator]"}),($=function(){return{w:o,m}})()}function ee(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ee=function(e,t,n,r){function o(t,n){ee(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ee(e,t,n,r)}function te(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return ne(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ne(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ne(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,ne(d,"constructor",s),ne(s,"constructor",c),c.displayName="GeneratorFunction",ne(s,a,"GeneratorFunction"),ne(d),ne(d,a,"Generator"),ne(d,r,function(){return this}),ne(d,"toString",function(){return"[object Generator]"}),(te=function(){return{w:o,m}})()}function ne(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ne=function(e,t,n,r){function o(t,n){ne(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ne(e,t,n,r)}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ae(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?re(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var le=a(3633);function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function se(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ue(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return de(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(de(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,de(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,de(d,"constructor",s),de(s,"constructor",c),c.displayName="GeneratorFunction",de(s,a,"GeneratorFunction"),de(d),de(d,a,"Generator"),de(d,r,function(){return this}),de(d,"toString",function(){return"[object Generator]"}),(ue=function(){return{w:o,m}})()}function de(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}de=function(e,t,n,r){function o(t,n){de(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},de(e,t,n,r)}function me(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return ge(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ge(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ge(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,ge(d,"constructor",s),ge(s,"constructor",c),c.displayName="GeneratorFunction",ge(s,a,"GeneratorFunction"),ge(d),ge(d,a,"Generator"),ge(d,r,function(){return this}),ge(d,"toString",function(){return"[object Generator]"}),(me=function(){return{w:o,m}})()}function ge(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ge=function(e,t,n,r){function o(t,n){ge(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ge(e,t,n,r)}function fe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return pe(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(pe(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,pe(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,pe(d,"constructor",s),pe(s,"constructor",c),c.displayName="GeneratorFunction",pe(s,a,"GeneratorFunction"),pe(d),pe(d,a,"Generator"),pe(d,r,function(){return this}),pe(d,"toString",function(){return"[object Generator]"}),(fe=function(){return{w:o,m}})()}function pe(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}pe=function(e,t,n,r){function o(t,n){pe(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},pe(e,t,n,r)}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ye(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?he(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var ve=a(7286),be=a(7097);function we(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return xe(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(xe(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,xe(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,xe(d,"constructor",s),xe(s,"constructor",c),c.displayName="GeneratorFunction",xe(s,a,"GeneratorFunction"),xe(d),xe(d,a,"Generator"),xe(d,r,function(){return this}),xe(d,"toString",function(){return"[object Generator]"}),(we=function(){return{w:o,m}})()}function xe(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}xe=function(e,t,n,r){function o(t,n){xe(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},xe(e,t,n,r)}function Ee(e){var t,n,r,a="percent"===(null==e?void 0:e.discount_type)?"percentage":"flat",o=null!==(t=null==e?void 0:e.ID)&&void 0!==t?t:null==e?void 0:e.id,i=(null==e?void 0:e.date)||(null==e?void 0:e.date_start)||"";return{id:Number(o),coupon_for:String((null==e?void 0:e.title)||""),coupon_code:String((null==e?void 0:e.id_code)||""),discount_type:a,discount_value:String(null!==(n=null!==(r=null==e?void 0:e.discount_amount)&&void 0!==r?r:null==e?void 0:e.discount_value)&&void 0!==n?n:""),start_date:(null==e?void 0:e.date_start)||void 0,end_date:(null==e?void 0:e.date_end)||void 0,usage_limit:null!==(null==e?void 0:e.usage_limit)&&void 0!==(null==e?void 0:e.usage_limit)?String(null==e?void 0:e.usage_limit):void 0,date:i,status:null==e?void 0:e.status,times_used:"number"==typeof(null==e?void 0:e.times_used)?null==e?void 0:e.times_used:void 0}}function _e(e){var t;return{id:Number(null==e?void 0:e.id),coupon_for:String((null==e?void 0:e.coupon_for)||""),coupon_code:String((null==e?void 0:e.coupon_code)||""),discount_type:"percentage"===(null==e?void 0:e.discount_type)||"flat"===(null==e?void 0:e.discount_type)?null==e?void 0:e.discount_type:"flat",discount_value:String(null!==(t=null==e?void 0:e.discount_value)&&void 0!==t?t:""),start_date:(null==e?void 0:e.start_date)||void 0,end_date:(null==e?void 0:e.end_date)||void 0,usage_limit:null!==(null==e?void 0:e.usage_limit)&&void 0!==(null==e?void 0:e.usage_limit)?String(null==e?void 0:e.usage_limit):void 0,date:(null==e?void 0:e.date)||(null==e?void 0:e.start_date)||"",status:null==e?void 0:e.status,times_used:"number"==typeof(null==e?void 0:e.times_used)?null==e?void 0:e.times_used:void 0}}var Ce=function(e){return["coupon",e]},Ne=function(e){return(0,ve.I)({queryKey:e?Ce(e):["coupon","none"],enabled:!!e,queryFn:(t=(0,i.A)(we().m(function t(){var n,r,a;return we().w(function(t){for(;;)switch(t.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,t.n=1,_()({path:"/imagely/v1/coupons/".concat(e),method:"GET",headers:{"X-WP-Nonce":r}});case 1:if(!(a=t.v)||!a.id_code&&!a.ID){t.n=2;break}return t.a(2,Ee(a));case 2:return t.a(2,_e(a))}},t)})),function(){return t.apply(this,arguments)}),staleTime:0,gcTime:6e5,retry:0,refetchOnMount:!0,refetchOnWindowFocus:!1});var t},ke=a(2026);var Oe=a(7899),Ae=a(5909);function Se(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return je(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(je(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,je(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,je(d,"constructor",s),je(s,"constructor",c),c.displayName="GeneratorFunction",je(s,a,"GeneratorFunction"),je(d),je(d,a,"Generator"),je(d,r,function(){return this}),je(d,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:o,m}})()}function je(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}je=function(e,t,n,r){function o(t,n){je(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},je(e,t,n,r)}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Te(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Pe(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ie(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return De(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(De(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,De(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,De(d,"constructor",s),De(s,"constructor",c),c.displayName="GeneratorFunction",De(s,a,"GeneratorFunction"),De(d),De(d,a,"Generator"),De(d,r,function(){return this}),De(d,"toString",function(){return"[object Generator]"}),(Ie=function(){return{w:o,m}})()}function De(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}De=function(e,t,n,r){function o(t,n){De(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},De(e,t,n,r)}function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Re(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Le(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var Fe=a(3717),Me=["isOpen","entityType","items","getItemId","getItemLabel","onClose","onConfirm","title","singularLabel","pluralLabel","confirmLabel","cancelLabel","maxList"];function Ge(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Qe(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Qe(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Qe(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Qe(d,"constructor",s),Qe(s,"constructor",c),c.displayName="GeneratorFunction",Qe(s,a,"GeneratorFunction"),Qe(d),Qe(d,a,"Generator"),Qe(d,r,function(){return this}),Qe(d,"toString",function(){return"[object Generator]"}),(Ge=function(){return{w:o,m}})()}function Qe(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Qe=function(e,t,n,r){function o(t,n){Qe(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Qe(e,t,n,r)}const Be=function(e){var n=e.isOpen,r=e.entityType,a=e.items,o=e.getItemId,l=e.getItemLabel,c=e.onClose,s=void 0===c?function(){}:c,m=e.onConfirm,g=void 0===m?function(){}:m,f=e.title,h=e.singularLabel,b=void 0===h?"item":h,x=e.pluralLabel,E=void 0===x?"items":x,_=e.confirmLabel,C=void 0===_?(0,p.__)("Delete","nggallery"):_,N=e.cancelLabel,k=void 0===N?(0,p.__)("Cancel","nggallery"):N,O=e.maxList,A=void 0===O?5:O,S=(0,w.A)(e,Me),j=(0,Fe.Ws)(),P=(0,M.ln)(),T=(0,q.wY)(),I=(0,U.E)(),D=I.showSuccess,L=I.showError,R=j.isPending||P.isPending||T.isPending,F=(0,u.useMemo)(function(){return a.length<=A?d().createElement("ul",{className:"list-none text-sm text-gray-700 px-4 text-center"},a.map(function(e){return d().createElement("li",{key:o(e)},l(e))})):null},[a,o,l,A]),G=function(){var e=(0,i.A)(Ge().m(function e(){var t,n;return Ge().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==a.length){e.n=1;break}return e.a(2);case 1:if(e.p=1,"images"!==r){e.n=3;break}return e.n=2,Promise.all(a.map(function(e){return j.mutateAsync({imageId:o(e)})}));case 2:e.n=6;break;case 3:if("galleries"!==r){e.n=5;break}return e.n=4,Promise.all(a.map(function(e){return P.mutateAsync(o(e))}));case 4:e.n=6;break;case 5:if("albums"!==r){e.n=6;break}return e.n=6,Promise.all(a.map(function(e){return T.mutateAsync(o(e))}));case 6:t=1===a.length?b:E,D((0,p.__)("Successfully deleted ".concat(a.length," ").concat(t),"nggallery")),g(),s(),e.n=8;break;case 7:e.p=7,n=e.v,console.error("Error deleting items:",n),L((0,p.__)("Failed to delete items","nggallery"));case 8:return e.a(2)}},e,null,[[1,7]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,(0,y.A)({isOpen:n,onClose:s},S),d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"flex items-center gap-2 justify-center"},d().createElement("div",null,d().createElement(t.b4,null))),f&&d().createElement("h2",{className:"text-xl font-bold text-center text-gray-900 mt-2"},f),d().createElement("p",{className:"text-sm text-gray-500 text-center"},(0,p.__)("Are you sure you want to delete ".concat(a.length," ").concat(1===a.length?b:E,"?"))),F,d().createElement("p",{className:"text-sm text-red-500 text-center"},(0,p.__)("This action cannot be undone.","nggallery")),d().createElement("div",{className:"flex justify-center space-x-3 !mb-4 ".concat(R?"cursor-wait":"")},d().createElement("button",{type:"button",onClick:s,disabled:R,className:"px-8 py-2 font-medium text-gray-700 bg-white border border-gray-300 rounded-lg shadow hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},k),d().createElement("button",{type:"button",onClick:G,disabled:R,className:"px-8 py-2 font-bold text-white bg-green-500 border border-transparent rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},R?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Deleting...","nggallery")):C))))};var qe=["isOpen","albums","onClose","onConfirm","title"];function Ue(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return He(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(He(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,He(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,He(d,"constructor",s),He(s,"constructor",c),c.displayName="GeneratorFunction",He(s,a,"GeneratorFunction"),He(d),He(d,a,"Generator"),He(d,r,function(){return this}),He(d,"toString",function(){return"[object Generator]"}),(Ue=function(){return{w:o,m}})()}function He(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}He=function(e,t,n,r){function o(t,n){He(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},He(e,t,n,r)}var ze=["isOpen","galleries","onClose","onConfirm","title"];var Ke=["isOpen","images","onClose","onConfirm","title"];function Ve(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return We(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(We(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,We(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,We(d,"constructor",s),We(s,"constructor",c),c.displayName="GeneratorFunction",We(s,a,"GeneratorFunction"),We(d),We(d,a,"Generator"),We(d,r,function(){return this}),We(d,"toString",function(){return"[object Generator]"}),(Ve=function(){return{w:o,m}})()}function We(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}We=function(e,t,n,r){function o(t,n){We(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},We(e,t,n,r)}var Xe=["isOpen","tags","onClose","onConfirm","title"];function Ye(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Ze(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ze(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Ze(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Ze(d,"constructor",s),Ze(s,"constructor",c),c.displayName="GeneratorFunction",Ze(s,a,"GeneratorFunction"),Ze(d),Ze(d,a,"Generator"),Ze(d,r,function(){return this}),Ze(d,"toString",function(){return"[object Generator]"}),(Ye=function(){return{w:o,m}})()}function Ze(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Ze=function(e,t,n,r){function o(t,n){Ze(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Ze(e,t,n,r)}function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $e(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Je(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function et(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return tt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(tt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,tt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,tt(d,"constructor",s),tt(s,"constructor",c),c.displayName="GeneratorFunction",tt(s,a,"GeneratorFunction"),tt(d),tt(d,a,"Generator"),tt(d,r,function(){return this}),tt(d,"toString",function(){return"[object Generator]"}),(et=function(){return{w:o,m}})()}function tt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}tt=function(e,t,n,r){function o(t,n){tt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},tt(e,t,n,r)}var nt=a(1985);function rt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return at(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(at(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,at(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,at(d,"constructor",s),at(s,"constructor",c),c.displayName="GeneratorFunction",at(s,a,"GeneratorFunction"),at(d),at(d,a,"Generator"),at(d,r,function(){return this}),at(d,"toString",function(){return"[object Generator]"}),(rt=function(){return{w:o,m}})()}function at(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}at=function(e,t,n,r){function o(t,n){at(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},at(e,t,n,r)}function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function it(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ot(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ct(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?lt(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function st(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return ut(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ut(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ut(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,ut(d,"constructor",s),ut(s,"constructor",c),c.displayName="GeneratorFunction",ut(s,a,"GeneratorFunction"),ut(d),ut(d,a,"Generator"),ut(d,r,function(){return this}),ut(d,"toString",function(){return"[object Generator]"}),(st=function(){return{w:o,m}})()}function ut(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ut=function(e,t,n,r){function o(t,n){ut(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ut(e,t,n,r)}var dt=a(3597);function mt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return gt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(gt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,gt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,gt(d,"constructor",s),gt(s,"constructor",c),c.displayName="GeneratorFunction",gt(s,a,"GeneratorFunction"),gt(d),gt(d,a,"Generator"),gt(d,r,function(){return this}),gt(d,"toString",function(){return"[object Generator]"}),(mt=function(){return{w:o,m}})()}function gt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}gt=function(e,t,n,r){function o(t,n){gt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},gt(e,t,n,r)}function ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ft(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}const ht=function(t){var n=t.gallery,r=t.onClose,a=t.onUpdate,o=(0,M.hW)(),l=(0,U.E)(),s=l.showSuccess,m=l.showError,g=(0,u.useState)({title:"",galdesc:""}),f=(0,c.A)(g,2),h=f[0],y=f[1];(0,u.useEffect)(function(){y({title:n.title||"",galdesc:n.galdesc||""})},[n]);var v=function(t){var n=t.target,r=n.name,a=n.value;y(function(t){return pt(pt({},t),{},(0,e.A)({},r,a))})},b=function(){var e=(0,i.A)(mt().m(function e(t){var i;return mt().w(function(e){for(;;)switch(e.p=e.n){case 0:return t.preventDefault(),e.p=1,e.n=2,o.mutateAsync({id:n.gid,data:{title:h.title,name:h.title,galdesc:h.galdesc}});case 2:a&&a(),r(),s((0,p.__)("Gallery updated successfully!","nggallery")),e.n=4;break;case 3:e.p=3,i=e.v,console.error("Error updating gallery:",i),console.error("Error details:",{message:i instanceof Error?i.message:"Unknown error",stack:i instanceof Error?i.stack:void 0,errorObject:i}),m((0,p.__)("Failed to update gallery. Please try again.","nggallery"));case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();return d().createElement("form",{onSubmit:b,className:"space-y-4"},d().createElement(Ae.A,{type:"text",name:"title",value:h.title,onChange:v,label:(0,p.__)("Gallery Title","nggallery"),placeholder:(0,p.__)("Enter gallery title","nggallery")}),d().createElement(dt.A,{name:"galdesc",value:h.galdesc,onChange:v,label:(0,p.__)("Gallery Description","nggallery"),placeholder:(0,p.__)("Enter gallery description","nggallery"),rows:6}),d().createElement("div",{className:"flex justify-end space-x-2"},d().createElement("button",{type:"button",onClick:r,className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors"},(0,p.__)("Save Changes","nggallery"))))};function yt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return vt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(vt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,vt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,vt(d,"constructor",s),vt(s,"constructor",c),c.displayName="GeneratorFunction",vt(s,a,"GeneratorFunction"),vt(d),vt(d,a,"Generator"),vt(d,r,function(){return this}),vt(d,"toString",function(){return"[object Generator]"}),(yt=function(){return{w:o,m}})()}function vt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}vt=function(e,t,n,r){function o(t,n){vt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},vt(e,t,n,r)}function bt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return wt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(wt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,wt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,wt(d,"constructor",s),wt(s,"constructor",c),c.displayName="GeneratorFunction",wt(s,a,"GeneratorFunction"),wt(d),wt(d,a,"Generator"),wt(d,r,function(){return this}),wt(d,"toString",function(){return"[object Generator]"}),(bt=function(){return{w:o,m}})()}function wt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}wt=function(e,t,n,r){function o(t,n){wt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},wt(e,t,n,r)}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Et(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?xt(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}const _t=function(t){var n=t.onSuccess,r=(0,g.useDispatch)(m.EF),a=(0,M.AO)(),o=(0,U.E)(),l=o.showSuccess,s=o.showError,f=(0,u.useState)({title:"",galdesc:""}),h=(0,c.A)(f,2),y=h[0],v=h[1],b=function(t){var n=t.target,r=n.name,a=n.value;v(function(t){return Et(Et({},t),{},(0,e.A)({},r,a))})},w=function(){var e=(0,i.A)(bt().m(function e(t){var o,i;return bt().w(function(e){for(;;)switch(e.p=e.n){case 0:return t.preventDefault(),e.p=1,e.n=2,a.mutateAsync(Et(Et({},y),{},{name:y.title}));case 2:o=e.v,v({title:"",galdesc:""}),r.setActiveModal(null),n&&null!=o&&o.gid?(n(o.gid),l((0,p.__)("Gallery created successfully!","nggallery"))):null!=o&&o.gid?(r.navigateTo("imagely-add-new","images",o.gid),l((0,p.__)("Gallery created successfully!","nggallery"))):(console.warn("Could not navigate: Gallery ID is missing from response"),console.warn("Response structure:",Object.keys(o||{}))),e.n=4;break;case 3:e.p=3,i=e.v,console.error("Error creating gallery:",i),console.error("Error details:",{message:i instanceof Error?i.message:"Unknown error",stack:i instanceof Error?i.stack:void 0,errorObject:i}),s((0,p.__)("Failed to create gallery. Please try again.","nggallery"));case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();return d().createElement("form",{onSubmit:w,className:"space-y-4"},d().createElement(Ae.A,{type:"text",name:"title",value:y.title,onChange:b,label:(0,p.__)("Gallery Title","nggallery"),placeholder:(0,p.__)("Enter gallery title","nggallery")}),d().createElement(dt.A,{name:"galdesc",value:y.galdesc,onChange:b,label:(0,p.__)("Gallery Description","nggallery"),placeholder:(0,p.__)("Enter gallery description","nggallery"),rows:6}),d().createElement("button",{type:"submit",className:"bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition-colors"},(0,p.__)("Create Gallery","nggallery")))};var Ct=["isOpen","onClose","onGalleryCreated"];function Nt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return kt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(kt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,kt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,kt(d,"constructor",s),kt(s,"constructor",c),c.displayName="GeneratorFunction",kt(s,a,"GeneratorFunction"),kt(d),kt(d,a,"Generator"),kt(d,r,function(){return this}),kt(d,"toString",function(){return"[object Generator]"}),(Nt=function(){return{w:o,m}})()}function kt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}kt=function(e,t,n,r){function o(t,n){kt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},kt(e,t,n,r)}function Ot(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return At(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(At(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,At(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,At(d,"constructor",s),At(s,"constructor",c),c.displayName="GeneratorFunction",At(s,a,"GeneratorFunction"),At(d),At(d,a,"Generator"),At(d,r,function(){return this}),At(d,"toString",function(){return"[object Generator]"}),(Ot=function(){return{w:o,m}})()}function At(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}At=function(e,t,n,r){function o(t,n){At(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},At(e,t,n,r)}const St=function(e){var t=e.icon,n=e.label,r=e.isSelected,a=e.onClick,o=e.iconSize,i="small"===(void 0===o?"default":o)?"w-5 h-5":"w-6 h-6";return d().createElement("button",{onClick:a,className:"flex flex-col gap-[12px] items-center justify-center px-1 py-2 rounded-lg border transition-colors w-[112px] h-[88px] ".concat(r?"bg-[#f0f1f3] border-gray-700":"bg-white border-gray-300"," shadow-[0px_4px_4px_0px_rgba(55,65,81,0.08)] hover:bg-[#f0f1f3] hover:border-gray-700")},d().createElement(t,{className:"".concat(i," text-gray-700")}),d().createElement("p",{className:"font-medium text-[14px] leading-[16px] text-center text-gray-700"},n))};var jt=a(6415),Pt=a(3140),Tt=a(443),It=a(9836),Dt=a(5300),Lt=a(8881);function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ft(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Rt(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Mt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Gt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Gt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Gt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Gt(d,"constructor",s),Gt(s,"constructor",c),c.displayName="GeneratorFunction",Gt(s,a,"GeneratorFunction"),Gt(d),Gt(d,a,"Generator"),Gt(d,r,function(){return this}),Gt(d,"toString",function(){return"[object Generator]"}),(Mt=function(){return{w:o,m}})()}function Gt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Gt=function(e,t,n,r){function o(t,n){Gt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Gt(e,t,n,r)}var Qt={images:"image/jpeg,image/png,image/gif,image/webp",zip:"application/zip,application/x-zip-compressed"},Bt=function(e){return Qt.images.includes(e.type)||Qt.zip.includes(e.type)},qt=function(e){return Qt.zip.includes(e.type)};const Ut=function(e){var n=e.galleryId,r=e.onGalleryCreated,a=(0,u.useState)("media"),o=(0,c.A)(a,2),s=o[0],f=o[1],h=(0,u.useState)(!1),y=(0,c.A)(h,2),v=y[0],w=y[1],E=(0,u.useState)([]),C=(0,c.A)(E,2),N=C[0],k=C[1],O=(0,u.useState)([]),A=(0,c.A)(O,2),S=A[0],j=A[1],P=(0,u.useState)(""),T=(0,c.A)(P,2),I=T[0],D=T[1],L=(0,u.useState)(!1),R=(0,c.A)(L,2),Q=R[0],B=R[1],q=(0,u.useState)(""),H=(0,c.A)(q,2),z=H[0],K=H[1],V=(0,u.useState)(""),W=(0,c.A)(V,2),X=W[0],Y=W[1],Z=(0,u.useState)([]),$=(0,c.A)(Z,2),ee=$[0],te=$[1],ne=(0,u.useState)(!1),re=(0,c.A)(ne,2),ae=re[0],oe=re[1],ie=(0,u.useState)(""),le=(0,c.A)(ie,2),ce=le[0],se=le[1],ue=(0,u.useRef)(null),de=!n,me=(0,g.useDispatch)(m.EF),ge=(0,Tt.r)(),fe=ge.navigateTo,pe=ge.setCurrentId,he=(0,U.E)(),ye=he.showSuccess,ve=he.showError,be=(0,G.jE)(),we=(0,M.AO)(),xe=(0,M.hW)(),Ee=(0,M.ln)(),_e=(0,Pt._S)().data,Ce=(0,J.UG)().data;(0,u.useEffect)(function(){"folder"===s&&ke()},[s]);var Ne=function(e){setTimeout(function(){k(function(t){return t.filter(function(t){return t.file!==e||"uploading"===t.status||"error"===t.status})})},1e3)},ke=function(){var e=(0,i.A)(Mt().m(function e(){var t,n,r,a,o=arguments;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"",B(!0),K(""),e.p=1,e.n=2,_()({path:"/imagely/v1/folders/browse".concat(t?"?dir=".concat(encodeURIComponent(t)):""),method:"GET"});case 2:n=e.v,j(n.directories||[]),D(t),e.n=4;break;case 3:e.p=3,a=e.v,console.error("Error loading directories:",a),r=(null==a?void 0:a.error)||(0,p.__)("Failed to load directories. Please try again.","nggallery"),K(r);case 4:return e.p=4,B(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=(0,i.A)(Mt().m(function e(t){var n,a,o;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),X.trim()){e.n=1;break}return ve((0,p.__)("Please provide a gallery title.","nggallery")),e.a(2);case 1:return e.p=1,me.setPageLoading(!0),e.n=2,we.mutateAsync({title:X.trim(),name:X.trim(),galdesc:""});case 2:if(null==(n=e.v)||!n.gid){e.n=3;break}a=n.gid,me.setActiveModal(null),be.invalidateQueries({queryKey:["galleries"]}),be.invalidateQueries({queryKey:["gallery",a]}),r?r(a):fe("imagely-add-new","images",a),ye((0,p.__)("Gallery created successfully! You can now add images.","nggallery")),e.n=4;break;case 3:throw new Error((0,p.__)("Failed to create gallery","nggallery"));case 4:e.n=6;break;case 5:e.p=5,o=e.v,console.error("Error creating gallery:",o),ve((0,p.__)("Failed to create gallery. Please try again.","nggallery"));case 6:return e.p=6,me.setPageLoading(!1),e.f(6);case 7:return e.a(2)}},e,null,[[1,5,6,7]])}));return function(t){return e.apply(this,arguments)}}(),Se=function(){var e=(0,i.A)(Mt().m(function e(){var t,r,a,o,l;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(I){e.n=1;break}return K((0,p.__)("Please select a folder to import.","nggallery")),e.a(2);case 1:if(n||X.trim()){e.n=2;break}return K((0,p.__)("Please provide a gallery title.","nggallery")),e.a(2);case 2:return B(!0),K(""),e.p=3,t={folder:I,keep_location:ae},n?t.gallery_id=n:X&&(t.gallery_title=X),e.n=4,_()({path:"/imagely/v1/folders/import",method:"POST",headers:(0,x.kX)(),data:t}).catch(function(){var e=(0,i.A)(Mt().m(function e(t){var n;return Mt().w(function(e){for(;;)switch(e.n){case 0:if(console.error("Error importing folder:",t),!(t instanceof Response)){e.n=2;break}return e.n=1,t.json();case 1:if(null==(n=e.v)||!n.error){e.n=2;break}throw new Error(n.error);case 2:throw new Error((0,p.__)("Failed to import folder. Please try again.","nggallery"));case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}());case 4:if(!(r=e.v)||"object"!==(0,b.A)(r)||!("error"in r)){e.n=5;break}throw new Error(r.error);case 5:if(a=null==r?void 0:r.gallery_id){e.n=6;break}throw new Error((0,p.__)("No gallery ID returned from the import.","nggallery"));case 6:return ye((0,p.__)("Folder imported successfully!","nggallery")),e.n=7,Re(a);case 7:e.n=9;break;case 8:e.p=8,l=e.v,console.error("Error importing folder:",l),o=(null==l?void 0:l.message)||(0,p.__)("Failed to import folder. Please try again.","nggallery"),K(o),ve(o);case 9:return e.p=9,B(!1),e.f(9);case 10:return e.a(2)}},e,null,[[3,8,9,10]])}));return function(){return e.apply(this,arguments)}}(),je=function(){var e=(0,i.A)(Mt().m(function e(t){var r,a,o,i,l,c,s;return Mt().w(function(e){for(;;)switch(e.n){case 0:if(Bt(t)){e.n=1;break}return k(function(e){return e.map(function(e){return e.file===t?Ft(Ft({},e),{},{status:"error",error:(0,p.__)("Invalid file type. Please upload images (JPEG, PNG, GIF, WebP) or ZIP files.","nggallery")}):e})}),e.a(2);case 1:return(a=new FormData).append("file",t),n?a.append("gallery_id",n.toString()):X&&a.append("gallery_name",X),k(function(e){return e.map(function(e){return e.file===t?Ft(Ft({},e),{},{status:"uploading",progress:1}):e})}),o=window,i=(null===(r=o.imagelyApp)||void 0===r?void 0:r.restURL)||"/wp-json/",l=i.replace(/\/+$/,""),c="".concat(l,"/imagely/v1/images/upload"),s=(0,x.m9)(),e.n=2,new Promise(function(e){var n=new XMLHttpRequest,r=null;n.open("POST",c,!0),n.withCredentials=!0,s&&n.setRequestHeader("X-WP-Nonce",s),n.upload.onprogress=function(e){if(e.lengthComputable&&0!==e.total){var n=e.loaded/e.total*100,a=Math.round(n);k(function(e){return e.map(function(e){if(e.file!==t||"uploading"!==e.status)return e;var n=Math.min(100,Math.max(1,a)),r=Math.round(n/100*80),o=e.progress||0,i=Math.max(o,r);return Ft(Ft({},e),{},{progress:i})})}),e.lengthComputable&&e.loaded===e.total&&null===r&&(r=window.setInterval(function(){k(function(e){return e.map(function(e){if(e.file!==t||"uploading"!==e.status)return e;var n=e.progress||0;return n>=95?e:Ft(Ft({},e),{},{progress:Math.min(95,n+1)})})})},200))}},n.onerror=function(){null!==r&&clearInterval(r),console.error("Error uploading file:",t.name,n.statusText),k(function(e){return e.map(function(e){return e.file===t?Ft(Ft({},e),{},{status:"error",error:(0,p.__)("Upload failed","nggallery")}):e})}),e(void 0)},n.onload=function(){var a;null!==r&&clearInterval(r);try{var o=n.status,i=n.responseText||"";if(o<200||o>=300){if(i)try{var l=JSON.parse(i);if(l&&"object"===(0,b.A)(l)&&l.error)throw new Error(l.error)}catch(e){console.error("Error parsing JSON:",e)}throw new Error((0,p.__)("Upload failed","nggallery"))}if((a=i?JSON.parse(i):{}).error)throw new Error(a.error);k(function(e){return e.map(function(e){return e.file===t?Ft(Ft({},e),{},{status:"completed",progress:100}):e})}),Ne(t),e(a)}catch(n){console.error("Error uploading file:",t.name,n),k(function(e){return e.map(function(e){return e.file===t?Ft(Ft({},e),{},{status:"error",error:(0,p.__)("Upload failed","nggallery")}):e})}),e(void 0)}},n.send(a)});case 2:return e.a(2,e.v)}},e)}));return function(t){return e.apply(this,arguments)}}();(0,u.useEffect)(function(){return function(){ee.forEach(function(e){e.preview.startsWith("blob:")&&URL.revokeObjectURL(e.preview)})}},[ee]);var Pe=function(e){var t=Array.from(e).map(function(e){return{file:e,preview:qt(e)?(0,Dt.B)({width:130,height:130,text:"ZIP FILE",backgroundColor:"#f0f0f0",textColor:"#666666",fontSize:24}):URL.createObjectURL(e),excluded:!1,id:"".concat(e.name,"-").concat(e.lastModified)}});te(function(e){return[].concat((0,l.A)(e),(0,l.A)(t))})},Te=function(){var e=(0,i.A)(Mt().m(function e(t){var a,o,c,s,u,d,m,g,f,h,y,v,b,w;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,n||X.trim()){e.n=1;break}return ve((0,p.__)("Please provide a gallery title.","nggallery")),e.a(2);case 1:if(a=Array.from(t),o=a.map(function(e){return{file:e,progress:0,status:"pending"}}),k(function(e){return[].concat((0,l.A)(e),(0,l.A)(o))}),c=n,s=!1,u=function(){var e=(0,i.A)(Mt().m(function e(t){var n;return Mt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,je(t);case 1:return(n=e.v)&&!n.error||(s=!0),e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),d=0,n||!(a.length>0)){e.n=3;break}return e.n=2,u(a[0]);case 2:m=e.v,d=1,null!=m&&m.gallery_id&&(c=m.gallery_id,r||pe(c),n=c);case 3:if(!c){e.n=4;break}if(!((g=a.length-d)>0)){e.n=4;break}for(f=d,h=function(){var e=(0,i.A)(Mt().m(function e(){var t,n;return Mt().w(function(e){for(;;)switch(e.n){case 0:if(!((t=f)>=a.length)){e.n=1;break}return e.a(3,3);case 1:return f+=1,n=a[t],e.n=2,u(n);case 2:e.n=0;break;case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),y=Math.min(3,g),v=[],b=0;b<y;b++)v.push(h());return e.n=4,Promise.all(v);case 4:if(s||!c){e.n=5;break}return ye((0,p.__)("Images uploaded successfully!","nggallery")),e.n=5,Re(c);case 5:te([]),e.n=7;break;case 6:e.p=6,w=e.v,console.error("Error handling file upload:",w),ve((0,p.__)("Failed to upload images. Please try again.","nggallery"));case 7:return e.p=7,e.f(7);case 8:return e.a(2)}},e,null,[[0,6,7,8]])}));return function(t){return e.apply(this,arguments)}}(),Ie=function(){var e=(0,i.A)(Mt().m(function e(t){var r,a,o;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,B(!0),K(""),r={attachment_ids:t},n?r.gallery_id=n:X&&(r.gallery_name=X),e.n=1,_()({path:"/imagely/v1/images/import-media-library",method:"POST",headers:(0,x.kX)(),data:r});case 1:if(!(a=e.v).error){e.n=2;break}throw new Error(a.error);case 2:return e.a(2,a);case 3:throw e.p=3,o=e.v,console.error("Error importing media library images:",o),K((0,p.__)("Failed to import media library images. Please try again.","nggallery")),o;case 4:return e.p=4,B(!1),e.f(4);case 5:return e.a(2)}},e,null,[[0,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),De=function(){var e=(0,i.A)(Mt().m(function e(){var t;return Mt().w(function(e){for(;;)switch(e.n){case 0:if(n||X.trim()){e.n=1;break}return ve((0,p.__)("Please provide a gallery title.","nggallery")),e.a(2);case 1:(t=window.wp.media({title:(0,p.__)("Select Images","nggallery"),button:{text:(0,p.__)("Add to Gallery","nggallery")},multiple:!0,library:{type:"image"},states:[new window.wp.media.controller.Library({library:window.wp.media.query({type:"image"}),multiple:!0,title:(0,p.__)("Select Images","nggallery"),priority:20,filterable:"uploaded",editable:!0,allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0})]})).on("open",function(){setTimeout(function(){var e=document.querySelector(".media-button-primary");e?e.addEventListener("click",function(){me.showNotice("info",(0,p.__)("Loading images from WP Media, please wait...","nggallery"),{dismissible:!0,duration:15e3}),me.setPageLoading(!0)},{once:!0}):document.querySelectorAll(".media-button").forEach(function(e){e.addEventListener("click",function(){var t;(null!==(t=e.textContent)&&void 0!==t&&t.includes("Add to Gallery")||e.classList.contains("media-button-primary"))&&(me.showNotice("info",(0,p.__)("Loading images from WP Media, please wait...","nggallery"),{dismissible:!0,duration:15e3}),me.setPageLoading(!0))},{once:!0})})},100)}),t.on("select",(0,i.A)(Mt().m(function e(){var n,r,a,o,i;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=t.state().get("selection").toJSON(),r=n.map(function(e){return e.id}),e.p=1,e.n=2,Ie(r);case 2:if(!(a=e.v).error){e.n=3;break}throw new Error(a.error);case 3:if(o=null==a?void 0:a.gallery_id){e.n=4;break}throw new Error((0,p.__)("No gallery ID returned from the import.","nggallery"));case 4:return e.n=5,Re(o);case 5:ye((0,p.__)("Media library images imported successfully!","nggallery")),e.n=7;break;case 6:e.p=6,i=e.v,console.error("Error importing images:",i),ve((0,p.__)("Failed to import media library images. Please try again.","nggallery")),me.clearAllNotices(),me.setPageLoading(!1);case 7:return e.a(2)}},e,null,[[1,6]])}))),t.open();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),Le=function(){return new Promise(function(e){var t=function(){var n=document.querySelectorAll('[data-testid="gallery-image"], .gallery-image, img[src*="gallery"]');if(n.length>0){var r=Array.from(n).filter(function(e){return e.complete&&0!==e.naturalHeight});if(r.length===n.length&&r.length>0)return void e()}setTimeout(t,200)};setTimeout(t,300),setTimeout(function(){e()},3e3)})},Re=function(){var e=(0,i.A)(Mt().m(function e(t){return Mt().w(function(e){for(;;)switch(e.n){case 0:be.invalidateQueries({queryKey:["gallery",t,"images"]}),be.invalidateQueries({queryKey:["gallery",t]}),be.invalidateQueries({queryKey:["galleries"]}),de&&(r?r(t):fe("imagely-add-new","images",t)),me.setActiveModal(null),setTimeout((0,i.A)(Mt().m(function e(){return Mt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Le();case 1:me.clearAllNotices(),me.setPageLoading(!1);case 2:return e.a(2)}},e)})),100);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Fe=function(e){var t={type:e};switch(e){case"dribbble":return Ft(Ft({},t),{},{dribbble_type:"users_self_media_recent",dribbble_number:5,dribbble_link:0,dribbble_image_size:"default",dribbble_link_target:0,dribbble_caption:1,dribbble_caption_length:999,dribbble_random:0,dribbble_cache:1});case"tiktok":return Ft(Ft({},t),{},{tiktok_account:1,tiktok_number:10,tiktok_link:0,tiktok_image_size:"default",tiktok_link_target:0,tiktok_caption:1,tiktok_caption_length:999,tiktok_cache:1});case"google_photos":return Ft(Ft({},t),{},{google_photos_account:1});case"video":return Ft(Ft({},t),{},{show_video_controls:!0,show_play_pause_controls:!0,autoplay_videos:!1});default:return t}},Me=function(){var e=(0,i.A)(Mt().m(function e(t){var n,a,o,i,l,c,s,u;return Mt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=null,!["tiktok","dribbble","dropbox","google_photos"].includes(t.toLowerCase())||"pro"===m.WA){e.n=1;break}return a={tiktok:"TikTok",dribbble:"Dribbble",dropbox:"Dropbox",google_photos:"Google Photos"},me.setActiveModal("upgrade",{feature:a[t.toLowerCase()]}),e.a(2);case 1:if(e.p=1,me.setPageLoading(!0),X.trim()){e.n=2;break}return me.setPageLoading(!1),ve((0,p.__)("Please provide a gallery title.","nggallery")),e.a(2);case 2:return se(t),o=X.trim(),e.n=3,we.mutateAsync({title:o,name:o,galdesc:""});case 3:if(null!=(i=e.v)&&i.gid){e.n=4;break}throw new Error((0,p.__)("Failed to create gallery","nggallery"));case 4:return l=i.gid,n=l,c=Fe(t),e.n=5,xe.mutateAsync({id:l,data:{external_source:c}});case 5:n=null,be.refetchQueries({queryKey:["galleries"],type:"all"}),be.invalidateQueries({queryKey:["gallery",l]}),me.setActiveModal(null),r?r(l):fe("imagely-add-new","images",l),ye((0,p.__)("Gallery created successfully!","nggallery")),e.n=11;break;case 6:if(e.p=6,s=e.v,console.error("Error creating gallery:",s),!n){e.n=10;break}return e.p=7,e.n=8,Ee.mutateAsync(n);case 8:e.n=10;break;case 9:e.p=9,u=e.v,console.error("Failed to cleanup partially created gallery:",u);case 10:ve((0,p.__)("Failed to create gallery. Please try again.","nggallery"));case 11:return e.p=11,me.setPageLoading(!1),e.f(11);case 12:return e.a(2)}},e,null,[[7,9],[1,6,11,12]])}));return function(t){return e.apply(this,arguments)}}(),Ge=[{id:"media",icon:t.ZH,label:"Media Library",iconSize:"default",onClick:function(){se("media"),De()},isVisible:function(){return!0}},{id:"folder",icon:t.B8,label:"Import Folder",iconSize:"default",onClick:function(){f("folder"),se("folder")},isVisible:function(){var e;return(0,It.tB)(null===(e=window.imagelyApp)||void 0===e?void 0:e.canImportFolderFromServer,!0)&&(!n||X)}},{id:"instagram",icon:t.oW,label:"Instagram",iconSize:"default",onClick:function(){return Me("instagram")},isVisible:function(){var e;return null==_e||null===(e=_e.enabled_addons)||void 0===e?void 0:e.instagram}},{id:"tiktok",icon:t.cw,label:"TikTok",iconSize:"small",onClick:function(){var e;"pro"!==m.WA?me.setActiveModal("upgrade",{feature:"TikTok"}):null!=_e&&null!==(e=_e.enabled_addons)&&void 0!==e&&e.tiktok?Me("tiktok"):window.location.href="".concat(window.location.origin,"/wp-admin/admin.php?page=imagely-addons")},isVisible:function(){return!n}},{id:"dribbble",icon:t.Yw,label:"Dribbble",iconSize:"default",onClick:function(){var e;"pro"!==m.WA?me.setActiveModal("upgrade",{feature:"Dribbble"}):null!=_e&&null!==(e=_e.enabled_addons)&&void 0!==e&&e.dribbble?Me("dribbble"):window.location.href="".concat(window.location.origin,"/wp-admin/admin.php?page=imagely-addons")},isVisible:function(){return!n}},{id:"google_photos",icon:t.mb,label:"Google Photos",iconSize:"default",onClick:function(){var e;"pro"!==m.WA?me.setActiveModal("upgrade",{feature:"Google Photos"}):null!=_e&&null!==(e=_e.enabled_addons)&&void 0!==e&&e.google_photos?n?me.setActiveModal(null):Me("google_photos"):window.location.href="".concat(window.location.origin,"/wp-admin/admin.php?page=imagely-addons")},isVisible:function(){return!n&&(void 0===(null==Ce?void 0:Ce.addon_show_google_photos)||(0,It._w)(Ce.addon_show_google_photos))}},{id:"video-links",icon:t.xy,label:"Video Links",iconSize:"default",onClick:function(){"pro"!==m.WA?me.setActiveModal("upgrade",{feature:"Video Links"}):se("video-links")},isVisible:function(){return!0}},{id:"dropbox",icon:t.Cg,label:"Dropbox",iconSize:"default",onClick:function(){var e;"pro"!==m.WA?me.setActiveModal("upgrade",{feature:"Dropbox"}):null!=_e&&null!==(e=_e.enabled_addons)&&void 0!==e&&e.dropbox?n||X.trim()?se("dropbox"):ve((0,p.__)("Please provide a gallery title.","nggallery")):window.location.href="".concat(window.location.origin,"/wp-admin/admin.php?page=imagely-addons")},isVisible:function(){return!0}}].filter(function(e){return e.isVisible()});return d().createElement("div",{className:"p-0 max-h-[90vh] flex flex-col overflow-y-auto"},!n&&d().createElement("form",{onSubmit:Oe,className:"mb-6"},d().createElement(Ae.A,{type:"text",name:"gallery-title",value:X,onChange:function(e){return Y(e.target.value)},label:(0,p.__)("Gallery Title","nggallery"),placeholder:(0,p.__)("Enter a title for your new gallery","nggallery")}),d().createElement("button",{type:"submit",style:{display:"none"},"aria-hidden":"true"})),d().createElement("div",{className:"flex-1 min-h-0"},"dropbox"===ce?d().createElement(Lt.A,{integrationType:"dropbox",galleryId:n,galleryTitle:X,onSuccess:Re}):"video-links"===ce?d().createElement(F,{galleryId:n,galleryTitle:X,onSuccess:Re}):"google_photos"===ce&&n?d().createElement(Lt.A,{integrationType:"google_photos",galleryId:n}):"folder"===s?d().createElement("div",{className:"flex flex-col h-full"},d().createElement("div",{className:"flex items-center space-x-1 sm:space-x-2 text-xs sm:text-sm mb-2 bg-white overflow-x-auto"},d().createElement("button",{onClick:function(){return ke("")},className:"text-gray-700 underline hover:text-green-600 p-0"},(0,p.__)("Root","nggallery")),I&&d().createElement(d().Fragment,null,d().createElement("span",null,"/"),I.split("/").filter(Boolean).map(function(e,t,n){return d().createElement(d().Fragment,{key:e},d().createElement("button",{onClick:function(){return ke(n.slice(0,t+1).join("/"))},className:"text-gray-700 underline hover:text-green-600"},e),t<n.length-1&&d().createElement("span",null,"/"))}))),d().createElement("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col"},d().createElement("div",{className:"border rounded-lg divide-y max-h-48 sm:max-h-64 overflow-y-auto"},Q?d().createElement("div",{className:"p-2 text-center text-gray-500 text-xs sm:text-sm"},(0,p.__)("Loading...","nggallery")):S.length>0?S.map(function(e){return d().createElement("button",{key:e.relative_path,onClick:function(){ke(e.relative_path)},className:"w-full text-left py-2 px-2 sm:py-1.5 hover:bg-gray-50 flex items-center space-x-2 text-xs sm:text-sm"},d().createElement("span",{className:"text-sm sm:text-base"},d().createElement(t.sj,null)),d().createElement("span",{className:"truncate"},e.name))}):d().createElement("div",{className:"p-2 text-center text-gray-500 text-xs sm:text-sm"},I?(0,p.__)("No subdirectories found. Click Import to import images from this folder.","nggallery"):(0,p.__)("No directories found.","nggallery"))),d().createElement("div",{className:"mt-3 sm:mt-4 p-2 sm:p-3 rounded-lg border"},d().createElement(jt.A,{id:"keep-original-location",name:"keep_original_location",checked:ae,onChange:function(e){return oe(e.target.checked)},label:(0,p.__)("Keep images in original location","nggallery"),help:(0,p.__)("Caution: If you keep images in the original folder and later delete the gallery, the images in that folder might be deleted depending on your settings.","nggallery")})),z&&d().createElement("div",{className:"text-red-500 text-xs sm:text-sm p-2 mt-2"},z),I&&d().createElement("div",{className:"mt-3 sm:mt-4"},d().createElement("button",{onClick:Se,disabled:Q,className:"w-full py-2 sm:py-3 px-3 sm:px-4 text-white rounded-lg transition-colors text-sm sm:text-base ".concat(Q?"bg-green-300":"bg-green-500 hover:bg-green-600")},Q?(0,p.__)("Importing...","nggallery"):(0,p.__)("Import Selected Folder","nggallery"))))):d().createElement("div",{className:"relative text-center p-4 sm:p-8 border border-dashed rounded-lg transition-colors h-full overflow-y-auto ".concat(v?"border-blue-500 bg-blue-50":"border-gray-300"),onDragOver:function(e){e.preventDefault(),w(!0)},onDragLeave:function(e){e.preventDefault(),w(!1)},onDrop:function(e){e.preventDefault(),w(!1);var t=e.dataTransfer.files;t.length>0&&Pe(t)}},d().createElement("input",{ref:ue,type:"file",multiple:!0,accept:"".concat(Qt.images,",").concat(Qt.zip),onChange:function(e){var t=e.target.files;t&&t.length>0&&Pe(t)},className:"hidden"}),N.length>0?d().createElement("div",{className:"space-y-3 sm:space-y-4"},N.map(function(e,t){return d().createElement("div",{key:"".concat(e.file.name,"-").concat(t),className:"text-left py-3 px-5 sm:p-4 text-gray-900"},d().createElement("div",{className:"flex justify-between mb-2"},d().createElement("span",{className:"text-xs sm:text-sm text-gray-900 truncate pr-2"},e.file.name),d().createElement("span",{className:"text-xs sm:text-sm text-gray-900 flex-shrink-0"},"completed"===e.status&&"✓","error"===e.status&&"❌","uploading"===e.status&&"".concat(e.progress,"%"))),d().createElement("div",{className:"w-full bg-gray-100 rounded-full h-1"},d().createElement("div",{className:"h-1 rounded-full ".concat("completed"===e.status?"bg-green-500":"error"===e.status?"bg-red-500":"bg-blue-500"),style:{width:"".concat(e.progress,"%")}})),e.error&&d().createElement("p",{className:"text-xs sm:text-sm text-red-500 mt-1"},e.error))})):ee.length>0?d().createElement("div",{className:"space-y-3 sm:space-y-4"},d().createElement("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 sm:gap-4"},d().createElement("button",{onClick:function(){var e;return null===(e=ue.current)||void 0===e?void 0:e.click()},className:"relative aspect-square border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400 transition-colors flex flex-col items-center justify-center gap-1 sm:gap-2"},d().createElement("span",{className:"text-xl sm:text-2xl"},"+"),d().createElement("span",{className:"text-xs sm:text-sm text-gray-600"},(0,p.__)("Add More","nggallery"))),ee.filter(function(e){return!e.excluded}).map(function(e){return d().createElement("div",{key:e.id,className:"relative aspect-square group"},d().createElement("div",{className:"absolute inset-0 rounded-lg overflow-hidden"},d().createElement("img",{src:e.preview,alt:e.file.name,className:"w-full h-full object-cover"}),d().createElement("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center cursor-pointer",onClick:function(t){var n;t.preventDefault(),t.stopPropagation(),n=e.file,te(function(e){return e.map(function(e){return e.file===n?Ft(Ft({},e),{},{excluded:!0}):e})})},title:(0,p.__)("Remove","nggallery")},d().createElement("div",{className:"text-white transform scale-100 group-hover:scale-110 transition-transform"},d().createElement(t.uc,null)))))})),d().createElement("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mt-4 sm:mt-6 pt-3 sm:pt-4 border-t border-gray-200 gap-3 sm:gap-0"},d().createElement("div",{className:"text-xs sm:text-sm text-gray-500"},ee.filter(function(e){return!e.excluded}).length," ",(0,p.__)("files selected","nggallery")),d().createElement("div",{className:"flex gap-2 sm:gap-3 w-full sm:w-auto"},d().createElement("button",{onClick:function(){te([]),ue.current&&(ue.current.value="")},className:"px-3 sm:px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 transition-colors"},(0,p.__)("Clear All","nggallery")),d().createElement("button",{onClick:function(){var e=ee.filter(function(e){return!e.excluded}).map(function(e){return e.file});Te(e)},className:"px-4 sm:px-6 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors text-sm font-medium flex-1 sm:flex-none",disabled:0===ee.filter(function(e){return!e.excluded}).length},(0,p.__)("Upload","nggallery"))))):d().createElement(d().Fragment,null,d().createElement("div",{className:"flex flex-col items-center mb-4 sm:mb-6 p-4 sm:p-4 border border-dashed border-gray-300 rounded-lg bg-[#f8f9fb]"},d().createElement("div",{className:"flex flex-col items-center"},d().createElement(t.JM,{className:"mb-4"}),d().createElement("p",{className:"text-[14px] sm:text-[14px] text-gray-600 "},(0,p.__)("Drag & Drop images or","nggallery")," ",d().createElement("button",{onClick:function(){var e;return null===(e=ue.current)||void 0===e?void 0:e.click()},className:"text-green-500 hover:text-green-600 underline hover:underline transition-colors cursor-pointer bg-transparent border-none p-0 text-sm sm:text-base font-bold"},(0,p.__)("Browse from Computer","nggallery"))))),d().createElement("div",{className:"flex flex-col gap-3"},d().createElement("div",{className:"grid grid-cols-3 gap-4 justify-items-center"},Ge.map(function(e){return d().createElement(St,{key:e.id,icon:e.icon,label:e.label,isSelected:ce===e.id,onClick:e.onClick,iconSize:e.iconSize})})))))))},Ht=function(e){var t=e.isOpen,n=e.onClose,r=e.galleryId,a=e.onGalleryCreated,o=!r,i=o?(0,p.__)("Add a New Gallery","nggallery"):(0,p.__)("Add Images","nggallery");return d().createElement(v.A,{isOpen:t,onClose:n,title:i,contentClassName:o?" !p-[38px] !rounded-2xl ":"",modalClassName:o?"rounded-2xl":""},d().createElement(Ut,{galleryId:r,onGalleryCreated:a}))};function zt(e){var t="string"==typeof e?parseFloat(e):"number"==typeof e?e:NaN;return Number.isFinite(t)&&t>0?t:null}var Kt=a(8093),Vt=a.n(Kt),Wt=a(2858);function Xt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Yt(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Yt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Yt(d,"constructor",s),Yt(s,"constructor",c),c.displayName="GeneratorFunction",Yt(s,a,"GeneratorFunction"),Yt(d),Yt(d,a,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),(Xt=function(){return{w:o,m}})()}function Yt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Yt=function(e,t,n,r){function o(t,n){Yt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Yt(e,t,n,r)}function Zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jt(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Zt(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}const $t=function(e){var n=e.isOpen,r=e.onClose,a=e.action,o=void 0===a?"create new galleries":a,i=(0,g.useDispatch)(m.EF),l=(0,H.X)();return d().createElement(v.A,{id:"license-required-modal",isOpen:n,onClose:r,title:""},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"flex items-center justify-center w-16 h-16 mx-auto mb-4 bg-orange-100 rounded-full"},d().createElement(t.wl,{className:"w-8 h-8 text-orange-600"})),d().createElement("h3",{className:"text-xl font-semibold text-gray-800 mb-4"},(0,p.__)("License Activation Required","nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-2"},(0,p.__)("To ".concat(o,", you need an active license."),"nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-6"},(0,p.__)("Please add or update your license key to continue.","nggallery")),d().createElement("div",{className:"flex flex-col sm:flex-row gap-3 justify-center mb-6"},d().createElement("button",{onClick:function(){if(r(),null!=l&&l.isEmbed){var e,t=null!==(e=window.imagelyApp)&&void 0!==e&&e.adminURL?"".concat(window.imagelyApp.adminURL,"admin.php?page=imagely-settings&tab=license"):"/wp-admin/admin.php?page=imagely-settings&tab=license";window.location.href=t}else i.navigateTo("imagely-settings","license",null)},className:"inline-flex items-center justify-center bg-green-500 text-white text-center text-base py-3 px-6 rounded-lg font-medium hover:bg-green-600 transition-colors"},d().createElement(t.ik,{className:"w-5 h-5 mr-2"}),(0,p.__)("Activate License","nggallery")),d().createElement("button",{onClick:r,className:"inline-flex items-center justify-center bg-gray-100 text-gray-700 text-center text-base py-3 px-6 rounded-lg font-medium hover:bg-gray-200 transition-colors"},(0,p.__)("Cancel","nggallery"))),d().createElement("div",{className:"bg-green-50 border-t border-green-100 -mx-4 -mb-4 px-6 py-4 rounded-b-lg"},d().createElement("div",{className:"flex items-start"},d().createElement(t.F,{className:"w-5 h-5 text-green-500 mr-2 flex-shrink-0 mt-0.5"}),d().createElement("p",{className:"text-gray-700 text-sm text-left"},(0,p.__)("Your license key can be found in your account dashboard. If your license has expired, you can renew it to continue using all pro features.","nggallery"))))))};function en(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return tn(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(tn(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,tn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,tn(d,"constructor",s),tn(s,"constructor",c),c.displayName="GeneratorFunction",tn(s,a,"GeneratorFunction"),tn(d),tn(d,a,"Generator"),tn(d,r,function(){return this}),tn(d,"toString",function(){return"[object Generator]"}),(en=function(){return{w:o,m}})()}function tn(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}tn=function(e,t,n,r){function o(t,n){tn(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},tn(e,t,n,r)}function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rn(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?nn(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function an(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return on(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(on(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,on(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,on(d,"constructor",s),on(s,"constructor",c),c.displayName="GeneratorFunction",on(s,a,"GeneratorFunction"),on(d),on(d,a,"Generator"),on(d,r,function(){return this}),on(d,"toString",function(){return"[object Generator]"}),(an=function(){return{w:o,m}})()}function on(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}on=function(e,t,n,r){function o(t,n){on(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},on(e,t,n,r)}function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cn(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ln(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function sn(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return un(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(un(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,un(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,un(d,"constructor",s),un(s,"constructor",c),c.displayName="GeneratorFunction",un(s,a,"GeneratorFunction"),un(d),un(d,a,"Generator"),un(d,r,function(){return this}),un(d,"toString",function(){return"[object Generator]"}),(sn=function(){return{w:o,m}})()}function un(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}un=function(e,t,n,r){function o(t,n){un(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},un(e,t,n,r)}function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mn(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?dn(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function gn(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return fn(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(fn(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,fn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,fn(d,"constructor",s),fn(s,"constructor",c),c.displayName="GeneratorFunction",fn(s,a,"GeneratorFunction"),fn(d),fn(d,a,"Generator"),fn(d,r,function(){return this}),fn(d,"toString",function(){return"[object Generator]"}),(gn=function(){return{w:o,m}})()}function fn(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}fn=function(e,t,n,r){function o(t,n){fn(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},fn(e,t,n,r)}var pn=a(380);function hn(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return yn(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(yn(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,yn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,yn(d,"constructor",s),yn(s,"constructor",c),c.displayName="GeneratorFunction",yn(s,a,"GeneratorFunction"),yn(d),yn(d,a,"Generator"),yn(d,r,function(){return this}),yn(d,"toString",function(){return"[object Generator]"}),(hn=function(){return{w:o,m}})()}function yn(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}yn=function(e,t,n,r){function o(t,n){yn(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},yn(e,t,n,r)}var vn=function(){var e=(0,i.A)(hn().m(function e(t){var n,r,a,o,i;return hn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.n=1,_()({path:"/imagely/v1/pricelist-items/bulk",method:"POST",headers:{"X-WP-Nonce":r},data:{items:t}});case 1:if(!((a=e.v).created_items&&a.created_items.length>0)){e.n=2;break}return e.a(2,a.created_items);case 2:if(!(a.errors>0)){e.n=3;break}throw new Error("Failed to create items: ".concat((null===(o=a.error_messages)||void 0===o?void 0:o.join(", "))||"Unknown error"));case 3:throw new Error("No items were created");case 4:e.n=6;break;case 5:throw e.p=5,i=e.v,console.error("Error creating multiple pricelist items:",i),i;case 6:return e.a(2)}},e,null,[[0,5]])}));return function(t){return e.apply(this,arguments)}}();function bn(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return wn(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(wn(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,wn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,wn(d,"constructor",s),wn(s,"constructor",c),c.displayName="GeneratorFunction",wn(s,a,"GeneratorFunction"),wn(d),wn(d,a,"Generator"),wn(d,r,function(){return this}),wn(d,"toString",function(){return"[object Generator]"}),(bn=function(){return{w:o,m}})()}function wn(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}wn=function(e,t,n,r){function o(t,n){wn(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},wn(e,t,n,r)}var xn=function(){var e=(0,i.A)(bn().m(function e(t){var n,r,a,o,i,l;return bn().w(function(e){for(;;)switch(e.p=e.n){case 0:return n="/imagely/v1/whcc-catalog",r=t?"".concat(n,"?category=").concat(encodeURIComponent(t)):n,e.p=1,o=null===(a=window.imagelyApp)||void 0===a?void 0:a.nonce,e.n=2,_()({path:r,method:"GET",headers:{"X-WP-Nonce":o}});case 2:return i=e.v,e.a(2,i);case 3:throw e.p=3,l=e.v,console.error("Error fetching WHCC catalog:",l),l;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();function En(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return _n(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(_n(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,_n(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,_n(d,"constructor",s),_n(s,"constructor",c),c.displayName="GeneratorFunction",_n(s,a,"GeneratorFunction"),_n(d),_n(d,a,"Generator"),_n(d,r,function(){return this}),_n(d,"toString",function(){return"[object Generator]"}),(En=function(){return{w:o,m}})()}function _n(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}_n=function(e,t,n,r){function o(t,n){_n(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},_n(e,t,n,r)}function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nn(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Cn(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var kn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$";if("number"==typeof t)return"".concat(n," ").concat(t.toFixed(2));var r=(0,ke.aN)(e);return"".concat(n," ").concat(r.toFixed(2))},On=function(e){var t=e.className;return d().createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))};var An={gallery:function(e){var t=e.isOpen,n=e.onClose,r=e.onGalleryCreated,a=(0,w.A)(e,Ct),o=(0,H.X)(),i=(0,u.useCallback)(function(){n&&n(),null!=o&&o.isEmbed&&null!=o&&o.onClose&&o.onClose()},[n,o]);return d().createElement(v.A,(0,y.A)({isOpen:t,onClose:i,title:(0,p.__)("New Gallery","nggallery")},a),d().createElement(_t,{onSuccess:r}))},album:W,albumSuccess:function(e){var n=e.isOpen,r=e.onClose,a=e.albumId,o=e.albumName,l=(0,g.useDispatch)(m.EF),c=(0,u.useMemo)(function(){return a?'[imagely album="'.concat(a,'"]'):""},[a]),s=function(){var e=(0,i.A)(X().m(function e(){return X().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.writeText(c);case 1:l.showNotice("success",(0,p.__)("Shortcode copied to clipboard!","nggallery")),e.n=3;break;case 2:e.p=2,e.v,l.showNotice("error",(0,p.__)("Failed to copy shortcode to clipboard","nggallery"));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:""},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"flex items-center justify-center mx-auto"},d().createElement(t.P7,{className:"w-48 h-48"})),d().createElement("h3",{className:"text-2xl font-semibold text-gray-800 mb-3"},o?(0,p.sprintf)((0,p.__)("%s updated successfully!","nggallery"),o):(0,p.__)("Album updated successfully!","nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-6 text-base"},(0,p.__)("Your album is ready to be published. You can add it to any page, post, or widget area using the Imagely Album block or the shortcode below:","nggallery")),c&&d().createElement("div",{className:"mb-8"},d().createElement("button",{onClick:s,className:"bg-gray-100 border-2 border-gray-300 rounded-lg px-6 py-3 font-mono text-base text-gray-800 hover:bg-green-50 hover:border-green-500 transition-colors cursor-pointer w-3/5 mx-auto block",title:(0,p.__)("Click to copy shortcode","nggallery")},c)),d().createElement("div",{className:"flex justify-center mb-6"},d().createElement("button",{onClick:function(){r(),l.navigateTo("imagely-albums","general")},className:"inline-flex items-center justify-center bg-green-500 text-white text-center text-base py-3 px-8 rounded-lg font-medium hover:bg-green-600 transition-colors"},(0,p.__)("View Albums","nggallery")))))},galleryEdit:function(e){var t=e.isOpen,n=e.galleryId,r=e.onClose,a=(0,M.iX)(n),o=a.data,l=a.refetch;if(!o)return null;var c=function(){var e=(0,i.A)(yt().m(function e(){return yt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,l();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:t,onClose:r,title:(0,p.__)("Edit Gallery Details","nggallery")},d().createElement(ht,{gallery:o,onClose:r,onUpdate:c}))},gallerySuccess:function(e){var n=e.isOpen,r=e.onClose,a=e.galleryId,o=e.galleryName,l=e.pageId,s=e.pageName,f=(0,g.useDispatch)(m.EF),h=(0,u.useState)(s),y=(0,c.A)(h,2),b=y[0],w=y[1],x=(0,u.useState)(void 0),E=(0,c.A)(x,2),C=E[0],N=E[1],k=(0,u.useState)(!1),O=(0,c.A)(k,2),A=(O[0],O[1]),S=(0,u.useMemo)(function(){return a?'[imagely id="'.concat(a,'"]'):""},[a]);(0,u.useEffect)(function(){var e=function(){var e=(0,i.A)(Ot().m(function e(){var t,r,a,o,i;return Ot().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!l||s||!n){e.n=6;break}return A(!0),e.p=1,e.n=2,_()({path:"/wp/v2/pages/".concat(l)});case 2:null!=(r=e.v)&&null!==(t=r.title)&&void 0!==t&&t.rendered&&w(r.title.rendered),null!=r&&r.link&&N(r.link),e.n=4;break;case 3:e.p=3,o=e.v,console.error("Error fetching page:",o);case 4:return e.p=4,A(!1),e.f(4);case 5:e.n=11;break;case 6:if(!(l&&s&&n)){e.n=11;break}return A(!0),e.p=7,e.n=8,_()({path:"/wp/v2/pages/".concat(l)});case 8:null!=(a=e.v)&&a.link&&N(a.link),e.n=10;break;case 9:e.p=9,i=e.v,console.error("Error fetching page:",i);case 10:return e.p=10,A(!1),e.f(10);case 11:return e.a(2)}},e,null,[[7,9,10,11],[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}();e()},[l,s,n]),(0,u.useEffect)(function(){n||(w(s),N(void 0))},[n,s]);var j=function(){var e=(0,i.A)(Ot().m(function e(){return Ot().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,navigator.clipboard.writeText(S);case 1:f.showNotice("success",(0,p.__)("Shortcode copied to clipboard!","nggallery")),e.n=3;break;case 2:e.p=2,e.v,f.showNotice("error",(0,p.__)("Failed to copy shortcode to clipboard","nggallery"));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:""},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"flex items-center justify-center mx-auto"},d().createElement(t.P7,{className:"w-48 h-48"})),d().createElement("h3",{className:"text-2xl font-semibold text-gray-800 mb-3"},o?(0,p.sprintf)((0,p.__)("%s created successfully!","nggallery"),o):(0,p.__)("Gallery created successfully!","nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-6 text-base"},l&&b?d().createElement(d().Fragment,null,(0,p.__)("Your gallery has been linked to the page","nggallery")," ",C?d().createElement("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"text-green-600 hover:text-green-700 font-medium underline"},'"',b,'"'):d().createElement("span",{className:"font-medium"},'"',b,'"'),". ",(0,p.__)("You can also add it to any other page, post, or widget area using the Imagely Gallery block or the shortcode below:","nggallery")):(0,p.__)("Your gallery is ready to be published. You can add it to any page, post, or widget area using the Imagely Gallery block or the shortcode below:","nggallery")),S&&d().createElement("div",{className:"mb-8"},d().createElement("button",{onClick:j,className:"bg-gray-100 border-2 border-gray-300 rounded-lg px-6 py-3 font-mono text-base text-gray-800 hover:bg-green-50 hover:border-green-500 transition-colors cursor-pointer w-3/5 mx-auto block",title:(0,p.__)("Click to copy shortcode","nggallery")},S)),d().createElement("div",{className:"flex justify-center mb-6"},d().createElement("button",{onClick:function(){r(),f.navigateTo("imagely","galleryList")},className:"inline-flex items-center justify-center bg-green-500 text-white text-center text-base py-3 px-8 rounded-lg font-medium hover:bg-green-700 transition-colors"},(0,p.__)("View Galleries","nggallery")))))},deleteGalleries:function(e){var t=e.isOpen,n=e.galleries,r=e.onClose,a=void 0===r?function(){}:r,o=e.onConfirm,i=void 0===o?function(){}:o,l=e.title,c=(0,w.A)(e,ze);return d().createElement(Be,(0,y.A)({isOpen:t,entityType:"galleries",items:n,getItemId:function(e){return e.id},getItemLabel:function(e){return e.galleryTitle},onClose:a,onConfirm:i,title:l||(0,p.__)("Delete Galleries","nggallery"),singularLabel:(0,p.__)("gallery","nggallery"),pluralLabel:(0,p.__)("galleries","nggallery")},c))},deleteAlbums:function(e){var t=e.isOpen,n=e.albums,r=e.onClose,a=void 0===r?function(){}:r,o=e.onConfirm,i=void 0===o?function(){}:o,l=e.title,c=(0,w.A)(e,qe);return d().createElement(Be,(0,y.A)({isOpen:t,entityType:"albums",items:n,getItemId:function(e){return e.id},getItemLabel:function(e){return e.albumTitle},onClose:a,onConfirm:i,title:l||(0,p.__)("Delete Albums","nggallery"),singularLabel:(0,p.__)("album","nggallery"),pluralLabel:(0,p.__)("albums","nggallery")},c))},deleteImages:function(e){var t=e.isOpen,n=e.images,r=e.onClose,a=void 0===r?function(){}:r,o=e.onConfirm,i=void 0===o?function(){}:o,l=e.title,c=(0,w.A)(e,Ke);return d().createElement(Be,(0,y.A)({isOpen:t,entityType:"images",items:n,getItemId:function(e){return e.pid},getItemLabel:function(e){return e.filename},onClose:a,onConfirm:i,title:l||(0,p.__)("Delete Images","nggallery"),singularLabel:(0,p.__)("image","nggallery"),pluralLabel:(0,p.__)("images","nggallery")},c))},deleteTags:function(e){var t=e.isOpen,n=e.tags,r=e.onClose,a=void 0===r?function(){}:r,o=e.onConfirm,i=void 0===o?function(){}:o,l=e.title,c=(0,w.A)(e,Xe);return d().createElement(Be,(0,y.A)({isOpen:t,entityType:"tags",items:n,getItemId:function(e){return e.term_id},getItemLabel:function(e){return e.name},onClose:a,onConfirm:i,title:l||(0,p.__)("Delete Tags","nggallery"),singularLabel:(0,p.__)("tag","nggallery"),pluralLabel:(0,p.__)("tags","nggallery")},c))},deleteCoupons:function(e){var n=e.isOpen,r=e.onClose,a=e.couponIds,o=e.items,l=e.onConfirm,c=void 0===l?function(){}:l,s=e.title,m=function(){var e,t=(0,G.jE)();return(0,be.n)({mutationFn:(e=(0,i.A)(we().m(function e(t){var n,r,a,o;return we().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,e.p=1,e.n=2,_()({path:"/imagely/v1/coupons/".concat(t),method:"DELETE",headers:{"X-WP-Nonce":r},parse:!1});case 2:e.n=5;break;case 3:if(e.p=3,404!==((null==(o=e.v)?void 0:o.status)||(null==o||null===(a=o.response)||void 0===a?void 0:a.status))){e.n=4;break}return e.a(2);case 4:throw o;case 5:return e.a(2)}},e,null,[[1,3]])})),function(t){return e.apply(this,arguments)}),onSettled:function(){t.invalidateQueries({queryKey:["coupons"]})}})}(),g=(0,U.E)(),f=g.showSuccess,h=g.showError,y=g.clearNotifications,b=(0,u.useMemo)(function(){return o&&o.length?o:a.map(function(e){return{id:e,title:(0,p.__)("Coupon","nggallery"),code:String(e)}})},[a,o]),w=(0,u.useMemo)(function(){return b.length>0&&b.length<=5?d().createElement("ul",{className:"list-none text-sm text-gray-700 px-4 text-center"},b.map(function(e){return d().createElement("li",{key:e.id},e.title," (",e.code,")")})):null},[b]),x=function(){var e=(0,i.A)(Ue().m(function e(){var t;return Ue().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==a.length){e.n=1;break}return e.a(2);case 1:return m.reset&&m.reset(),e.p=2,e.n=3,Promise.all(a.map(function(e){return m.mutateAsync(e)}));case 3:t=1===a.length?(0,p.__)("coupon","nggallery"):(0,p.__)("coupons","nggallery"),y(),f((0,p.__)("Successfully deleted ".concat(a.length," ").concat(t),"nggallery")),c(),r(),e.n=5;break;case 4:e.p=4,e.v,y(),h((0,p.__)("Failed to delete coupon(s)","nggallery"));case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}(),E=d().createElement(t.b4,null);return d().createElement(v.A,{isOpen:n,onClose:r},d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"flex items-center gap-2 justify-center"},d().createElement("div",null,E)),s&&d().createElement("h2",{className:"text-xl font-bold text-center text-gray-900 mt-2"},s),d().createElement("p",{className:"text-sm text-gray-500 text-center"},1===a.length?(0,p.__)("Are you sure you want to delete this coupon?","nggallery"):(0,p.__)("Are you sure you want to delete the selected coupons?","nggallery")),w,d().createElement("p",{className:"text-sm text-red-500 text-center"},(0,p.__)("This action cannot be undone.","nggallery")),d().createElement("div",{className:"flex justify-center space-x-3 !mb-4 ".concat(m.isPending?"cursor-wait":"")},d().createElement("button",{type:"button",onClick:r,disabled:m.isPending,className:"px-8 py-2 font-medium text-white bg-green-500 rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:x,disabled:m.isPending,className:"px-8 py-2 font-bold text-white bg-red-600 border border-transparent rounded-lg shadow hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},m.isPending?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Deleting...","nggallery")):(0,p.__)("Delete","nggallery")))))},imageUploader:Ht,imageView:function(e){var n=e.isOpen,r=e.onClose,a=e.image,o=e.returnTo,l=(0,u.useState)(!1),s=(0,c.A)(l,2),f=s[0],h=s[1],y=(0,u.useState)(void 0),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)(!1),_=(0,c.A)(E,2),C=_[0],N=_[1],k=(0,u.useState)(void 0),O=(0,c.A)(k,2),A=O[0],S=O[1],j=(0,u.useState)(null),P=(0,c.A)(j,2),T=P[0],I=P[1],D=(0,g.useDispatch)(m.EF),L=a.galleryid,R=(0,G.jE)(),F=(0,M.iX)(L).data,Q=(0,U.E)(),B=Q.showSuccess,q=Q.showError,H=(0,M.sr)(),z=(0,M.qr)(),K=(0,M.fZ)(),V=(0,u.useMemo)(function(){var e,t,n,r=null==F?void 0:F.display_type,a=r?null==F||null===(e=F.display_type_settings)||void 0===e?void 0:e[r]:void 0,o=null!==(t=zt(null==a?void 0:a.thumbnail_width))&&void 0!==t?t:zt(null==a?void 0:a.thumbwidth),i=null!==(n=zt(null==a?void 0:a.thumbnail_height))&&void 0!==n?n:zt(null==a?void 0:a.thumbheight);return o&&i&&0!==i?o/i:1.5},[F]),W=function(){var e=(0,i.A)(Xt().m(function e(t){var n,r,o;return Xt().w(function(e){for(;;)switch(e.p=e.n){case 0:return h(!0),e.p=1,e.n=2,H.mutateAsync({pid:a.pid,rotation:t});case 2:n=e.v,r=(null==n?void 0:n.updated_at)||Date.now(),x(r),R.setQueriesData({queryKey:["gallery",L,"images"]},function(e){return null!=e&&e.images?Jt(Jt({},e),{},{images:e.images.map(function(e){return e.pid===a.pid?Jt(Jt({},e),{},{reloadKey:r}):e})}):e}),F&&F.previewpic===a.pid&&(R.setQueryData(["gallery",F.gid],function(e){return e?Jt(Jt({},e),{},{previewpic_url:(0,nt.s)(e.previewpic_url,r)}):e}),B((0,p.__)("Gallery thumbnail updated after image rotation!","nggallery"))),e.n=4;break;case 3:e.p=3,o=e.v,console.error("Error rotating image",o);case 4:return e.p=4,h(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),X=function(){var e=(0,i.A)(Xt().m(function e(){var t,n,r;return Xt().w(function(e){for(;;)switch(e.p=e.n){case 0:return h(!0),e.p=1,e.n=2,K.mutateAsync(a.pid);case 2:t=e.v,n=(null==t?void 0:t.updated_at)||Date.now(),x(n),R.setQueriesData({queryKey:["gallery",L,"images"]},function(e){return null!=e&&e.images?Jt(Jt({},e),{},{images:e.images.map(function(e){return e.pid===a.pid?Jt(Jt({},e),{},{reloadKey:n}):e})}):e}),F&&F.previewpic===a.pid&&(R.setQueryData(["gallery",F.gid],function(e){return e?Jt(Jt({},e),{},{previewpic_url:(0,nt.s)(e.previewpic_url,n)}):e}),B((0,p.__)("Gallery thumbnail updated after image recovery!","nggallery"))),e.n=4;break;case 3:e.p=3,r=e.v,console.error("Error recovering image",r);case 4:return e.p=4,h(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}(),Y=(0,u.useCallback)((0,i.A)(Xt().m(function e(){var t,n,r,o,i,l,c,s,u,d,m,g,f;return Xt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(T&&A){e.n=1;break}return e.a(2);case 1:return h(!0),e.p=2,t=a.image_url||"",e.n=3,fetch(t);case 3:return n=e.v,e.n=4,n.blob();case 4:return r=e.v,(o=new Image).src=URL.createObjectURL(r),e.n=5,new Promise(function(e){o.onload=e});case 5:return i=o.naturalWidth/T.width,l=o.naturalHeight/T.height,c=A.x*i,s=A.y*l,u=A.width*i,d=A.height*l,e.n=6,z.mutateAsync({pid:a.pid,cropData:{x:c,y:s,w:u,h:d,rr:1}});case 6:m=e.v,g=(null==m?void 0:m.updated_at)||Date.now(),x(g),R.setQueriesData({queryKey:["gallery",L,"images"]},function(e){return null!=e&&e.images?Jt(Jt({},e),{},{images:e.images.map(function(e){return e.pid===a.pid?Jt(Jt({},e),{},{reloadKey:g}):e})}):e}),F&&F.previewpic===a.pid&&(R.setQueryData(["gallery",F.gid],function(e){return e?Jt(Jt({},e),{},{previewpic_url:(0,nt.s)(e.previewpic_url,g)}):e}),B((0,p.__)("Gallery thumbnail updated after crop!","nggallery"))),B((0,p.__)("Image cropped successfully!","nggallery")),N(!1),S(void 0),e.n=8;break;case 7:e.p=7,f=e.v,console.error("Error cropping thumbnail",f),q((0,p.__)("Failed to crop thumbnail","nggallery"));case 8:return e.p=8,h(!1),e.f(8);case 9:return e.a(2)}},e,null,[[2,7,8,9]])})),[A,T,a,F,R,B,q]),Z=(0,u.useCallback)(function(e,t){var n=V,r=120,a=Math.round(r/n);(e<r||t<a)&&(r=e,(a=Math.round(r/n))>t&&(a=t,r=Math.round(a*n)));var o=Math.round(.1*e),i=Math.round(.1*t);return o+r>e&&(o=e-r),i+a>t&&(i=t-a),o<0&&(o=0),i<0&&(i=0),{unit:"px",width:r,height:a,x:o,y:i}},[V]);(0,u.useEffect)(function(){C&&T&&S(Z(T.naturalWidth,T.naturalHeight))},[C,T,Z]);var J=d().createElement("svg",{className:"w-5 h-5",viewBox:"0 0 18 18",fill:"none"},d().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.00016 0.833496C5.4604 0.833496 5.8335 1.20659 5.8335 1.66683V4.16683H13.3335C13.9965 4.16683 14.6324 4.43022 15.1013 4.89906C15.5701 5.3679 15.8335 6.00379 15.8335 6.66683V14.1668H18.3335C18.7937 14.1668 19.1668 14.5399 19.1668 15.0002C19.1668 15.4604 18.7937 15.8335 18.3335 15.8335H15.8335V18.3335C15.8335 18.7937 15.4604 19.1668 15.0002 19.1668C14.5399 19.1668 14.1668 18.7937 14.1668 18.3335V15.8335H6.66683C6.00379 15.8335 5.3679 15.5701 4.89906 15.1013C4.43022 14.6324 4.16683 13.9965 4.16683 13.3335V5.8335H1.66683C1.20659 5.8335 0.833496 5.4604 0.833496 5.00016C0.833496 4.53993 1.20659 4.16683 1.66683 4.16683H4.16683V1.66683C4.16683 1.20659 4.53993 0.833496 5.00016 0.833496ZM5.8335 5.8335V13.3335C5.8335 13.5545 5.92129 13.7665 6.07757 13.9228C6.23385 14.079 6.44582 14.1668 6.66683 14.1668H14.1668V6.66683C14.1668 6.44582 14.079 6.23385 13.9228 6.07757C13.7665 5.92129 13.5545 5.8335 13.3335 5.8335H5.8335Z",fill:"currentColor",fillOpacity:"0.6"})),$=d().createElement("svg",{className:"w-5 h-5",viewBox:"0 0 18 18",fill:"none"},d().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00016 1.66683C5.31826 1.66683 2.3335 4.65159 2.3335 8.3335C2.3335 12.0154 5.31826 15.0002 9.00016 15.0002C12.6821 15.0002 15.6668 12.0154 15.6668 8.3335C15.6668 4.65159 12.6821 1.66683 9.00016 1.66683ZM1.00016 8.3335C1.00016 4.09937 4.76603 0.666504 9.00016 0.666504C13.2343 0.666504 17.0002 4.09937 17.0002 8.3335C17.0002 12.5676 13.2343 16.0005 9.00016 16.0005C4.76603 16.0005 1.00016 12.5676 1.00016 8.3335ZM9.00016 4.16683C9.4604 4.16683 9.8335 4.53993 9.8335 5.00016V8.3335L12.1668 10.6668C12.4933 10.9933 12.4933 11.5068 12.1668 11.8333C11.8404 12.1598 11.3268 12.1598 11.0003 11.8333L8.3335 9.1665V5.00016C8.3335 4.53993 8.70659 4.16683 9.00016 4.16683Z",fill:"currentColor",fillOpacity:"0.6"}));return d().createElement(v.A,{isOpen:n,onClose:function(){r(),o&&setTimeout(function(){var e;D.setActiveModal(o.type,Jt(Jt({},o.props),w&&(null===(e=o.props)||void 0===e?void 0:e.image)&&{image:Jt(Jt({},o.props.image),{},{reloadKey:w})}))},100)},title:a.filename},d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"relative"},d().createElement("div",{className:"flex justify-center items-center max-h-[50vh] max-w-full mx-auto transition-all duration-300"},C?d().createElement(Vt(),{crop:A,onChange:function(e){return S(e)},onComplete:function(e){return S(e)},aspect:V},d().createElement("img",{src:(0,nt.s)(a.image_url,w),alt:a.alttext,className:"!max-w-full !max-h-[50vh] !shadow-lg !mx-auto ".concat(f?"!opacity-50":""),style:{display:"block",margin:"0 auto"},ref:I})):d().createElement("img",{src:(0,nt.s)(a.image_url,w),alt:a.alttext,className:"max-w-full max-h-[50vh] shadow-lg mx-auto ".concat(f?"opacity-50":""),style:{display:"block",margin:"0 auto"},ref:I}),f&&d().createElement("div",{className:"absolute inset-0 flex items-center justify-center"},d().createElement(t.Nl,{className:"animate-spin h-8 w-8 text-green-500"})))),d().createElement("div",{className:"flex justify-center space-x-4"},d().createElement(Wt.m,{text:(0,p.__)("Rotate 90 degrees clockwise","nggallery")},d().createElement("button",{onClick:function(){return W("cw")},disabled:f||C,className:"px-4 py-2 bg-gray-400 text-white rounded hover:bg-gray-500 flex items-center space-x-2 ".concat(f||C?"opacity-50 cursor-not-allowed":"")},d().createElement("svg",{className:"w-5 h-5",viewBox:"0 0 18 18",fill:"none"},d().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99984 2.33317C7.6813 2.33317 6.39237 2.72416 5.29604 3.45671C4.19971 4.18925 3.34523 5.23044 2.84064 6.44861C2.33606 7.66679 2.20404 9.00723 2.46127 10.3004C2.71851 11.5936 3.35345 12.7815 4.2858 13.7139C5.21815 14.6462 6.40603 15.2812 7.69924 15.5384C8.99245 15.7956 10.3329 15.6636 11.5511 15.159C12.7692 14.6545 13.8104 13.8 14.543 12.7036C15.2755 11.6073 15.6665 10.3184 15.6665 8.99984C15.6665 8.5396 16.0396 8.1665 16.4998 8.1665C16.9601 8.1665 17.3332 8.5396 17.3332 8.99984C17.3332 10.648 16.8444 12.2592 15.9288 13.6296C15.0131 15 13.7116 16.0681 12.1889 16.6988C10.6662 17.3296 8.9906 17.4946 7.37409 17.173C5.75758 16.8515 4.27272 16.0578 3.10728 14.8924C1.94185 13.727 1.14817 12.2421 0.82663 10.6256C0.505087 9.00908 0.670115 7.33353 1.30084 5.81081C1.93158 4.28809 2.99968 2.9866 4.37009 2.07092C5.7405 1.15525 7.35166 0.666504 8.99984 0.666504C11.3213 0.666504 13.535 1.58751 15.194 3.18241L15.2058 3.19391L15.6665 3.65466V1.49984C15.6665 1.0396 16.0396 0.666504 16.4998 0.666504C16.9601 0.666504 17.3332 1.0396 17.3332 1.49984V5.6665C17.3332 6.12674 16.9601 6.49984 16.4998 6.49984H12.3332C11.8729 6.49984 11.4998 6.12674 11.4998 5.6665C11.4998 5.20627 11.8729 4.83317 12.3332 4.83317H14.488L14.0332 4.3784C12.6763 3.07672 10.8757 2.33317 8.99984 2.33317Z",fill:"currentColor",fillOpacity:"0.6"})))),d().createElement(Wt.m,{text:(0,p.__)("Rotate 90 degrees counter-clockwise","nggallery")},d().createElement("button",{onClick:function(){return W("ccw")},disabled:f||C,className:"px-4 py-2 bg-gray-400 text-white rounded hover:bg-gray-500 flex items-center space-x-2 ".concat(f||C?"opacity-50 cursor-not-allowed":"")},d().createElement("svg",{className:"w-5 h-5",viewBox:"0 0 18 18",fill:"none"},d().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.9967 0.666516L8.99984 0.666504C10.648 0.66651 12.2592 1.15525 13.6296 2.07093C15 2.98661 16.0681 4.2881 16.6988 5.81081C17.3296 7.33353 17.4946 9.00909 17.173 10.6256C16.8515 12.2421 16.0578 13.727 14.8924 14.8924C13.727 16.0578 12.2421 16.8515 10.6256 17.1731C9.00908 17.4946 7.33353 17.3296 5.81081 16.6988C4.28809 16.0681 2.9866 15 2.07092 13.6296C1.15525 12.2592 0.666504 10.648 0.666504 8.99984C0.666504 8.53961 1.0396 8.16651 1.49984 8.16651C1.96007 8.16651 2.33317 8.53961 2.33317 8.99984C2.33317 10.3184 2.72416 11.6073 3.45671 12.7036C4.18925 13.8 5.23044 14.6545 6.44861 15.159C7.66679 15.6636 9.00723 15.7956 10.3004 15.5384C11.5936 15.2812 12.7815 14.6462 13.7139 13.7139C14.6462 12.7815 15.2812 11.5937 15.5384 10.3004C15.7956 9.00724 15.6636 7.66679 15.159 6.44862C14.6545 5.23045 13.8 4.18926 12.7036 3.45671C11.6077 2.72446 10.3194 2.33348 9.0014 2.33318C7.12259 2.34065 5.31925 3.07305 3.96731 4.37755L3.51168 4.83318H5.6665C6.12674 4.83318 6.49984 5.20627 6.49984 5.66651C6.49984 6.12675 6.12674 6.49984 5.6665 6.49984H1.49984C1.0396 6.49984 0.666504 6.12675 0.666504 5.66651V1.49984C0.666504 1.03961 1.0396 0.66651 1.49984 0.66651C1.96007 0.66651 2.33317 1.03961 2.33317 1.49984V3.65466L2.79392 3.19392L2.80397 3.18404C4.46605 1.57726 6.68495 0.675212 8.9967 0.666516Z",fill:"currentColor",fillOpacity:"0.6"})))),C?d().createElement(Wt.m,{text:(0,p.__)("Apply current crop","nggallery")},d().createElement("button",{onClick:Y,disabled:f,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 flex items-center space-x-2 ".concat(f?"opacity-50 cursor-not-allowed":"")},J)):d().createElement(Wt.m,{text:(0,p.__)("Select crop area for the thumbnail","nggallery")},d().createElement("button",{onClick:function(){N(!0)},disabled:f,className:"px-4 py-2 bg-gray-400 text-white rounded hover:bg-gray-500 flex items-center space-x-2 ".concat(f?"opacity-50 cursor-not-allowed":"")},J)),d().createElement(Wt.m,{text:(0,p.__)("Restore from backup","nggallery")},d().createElement("button",{onClick:X,disabled:f||C,className:"px-4 py-2 bg-gray-400 text-white rounded hover:bg-gray-500 flex items-center space-x-2 ".concat(f||C?"opacity-50 cursor-not-allowed":"")},$)))))},galleryImageView:function(e){var t=e.isOpen,n=e.onClose,r=e.image,a=e.galleryId,o=(0,u.useState)(0),i=(0,c.A)(o,2),l=i[0],s=i[1],m=a&&a>0?a:0,g=(0,M.gj)(m).data,f=(null==g?void 0:g.images)||[];(0,u.useEffect)(function(){if(f.length>0&&t){var e=f.findIndex(function(e){return e.pid===r.pid});e>=0&&s(e)}},[f.length,r.pid,t]);var h=f[l],y=(0,u.useCallback)(function(){l>0&&s(l-1)},[l]),v=(0,u.useCallback)(function(){l<f.length-1&&s(l+1)},[l,f.length]);if((0,u.useEffect)(function(){var e=function(e){t&&("Escape"===e.key?(e.preventDefault(),n()):"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),v()))};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[t,y,v,n]),(0,u.useEffect)(function(){return document.body.style.overflow=t?"hidden":"unset",function(){document.body.style.overflow="unset"}},[t]),!t||!h||!a||a<=0)return null;var b=l>0,w=l<f.length-1;return d().createElement("div",{className:"fixed inset-0 z-[9999] bg-black bg-opacity-95 flex items-center justify-center",onClick:n},d().createElement("button",{onClick:n,className:"absolute top-3 sm:top-[39px] right-3 sm:right-4 z-50 text-white hover:text-gray-300 transition-colors",title:(0,p.__)("Close (ESC)","nggallery")},d().createElement("svg",{className:"w-6 h-6 sm:w-8 sm:h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))),d().createElement("div",{className:"absolute top-3 sm:top-[39px] left-3 sm:left-4 z-50 text-white"},d().createElement("h2",{className:"text-sm sm:text-lg font-medium text-gray-300"},h.filename," (",l+1," of ",f.length,")")),d().createElement("div",{className:"relative w-full h-full flex items-center justify-between p-2 sm:p-4 ml-0",onClick:function(e){return e.stopPropagation()}},d().createElement("div",{className:"flex items-center justify-center w-8 sm:w-16 h-full"},b&&d().createElement("button",{onClick:y,className:"bg-black bg-opacity-60 hover:bg-opacity-80 text-white rounded-full p-2 sm:p-3 transition-all",title:(0,p.__)("Previous image (←)","nggallery")},d().createElement("svg",{className:"w-5 h-5 sm:w-8 sm:h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})))),d().createElement("div",{className:"flex-1 flex items-center justify-center max-w-full max-h-full mx-2 sm:mx-4"},d().createElement("div",{className:"relative"},d().createElement("img",{src:(0,nt.s)(h.image_url,h.reloadKey),alt:h.alttext||h.filename,className:"max-w-full max-h-full object-contain ".concat(h.exclude?"opacity-50 grayscale":""),style:{maxHeight:"85vh",maxWidth:"100%"}}),h.exclude&&d().createElement("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none"},d().createElement("div",{className:"bg-gray-600 text-white text-sm px-3 py-2 rounded font-medium shadow-lg"},(0,p.__)("Hidden","nggallery"))))),d().createElement("div",{className:"flex items-center justify-center w-8 sm:w-16 h-full"},w&&d().createElement("button",{onClick:v,className:"bg-black bg-opacity-60 hover:bg-opacity-80 text-white rounded-full p-2 sm:p-3 transition-all",title:(0,p.__)("Next image (→)","nggallery")},d().createElement("svg",{className:"w-5 h-5 sm:w-8 sm:h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}))))),d().createElement("div",{className:"absolute bottom-0 left-1/2 transform -translate-x-1/2 bg-black bg-opacity-80 text-white p-2 sm:p-4 rounded-t-lg w-full sm:w-auto max-w-4xl"},d().createElement("div",{className:"px-2 sm:px-4"},d().createElement("div",{className:"text-center mb-2 sm:mb-3"},d().createElement("h2",{className:"text-sm sm:text-lg font-medium text-gray-300"},h.filename," (",l+1," of ",f.length,")")),d().createElement("div",{className:"text-center mb-2 sm:mb-4"},h.alttext&&d().createElement("p",{className:"text-sm sm:text-lg font-medium mb-1 sm:mb-2"},h.alttext),h.description&&d().createElement("p",{className:"text-xs sm:text-sm text-gray-300"},h.description)),f.length>1&&d().createElement("div",{className:"flex justify-center space-x-1 sm:space-x-2 mb-2"},f.map(function(e,t){return d().createElement("button",{key:t,onClick:function(){return s(t)},className:"w-2 h-2 sm:w-3 sm:h-3 rounded-full transition-colors ".concat(t===l?"bg-white":"bg-gray-500 hover:bg-gray-300"),title:"".concat((0,p.__)("Go to image","nggallery")," ").concat(t+1)})})),d().createElement("div",{className:"text-center text-xs text-gray-400"},(0,p.__)("Use ← → arrow keys to navigate • ESC to close","nggallery")))))},bulkResize:function(e){var n=e.isOpen,r=e.onClose,a=e.imageIds,o=e.galleryId,l=e.onConfirm,s=void 0===l?function(){}:l,m=(0,u.useState)(""),g=(0,c.A)(m,2),f=g[0],h=g[1],y=(0,u.useState)(""),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,G.jE)(),_=(0,M.G5)(),C=(0,U.E)(),N=C.showSuccess,k=C.showError,O=C.showWarning,A=function(){var e=(0,i.A)(fe().m(function e(){var t,n,i,l,c;return fe().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=f?parseInt(f,10):void 0,n=w?parseInt(w,10):void 0,e.n=1,_.mutateAsync({imageIds:a,width:t,height:n});case 1:i=e.v,l=Date.now(),o&&E.setQueriesData({queryKey:["gallery",o,"images"]},function(e){return null!=e&&e.images?ye(ye({},e),{},{images:e.images.map(function(e){return a.includes(e.pid)?ye(ye({},e),{},{reloadKey:l}):e})}):e}),i.success_count>0&&N("Successfully resized ".concat(i.success_count," of ").concat(i.processed," images")),i.failure_count>0&&O("Failed to resize ".concat(i.failure_count," images")),s(),r(),e.n=3;break;case 2:e.p=2,c=e.v,console.error("Error bulk resizing images:",c),k("Failed to resize selected images");case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Bulk Resize Images","nggallery")},d().createElement("div",{className:"space-y-4"},d().createElement("p",{className:"text-gray-600"},(0,p.__)("Resize","nggallery")," ",a.length," ",(0,p.__)("selected images. Leave fields empty to use global settings.","nggallery")),d().createElement("div",{className:"space-y-4"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Width (pixels)","nggallery")),d().createElement("input",{type:"number",min:"1",placeholder:(0,p.__)("Leave empty for global setting","nggallery"),value:f,onChange:function(e){return h(e.target.value)},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:_.isPending})),d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Height (pixels)","nggallery")),d().createElement("input",{type:"number",min:"1",placeholder:(0,p.__)("Leave empty for global setting","nggallery"),value:w,onChange:function(e){return x(e.target.value)},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:_.isPending}))),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{onClick:r,disabled:_.isPending,className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 disabled:opacity-50"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:A,disabled:_.isPending,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 disabled:opacity-50 flex items-center space-x-2"},_.isPending&&d().createElement(t.Nl,{className:"animate-spin h-4 w-4 text-white"}),d().createElement("span",null,_.isPending?(0,p.__)("Resizing...","nggallery"):(0,p.__)("Resize Images","nggallery"))))))},bulkGenerateThumbnails:function(e){var n=e.isOpen,r=e.onClose,a=e.imageIds,o=e.galleryId,s=e.onConfirm,m=void 0===s?function(){}:s,g=(0,u.useState)("240x160"),f=(0,c.A)(g,2),h=f[0],y=f[1],b=(0,u.useState)("240"),w=(0,c.A)(b,2),x=w[0],E=w[1],_=(0,u.useState)("160"),C=(0,c.A)(_,2),N=C[0],k=C[1],O=(0,u.useState)(!1),A=(0,c.A)(O,2),S=A[0],j=A[1],P=(0,u.useState)(!1),T=(0,c.A)(P,2),I=T[0],D=T[1],L=(0,u.useState)(!1),R=(0,c.A)(L,2),F=R[0],Q=R[1],B=(0,u.useState)(function(){var e=localStorage.getItem("ngg_custom_thumbnail_sizes");return e?JSON.parse(e):[]}),q=(0,c.A)(B,2),H=q[0],z=q[1],K=(0,G.jE)(),V=(0,J.h5)(),W=(0,J.UG)(),X=W.data,Y=W.isLoading,Z=(0,U.E)(),$=Z.showSuccess,ee=Z.showError,ne=Z.showWarning,re=(0,M.T8)();(0,u.useEffect)(function(){if(X&&n&&!F){var e=X.thumbwidth||240,t=X.thumbheight||160,r=X.thumbfix||!1;E(e.toString()),k(t.toString()),j(r);var a="".concat(e,"x").concat(t);if("240x160"===a||H.includes(a))y(a);else{if(!H.includes(a)&&"240x160"!==a){var o=[].concat((0,l.A)(H),[a]);z(o),localStorage.setItem("ngg_custom_thumbnail_sizes",JSON.stringify(o))}y(a)}Q(!0)}},[X,n,F,H]),(0,u.useEffect)(function(){n||Q(!1)},[n]);var ie=function(e,t){var n="".concat(e,"x").concat(t);if("240x160"!==n&&!H.includes(n)){var r=[].concat((0,l.A)(H),[n]);z(r),localStorage.setItem("ngg_custom_thumbnail_sizes",JSON.stringify(r))}},le=function(){var e=(0,i.A)(te().m(function e(){var t,n,i,l,s,u,d,g,f,p,y,v,b,w,E,_;return te().w(function(e){for(;;)switch(e.p=e.n){case 0:return D(!0),e.p=1,"custom"===h?(t=x?parseInt(x,10):240,n=N?parseInt(N,10):160):(i=h.split("x"),l=(0,c.A)(i,2),s=l[0],u=l[1],t=parseInt(s,10),n=parseInt(u,10)),"custom"===h&&ie(t,n),e.p=2,e.n=3,V.mutateAsync({thumbwidth:t,thumbheight:n,thumbfix:S});case 3:e.n=5;break;case 4:e.p=4,b=e.v,console.error("Error saving thumbnail settings:",b);case 5:d=0,g=0,f=oe(a),e.p=6,f.s();case 7:if((p=f.n()).done){e.n=12;break}return y=p.value,e.p=8,e.n=9,re.mutateAsync({pid:y,width:t,height:n,setFixDimension:S});case 9:d++,e.n=11;break;case 10:e.p=10,w=e.v,console.error("Error generating thumbnail for image ".concat(y,":"),w),g++;case 11:e.n=7;break;case 12:e.n=14;break;case 13:e.p=13,E=e.v,f.e(E);case 14:return e.p=14,f.f(),e.f(14);case 15:v=Date.now(),o&&K.setQueriesData({queryKey:["gallery",o,"images"]},function(e){return null!=e&&e.images?ae(ae({},e),{},{images:e.images.map(function(e){return a.includes(e.pid)?ae(ae({},e),{},{reloadKey:v}):e})}):e}),d>0&&$("Successfully generated thumbnails for ".concat(d," of ").concat(a.length," images")),g>0&&ne("Failed to generate thumbnails for ".concat(g," images")),m(),r(),e.n=17;break;case 16:e.p=16,_=e.v,console.error("Error bulk generating thumbnails:",_),ee("Failed to generate thumbnails for selected images");case 17:return e.p=17,D(!1),e.f(17);case 18:return e.a(2)}},e,null,[[8,10],[6,13,14,15],[2,4],[1,16,17,18]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Create new thumbnails","nggallery")},d().createElement("div",{className:"space-y-4"},d().createElement("p",{className:"text-gray-600"},(0,p.__)("Generate custom thumbnails for","nggallery")," ",a.length," ",(0,p.__)("selected images.","nggallery")),Y&&d().createElement("div",{className:"flex items-center justify-center py-4"},d().createElement(t.Nl,{className:"animate-spin h-5 w-5 text-gray-500"}),d().createElement("span",{className:"ml-2 text-gray-500"},(0,p.__)("Loading current settings...","nggallery"))),!Y&&d().createElement("div",{className:"space-y-4"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Width x height (in pixel)","nggallery")),d().createElement("select",{value:h,onChange:function(e){return function(e){if(y(e),"custom"!==e&&e.includes("x")){var t=e.split("x"),n=(0,c.A)(t,2),r=n[0],a=n[1];E(r),k(a)}}(e.target.value)},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:I},d().createElement("option",{value:"240x160"},"240x160"),H.map(function(e){return d().createElement("option",{key:e,value:e},e)}),d().createElement("option",{value:"custom"},(0,p.__)("Custom","nggallery"))),"custom"===h&&d().createElement("div",{className:"mt-3"},d().createElement("div",{className:"flex items-center space-x-2"},d().createElement("input",{type:"number",min:"1",value:x,onChange:function(e){return E(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:I}),d().createElement("span",{className:"text-gray-500"},"x"),d().createElement("input",{type:"number",min:"1",value:N,onChange:function(e){return k(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:I})),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("These are maximum values","nggallery")))),d().createElement("div",null,d().createElement("div",{className:"flex items-center space-x-2"},d().createElement("input",{type:"checkbox",id:"setFixDimension",checked:S,onChange:function(e){return j(e.target.checked)},className:"rounded border-gray-300 text-green-600 focus:ring-green-500",disabled:I}),d().createElement("label",{htmlFor:"setFixDimension",className:"text-sm text-gray-700"},(0,p.__)("Set fix dimension","nggallery"))),d().createElement("p",{className:"text-xs text-gray-500 ml-5 mt-1"},(0,p.__)("Ignore the aspect ratio, no portrait thumbnails","nggallery")))),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{onClick:r,disabled:I||Y,className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 disabled:opacity-50"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:le,disabled:I||Y,className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 flex items-center space-x-2"},I&&d().createElement(t.Nl,{className:"animate-spin h-4 w-4 text-white"}),d().createElement("span",null,I?(0,p.__)("Generating...","nggallery"):(0,p.__)("OK","nggallery"))))))},bulkOperationConfirmation:function(e){var n,r,a=e.isOpen,o=e.onClose,l=e.galleries,s=e.operationType,m=e.onConfirm,g=e.title,f=e.description,h=e.warningText,y=e.confirmLabel,b=void 0===y?(0,p.__)("OK","nggallery"):y,w=e.processingLabel,x=void 0===w?(0,p.__)("Processing...","nggallery"):w,E=(0,u.useState)(!1),_=(0,c.A)(E,2),C=_[0],N=_[1],k=(0,u.useState)(null),O=(0,c.A)(k,2),A=O[0],S=O[1],j=function(){var e=(0,i.A)(ue().m(function e(){var t;return ue().w(function(e){for(;;)switch(e.p=e.n){case 0:return N(!0),S({current:0,total:0}),e.p=1,e.n=2,m(function(e,t){S({current:e,total:t})});case 2:o(),e.n=4;break;case 3:e.p=3,t=e.v,console.error("Operation failed:",t);case 4:return e.p=4,N(!1),S(null),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}(),P=g||function(){switch(s){case"watermark":return(0,p.__)("Set Watermark","nggallery");case"metadata":return(0,p.__)("Import Metadata","nggallery");case"recovery":return(0,p.__)("Recover from Backup","nggallery");default:return(0,p.__)("Confirm Operation","nggallery")}}(),T=f||function(){var e=l.length,t=1===e?(0,p.__)("gallery","nggallery"):(0,p.__)("galleries","nggallery");switch(s){case"watermark":return(0,p.__)("Apply watermark to all images in ".concat(e," ").concat(t,"?"),"nggallery");case"metadata":return(0,p.__)("Import metadata for all images in ".concat(e," ").concat(t,"?"),"nggallery");case"recovery":return(0,p.__)("Recover all images from backup in ".concat(e," ").concat(t,"?"),"nggallery");default:return(0,p.__)("Perform operation on ".concat(e," ").concat(t,"?"),"nggallery")}}(),I=h||("recovery"===s?(0,p.__)("This will overwrite current images with their backup versions.","nggallery"):null);return d().createElement(v.A,{isOpen:a,onClose:o,title:P},d().createElement("div",{className:"space-y-4"},d().createElement("p",{className:"text-sm text-gray-600 text-center"},T),(n=l.slice(0,5),r=l.length-5,d().createElement("div",{className:"my-4"},d().createElement("ul",{className:"list-none text-sm text-gray-700 px-4 text-center"},n.map(function(e){return d().createElement("li",{key:e.id},e.galleryTitle)}),r>0&&d().createElement("li",{className:"text-gray-500 italic"},(0,p.__)("and ".concat(r," more..."),"nggallery"))))),I&&d().createElement("p",{className:"text-sm text-yellow-600 text-center bg-yellow-50 p-3 rounded border border-yellow-200"},"⚠️ ",I),C&&A&&A.total>0&&d().createElement("div",{className:"mt-4"},d().createElement(Z,{current:A.current,total:A.total,label:(0,p.__)("Processing images","nggallery"),showPercentage:!0})),d().createElement("div",{className:"flex justify-center space-x-3 !mb-4 ".concat(C?"cursor-wait":"")},d().createElement("button",{type:"button",onClick:o,disabled:C,className:"px-8 py-2 font-medium text-gray-700 bg-white border border-gray-300 rounded-lg shadow hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:j,disabled:C,className:"px-8 py-2 font-bold text-white bg-green-600 border border-transparent rounded-lg shadow hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},C?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),x):b))))},bulkCreateThumbnailsGalleries:function(e){var n=e.isOpen,r=e.onClose,a=e.galleryIds,o=e.onConfirm,s=void 0===o?function(){}:o,m=(0,u.useState)("240x160"),g=(0,c.A)(m,2),f=g[0],h=g[1],y=(0,u.useState)("240"),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)("160"),_=(0,c.A)(E,2),C=_[0],N=_[1],k=(0,u.useState)(!1),O=(0,c.A)(k,2),A=O[0],S=O[1],j=(0,u.useState)(!1),P=(0,c.A)(j,2),T=P[0],I=P[1],D=(0,u.useState)(!1),L=(0,c.A)(D,2),R=L[0],F=L[1],G=(0,u.useState)(0),Q=(0,c.A)(G,2),B=Q[0],q=Q[1],H=(0,u.useState)(0),z=(0,c.A)(H,2),K=z[0],V=z[1],W=(0,u.useState)(function(){var e=localStorage.getItem("ngg_custom_thumbnail_sizes");return e?JSON.parse(e):[]}),X=(0,c.A)(W,2),Y=X[0],ee=X[1],te=(0,J.h5)(),ne=(0,M.Rg)(),re=(0,J.UG)(),ae=re.data,oe=re.isLoading,ie=(0,U.E)(),le=ie.showSuccess,ce=ie.showError,se=ie.showWarning;(0,u.useEffect)(function(){if(ae&&n&&!R){var e=ae.thumbwidth||240,t=ae.thumbheight||160,r=ae.thumbfix||!1;x(e.toString()),N(t.toString()),S(r);var a="".concat(e,"x").concat(t);if("240x160"===a||Y.includes(a))h(a);else{if(!Y.includes(a)&&"240x160"!==a){var o=[].concat((0,l.A)(Y),[a]);ee(o),localStorage.setItem("ngg_custom_thumbnail_sizes",JSON.stringify(o))}h(a)}F(!0)}},[ae,n,R,Y]),(0,u.useEffect)(function(){n||F(!1)},[n]);var ue=function(e,t){var n="".concat(e,"x").concat(t);if("240x160"!==n&&!Y.includes(n)){var r=[].concat((0,l.A)(Y),[n]);ee(r),localStorage.setItem("ngg_custom_thumbnail_sizes",JSON.stringify(r))}},de=function(){var e=(0,i.A)($().m(function e(){var t,n,o,i,l,u,d,m,g;return $().w(function(e){for(;;)switch(e.p=e.n){case 0:return I(!0),q(0),V(0),e.p=1,"custom"===f?(t=w?parseInt(w,10):240,n=C?parseInt(C,10):160):(o=f.split("x"),i=(0,c.A)(o,2),l=i[0],u=i[1],t=parseInt(l,10),n=parseInt(u,10)),"custom"===f&&ue(t,n),e.p=2,e.n=3,te.mutateAsync({thumbwidth:t,thumbheight:n,thumbfix:A});case 3:e.n=5;break;case 4:e.p=4,m=e.v,console.error("Error saving thumbnail settings:",m);case 5:return e.n=6,ne.mutateAsync({galleryIds:a,width:t,height:n,fixDimension:A,onProgress:function(e,t){q(e),V(t)}});case 6:(d=e.v).failureCount>0?se("".concat((0,p.__)("Generated thumbnails for","nggallery")," ").concat(d.successCount," ").concat((0,p.__)("of","nggallery")," ").concat(d.total," ").concat((0,p.__)("images","nggallery"))):le("".concat((0,p.__)("Successfully generated thumbnails for","nggallery")," ").concat(d.total," ").concat((0,p.__)("images","nggallery"))),s(),r(),e.n=8;break;case 7:e.p=7,g=e.v,console.error("Error bulk generating thumbnails:",g),ce((0,p.__)("Failed to generate thumbnails for selected galleries","nggallery"));case 8:return e.p=8,I(!1),e.f(8);case 9:return e.a(2)}},e,null,[[2,4],[1,7,8,9]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Create new thumbnails","nggallery")},d().createElement("div",{className:"space-y-4"},d().createElement("p",{className:"text-gray-600"},(0,p.__)("Generate custom thumbnails for","nggallery")," ",a.length," ",(0,p.__)("selected galleries.","nggallery")),oe&&d().createElement("div",{className:"flex items-center justify-center py-4"},d().createElement(t.Nl,{className:"animate-spin h-5 w-5 text-gray-500"}),d().createElement("span",{className:"ml-2 text-gray-500"},(0,p.__)("Loading current settings...","nggallery"))),!oe&&d().createElement("div",{className:"space-y-4"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Width x height (in pixel)","nggallery")),d().createElement("select",{value:f,onChange:function(e){return function(e){if(h(e),"custom"!==e&&e.includes("x")){var t=e.split("x"),n=(0,c.A)(t,2),r=n[0],a=n[1];x(r),N(a)}}(e.target.value)},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:T},d().createElement("option",{value:"240x160"},"240x160"),Y.map(function(e){return d().createElement("option",{key:e,value:e},e)}),d().createElement("option",{value:"custom"},(0,p.__)("Custom","nggallery"))),"custom"===f&&d().createElement("div",{className:"mt-3"},d().createElement("div",{className:"flex items-center space-x-2"},d().createElement("input",{type:"number",min:"1",value:w,onChange:function(e){return x(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:T}),d().createElement("span",{className:"text-gray-500"},"x"),d().createElement("input",{type:"number",min:"1",value:C,onChange:function(e){return N(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:T})),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("These are maximum values","nggallery")))),d().createElement("div",null,d().createElement("div",{className:"flex items-center space-x-2"},d().createElement("input",{type:"checkbox",id:"setFixDimension",checked:A,onChange:function(e){return S(e.target.checked)},className:"rounded border-gray-300 text-green-600 focus:ring-green-500",disabled:T}),d().createElement("label",{htmlFor:"setFixDimension",className:"text-sm text-gray-700"},(0,p.__)("Set fix dimension","nggallery"))),d().createElement("p",{className:"text-xs text-gray-500 ml-5 mt-1"},(0,p.__)("Ignore the aspect ratio, no portrait thumbnails","nggallery")))),T&&K>0&&d().createElement("div",{className:"mt-4"},d().createElement(Z,{current:B,total:K,label:(0,p.__)("Processing images","nggallery"),showPercentage:!0})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{onClick:r,disabled:T||oe,className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 disabled:opacity-50"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:de,disabled:T||oe,className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 flex items-center space-x-2"},T&&d().createElement(t.Nl,{className:"animate-spin h-4 w-4 text-white"}),d().createElement("span",null,T?(0,p.__)("Generating...","nggallery"):(0,p.__)("OK","nggallery"))))))},bulkResizeImagesGalleries:function(e){var n=e.isOpen,r=e.onClose,a=e.galleryIds,o=e.onConfirm,l=void 0===o?function(){}:o,s=(0,u.useState)("800"),m=(0,c.A)(s,2),g=m[0],f=m[1],h=(0,u.useState)("600"),y=(0,c.A)(h,2),b=y[0],w=y[1],x=(0,u.useState)(!1),E=(0,c.A)(x,2),_=E[0],C=E[1],N=(0,u.useState)(!1),k=(0,c.A)(N,2),O=k[0],A=k[1],S=(0,u.useState)(0),j=(0,c.A)(S,2),P=j[0],T=j[1],I=(0,u.useState)(0),D=(0,c.A)(I,2),L=D[0],R=D[1],F=(0,J.h5)(),G=(0,M.mQ)(),Q=(0,J.UG)(),B=Q.data,q=Q.isLoading,H=(0,U.E)(),z=H.showSuccess,K=H.showError,V=H.showWarning;(0,u.useEffect)(function(){if(B&&n&&!O){var e=B.imgWidth||800,t=B.imgHeight||600;f(e.toString()),w(t.toString()),A(!0)}},[B,n,O]),(0,u.useEffect)(function(){n||A(!1)},[n]);var W=function(){var e=(0,i.A)(me().m(function e(){var t,n,o,i,c;return me().w(function(e){for(;;)switch(e.p=e.n){case 0:return C(!0),T(0),R(0),e.p=1,t=g?parseInt(g,10):800,n=b?parseInt(b,10):600,e.p=2,e.n=3,F.mutateAsync({imgWidth:t,imgHeight:n});case 3:e.n=5;break;case 4:e.p=4,i=e.v,console.error("Error saving resize settings:",i);case 5:return e.n=6,G.mutateAsync({galleryIds:a,width:t,height:n,onProgress:function(e,t){T(e),R(t)}});case 6:(o=e.v).failureCount>0?V("".concat((0,p.__)("Resized","nggallery")," ").concat(o.successCount," ").concat((0,p.__)("of","nggallery")," ").concat(o.total," ").concat((0,p.__)("images","nggallery"))):z("".concat((0,p.__)("Successfully resized","nggallery")," ").concat(o.total," ").concat((0,p.__)("images","nggallery"))),l(),r(),e.n=8;break;case 7:e.p=7,c=e.v,console.error("Error bulk resizing images:",c),K((0,p.__)("Failed to resize images for selected galleries","nggallery"));case 8:return e.p=8,C(!1),e.f(8);case 9:return e.a(2)}},e,null,[[2,4],[1,7,8,9]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Resize Images","nggallery")},d().createElement("div",{className:"space-y-4"},d().createElement("p",{className:"text-gray-600"},(0,p.__)("Resize images in","nggallery")," ",a.length," ",(0,p.__)("selected galleries.","nggallery")),q&&d().createElement("div",{className:"flex items-center justify-center py-4"},d().createElement(t.Nl,{className:"animate-spin h-5 w-5 text-gray-500"}),d().createElement("span",{className:"ml-2 text-gray-500"},(0,p.__)("Loading current settings...","nggallery"))),!q&&d().createElement("div",{className:"space-y-4"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Resize Images to","nggallery")),d().createElement("div",{className:"flex items-center space-x-2"},d().createElement("input",{type:"number",min:"1",value:g,onChange:function(e){return f(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:_}),d().createElement("span",{className:"text-gray-500"},"x"),d().createElement("input",{type:"number",min:"1",value:b,onChange:function(e){return w(e.target.value)},className:"w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",disabled:_}),d().createElement("span",{className:"text-gray-500 ml-2"},"px")),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("Width x height. Leave height or width empty to keep ratio.","nggallery")))),_&&L>0&&d().createElement("div",{className:"mt-4"},d().createElement(Z,{current:P,total:L,label:(0,p.__)("Processing images","nggallery"),showPercentage:!0})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{onClick:r,disabled:_||q,className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 disabled:opacity-50"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:W,disabled:_||q,className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 flex items-center space-x-2"},_&&d().createElement(t.Nl,{className:"animate-spin h-4 w-4 text-white"}),d().createElement("span",null,_?(0,p.__)("Resizing...","nggallery"):(0,p.__)("OK","nggallery"))))))},gallerySelect:function(e){var n=e.isOpen,r=e.onClose,a=e.imageIds,o=e.operation,l=void 0===o?"copy":o,m=e.onConfirm,g=e.excludeGalleryId,f=(0,u.useState)(null),h=(0,c.A)(f,2),y=h[0],b=h[1],w=(0,M.yr)({get_all:!0}),x=w.data,E=w.isLoading,_=(0,U.E)(),C=_.showSuccess,N=_.showError,k=_.showWarning,O=(0,M.BD)(),A=(0,M.dj)(),S=((null==x?void 0:x.galleries)||[]).filter(function(e){return!g||e.id!==g}),j=function(){var e=(0,i.A)(Nt().m(function e(){var t,n,o;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(y){e.n=1;break}return e.a(2);case 1:return t="copy"===l?O:A,e.p=2,e.n=3,t.mutateAsync({imageIds:a,destinationGalleryId:y});case 3:(n=e.v).success_count>0&&C(n.message),n.failure_count>0&&k("Failed to ".concat(l," ").concat(n.failure_count," images")),m&&m(y),r(),e.n=5;break;case 4:e.p=4,o=e.v,console.error("Error ".concat(l,"ing images:"),o),N("Failed to ".concat(l," images"));case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}(),P="copy"===l?(0,p.__)("Copy","nggallery"):(0,p.__)("Move","nggallery"),T="copy"===l?(0,p.__)("copy","nggallery"):(0,p.__)("move","nggallery");return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.sprintf)((0,p.__)("%s Images to Gallery","nggallery"),P)},d().createElement("p",{className:"text-gray-600 mb-4"},(0,p.sprintf)((0,p.__)("Select the gallery where you want to %s the selected images.","nggallery"),T)),d().createElement("div",{className:"mb-4"},d().createElement("p",{className:"text-sm text-gray-500"},1===a.length?(0,p.sprintf)((0,p.__)("1 image will be %s","nggallery"),"copy"===l?(0,p.__)("copied","nggallery"):(0,p.__)("moved","nggallery")):(0,p.sprintf)((0,p.__)("%d images will be %s","nggallery"),a.length,"copy"===l?(0,p.__)("copied","nggallery"):(0,p.__)("moved","nggallery")))),E?d().createElement("div",{className:"py-8"},d().createElement(s.A,{size:"md",text:(0,p.__)("Loading galleries...","nggallery")})):0===S.length?d().createElement("div",{className:"text-center py-8"},d().createElement("p",{className:"text-gray-500"},(0,p.__)("No galleries available","nggallery"))):d().createElement("div",{className:"space-y-2 max-h-96 overflow-y-auto"},S.map(function(e){return d().createElement("div",{key:e.id,className:"flex items-center p-3 border rounded-lg cursor-pointer transition-colors ".concat(y===e.id?"border-green-500 bg-green-50":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"),onClick:function(){return b(e.id)}},d().createElement("input",{type:"radio",name:"gallery",value:e.id,checked:y===e.id,onChange:function(){return b(e.id)},className:"mr-3"}),e.thumbnail?d().createElement("img",{src:e.thumbnail,alt:e.galleryTitle,className:"w-12 h-12 object-cover rounded mr-3"}):d().createElement("div",{className:"w-12 h-12 bg-gray-200 rounded mr-3 flex items-center justify-center"},d().createElement("span",{className:"text-gray-500 text-xs"},(0,p.__)("No image","nggallery"))),d().createElement("div",{className:"flex-1"},d().createElement("h3",{className:"font-medium"},e.galleryTitle),d().createElement("p",{className:"text-sm text-gray-500"},e.count," ","1"===e.count?(0,p.__)("image","nggallery"):(0,p.__)("images","nggallery"))))})),d().createElement("div",{className:"flex justify-end space-x-2 mt-6"},d().createElement("button",{onClick:r,className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",disabled:O.isPending||A.isPending},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:j,disabled:!y||O.isPending||A.isPending,className:"px-4 py-2 text-white rounded-md hover:bg-opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center ".concat("move"===l?"bg-orange-600 hover:bg-orange-700":"bg-green-500 hover:bg-green-600")},(O.isPending||A.isPending)&&d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.sprintf)((0,p.__)("%s Images","nggallery"),P))))},tags:function(e){var n=e.isOpen,r=e.onClose,a=e.imageIds,o=e.onConfirm,m=(0,u.useState)(""),g=(0,c.A)(m,2),f=g[0],h=g[1],y=(0,u.useState)(new Set),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)("append"),C=(0,c.A)(E,2),N=C[0],k=C[1],O=(0,u.useState)([]),A=(0,c.A)(O,2),S=A[0],j=A[1],P=(0,u.useState)(!1),T=(0,c.A)(P,2),I=T[0],D=T[1],L=(0,Fe.IG)(),R=(0,Fe.PN)(),F=(0,U.E)().showWarning;(0,u.useEffect)(function(){n&&M()},[n]);var M=function(){var e=(0,i.A)(gn().m(function e(){var t,n,r,a;return gn().w(function(e){for(;;)switch(e.p=e.n){case 0:return D(!0),e.p=1,n=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce,e.n=2,_()({path:"/imagely/v1/tags",method:"GET",headers:{"X-WP-Nonce":n,"Content-Type":"application/json"}});case 2:r=e.v,j(r),e.n=4;break;case 3:e.p=3,a=e.v,console.error("Error fetching tags:",a);case 4:return e.p=4,D(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}(),G=function(e){return e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0})},Q=function(){var e=(0,i.A)(gn().m(function e(){var t,n,i,c,s;return gn().w(function(e){for(;;)switch(e.p=e.n){case 0:if("remove"!==N){e.n=5;break}return e.p=1,e.n=2,R.mutateAsync({imageIds:a});case 2:o&&o(),r(),e.n=4;break;case 3:e.p=3,c=e.v,console.error("Error removing tags:",c);case 4:return e.a(2);case 5:if(t=G(f),n=Array.from(w),0!==(i=[].concat((0,l.A)(t),n)).length){e.n=6;break}return F((0,p.__)("Please select existing tags or enter new tags","nggallery")),e.a(2);case 6:return e.p=6,e.n=7,L.mutateAsync({imageIds:a,tags:i,append:"append"===N});case 7:o&&o(),r(),e.n=9;break;case 8:e.p=8,s=e.v,console.error("Error adding tags:",s);case 9:return e.a(2)}},e,null,[[6,8],[1,3]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Add Tags to Images","nggallery")},d().createElement("div",{className:"mb-4"},d().createElement("p",{className:"text-sm text-gray-500"},1===a.length?(0,p.__)("1 image will be tagged","nggallery"):(0,p.sprintf)((0,p.__)("%d images will be tagged","nggallery"),a.length))),d().createElement("div",{className:"mb-6"},d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-3"},(0,p.__)("Tag Mode","nggallery")),d().createElement("div",{className:"space-y-2"},d().createElement("label",{className:"flex items-center"},d().createElement("input",{type:"radio",name:"tagMode",checked:"append"===N,onChange:function(){return k("append")},className:"mr-2"}),d().createElement("span",null,(0,p.__)("Add to existing tags","nggallery"))),d().createElement("label",{className:"flex items-center"},d().createElement("input",{type:"radio",name:"tagMode",checked:"replace"===N,onChange:function(){return k("replace")},className:"mr-2"}),d().createElement("span",{className:"text-orange-600"},(0,p.__)("Replace all existing tags","nggallery"))),d().createElement("label",{className:"flex items-center"},d().createElement("input",{type:"radio",name:"tagMode",checked:"remove"===N,onChange:function(){return k("remove")},className:"mr-2"}),d().createElement("span",{className:"text-red-600"},(0,p.__)("Remove all tags","nggallery"))))),"remove"!==N&&d().createElement("div",{className:"mb-6"},d().createElement("label",{htmlFor:"newTags",className:"block text-sm font-medium text-gray-700 mb-2"},(0,p.__)("New Tags","nggallery")),d().createElement("input",{id:"newTags",type:"text",value:f,onChange:function(e){return h(e.target.value)},placeholder:(0,p.__)("Enter new tags separated by commas (e.g., nature, landscape, photography)","nggallery"),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"}),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("Separate multiple tags with commas","nggallery"))),"remove"!==N&&d().createElement("div",{className:"mb-6"},d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-2"},(0,p.__)("Existing Tags","nggallery")),I?d().createElement("div",{className:"py-4"},d().createElement(s.A,{size:"sm",text:(0,p.__)("Loading tags...","nggallery"),centerInContainer:!1})):0===S.length?d().createElement("p",{className:"text-gray-500 py-4"},(0,p.__)("No existing tags found","nggallery")):d().createElement("div",{className:"max-h-48 overflow-y-auto border border-gray-300 rounded-md p-3"},d().createElement("div",{className:"space-y-2"},S.map(function(e){return d().createElement("label",{key:e.term_id,className:"flex items-center cursor-pointer"},d().createElement("input",{type:"checkbox",checked:w.has(e.name),onChange:function(){return t=e.name,(n=new Set(w)).has(t)?n.delete(t):n.add(t),void x(n);var t,n},className:"mr-2"}),d().createElement("span",{className:"flex-1"},e.name),d().createElement("span",{className:"text-xs text-gray-500 ml-2"},"(",e.count,")"))})))),"remove"===N&&d().createElement("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-md"},d().createElement("div",{className:"flex"},d().createElement(t.m,{className:"w-5 h-5 text-red-400 mr-2 mt-0.5"}),d().createElement("div",null,d().createElement("h3",{className:"text-sm font-medium text-red-800"},(0,p.__)("Warning: This will remove all tags","nggallery")),d().createElement("p",{className:"text-sm text-red-700 mt-1"},1===a.length?(0,p.__)("All tags will be permanently removed from the selected image.","nggallery"):(0,p.sprintf)((0,p.__)("All tags will be permanently removed from all %d selected images.","nggallery"),a.length))))),d().createElement("div",{className:"flex justify-end space-x-2"},d().createElement("button",{onClick:r,className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50",disabled:L.isPending||R.isPending},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:Q,disabled:L.isPending||R.isPending,className:"px-4 py-2 text-white rounded-md hover:bg-opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center ".concat("remove"===N?"bg-red-600 hover:bg-red-700":"bg-green-500 hover:bg-green-600")},(L.isPending||R.isPending)&&d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),"remove"===N?(0,p.__)("Remove All Tags","nggallery"):(0,p.__)("Add Tags","nggallery"))))},tagForm:function(n){var r=n.isOpen,a=n.onClose,o=n.tag,l=void 0===o?null:o,s=n.onSuccess,f=(0,g.useDispatch)(m.EF),h=(0,u.useState)({name:"",slug:"",description:""}),y=(0,c.A)(h,2),b=y[0],w=y[1],x=(0,u.useState)(!1),E=(0,c.A)(x,2),C=E[0],N=E[1],k=(0,u.useState)({}),O=(0,c.A)(k,2),A=O[0],S=O[1],j=!!l;(0,u.useEffect)(function(){r&&(w(l?{name:l.name||"",slug:l.slug||"",description:l.description||""}:{name:"",slug:"",description:""}),S({}))},[r,l]);var P=function(e,t){var n,r=(null==e?void 0:e.message)||t;null!=e&&e.code&&(r+=" (".concat((0,p.__)("Error Code","nggallery"),": ").concat(e.code,")")),null!=e&&null!==(n=e.data)&&void 0!==n&&n.details&&(r+=" - ".concat(e.data.details)),f.showNotice("error",r)},T=function(){var e={};return b.name.trim()||(e.name=(0,p.__)("Tag name is required","nggallery")),S(e),0===Object.keys(e).length},I=function(t){var n=t.target,r=n.name,a=n.value;w(function(t){return mn(mn({},t),{},(0,e.A)({},r,a))}),A[r]&&S(function(t){return mn(mn({},t),{},(0,e.A)({},r,""))})},D=function(){var e=(0,i.A)(sn().m(function e(t){var n,r,o,i,c;return sn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),T()){e.n=1;break}return e.a(2);case 1:if(N(!0),e.p=2,r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,o={name:b.name.trim(),description:b.description.trim()},b.slug.trim()&&(o.slug=b.slug.trim()),!j||!l){e.n=4;break}return e.n=3,_()({path:"/imagely/v1/tags/".concat(l.term_id),method:"PUT",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:o});case 3:f.showNotice("success",(0,p.__)("Tag updated successfully","nggallery")),e.n=6;break;case 4:return e.n=5,_()({path:"/imagely/v1/tags",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:o});case 5:f.showNotice("success",(0,p.__)("Tag created successfully","nggallery"));case 6:s&&s(),a(),e.n=13;break;case 7:if(e.p=7,c=e.v,console.error("Error saving tag:",c),!(c instanceof Response)){e.n=12;break}return e.p=8,e.n=9,c.json();case 9:i=e.v,P(i,(0,p.__)("Failed to save tag","nggallery")),e.n=11;break;case 10:e.p=10,e.v,f.showNotice("error",(0,p.__)("Failed to save tag","nggallery"));case 11:e.n=13;break;case 12:P(c,(0,p.__)("Failed to save tag","nggallery"));case 13:return e.p=13,N(!1),e.f(13);case 14:return e.a(2)}},e,null,[[8,10],[2,7,13,14]])}));return function(t){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:r,onClose:a,title:j?(0,p.__)("Edit Tag","nggallery"):(0,p.__)("Add New Tag","nggallery")},d().createElement("form",{onSubmit:D,className:"space-y-4"},d().createElement("div",null,d().createElement("label",{htmlFor:"tag-name",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Name","nggallery")," ",d().createElement("span",{className:"text-red-500"},"*")),d().createElement("input",{type:"text",id:"tag-name",name:"name",value:b.name,onChange:I,className:"w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 ".concat(A.name?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 focus:ring-green-500 focus:border-green-500"),placeholder:(0,p.__)("Enter tag name","nggallery"),disabled:C}),A.name&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},A.name)),d().createElement("div",null,d().createElement("label",{htmlFor:"tag-slug",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Slug","nggallery")),d().createElement("input",{type:"text",id:"tag-slug",name:"slug",value:b.slug,onChange:I,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500",placeholder:(0,p.__)("Leave empty to auto-generate from name","nggallery"),disabled:C}),d().createElement("p",{className:"mt-1 text-sm text-gray-500"},(0,p.__)("The slug is the URL-friendly version of the name. Leave empty to auto-generate.","nggallery"))),d().createElement("div",null,d().createElement("label",{htmlFor:"tag-description",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Description","nggallery")),d().createElement("textarea",{id:"tag-description",name:"description",value:b.description,onChange:I,rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500",placeholder:(0,p.__)("Optional description for this tag","nggallery"),disabled:C})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:C,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:C,className:"px-4 py-2 text-sm font-medium text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},C?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Saving...","nggallery")):j?(0,p.__)("Update Tag","nggallery"):(0,p.__)("Create Tag","nggallery")))))},editImage:function(n){var r=n.isOpen,a=n.onClose,o=n.image,s=(0,g.useDispatch)(m.EF),f=(0,M.iX)(o.galleryid).data,h=(0,le.Eq)({enabled:"pro"===m.WA,per_page:-1}),y=h.data,b=h.isLoading,w=(0,M.gj)(o.galleryid).data,x=(null==w?void 0:w.images)||[],E=(null==x?void 0:x.find(function(e){return e.pid===o.pid}))||o,_=(0,Fe.yr)(),C=(0,U.E)(),N=C.showSuccess,k=C.showError,O=function(e){var t=e.pricelist_id;return 0===t?"0":-1===t?"-1":t&&t>0?t.toString():"0"},A=(0,u.useState)(function(){var e={alttext:"",description:"",tags:""};return"pro"===m.WA?it(it({},e),{},{pricelist_id:"0"}):e}),S=(0,c.A)(A,2),j=S[0],P=S[1],T=(0,u.useState)(!1),I=(0,c.A)(T,2),D=I[0],L=I[1],R=(0,u.useState)({}),F=(0,c.A)(R,2),G=F[0],Q=F[1];(0,u.useEffect)(function(){if(r&&E){var e,t={alttext:E.alttext||"",description:E.description||"",tags:(null===(e=E.tags)||void 0===e?void 0:e.join(","))||""},n="pro"===m.WA?it(it({},t),{},{pricelist_id:O(E)}):t;P(n),Q({})}},[r,E]);var B=function(){var e={};return j.alttext.trim()||(e.alttext=(0,p.__)("Alt text is required for accessibility","nggallery")),Q(e),0===Object.keys(e).length},q=function(){var e=(0,i.A)(rt().m(function e(t){var n,r,i,c,s;return rt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),B()){e.n=1;break}return e.a(2);case 1:return L(!0),e.p=2,n=(0,l.A)(new Set(j.tags.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0}))).join(","),r={alttext:j.alttext,description:j.description,tags:n},i="pro"===m.WA&&"pricelist_id"in j?it(it({},r),{},{pricelist_id:parseInt(j.pricelist_id,10)}):r,e.n=3,_.mutateAsync({imageId:o.pid,data:i});case 3:N((0,p.__)("Image updated successfully","nggallery")),setTimeout(function(){a()},100),e.n=5;break;case 4:e.p=4,s=e.v,c=s instanceof Error?s.message:(0,p.__)("Failed to update image","nggallery"),k(c);case 5:return e.p=5,L(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}(),H=function(t){var n=t.target,r=n.name,a=n.value;P(function(t){return it(it({},t),{},(0,e.A)({},r,a))}),G[r]&&Q(function(t){return it(it({},t),{},(0,e.A)({},r,""))})};return d().createElement(v.A,{isOpen:r,onClose:a,title:(0,p.__)("Edit Image","nggallery")},d().createElement("form",{onSubmit:q,className:"space-y-4"},d().createElement("div",{className:"flex justify-center mb-6"},d().createElement("div",{className:"relative w-48 h-32 cursor-pointer hover:opacity-80 transition-opacity",onClick:function(e){e.stopPropagation(),e.preventDefault();var t={image:{filename:o.filename,alttext:o.alttext||"",galleryPath:(null==f?void 0:f.path)||"",pid:o.pid,galleryid:o.galleryid,image_url:o.image_url},returnTo:{type:"editImage",props:{image:o}}};s.setActiveModal("imageView",t)},title:(0,p.__)("Click to edit image","nggallery")},d().createElement("img",{src:(0,nt.s)(o.thumb_url,o.reloadKey),alt:o.alttext,className:"w-full h-full object-cover rounded-lg shadow-md"}),d().createElement("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity bg-black bg-opacity-30 rounded-lg"},d().createElement("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))))),d().createElement("div",null,d().createElement("label",{htmlFor:"alttext",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Alt Text","nggallery")),d().createElement("input",{type:"text",id:"alttext",name:"alttext",value:j.alttext,onChange:H,className:"w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 ".concat(G.alttext?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 focus:ring-green-500 focus:border-green-500")}),G.alttext&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},G.alttext)),d().createElement("div",null,d().createElement("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Description","nggallery")),d().createElement("textarea",{id:"description",name:"description",value:j.description,onChange:H,rows:4,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500"})),d().createElement("div",null,d().createElement("label",{htmlFor:"tags",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Tags (comma-separated)","nggallery")),d().createElement("input",{type:"text",id:"tags",name:"tags",value:j.tags,onChange:H,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500"})),"pro"===m.WA?d().createElement("div",null,d().createElement("label",{htmlFor:"pricelist_id",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Pricelist","nggallery")),d().createElement("select",{id:"pricelist_id",name:"pricelist_id",value:"pricelist_id"in j?j.pricelist_id:"0",onChange:H,disabled:D||b,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500",style:{width:"100%",minWidth:"100%"}},b?d().createElement("option",{value:"0"},(0,p.__)("Loading pricelists...","nggallery")):d().createElement(d().Fragment,null,d().createElement("option",{value:"0"},(0,p.__)("Use gallery's pricelist","nggallery")),d().createElement("option",{value:"-1"},(0,p.__)("None (not for sale)","nggallery")),((null==y?void 0:y.pricelists)||[]).map(function(e){return d().createElement("option",{key:e.id,value:e.id.toString()},e.title)}))),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("Choose how to handle pricing for this image.","nggallery"))):d().createElement("div",{className:"relative"},d().createElement("div",{className:"opacity-50 pointer-events-none"},d().createElement("label",{htmlFor:"pricelist_id",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Pricelist","nggallery")),d().createElement("select",{id:"pricelist_id",name:"pricelist_id",value:"0",onChange:function(){},disabled:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500",style:{width:"100%",minWidth:"100%"}},d().createElement("option",{value:"0"},(0,p.__)("Use gallery's pricelist","nggallery")),d().createElement("option",{value:"-1"},(0,p.__)("None (not for sale)","nggallery"))),d().createElement("p",{className:"text-xs text-gray-500 mt-1"},(0,p.__)("Choose how to handle pricing for this image.","nggallery"))),d().createElement("div",{className:"absolute inset-0 cursor-pointer flex items-center",onClick:function(){s.setActiveModal("upgrade",{feature:"eCommerce features",onClose:function(){s.setActiveModal("editImage",{image:o})}})},title:(0,p.__)("Requires NextGEN Gallery Pro","nggallery")},d().createElement("span",{className:"sr-only"},(0,p.__)("Upgrade to Pro for eCommerce features","nggallery")))),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:D,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:D,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 border border-transparent rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center"},D&&d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),D?(0,p.__)("Saving...","nggallery"):(0,p.__)("Save Changes","nggallery")))))},editVideo:function(n){var r=n.isOpen,a=n.onClose,o=n.image,l=n.galleryId,s=(0,G.jE)(),g=(null==o?void 0:o.galleryid)||l,f=!!o,h=(0,M.gj)(null!=g?g:0,{enabled:f&&!!g}).data,y=(null==h?void 0:h.images)||[],b=f&&o?(null==y?void 0:y.find(function(e){return e.pid===o.pid}))||o:null,w=(0,Fe.Ws)(),E=(0,U.E)(),N=E.showSuccess,O=E.showError,S=(0,u.useState)({videoLink:"",thumbnailImageLink:""}),j=(0,c.A)(S,2),P=j[0],T=j[1],I=(0,u.useState)(null),D=(0,c.A)(I,2),L=D[0],R=D[1],F=(0,u.useState)(!1),Q=(0,c.A)(F,2),B=Q[0],q=Q[1],H=(0,u.useState)({}),z=(0,c.A)(H,2),K=z[0],V=z[1],W=A(),X=W.isMediaLibraryOpen,Y=W.openMediaFrame,Z=(0,u.useRef)(null),J=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=(0,u.useState)(!1),r=(0,c.A)(n,2),a=r[0],o=r[1];return(0,u.useEffect)(function(){var n=e.trim();if(n){var r=setTimeout((0,i.A)(C().m(function e(){var t;return C().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,k(n);case 1:t=e.v,o(t);case 2:return e.a(2)}},e)})),t);return function(){return clearTimeout(r)}}o(!1)},[e,t]),{isHostedVideo:a}}(P.videoLink).isHostedVideo;(0,u.useEffect)(function(){if(r){if(f&&b){var e,t=(null===(e=b.meta_data)||void 0===e?void 0:e.video_link)||"",n=b.thumb_url||b.image_url||"";T({videoLink:t,thumbnailImageLink:n})}else T({videoLink:"",thumbnailImageLink:""});R(null),V({})}},[r,b,f]),(0,u.useEffect)(function(){return function(){P.thumbnailImageLink.startsWith("blob:")&&URL.revokeObjectURL(P.thumbnailImageLink)}},[P.thumbnailImageLink]);var $=function(){var e={};return P.videoLink.trim()||(e.videoLink=(0,p.__)("Video link is required","nggallery")),!J||P.thumbnailImageLink.trim()||L||(e.thumbnailImageLink=(0,p.__)("Thumbnail image link is required if specifying a local video URL","nggallery")),V(e),0===Object.keys(e).length},ee=function(){var e=(0,i.A)(st().m(function e(t){var n,r,o,i,l;return st().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),$()){e.n=1;break}return e.a(2);case 1:return q(!0),e.p=2,n=new FormData,g&&n.append("gallery_id",g.toString()),n.append("video_links[0][videoLink]",P.videoLink.trim()),r=P.thumbnailImageLink.startsWith("blob:")?"":P.thumbnailImageLink.trim(),n.append("video_links[0][thumbnailImageLink]",r),L&&n.append("video_links[0][thumbnailFileInput]",L),e.n=3,_()({path:m.Co,method:"POST",headers:{"X-WP-Nonce":(0,x.m9)()},body:n});case 3:if(!(o=e.v).error){e.n=4;break}throw new Error(o.error);case 4:if(!(o.errors&&o.errors.length>0)){e.n=5;break}throw new Error(o.errors.join(", "));case 5:if(!f||null==b||!b.pid){e.n=6;break}return e.n=6,w.mutateAsync({imageId:b.pid}).catch(function(e){console.warn("Failed to delete old image ".concat(b.pid,":"),e)});case 6:if(N(f?(0,p.__)("Video updated successfully","nggallery"):(0,p.__)("Video added successfully","nggallery")),!g){e.n=7;break}return e.n=7,s.invalidateQueries({queryKey:["gallery",g,"images"]});case 7:setTimeout(function(){a()},100),e.n=9;break;case 8:e.p=8,l=e.v,i=l instanceof Error?l.message:(0,p.__)("Failed to update video","nggallery"),O(i);case 9:return e.p=9,q(!1),e.f(9);case 10:return e.a(2)}},e,null,[[2,8,9,10]])}));return function(t){return e.apply(this,arguments)}}(),te=function(t){var n=t.target,r=n.name,a=n.value;T(function(t){return ct(ct({},t),{},(0,e.A)({},r,a))}),K[r]&&V(function(t){return ct(ct({},t),{},(0,e.A)({},r,""))})};return d().createElement(v.A,{isOpen:r,onClose:a,title:(0,p.__)("Edit Video","nggallery")},d().createElement("form",{onSubmit:ee,className:"space-y-4"},d().createElement("div",{className:"p-3 sm:p-4 border border-gray-300 rounded-lg bg-white"},d().createElement("div",null,d().createElement("label",{htmlFor:"videoLink",className:"block text-sm font-medium text-gray-700 mb-1.5"},(0,p.__)("Video Link","nggallery")),d().createElement("input",{type:"url",id:"videoLink",name:"videoLink",value:P.videoLink,onChange:te,placeholder:(0,p.__)("Enter video URL","nggallery"),className:"bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5 hover:border-green-500 transition-colors ".concat(K.videoLink?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-400")}),K.videoLink&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},K.videoLink)),d().createElement("div",{className:"mt-4"},d().createElement("label",{htmlFor:"thumbnailImageLink",className:"block text-sm font-medium text-gray-700 mb-1.5"},(0,p.__)("Thumbnail Image Link","nggallery")),d().createElement("input",{type:"url",id:"thumbnailImageLink",name:"thumbnailImageLink",value:P.thumbnailImageLink.startsWith("blob:")?"":P.thumbnailImageLink,onChange:te,placeholder:(0,p.__)("Enter thumbnail image URL or select from media library","nggallery"),className:"bg-white border text-gray-900 text-sm rounded-lg focus:ring-green-500 focus:border-green-500 block w-full p-2.5 hover:border-green-500 transition-colors mb-2 ".concat(K.thumbnailImageLink?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-400"," ").concat(L?"opacity-50":""),disabled:!!L}),d().createElement("input",{ref:Z,type:"file",id:"thumbnailFileInput",name:"thumbnailFileInput",accept:"image/*",onChange:function(e){var t=e.target.files;if(t&&t.length>0){var n=t[0];if(!n.type.startsWith("image/"))return void V(function(e){return ct(ct({},e),{},{thumbnailImageLink:(0,p.__)("Please select a valid image file.","nggallery")})});var r=URL.createObjectURL(n);R(n),T(function(e){return ct(ct({},e),{},{thumbnailImageLink:r})}),V(function(e){return ct(ct({},e),{},{thumbnailImageLink:""})})}e.target&&(e.target.value="")},className:"hidden",disabled:B}),K.thumbnailImageLink&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},K.thumbnailImageLink),d().createElement("div",{className:"flex gap-4 items-start mt-2"},d().createElement("div",{className:"flex flex-col gap-2"},d().createElement("button",{type:"button",onClick:function(){var e;null===(e=Z.current)||void 0===e||e.click()},disabled:B||X,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 border border-gray-300 rounded-lg transition-colors flex items-center justify-center gap-2 text-gray-700 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed",title:(0,p.__)("Upload from computer","nggallery")},d().createElement(t.kA,{className:"w-5 h-5 flex-shrink-0"}),d().createElement("span",{className:"text-sm font-medium"},(0,p.__)("Select File","nggallery"))),d().createElement("button",{type:"button",onClick:function(e){Y({title:(0,p.__)("Select Cover Image","nggallery"),buttonText:(0,p.__)("Use this image","nggallery"),onSelect:function(e){R(null),T(function(t){return ct(ct({},t),{},{thumbnailImageLink:e})}),V(function(e){return ct(ct({},e),{},{thumbnailImageLink:""})})}},e)},disabled:B||X,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 border border-gray-300 rounded-lg transition-colors flex items-center justify-center gap-2 text-gray-700 hover:text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed"},d().createElement(t.ZH,{className:"w-5 h-5 flex-shrink-0"}),d().createElement("span",{className:"text-sm font-medium"},(0,p.__)("Upload","nggallery"))),L&&d().createElement("div",{className:"text-xs text-gray-600"},(0,p.__)("File selected:","nggallery")," ",L.name)),P.thumbnailImageLink&&d().createElement("div",{className:"flex-1 flex justify-end"},d().createElement("div",{className:"relative w-32 h-24 sm:w-40 sm:h-32"},d().createElement("img",{src:P.thumbnailImageLink,alt:(0,p.__)("Video thumbnail","nggallery"),className:"w-full h-full object-cover rounded-lg shadow-md border border-gray-300",onError:function(e){e.target.style.display="none"}})))))),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:B,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:B,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 border border-transparent rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center"},B&&d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),B?(0,p.__)("Saving...","nggallery"):(0,p.__)("Save Changes","nggallery")))))},addVideoLinks:function(e){var t=e.isOpen,n=e.onClose,r=e.galleryId,a=(0,G.jE)(),o=(0,M.iX)(null!=r?r:0).data,l=function(){var e=(0,i.A)(Q().m(function e(t){return Q().w(function(e){for(;;)switch(e.n){case 0:if(!r&&!t){e.n=1;break}return e.n=1,a.invalidateQueries({queryKey:["gallery",r||t,"images"]});case 1:setTimeout(function(){n()},100);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();return React.createElement(v.A,{isOpen:t,onClose:n,title:(0,p.__)("Add Video Links","nggallery"),modalClassName:"rounded-lg max-w-4xl",contentClassName:"p-0"},React.createElement(F,{galleryId:r,galleryTitle:(null==o?void 0:o.title)||(0,p.__)("New Gallery","nggallery"),onSuccess:l,buttonLabel:(0,p.__)("Save","nggallery")}))},upgrade:function(e){var n=e.isOpen,r=e.onClose,a=e.feature,o=void 0===a?"eCommerce features":a,i=o.replace(/\s+(features?)$/i,"").trim(),l="eCommerce"===i?i:i.split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" "),c=("eCommerce"===i||function(e){e.toLowerCase()}(l),i),s=/layout/i.test(o),u=(0,pn.c)(void 0,i);return d().createElement(v.A,{isOpen:n,onClose:r,title:""},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"flex items-center justify-center w-10 h-10 mx-auto mb-4"},d().createElement(t.$O,{className:"w-12 h-12"})),d().createElement("h3",{className:"text-xl font-semibold text-gray-800 mb-4"},s?(0,p.__)("This layout is a Pro Feature","nggallery"):(0,p.__)("".concat(l," is a Pro Feature"),"nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-0"},s?(0,p.__)("We're sorry, using this layout is not available on your plan.","nggallery"):(0,p.__)("We're sorry, using ".concat(c," is not available on your plan."),"nggallery")),d().createElement("p",{className:"text-gray-600 text-center mb-6"},(0,p.__)("Please upgrade to the Pro plan to unlock this and all our awesome features.","nggallery")),d().createElement("div",{className:"relative mb-8 flex justify-center items-center"},d().createElement(t.IP,{className:"absolute left-[90px] -top-4 w-12 h-12 flex-shrink-0"}),d().createElement("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center bg-green-500 text-white text-center text-lg py-3 px-6 rounded-lg font-medium hover:bg-green-600 transition-colors"},(0,p.__)("Upgrade to Pro","nggallery"),d().createElement(t.gX,{className:"w-4 h-4 ml-2 flex-shrink-0"}))),d().createElement("div",{className:"bg-[#F0FDE6] -mx-4 -mb-4 sm:px-16 px-8 py-4 rounded-b-lg"},d().createElement("div",{className:"flex items-center"},d().createElement(t.xe,{className:"w-8 h-8 sm:ml-8 ml-2 mr-2 flex-shrink-0"}),d().createElement("p",{className:"text-gray-700 text-sm text-left"},(0,p.__)("Imagely lite users get","nggallery")," ",d().createElement("strong",{className:"text-green-600"},(0,p.__)("50% off","nggallery"))," ",(0,p.__)("the regular price, automatically applied at checkout!","nggallery"))))))},licenseRequired:$t,couponForm:function(n){var r=n.isOpen,a=n.onClose,o=n.onSuccess,l=(0,U.E)(),s=l.showSuccess,m=l.showError,g=(0,G.jE)(),f=(0,u.useState)(!1),h=(0,c.A)(f,2),y=h[0],b=h[1],w=(0,u.useState)({}),x=(0,c.A)(w,2),E=x[0],C=x[1],N=(0,u.useState)({couponFor:"",couponCode:"",discountType:"percentage",discountValue:"",startDate:"",endDate:"",usageLimit:""}),k=(0,c.A)(N,2),O=k[0],A=k[1],S=(0,ke.f8)();(0,u.useEffect)(function(){r&&(A({couponFor:"",couponCode:"",discountType:"percentage",discountValue:"",startDate:"",endDate:"",usageLimit:""}),C({}),b(!1))},[r]);var j=function(t){var n=t.target,r=n.name,a=n.value;A(function(t){var n=Re(Re({},t),{},(0,e.A)({},r,a));if("startDate"!==r||a||(n.endDate=""),"startDate"===r&&t.endDate&&a&&t.endDate&&a>t.endDate&&(n.endDate=a),"endDate"===r&&t.startDate&&a&&t.startDate&&a<t.startDate&&(n.startDate=a),"discountValue"===r){var o=String(a).replace(/[^0-9.]/g,"");if("percentage"===t.discountType){var i=parseFloat(o||"0");n.discountValue=String(Math.min(100,isNaN(i)?0:i))}else n.discountValue=o}if("discountType"===r&&"percentage"===a){var l=parseFloat(String(t.discountValue||"0"));isNaN(l)||(n.discountValue=String(Math.min(100,l)))}return n}),E[r]&&C(function(t){return Re(Re({},t),{},(0,e.A)({},r,""))})},P=function(){var e={};return O.couponFor.trim()||(e.couponFor=(0,p.__)("This field is required","nggallery")),O.couponCode.trim()||(e.couponCode=(0,p.__)("This field is required","nggallery")),O.discountValue.trim()||(e.discountValue=(0,p.__)("This field is required","nggallery")),O.startDate&&O.endDate&&O.endDate<O.startDate&&(e.endDate=(0,p.__)("End date cannot be before start date","nggallery")),C(e),0===Object.keys(e).length},T=function(){var e=(0,i.A)(Ie().m(function e(t){var n,r,i,l,c;return Ie().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),P()){e.n=1;break}return e.a(2);case 1:return b(!0),e.p=2,r=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,i={title:O.couponFor.trim(),id_code:O.couponCode.trim(),discount_type:"percentage"===O.discountType?"percent":"flat",discount_amount:parseFloat(String(O.discountValue).trim()),date_start:O.startDate||void 0,date_end:O.endDate||void 0,usage_limit:O.usageLimit?parseInt(String(O.usageLimit),10):void 0},e.n=3,_()({path:"/imagely/v1/coupons",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:i});case 3:g.invalidateQueries({queryKey:["coupons"]}),s((0,p.__)("Coupon created successfully","nggallery")),o&&o(),a(),e.n=5;break;case 4:e.p=4,c=e.v,l=(0,p.__)("Failed to create coupon","nggallery"),c&&c.message&&(l=c.message),m(l);case 5:return e.p=5,b(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:r,onClose:a,title:(0,p.__)("Create New Coupon","nggallery")},d().createElement("form",{onSubmit:T,className:"space-y-4"},d().createElement("div",null,d().createElement(Ae.A,{type:"text",id:"couponFor",name:"couponFor",value:O.couponFor,onChange:j,label:(0,p.__)("Coupon For","nggallery"),help:(0,p.__)("This is a label for your reference only and is not shown to customers.","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("For e.g. Black Friday","nggallery")}),E.couponFor&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},E.couponFor)),d().createElement("div",null,d().createElement(Ae.A,{type:"text",id:"couponCode",name:"couponCode",value:O.couponCode,onChange:j,label:(0,p.__)("Coupon Code","nggallery"),help:(0,p.__)("This field must be unique from every other coupon code","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("Enter unique coupon code","nggallery")}),E.couponCode&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},E.couponCode)),d().createElement("div",null,d().createElement(Oe.A,{id:"discountType",name:"discountType",value:O.discountType,onChange:j,label:(0,p.__)("Discount Type","nggallery"),tooltipPlacement:"right"},d().createElement("option",{value:"percentage"},(0,p.__)("Percentage","nggallery")),d().createElement("option",{value:"flat"},(0,p.__)("Flat Amount","nggallery")))),d().createElement("div",null,d().createElement(Ae.A,{type:"number",id:"discountValue",name:"discountValue",value:O.discountValue,onChange:j,label:(0,p.__)("Discount Value","nggallery"),placeholder:(0,p.__)("Enter Discount Amount","nggallery"),prefix:"percentage"===O.discountType?"%":S}),E.discountValue&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},E.discountValue)),d().createElement("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3"},d().createElement("div",null,d().createElement(Ae.A,{type:"date",id:"startDate",name:"startDate",value:O.startDate,onChange:j,label:(0,p.__)("Start Date","nggallery"),placeholder:(0,p.__)("Select Start Date","nggallery"),maxString:O.endDate||void 0})),d().createElement("div",null,d().createElement(Ae.A,{type:"date",id:"endDate",name:"endDate",value:O.endDate,onChange:j,label:(0,p.__)("End Date","nggallery"),placeholder:(0,p.__)("Select End Date","nggallery"),minString:O.startDate||void 0}))),d().createElement("div",null,d().createElement(Ae.A,{type:"number",id:"usageLimit",name:"usageLimit",value:O.usageLimit,onChange:j,label:(0,p.__)("Usage Limit","nggallery"),help:(0,p.__)("How many times this coupon may be used by users before it becomes invalid. An empty or 0 setting allows infinite uses.","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("Enter Usage Limit","nggallery")})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:y,className:"px-4 py-2 text-sm font-medium text-green-700 bg-white border border-green-500 rounded-md shadow-sm hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:y,className:"px-4 py-2 text-sm font-semibold text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},y?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Creating...","nggallery")):(0,p.__)("Create Code","nggallery")))))},couponDetails:function(e){var n,r,a,o,i,l,c,f,h,y,b,w,x,E,_=e.isOpen,C=e.onClose,N=e.data,k=e.onEdit,O=(0,g.useDispatch)(m.EF),A=Ne(null==N?void 0:N.id),S=A.data,j=A.isLoading,P=A.isFetching,T=A.refetch;(0,u.useEffect)(function(){_&&null!=N&&N.id&&T()},[_,null==N?void 0:N.id,T]);var I,D,L=S?{couponFor:null!==(n=null==S?void 0:S.coupon_for)&&void 0!==n?n:"",couponCode:null!==(r=null==S?void 0:S.coupon_code)&&void 0!==r?r:"",discountType:null!==(a=null==S?void 0:S.discount_type)&&void 0!==a?a:"",discountValue:String(null!==(o=null!==(i=null==S?void 0:S.discount_value)&&void 0!==i?i:null==S?void 0:S.discount_amount)&&void 0!==o?o:""),startDate:null!==(l=null!==(c=null==S?void 0:S.start_date)&&void 0!==c?c:null==S?void 0:S.date_start)&&void 0!==l?l:"",endDate:null!==(f=null!==(h=null==S?void 0:S.end_date)&&void 0!==h?h:null==S?void 0:S.date_end)&&void 0!==f?f:"",usageLimit:String(null!==(y=null==S?void 0:S.usage_limit)&&void 0!==y?y:"")}:{couponFor:N.couponFor,couponCode:N.couponCode,discountType:N.discountType,discountValue:null!==(b=N.discountValue)&&void 0!==b?b:"",startDate:null!==(w=N.startDate)&&void 0!==w?w:"",endDate:null!==(x=N.endDate)&&void 0!==x?x:"",usageLimit:null!==(E=N.usageLimit)&&void 0!==E?E:""},R=function(e){return(null==e?"":String(e).trim())||"-"},F=function(e){if(!e)return"-";var t=new Date(e),n=String(t.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],a=t.getFullYear();return"".concat(n," ").concat(r," ").concat(a)},M="percentage"===L.discountType?(0,p.__)("Percentage","nggallery"):"flat"===L.discountType?(0,p.__)("Flat","nggallery"):"-",G=(0,ke.f8)(),Q=(D=(null!==(I=L.discountValue)&&void 0!==I?I:"").trim())?"percentage"===L.discountType?"".concat(D,"%"):"".concat(G," ").concat(D):"-",B=function(e){var t=(null!==(e=L.usageLimit)&&void 0!==e?e:"").trim();if(!t)return"-";var n=Number(t);return Number.isNaN(n)||0===n?"-":String(n)}();return d().createElement(v.A,{isOpen:_,onClose:C,title:(0,p.__)("Coupon Details","nggallery")},d().createElement("div",{className:"absolute top-4 right-12"},d().createElement("button",{type:"button",onClick:function(){k?k():O.setActiveModal("couponEdit",{data:{id:null==N?void 0:N.id,couponFor:L.couponFor,couponCode:L.couponCode,discountType:L.discountType,discountValue:L.discountValue,startDate:L.startDate,endDate:L.endDate,usageLimit:L.usageLimit}})},className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs border border-gray-300 rounded-md bg-white text-gray-700 hover:bg-gray-50"},d().createElement(t.qU,{className:"w-4 h-4"}),(0,p.__)("Edit","nggallery"))),j||P?d().createElement("div",{className:"py-10"},d().createElement(s.A,{size:"md",color:"gray",text:(0,p.__)("Loading…","nggallery")})):d().createElement("div",{className:"space-y-6"},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("Coupon For","nggallery")),d().createElement("div",{className:"text-lg font-semibold text-gray-900 mt-1"},R(L.couponFor))),d().createElement("div",{className:""},d().createElement("div",{className:"bg-gray-100 border border-gray-200 rounded-md px-5 py-3 text-center w-full"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-600"},(0,p.__)("Coupon Code","nggallery")),d().createElement("div",{className:"mt-1 text-lg font-bold tracking-wider text-gray-900"},R(L.couponCode)))),d().createElement("div",{className:"grid grid-cols-2 gap-8"},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("Discount Type","nggallery")),d().createElement("div",{className:"pt-3 text-base font-medium text-gray-900"},M)),d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("Discount Value","nggallery")),d().createElement("div",{className:"pt-3 text-base font-semibold text-gray-900"},Q))),d().createElement("div",{className:"border-t border-dashed border-gray-300"}),d().createElement("div",{className:"grid grid-cols-2 gap-8"},d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("Start Date","nggallery")),d().createElement("div",{className:"pt-2 text-base font-medium text-gray-900"},F(L.startDate))),d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("End Date","nggallery")),d().createElement("div",{className:"pt-2 text-base font-medium text-gray-900"},F(L.endDate)))),d().createElement("div",{className:"text-center"},d().createElement("div",{className:"text-[11px] tracking-wide text-gray-500"},(0,p.__)("Usage Limit","nggallery")),d().createElement("div",{className:"pt-1 text-lg text-gray-900 font-semibold"},B))))},couponEdit:function(n){var r=n.isOpen,a=n.onClose,o=n.data,l=n.onSuccess,s=(0,U.E)(),m=s.showSuccess,g=s.showError,f=function(){var e,t=(0,G.jE)();return(0,be.n)({mutationFn:(e=(0,i.A)(we().m(function e(t){var n,r,a,o,i,l,c,s,u;return we().w(function(e){for(;;)switch(e.n){case 0:return r=t.id,a=t.data,o=null===(n=window.imagelyApp)||void 0===n?void 0:n.nonce,i={},"coupon_for"in a&&(i.title=""===a.coupon_for?null:a.coupon_for),"coupon_code"in a&&(i.id_code=""===a.coupon_code?null:a.coupon_code),"discount_type"in a&&(l=a.discount_type,i.discount_type=null==l?null:"percentage"===l?"percent":"flat"===l?"flat":null),"discount_value"in a&&(c=null===a.discount_value||void 0===a.discount_value||""===String(a.discount_value).trim()?null:parseFloat(String(a.discount_value)),i.discount_amount=c),"start_date"in a&&(i.date_start=a.start_date&&""!==String(a.start_date).trim()?a.start_date:null),"end_date"in a&&(i.date_end=a.end_date&&""!==String(a.end_date).trim()?a.end_date:null),"usage_limit"in a&&(s=null===a.usage_limit||void 0===a.usage_limit||""===String(a.usage_limit).trim()?null:parseInt(String(a.usage_limit),10),i.usage_limit=s),e.n=1,_()({path:"/imagely/v1/coupons/".concat(r),method:"PUT",headers:{"X-WP-Nonce":o},data:i});case 1:return u=e.v,e.a(2,Ee(u))}},e)})),function(t){return e.apply(this,arguments)}),onSuccess:function(e){t.invalidateQueries({queryKey:["coupons"]}),t.invalidateQueries({queryKey:Ce(e.id)})}})}(),h=Ne(null==o?void 0:o.id).data,y=(0,u.useState)(!1),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)({}),C=(0,c.A)(E,2),N=C[0],k=C[1],O=(0,ke.f8)(),A=(0,u.useState)({couponFor:"",couponCode:"",discountType:"percentage",discountValue:"",startDate:"",endDate:"",usageLimit:""}),S=(0,c.A)(A,2),j=S[0],P=S[1];(0,u.useEffect)(function(){var e;r&&(P(h?{couponFor:h.coupon_for||"",couponCode:h.coupon_code||"",discountType:h.discount_type||"percentage",discountValue:String((null!==(e=h.discount_value)&&void 0!==e?e:h.discount_amount)||"").replace(/[^0-9.]/g,""),startDate:h.start_date||h.date_start||"",endDate:h.end_date||h.date_end||"",usageLimit:h.usage_limit?String(h.usage_limit).replace(/[^0-9]/g,""):""}:{couponFor:(null==o?void 0:o.couponFor)||"",couponCode:(null==o?void 0:o.couponCode)||"",discountType:(null==o?void 0:o.discountType)||"percentage",discountValue:((null==o?void 0:o.discountValue)||"").replace(/[^0-9.]/g,""),startDate:(null==o?void 0:o.startDate)||"",endDate:(null==o?void 0:o.endDate)||"",usageLimit:((null==o?void 0:o.usageLimit)||"").replace(/[^0-9]/g,"")}),k({}),x(!1))},[r,o,h]);var T=function(t){var n=t.target,r=n.name,a=n.value;P(function(t){var n=Te(Te({},t),{},(0,e.A)({},r,a));if("startDate"!==r||a||(n.endDate=""),"startDate"===r&&t.endDate&&a&&t.endDate&&a>t.endDate&&(n.endDate=a),"endDate"===r&&t.startDate&&a&&t.startDate&&a<t.startDate&&(n.startDate=a),"discountValue"===r){var o=String(a).replace(/[^0-9.]/g,"");if("percentage"===t.discountType){var i=parseFloat(o||"0");n.discountValue=String(Math.min(100,isNaN(i)?0:i))}else n.discountValue=o}if("discountType"===r&&"percentage"===a){var l=parseFloat(String(t.discountValue||"0"));isNaN(l)||(n.discountValue=String(Math.min(100,l)))}return n}),N[r]&&k(function(t){return Te(Te({},t),{},(0,e.A)({},r,""))})},I=function(){var e={};return j.couponFor.trim()||(e.couponFor=(0,p.__)("This field is required","nggallery")),j.couponCode.trim()||(e.couponCode=(0,p.__)("This field is required","nggallery")),j.discountValue.trim()||(e.discountValue=(0,p.__)("This field is required","nggallery")),j.startDate&&j.endDate&&j.endDate<j.startDate&&(e.endDate=(0,p.__)("End date cannot be before start date","nggallery")),k(e),0===Object.keys(e).length},D=function(){var e=(0,i.A)(Se().m(function e(t){var n,r;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),I()){e.n=1;break}return e.a(2);case 1:return x(!0),e.p=2,n=(null==o?void 0:o.id)||(null==o?void 0:o.couponId),e.n=3,f.mutateAsync({id:n,data:{coupon_for:j.couponFor,coupon_code:j.couponCode,discount_type:j.discountType,discount_value:j.discountValue,start_date:j.startDate||void 0,end_date:j.endDate||void 0,usage_limit:j.usageLimit||void 0}});case 3:m((0,p.__)("Coupon updated successfully","nggallery")),l&&l(),a(),e.n=5;break;case 4:e.p=4,r=e.v,g((null==r?void 0:r.message)||(0,p.__)("Failed to update coupon","nggallery"));case 5:return e.p=5,x(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:r,onClose:a,title:(0,p.__)("Edit Coupon","nggallery")},d().createElement("form",{onSubmit:D,className:"space-y-4"},d().createElement("div",null,d().createElement(Ae.A,{type:"text",id:"couponFor",name:"couponFor",value:j.couponFor,onChange:T,label:(0,p.__)("Coupon For","nggallery"),help:(0,p.__)("This is a label for your reference only and is not shown to customers.","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("For e.g. Black Friday","nggallery")}),N.couponFor&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},N.couponFor)),d().createElement("div",null,d().createElement(Ae.A,{type:"text",id:"couponCode",name:"couponCode",value:j.couponCode,onChange:T,label:(0,p.__)("Coupon Code","nggallery"),help:(0,p.__)("This field must be unique from every other coupon code","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("Enter unique coupon code","nggallery")}),N.couponCode&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},N.couponCode)),d().createElement("div",null,d().createElement(Oe.A,{id:"discountType",name:"discountType",value:j.discountType,onChange:T,label:(0,p.__)("Discount Type","nggallery"),tooltipPlacement:"right"},d().createElement("option",{value:"percentage"},(0,p.__)("Percentage","nggallery")),d().createElement("option",{value:"flat"},(0,p.__)("Flat Amount","nggallery")))),d().createElement("div",null,d().createElement(Ae.A,{type:"number",id:"discountValue",name:"discountValue",value:j.discountValue,onChange:T,label:(0,p.__)("Discount Value","nggallery"),placeholder:(0,p.__)("Enter Discount Amount","nggallery"),prefix:"percentage"===j.discountType?"%":O}),N.discountValue&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},N.discountValue)),d().createElement("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3"},d().createElement("div",null,d().createElement(Ae.A,{type:"date",id:"startDate",name:"startDate",value:j.startDate,onChange:T,label:(0,p.__)("Start Date","nggallery"),placeholder:(0,p.__)("Select Start Date","nggallery"),maxString:j.endDate||void 0})),d().createElement("div",null,d().createElement(Ae.A,{type:"date",id:"endDate",name:"endDate",value:j.endDate,onChange:T,label:(0,p.__)("End Date","nggallery"),placeholder:(0,p.__)("Select End Date","nggallery"),minString:j.startDate||void 0}))),d().createElement("div",null,d().createElement(Ae.A,{type:"number",id:"usageLimit",name:"usageLimit",value:j.usageLimit,onChange:T,label:(0,p.__)("Usage Limit","nggallery"),help:(0,p.__)("How many times this coupon may be used by users before it becomes invalid. An empty or 0 setting allows infinite uses.","nggallery"),tooltipPlacement:"right",placeholder:(0,p.__)("Enter Usage Limit","nggallery")})),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:w,className:"px-4 py-2 text-sm font-medium text-green-700 bg-white border border-green-500 rounded-md shadow-sm hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:w,className:"px-4 py-2 text-sm font-semibold text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},w?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Saving...","nggallery")):(0,p.__)("SAVE","nggallery")))))},pricelistForm:function(n){var r=n.isOpen,a=n.onClose,o=n.onSuccess,l=(0,U.E)(),s=l.showSuccess,m=l.showError,g=(0,le.hE)(),f=(0,u.useState)({}),h=(0,c.A)(f,2),y=h[0],b=h[1],w=(0,u.useState)({title:""}),x=(0,c.A)(w,2),E=x[0],_=x[1];(0,u.useEffect)(function(){r&&(_({title:""}),b({}))},[r]);var C=function(){var e={};return E.title.trim()||(e.title=(0,p.__)("Pricelist name is required","nggallery")),b(e),0===Object.keys(e).length},N=function(){var e=(0,i.A)(an().m(function e(t){var n,r;return an().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.preventDefault(),C()){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,g.mutateAsync({title:E.title.trim()});case 2:s((0,p.__)("Pricelist created successfully","nggallery")),o&&o(),a(),e.n=4;break;case 3:e.p=3,r=e.v,console.error("Failed to create pricelist:",r),n=(0,p.__)("Failed to create pricelist","nggallery"),r&&r.message&&(n=r.message),m(n);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),k=g.isPending;return d().createElement(v.A,{isOpen:r,onClose:a,title:(0,p.__)("Add New Pricelist","nggallery")},d().createElement("form",{onSubmit:N,className:"space-y-4"},d().createElement("div",null,d().createElement(Ae.A,{type:"text",id:"title",name:"title",value:E.title,onChange:function(t){var n=t.target,r=n.name,a=n.value;_(function(t){return cn(cn({},t),{},(0,e.A)({},r,a))}),y[r]&&b(function(t){return cn(cn({},t),{},(0,e.A)({},r,""))})},label:(0,p.__)("New Pricelist Name","nggallery"),placeholder:(0,p.__)("For e.g. Wedding Album","nggallery")}),y.title&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},y.title)),d().createElement("div",{className:"flex justify-end space-x-3 pt-4"},d().createElement("button",{type:"button",onClick:a,disabled:k,className:"px-4 py-2 text-sm font-medium text-green-700 bg-white border border-green-500 rounded-md shadow-sm hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:k,className:"px-4 py-2 text-sm font-semibold text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},k?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Creating...","nggallery")):(0,p.__)("Create Pricelist","nggallery")))))},deletePricelists:function(e){var n=e.isOpen,r=e.onClose,a=e.pricelistIds,o=e.items,l=e.onConfirm,c=void 0===l?function(){}:l,s=e.title,m=(0,le.O8)(),g=(0,U.E)(),f=g.showSuccess,h=g.showError,y=g.clearNotifications,b=(0,u.useMemo)(function(){return o&&o.length?o:a.map(function(e){return{id:e,title:(0,p.__)("Pricelist","nggallery")}})},[a,o]),w=(0,u.useMemo)(function(){return b.length>0&&b.length<=5?d().createElement("ul",{className:"list-none text-sm text-gray-700 px-4 text-center"},b.map(function(e){return d().createElement("li",{key:e.id},e.title)})):null},[b]),x=function(){var e=(0,i.A)(Ve().m(function e(){var t;return Ve().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==a.length){e.n=1;break}return e.a(2);case 1:return m.reset&&m.reset(),e.p=2,e.n=3,Promise.all(a.map(function(e){return m.mutateAsync(e)}));case 3:t=1===a.length?(0,p.__)("pricelist","nggallery"):(0,p.__)("pricelists","nggallery"),y(),f((0,p.__)("Successfully deleted ".concat(a.length," ").concat(t),"nggallery")),c(),r(),e.n=5;break;case 4:e.p=4,e.v,y(),h((0,p.__)("Failed to delete pricelist(s)","nggallery"));case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}(),E=d().createElement(t.b4,null);return d().createElement(v.A,{isOpen:n,onClose:r},d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"flex items-center gap-2 justify-center"},d().createElement("div",null,E)),s&&d().createElement("h2",{className:"text-xl font-bold text-center text-gray-900 mt-2"},s),d().createElement("p",{className:"text-sm text-gray-500 text-center"},1===a.length?(0,p.__)("Are you sure you want to delete this pricelist?","nggallery"):(0,p.__)("Are you sure you want to delete the selected pricelists?","nggallery")),w,d().createElement("p",{className:"text-sm text-red-500 text-center"},(0,p.__)("This action cannot be undone.","nggallery")),d().createElement("div",{className:"flex justify-center space-x-3 !mb-4 ".concat(m.isPending?"cursor-wait":"")},d().createElement("button",{type:"button",onClick:r,disabled:m.isPending,className:"px-8 py-2 font-medium text-white bg-green-500 rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:x,disabled:m.isPending,className:"px-8 py-2 font-bold text-white bg-red-600 border border-transparent rounded-lg shadow hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},m.isPending?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Deleting...","nggallery")):(0,p.__)("Delete","nggallery")))))},duplicatePricelist:function(e){var n=e.isOpen,r=e.onClose,a=e.pricelistIds,o=e.items,l=e.onConfirm,c=void 0===l?function(){}:l,s=e.title,m=(0,le._D)(),g=(0,U.E)(),f=g.showSuccess,h=g.showError,y=g.clearNotifications,b=(0,u.useMemo)(function(){return o&&o.length?o:a.map(function(e){return{id:e,title:(0,p.__)("Pricelist","nggallery")}})},[a,o]),w=(0,u.useMemo)(function(){return b.length>0&&b.length<=5?d().createElement("ul",{className:"list-none text-sm text-gray-700 px-4 text-center"},b.map(function(e){return d().createElement("li",{key:e.id},e.title)})):null},[b]),x=function(){var e=(0,i.A)(et().m(function e(){var t,n,o;return et().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==a.length){e.n=1;break}return e.a(2);case 1:return m.reset&&m.reset(),e.p=2,e.n=3,m.mutateAsync(a);case 3:t=e.v,n=t.length,o=1===n?(0,p.__)("pricelist","nggallery"):(0,p.__)("pricelists","nggallery"),y(),n<a.length?h((0,p.__)("Only ".concat(n," of ").concat(a.length," pricelists were duplicated"),"nggallery")):f((0,p.__)("Successfully duplicated ".concat(n," ").concat(o),"nggallery")),c(),r(),e.n=5;break;case 4:e.p=4,e.v,y(),h((0,p.__)("Failed to duplicate pricelist(s)","nggallery"));case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}();return d().createElement(v.A,{isOpen:n,onClose:r},d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"flex items-center gap-2 justify-center"},d().createElement(t.yz,{className:"w-8 h-8"})),s&&d().createElement("h2",{className:"text-xl font-bold text-center text-gray-900 mt-2"},s),d().createElement("p",{className:"text-sm text-gray-500 text-center"},1===a.length?(0,p.__)("Are you sure you want to duplicate this pricelist?","nggallery"):(0,p.__)("Are you sure you want to duplicate the selected pricelists?","nggallery")),w,d().createElement("div",{className:"flex justify-center space-x-3 !mb-4 ".concat(m.isPending?"cursor-wait":"")},d().createElement("button",{type:"button",onClick:r,disabled:m.isPending,className:"px-8 py-2 font-medium text-white bg-green-500 rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:x,disabled:m.isPending,className:"px-8 py-2 font-bold text-white bg-blue-600 border border-transparent rounded-lg shadow hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},m.isPending?d().createElement("span",{className:"flex items-center"},d().createElement(t.Nl,{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white"}),(0,p.__)("Duplicating...","nggallery")):(0,p.__)("Duplicate","nggallery")))))},deletePricelistItem:function(e){var n=e.isOpen,r=e.onClose,a=e.itemTitle,o=e.onConfirm,i=e.isBulkDelete,l=void 0!==i&&i,c=e.bulkCount,s=void 0===c?1:c,u=d().createElement(t.b4,null);return d().createElement(v.A,{isOpen:n,onClose:r},d().createElement("div",{className:"space-y-4"},d().createElement("div",{className:"flex items-center gap-2 justify-center"},d().createElement("div",null,u)),d().createElement("h2",{className:"text-xl font-bold text-center text-gray-900 mt-2"},l?(0,p.__)("Delete ".concat(s," Products"),"nggallery"):(0,p.__)("Delete Product","nggallery")),d().createElement("p",{className:"text-sm text-gray-500 text-center"},l?(0,p.__)("Are you sure you want to delete these ".concat(s," products?"),"nggallery"):(0,p.__)("Are you sure you want to delete this product?","nggallery")),d().createElement("div",{className:"text-sm text-gray-700 px-4 text-center"},d().createElement("strong",null,a)),d().createElement("p",{className:"text-sm text-red-500 text-center"},(0,p.__)("This action cannot be undone.","nggallery")),d().createElement("div",{className:"flex justify-center space-x-3 !mb-4"},d().createElement("button",{type:"button",onClick:r,className:"px-8 py-2 font-medium text-white bg-green-500 rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:function(){o(),r()},className:"px-8 py-2 font-bold text-white bg-red-600 border border-transparent rounded-lg shadow hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors"},l?(0,p.__)("Delete (".concat(s,")"),"nggallery"):(0,p.__)("Delete","nggallery")))))},addProduct:function(e){var n=e.isOpen,r=e.onClose,a=e.pricelistId,o=e.existingItems,i=e.onSuccess,l=(0,g.useDispatch)(m.EF),c=[{id:"whcc",title:(0,p.__)("WHCC Prints","nggallery"),description:(0,p.__)("Automatically fulfill orders via Printlab","nggallery"),icon:d().createElement(t.F4,{className:"w-12 h-12"})},{id:"manual",title:(0,p.__)("Manual Sizes & Orders","nggallery"),description:(0,p.__)("Manually fulfill customer orders","nggallery"),icon:d().createElement(t.qP,{className:"w-12 h-12"})},{id:"digital",title:(0,p.__)("Digital Downloads","nggallery"),description:(0,p.__)("Include print lab options in your Pricelist","nggallery"),icon:d().createElement(t.$$,{className:"w-12 h-12"})}];return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Add Product","nggallery")},d().createElement("p",{className:"text-gray-600 text-sm mb-6"},(0,p.__)("Select an option from the following to add pricelist","nggallery")),d().createElement("div",{className:"space-y-4 mb-6"},c.map(function(e){return d().createElement("div",{key:e.id,className:"flex items-center justify-between p-4 rounded-lg"},d().createElement("div",{className:"flex items-center space-x-4"},d().createElement("div",{className:"flex-shrink-0"},d().createElement("div",{className:"w-12 h-12 flex items-center justify-center"},e.icon)),d().createElement("div",null,d().createElement("h4",{className:"text-sm font-medium text-gray-900"},e.title),d().createElement("p",{className:"text-sm text-gray-500 mt-1"},e.description))),d().createElement("div",{className:"flex-shrink-0"},d().createElement("button",{type:"button",onClick:function(){return function(e){r();var t={pricelistId:a,existingItems:o,onBack:function(){l.setActiveModal("addProduct",{pricelistId:a,existingItems:o,onSuccess:i})},onSuccess:function(e){null==i||i(e)}};switch(e.id){case"whcc":l.setActiveModal("whccPrints",t);break;case"manual":l.setActiveModal("manualSizesOrders",t);break;case"digital":l.setActiveModal("digitalDownloads",t)}}(e)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},(0,p.__)("Add Now","nggallery"))))})))},whccPrints:function(n){var r,a=n.isOpen,o=n.onClose,m=n.pricelistId,g=n.existingItems,f=void 0===g?{}:g,h=n.onBack,y=n.onSuccess,v=(0,u.useState)(""),w=(0,c.A)(v,2),x=w[0],E=w[1],_=(0,u.useState)(!0),C=(0,c.A)(_,2),N=C[0],k=C[1],O=(0,u.useState)({}),A=(0,c.A)(O,2),S=A[0],j=A[1],P=(0,u.useState)(null),T=(0,c.A)(P,2),I=T[0],D=T[1],L=(0,u.useState)(!1),R=(0,c.A)(L,2),F=R[0],M=R[1],Q=(0,ve.I)({queryKey:["whcc-catalog",r],queryFn:function(){return xn(r)},staleTime:9e5,refetchOnWindowFocus:!1,retry:3}),B=Q.data,q=Q.isLoading,H=Q.error,z=function(){var e=(0,G.jE)();return(0,be.n)({mutationFn:vn,onSuccess:function(t,n){if(n.length>0){var r=n[0].pricelist_id;e.invalidateQueries({queryKey:["pricelist-items",r]}),e.invalidateQueries({queryKey:["pricelist-items"]})}}})}(),K=(0,U.E)().showError,V=(0,ke.f8)(),W=(0,u.useMemo)(function(){if(!B||"object"!==(0,b.A)(B))return[];try{return Object.keys(B).filter(function(e){var t=B[e];return!e.toLowerCase().includes("digital")&&!t.label.toLowerCase().includes("digital")}).map(function(e){var t=B[e];return{id:e,label:(null==t?void 0:t.label)||e}})}catch(e){return console.error("Error creating tabs:",e),[]}},[B])||[];(0,u.useEffect)(function(){!(W&&W.length>0)||x&&null!=B&&B[x]||E(W[0].id)},[W,B]),(0,u.useEffect)(function(){a&&f&&j({})},[a,f]);var X=(0,u.useMemo)(function(){return B&&B[x]&&B[x].products||[]},[B,x]);(0,u.useEffect)(function(){if(x&&X.length>0&&!S[x]){var t=function(e){var t;if(!f||null==B||!B[e])return[];var n=null===(t=B[e])||void 0===t?void 0:t.ngg_id;return n?(f[n]||[]).filter(function(e){var t;return"ngg_whcc_pricelist"===e.source&&(null===(t=e.source_data)||void 0===t?void 0:t.product_id)}).map(function(e){return String(e.source_data.product_id)}):[]}(x);if(t.length>0){var n=t.filter(function(e){return X.some(function(t){return t.id===e})});if(n.length>0)return void j(function(t){return Nn(Nn({},t),{},(0,e.A)({},x,n))})}if(["prints","mounted_prints","canvas"].some(function(e){var t;return x.toLowerCase().includes(e)||(null==B||null===(t=B[x])||void 0===t||null===(t=t.label)||void 0===t?void 0:t.toLowerCase().includes(e))}))if(Object.keys(B||{}).every(function(e){var t,n=null==B||null===(t=B[e])||void 0===t?void 0:t.ngg_id;return!n||null==f||!f[n]||0===(f[n]||[]).length})){var r,a=(null===(r=X.filter(function(e){return e.is_default}))||void 0===r?void 0:r.map(function(e){return e.id}))||[];j(function(t){return Nn(Nn({},t),{},(0,e.A)({},x,a.length>0?a:[]))})}else j(function(t){return Nn(Nn({},t),{},(0,e.A)({},x,[]))});else j(function(t){return Nn(Nn({},t),{},(0,e.A)({},x,[]))})}},[x,X,S,f,B]);var Y=function(){return Object.entries(S).filter(function(e){var t=(0,c.A)(e,2);return t[0],t[1].length>0}).map(function(e){var t=(0,c.A)(e,2);return{tabId:t[0],productIds:t[1]}})},Z=function(){return Object.values(S).reduce(function(e,t){return e+t.length},0)},J=function(){return Object.keys(S).some(function(e){return e.toLowerCase().includes("canvas")&&S[e].length>0})},$=function(){var e=(0,i.A)(En().m(function e(){return En().w(function(e){for(;;)switch(e.n){case 0:if(0!==Z()&&B){e.n=1;break}return e.a(2);case 1:if(!J()){e.n=2;break}return M(!0),e.a(2);case 2:return e.n=3,ee();case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=(0,i.A)(En().m(function e(){var t,n,r;return En().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==Z()&&B){e.n=1;break}return e.a(2);case 1:if(e.p=1,t=Y(),n=t.flatMap(function(e){var t=e.tabId,n=e.productIds,r=null==B?void 0:B[t];return n.map(function(e){var n,a=null===(n=B[t])||void 0===n||null===(n=n.products)||void 0===n?void 0:n.find(function(t){return t.id===e});return a&&r?{pricelist_id:m,title:a.name,cost:a.estimated_raw||0,source:"ngg_whcc_pricelist",category:r.ngg_id,source_data:{product_id:a.id,lab_id:a.lab_id,catalog_id:a.catalog_id,category_id:a.category_id,options:a.options||{},lab_properties:a.lab_properties||{}},sortorder:0,resolution:""}:(console.warn("❌ Missing product or category for ".concat(e," in ").concat(t)),null)})}).filter(function(e){return null!==e}),0!==n.length){e.n=2;break}return K((0,p.__)("No valid products selected. Please try again.","nggallery")),e.a(2);case 2:y&&y(n),o(),e.n=4;break;case 3:e.p=3,r=e.v,K((0,p.__)("Failed to add products to pricelist","nggallery")),console.error("Error creating pricelist items:",r);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),te=S[x]||[],ne=X.length>0&&te.length===X.length,re=te.length>0,ae=function(e){D(function(t){return{key:e,direction:(null==t?void 0:t.key)===e&&"asc"===t.direction?"desc":"asc"}})},oe=(0,u.useMemo)(function(){if(!I)return X;var e=(0,l.A)(X);return e.sort(function(e,t){var n,r;switch(I.key){case"name":n=e.name.toLowerCase(),r=t.name.toLowerCase();break;case"cost":n=e.cost_raw,r=t.cost_raw;break;case"estimatedCost":n=e.estimated_raw,r=t.estimated_raw;break;default:return 0}return"asc"===I.direction?n<r?-1:n>r?1:0:n>r?-1:n<r?1:0}),e},[X,I]);return(0,u.useEffect)(function(){var e=function(){k(window.innerWidth>=1280)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),(0,u.useEffect)(function(){var e=function(e){"Escape"===e.key&&a&&o()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[a,o]),a?W?q?d().createElement("div",{className:"fixed inset-0 z-50 overflow-y-auto",role:"dialog","aria-modal":"true"},d().createElement("div",{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity duration-300 ease-in-out",onClick:o}),d().createElement("div",{className:"relative flex min-h-screen items-center justify-center p-4"},d().createElement("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-2xl transition-all duration-300 ease-in-out",style:{width:"1100px",maxWidth:"90vw",marginLeft:N?"160px":"0"}},d().createElement("div",{className:"p-8"},d().createElement(s.A,{size:"lg",color:"green",text:(0,p.__)("Loading WHCC Catalog...","nggallery")}))))):H?d().createElement("div",{className:"fixed inset-0 z-50 overflow-y-auto",role:"dialog","aria-modal":"true"},d().createElement("div",{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity duration-300 ease-in-out",onClick:o}),d().createElement("div",{className:"relative flex min-h-screen items-center justify-center p-4"},d().createElement("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-2xl transition-all duration-300 ease-in-out",style:{width:"1100px",maxWidth:"90vw",marginLeft:N?"160px":"0"}},d().createElement("div",{className:"p-8 text-center"},d().createElement("div",{className:"text-red-500 mb-4"},d().createElement(On,{className:"w-12 h-12 mx-auto"})),d().createElement("h3",{className:"text-lg font-medium text-gray-900 mb-2"},(0,p.__)("Failed to Load WHCC Catalog","nggallery")),d().createElement("p",{className:"text-sm text-gray-500 mb-4"},(0,p.__)("Unable to fetch the WHCC product catalog. Please try again later.","nggallery")),d().createElement("button",{onClick:o,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"},(0,p.__)("Close","nggallery")))))):W&&0!==W.length?d().createElement(d().Fragment,null,d().createElement("div",{className:"fixed inset-0 z-50 overflow-y-auto",role:"dialog","aria-modal":"true"},d().createElement("div",{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity duration-300 ease-in-out",onClick:o}),d().createElement("div",{className:"relative flex min-h-screen items-center justify-center p-4"},d().createElement("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-2xl transition-all duration-300 ease-in-out",style:{width:"1100px",maxWidth:"90vw",marginLeft:N?"160px":"0"}},d().createElement("div",{className:"relative bg-white px-6 py-4 border-b border-gray-200"},d().createElement("div",{className:"flex items-center justify-between"},d().createElement("div",{className:"flex items-center space-x-3"},h&&d().createElement("button",{onClick:h,className:"p-1 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500","aria-label":(0,p.__)("Go back","nggallery")},d().createElement(t.Jp,{className:"w-5 h-5"})),d().createElement("h3",{className:"text-lg font-medium text-gray-900"},(0,p.__)("WHCC Prints","nggallery"))),d().createElement("button",{onClick:o,className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":(0,p.__)("Close modal","nggallery")},d().createElement(On,{className:"h-6 w-6"})))),d().createElement("div",{className:"p-6"},d().createElement("div",{className:"border-b border-gray-200 mb-6"},d().createElement("nav",{className:"-mb-px flex overflow-x-auto"},W&&W.map(function(e){return d().createElement("button",{key:e.id,onClick:function(){return E(e.id)},className:"py-3 px-3 border-b-2 font-medium text-sm text-center whitespace-nowrap flex-shrink-0 min-w-[120px] sm:flex-1 ".concat(x===e.id?"border-green-500 text-green-600 bg-green-50":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 hover:bg-gray-50")},e.label)}))),d().createElement("div",{className:"whcc-modal-scroll max-h-80 overflow-auto"},d().createElement("table",{className:"min-w-full table-fixed"},d().createElement("thead",{className:"bg-gray-50 sticky top-0"},d().createElement("tr",null,d().createElement("th",{className:"w-12 px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},d().createElement("input",{type:"checkbox",className:"rounded border-gray-300",checked:ne,onChange:function(t){return n=t.target.checked,void j(function(t){return Nn(Nn({},t),{},(0,e.A)({},x,n?X.map(function(e){return e.id}):[]))});var n},ref:function(e){e&&(e.indeterminate=re&&!ne)},"aria-label":(0,p.__)("Select all products","nggallery")})),d().createElement("th",{className:"w-[65%] px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:function(){return ae("name")}},d().createElement("div",{className:"flex items-center space-x-1"},d().createElement("span",null,(0,p.__)("Product","nggallery")),"name"===(null==I?void 0:I.key)&&d().createElement("span",null,"asc"===I.direction?"↑":"↓"))),d().createElement("th",{className:"w-[17.5%] px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:function(){return ae("cost")}},d().createElement("div",{className:"flex items-center space-x-1"},d().createElement("span",null,(0,p.__)("Cost","nggallery")),"cost"===(null==I?void 0:I.key)&&d().createElement("span",null,"asc"===I.direction?"↑":"↓"))),d().createElement("th",{className:"w-[17.5%] px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:function(){return ae("estimatedCost")}},d().createElement("div",{className:"flex items-center space-x-1"},d().createElement("span",null,(0,p.__)("Estimated Cost","nggallery")),"estimatedCost"===(null==I?void 0:I.key)&&d().createElement("span",null,"asc"===I.direction?"↑":"↓"))))),d().createElement("tbody",{className:"bg-white"},q?d().createElement("tr",null,d().createElement("td",{colSpan:4,className:"px-4 py-8"},d().createElement(s.A,{size:"md",color:"green",text:(0,p.__)("Loading products...","nggallery")}))):0===oe.length?d().createElement("tr",null,d().createElement("td",{colSpan:4,className:"px-4 py-8 text-center text-gray-500"},(0,p.__)("No products available for this category","nggallery"))):oe.map(function(t){return d().createElement("tr",{key:t.id,className:"border-b hover:bg-gray-50"},d().createElement("td",{className:"w-12 px-4 py-3"},d().createElement("input",{type:"checkbox",className:"rounded border-gray-300",checked:te.includes(t.id),onChange:function(){return n=t.id,void j(function(t){var r=t[x]||[],a=r.includes(n)?r.filter(function(e){return e!==n}):[].concat((0,l.A)(r),[n]);return Nn(Nn({},t),{},(0,e.A)({},x,a))});var n},"aria-label":"Select ".concat(t.name)})),d().createElement("td",{className:"w-[65%] px-4 py-3 text-sm text-gray-900"},t.name),d().createElement("td",{className:"w-[17.5%] px-4 py-3 text-sm text-gray-900"},kn(t.cost,t.cost_raw,"$")),d().createElement("td",{className:"w-[17.5%] px-4 py-3 text-sm text-gray-900"},kn(t.estimatedCost,t.estimated_raw,V)))}))))),d().createElement("div",{className:"px-6 py-4 flex justify-end space-x-3"},d().createElement("button",{onClick:o,disabled:z.isPending,className:"px-4 py-2 text-sm font-medium text-green-700 bg-white border border-green-600 rounded-md shadow-sm hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{onClick:$,disabled:0===Z()||z.isPending,className:"px-4 py-2 text-sm font-semibold text-white bg-green-600 border border-transparent rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},z.isPending?d().createElement("span",{className:"flex items-center"},d().createElement(s.A,{size:"sm",color:"gray",className:"mr-2 !border-white",centerInContainer:!1}),(0,p.__)("Adding...","nggallery")):(0,p.__)("Add Product","nggallery")))))),F&&d().createElement("div",{className:"fixed inset-0 z-[60] overflow-y-auto"},d().createElement("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},d().createElement("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity","aria-hidden":"true"}),d().createElement("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},""),d().createElement("div",{className:"relative inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},d().createElement("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},d().createElement("div",{className:"sm:flex sm:items-start"},d().createElement("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100 sm:mx-0 sm:h-10 sm:w-10"},d().createElement("svg",{className:"h-6 w-6 text-yellow-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.502 0L4.732 8.5C3.962 10.333 4.924 12 6.464 12H20.5"}))),d().createElement("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},d().createElement("h3",{className:"text-lg leading-6 font-medium text-gray-900",id:"modal-title"},(0,p.__)("Canvas Product Warning","nggallery")),d().createElement("div",{className:"mt-2"},d().createElement("p",{className:"text-sm text-gray-500"},(0,p.__)("You are adding a Canvas to a pricelist. Please be aware that when printing a Canvas, the edges of the photo (between 1 to 3 inches) will wrap around the side of the product.","nggallery")))))),d().createElement("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},d().createElement("button",{type:"button",onClick:(0,i.A)(En().m(function e(){return En().w(function(e){for(;;)switch(e.n){case 0:return M(!1),e.n=1,ee();case 1:return e.a(2)}},e)})),className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm"},(0,p.__)("Continue","nggallery")),d().createElement("button",{type:"button",onClick:function(){return M(!1)},className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},(0,p.__)("Cancel","nggallery"))))))):d().createElement("div",{className:"fixed inset-0 z-50 overflow-y-auto",role:"dialog","aria-modal":"true"},d().createElement("div",{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity duration-300 ease-in-out",onClick:o}),d().createElement("div",{className:"relative flex min-h-screen items-center justify-center p-4"},d().createElement("div",{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-2xl transition-all duration-300 ease-in-out p-8"},d().createElement("div",{className:"text-center"},d().createElement("h3",{className:"text-lg font-medium text-gray-900 mb-2"},(0,p.__)("No WHCC Products Available","nggallery")),d().createElement("p",{className:"text-sm text-gray-500 mb-4"},(0,p.__)("No WHCC product categories are currently available.","nggallery")),d().createElement("button",{onClick:o,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},(0,p.__)("Close","nggallery")))))):(console.error("WHCCPrintsModal: tabs is undefined, returning early"),null):null},manualSizesOrders:function(n){var r=n.isOpen,a=n.onClose,o=n.pricelistId,l=n.onBack,s=n.onSuccess,m=(0,u.useState)({productName:"",price:"",category:"prints"}),g=(0,c.A)(m,2),f=g[0],h=g[1],y=(0,u.useState)(!1),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)({productName:"",price:""}),_=(0,c.A)(E,2),C=_[0],N=_[1],k=(0,U.E)().showError,O=(0,ke.f8)(),A=function(e){return{prints:"ngg_category_prints",canvas:"ngg_category_canvas",mounted_prints:"ngg_category_mounted_prints",metal_prints:"metal_prints",acrylic_prints:"acrylic_prints",wood_prints:"wood_prints",bamboo_panels:"bamboo_panels"}[e]||e},S=[{value:"prints",label:(0,p.__)("Prints","nggallery")},{value:"canvas",label:(0,p.__)("Canvas","nggallery")},{value:"mounted_prints",label:(0,p.__)("Mounted Prints","nggallery")},{value:"metal_prints",label:(0,p.__)("Metal Prints","nggallery")},{value:"acrylic_prints",label:(0,p.__)("Acrylic Prints","nggallery")},{value:"wood_prints",label:(0,p.__)("Wood Prints","nggallery")},{value:"bamboo_panels",label:(0,p.__)("Bamboo Panels","nggallery")}],j=function(e,t){switch(e){case"productName":return t.trim()?"":(0,p.__)("Product name is required","nggallery");case"price":return t?parseFloat(t)<0?(0,p.__)("Please enter a valid price","nggallery"):"":(0,p.__)("Price is required","nggallery");default:return""}},P=function(t,n){h(function(r){return rn(rn({},r),{},(0,e.A)({},t,n))}),C[t]&&N(function(n){return rn(rn({},n),{},(0,e.A)({},t,""))})},T=function(){var e=(0,i.A)(en().m(function e(){var t,n;return en().w(function(e){for(;;)switch(e.n){case 0:if(t={productName:j("productName",f.productName),price:j("price",f.price)},N(t),!Object.values(t).some(function(e){return e})){e.n=1;break}return e.a(2);case 1:x(!0);try{n={id:-1e6*Math.random(),pricelist_id:o,title:f.productName,cost:0,price:parseFloat(f.price),source:"ngg_manual_pricelist",category:A(f.category),sortorder:0,source_data:{manual_entry:!0,created_at:(new Date).toISOString(),catalog_id:null,product_id:null}},s&&s([n]),a()}catch(e){k((0,p.__)("Failed to add product to pricelist","nggallery")),console.error("Error creating manual pricelist item:",e)}finally{x(!1)}case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return d().createElement("div",{className:"relative"},d().createElement(v.A,{isOpen:r,onClose:function(){}},d().createElement("div",{className:"absolute top-0 left-0 right-0 z-10 bg-white border-b"},d().createElement("div",{className:"flex items-center justify-between p-4"},d().createElement("div",{className:"flex items-center gap-3"},d().createElement("button",{onClick:function(){null==l||l()},className:"flex items-center text-gray-600 hover:text-gray-800"},d().createElement(t.Jp,{className:"w-4 h-4"})),d().createElement("h2",{className:"text-lg font-medium text-gray-900"},(0,p.__)("Manual Sizes & Orders","nggallery"))),d().createElement("button",{onClick:a,className:"text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2","aria-label":"Close modal"},d().createElement("svg",{className:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))))),d().createElement("div",{className:"p-4"},d().createElement("div",{className:"space-y-6"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("New Product Name","nggallery")),d().createElement("input",{type:"text",value:f.productName,onChange:function(e){return P("productName",e.target.value)},placeholder:(0,p.__)('8x10" Canvas or 4x6" Glossy',"nggallery"),className:"w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ".concat(C.productName?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300")}),C.productName&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},C.productName)),d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Price","nggallery")),d().createElement("div",{className:"relative"},d().createElement("span",{className:"absolute ".concat((0,ke.Di)(O)," top-1/2 transform -translate-y-1/2 text-gray-500 text-sm")},O),d().createElement("input",{type:"number",min:"0",step:"1",value:f.price,onChange:function(e){return P("price",e.target.value)},onBlur:function(){if(f.price){var e=parseFloat(f.price);isNaN(e)||h(function(t){return rn(rn({},t),{},{price:e.toFixed(2)})})}},placeholder:(0,p.__)("0.00","nggallery"),className:"w-full ".concat((0,ke.LX)(O).left," ").concat((0,ke.LX)(O).right," py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ").concat(C.price?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300")})),C.price&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},C.price)),d().createElement("div",{className:"w-full"},d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Category","nggallery")),d().createElement("div",{className:"w-full"},d().createElement("select",{value:f.category,onChange:function(e){return P("category",e.target.value)},className:"w-full block px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",style:{width:"100%",minWidth:"100%",maxWidth:"100%"}},S.map(function(e){return d().createElement("option",{key:e.value,value:e.value},e.label)})))),d().createElement("div",{className:"flex items-center justify-end gap-3 mt-8"},d().createElement("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:T,disabled:w,className:"px-4 py-2 text-sm font-medium text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},w?(0,p.__)("Adding...","nggallery"):(0,p.__)("Add Product","nggallery")))))))},digitalDownloads:function(n){var r=n.isOpen,a=n.onClose,o=n.pricelistId,l=n.onBack,s=n.onSuccess,m=(0,u.useState)({productName:"",price:"",maxDimension:""}),g=(0,c.A)(m,2),f=g[0],h=g[1],y=(0,u.useState)(!1),b=(0,c.A)(y,2),w=b[0],x=b[1],E=(0,u.useState)({productName:"",price:"",maxDimension:""}),_=(0,c.A)(E,2),C=_[0],N=_[1],k=(0,U.E)().showError,O=(0,ke.f8)(),A=function(e,t){switch(e){case"productName":return t.trim()?"":(0,p.__)("Product name is required","nggallery");case"price":return t?parseFloat(t)<0?(0,p.__)("Please enter a valid price","nggallery"):"":(0,p.__)("Price is required","nggallery");case"maxDimension":return t&&(isNaN(parseInt(t))||parseInt(t)<0)?(0,p.__)("Please enter a valid maximum dimension","nggallery"):"";default:return""}},S=function(t,n){h(function(r){return $e($e({},r),{},(0,e.A)({},t,n))}),C[t]&&N(function(n){return $e($e({},n),{},(0,e.A)({},t,""))})},j=function(){var e=(0,i.A)(Ye().m(function e(){var t,n,r;return Ye().w(function(e){for(;;)switch(e.n){case 0:if(t={productName:A("productName",f.productName),price:A("price",f.price),maxDimension:A("maxDimension",f.maxDimension)},N(t),!Object.values(t).some(function(e){return e})){e.n=1;break}return e.a(2);case 1:n=f.maxDimension?parseInt(f.maxDimension):0,x(!0);try{r={id:-1e6*Math.random(),pricelist_id:o,title:f.productName,cost:0,price:parseFloat(f.price),source:"ngg_digital_downloads",category:"ngg_category_digital_downloads",resolution:n,sortorder:0,source_data:{resolution_type:"custom",max_dimension:n,digital_download:!0,catalog_id:null,product_id:null}},s&&s([r]),a()}catch(e){k((0,p.__)("Failed to add digital download product to pricelist","nggallery")),console.error("Error creating digital download pricelist item:",e)}finally{x(!1)}case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return d().createElement("div",{className:"relative"},d().createElement(v.A,{isOpen:r,onClose:function(){}},d().createElement("div",{className:"absolute top-0 left-0 right-0 z-10 bg-white border-b"},d().createElement("div",{className:"flex items-center justify-between p-4"},d().createElement("div",{className:"flex items-center gap-3"},d().createElement("button",{onClick:function(){null==l||l()},className:"flex items-center text-gray-600 hover:text-gray-800"},d().createElement(t.Jp,{className:"w-4 h-4"})),d().createElement("h2",{className:"text-lg font-medium text-gray-900"},(0,p.__)("Digital Downloads","nggallery"))),d().createElement("button",{onClick:a,className:"text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2","aria-label":"Close modal"},d().createElement("svg",{className:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},d().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))))),d().createElement("div",{className:"p-4"},d().createElement("div",{className:"space-y-6"},d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("New Product Name","nggallery")),d().createElement("input",{type:"text",value:f.productName,onChange:function(e){return S("productName",e.target.value)},placeholder:(0,p.__)("Low, Medium, or High Resolution","nggallery"),className:"w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ".concat(C.productName?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300")}),C.productName&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},C.productName)),d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Price","nggallery")),d().createElement("div",{className:"relative"},d().createElement("span",{className:"absolute ".concat((0,ke.Di)(O)," top-1/2 transform -translate-y-1/2 text-gray-500 text-sm")},O),d().createElement("input",{type:"number",min:"0",step:"1",value:f.price,onChange:function(e){return S("price",e.target.value)},onBlur:function(){if(f.price){var e=parseFloat(f.price);isNaN(e)||h(function(t){return $e($e({},t),{},{price:e.toFixed(2)})})}},placeholder:(0,p.__)("0.00","nggallery"),className:"w-full ".concat((0,ke.LX)(O).left," ").concat((0,ke.LX)(O).right," py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ").concat(C.price?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300")})),C.price&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},C.price)),d().createElement("div",null,d().createElement("label",{className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Longest Image Dimension","nggallery")),d().createElement("div",{className:"relative"},d().createElement("input",{type:"number",min:"0",value:f.maxDimension,onChange:function(e){return S("maxDimension",e.target.value)},placeholder:(0,p.__)("Enter 0 for maximum","nggallery"),className:"w-full pl-3 pr-8 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 ".concat(C.maxDimension?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300")}),d().createElement("span",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-500 text-sm"},"px")),C.maxDimension&&d().createElement("p",{className:"mt-1 text-sm text-red-600"},C.maxDimension)),d().createElement("div",{className:"flex items-center justify-end gap-3 mt-8"},d().createElement("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"button",onClick:j,disabled:w,className:"px-4 py-2 text-sm font-medium text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},w?(0,p.__)("Adding...","nggallery"):(0,p.__)("Add Product","nggallery")))))))},bulkMarkup:function(t){var n=t.isOpen,r=t.onClose,a=t.pricelistId,o=t.currentSettings,i=t.onSuccess,l=(0,u.useState)({markupPercent:300,rounding:"zero"}),s=(0,c.A)(l,2),m=s[0],g=s[1],f=(0,le.dw)(a).data;(0,u.useEffect)(function(){if(n){var e=o||(null==f?void 0:f.settings),t=(null==e?void 0:e.bulk_markup_amount)||300,r=(null==e?void 0:e.bulk_markup_rounding)||"zero";g({markupPercent:Number(t),rounding:r})}},[n,o,f]);var h=function(t,n){g(function(r){return se(se({},r),{},(0,e.A)({},t,n))})};return d().createElement(v.A,{isOpen:n,onClose:r,title:(0,p.__)("Apply Markup to All Products","nggallery")},d().createElement("form",{onSubmit:function(e){e.preventDefault();var t="string"==typeof m.markupPercent?parseInt(m.markupPercent):m.markupPercent;!a||isNaN(t)||t<0||""===m.markupPercent||(null==i||i({markupPercent:t,rounding:m.rounding}),r())},className:"space-y-4"},d().createElement("div",null,d().createElement("label",{htmlFor:"markup-percent",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Markup Percent","nggallery")),d().createElement("input",{id:"markup-percent",type:"number",min:"0",max:"10000",step:"1",value:m.markupPercent,onChange:function(e){return h("markupPercent",""===e.target.value?"":parseInt(e.target.value)||0)},className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"400",required:!0})),d().createElement("div",null,d().createElement("label",{htmlFor:"rounding",className:"block text-sm font-medium text-gray-700 mb-1"},(0,p.__)("Round prices up to","nggallery")),d().createElement("select",{id:"rounding",value:m.rounding,onChange:function(e){return h("rounding",e.target.value)},className:"w-full block px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",style:{width:"100%",minWidth:"100%",maxWidth:"100%"}},[{value:"zero",label:".00"},{value:"cent",label:".99"},{value:"none",label:"No Rounding"}].map(function(e){return d().createElement("option",{key:e.value,value:e.value},e.label)}))),d().createElement("div",{className:"flex items-center justify-end gap-3 mt-8"},d().createElement("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},(0,p.__)("Cancel","nggallery")),d().createElement("button",{type:"submit",disabled:""===m.markupPercent||"number"==typeof m.markupPercent&&m.markupPercent<0,className:"px-4 py-2 text-sm font-medium text-white bg-green-500 border border-transparent rounded-md shadow-sm hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},(0,p.__)("Apply to All","nggallery")))))}};const Sn=function(){var e=(0,g.useDispatch)(m.EF),t=(0,g.useSelect)(function(e){return e(m.EF).getActiveModal()},[]);if(!t)return null;var n=t.type,r=t.props,a=An[n];if(!a)return null;var o=null==r?void 0:r.onClose;return d().createElement(a,(0,y.A)({},r,{isOpen:!0,onClose:function(){if(o?o():e.setActiveModal(null),"imageUploader"===n)try{var t,r,a=document.querySelector("#toplevel_page_imagely");if(!a)return;var i=a.querySelector('ul.wp-submenu-wrap li a[href*="create_gallery=1"].current');if(!i)return;i.classList.remove("current"),null===(t=i.parentElement)||void 0===t||t.classList.remove("current");var l=a.querySelector('ul.wp-submenu-wrap li a[href*="page=imagely"]:not([href*="create_gallery"])');null==l||l.classList.add("current"),null==l||null===(r=l.parentElement)||void 0===r||r.classList.add("current")}catch(e){}}}))},jn=function(e){var n,r,a,o,i=e.notification,l=e.onDismiss,c=e.showDismissButton,s=void 0===c||c;return d().createElement("div",{className:"p-3 sm:p-4 hover:bg-gray-50"},d().createElement("div",{className:"flex items-start space-x-2 sm:space-x-3"},d().createElement("div",{className:"flex-shrink-0 mt-1 text-gray-400"},function(e){switch(e){case"info":return d().createElement(t.mo,{className:"w-5 h-5"});case"percent":return d().createElement(t.R3,{className:"w-5 h-5"});case"check":return d().createElement(t.BK,{className:"w-5 h-5"});default:return d().createElement(t.L6,{className:"w-5 h-5"})}}(i.icon)),d().createElement("div",{className:"flex-1 min-w-0"},d().createElement("h4",{className:"text-xs sm:text-sm font-medium text-gray-900 mb-1"},i.title),d().createElement("p",{className:"text-xs sm:text-sm text-gray-700 mb-2 sm:mb-3"},(a=i.content,(o=document.createElement("div")).innerHTML=a,o.textContent||o.innerText||"")),d().createElement("div",{className:"flex flex-col sm:flex-row sm:items-center space-y-2 sm:space-y-0 sm:space-x-3"},d().createElement("div",{className:"flex flex-wrap gap-2"},(null===(n=i.btns)||void 0===n?void 0:n.main)&&d().createElement("a",{href:i.btns.main.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 sm:px-3 py-1 border border-transparent text-xs font-medium rounded text-white bg-black hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},i.btns.main.text),(null===(r=i.btns)||void 0===r?void 0:r.alt)&&d().createElement("a",{href:i.btns.alt.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 sm:px-3 py-1 border border-gray-300 text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},i.btns.alt.text)),s&&d().createElement("button",{onClick:function(){l(i.id)},className:"text-xs text-gray-500 hover:text-gray-700 self-start sm:self-center"},(0,p.__)("Dismiss","nggallery"))))))},Pn=function(){var e=(0,g.useDispatch)(),n=(0,u.useState)(!1),r=(0,c.A)(n,2),a=r[0],o=r[1],i=(0,g.useSelect)(function(e){var t,n,r=e(m.EF).getInboxState();return{isOpen:(null==r?void 0:r.isOpen)||!1,activeNotifications:(null==r?void 0:r.active)||[],dismissedNotifications:(null==r?void 0:r.dismissed)||[],activeCounts:(null==r||null===(t=r.counts)||void 0===t?void 0:t.active)||0,dismissedCounts:(null==r||null===(n=r.counts)||void 0===n?void 0:n.dismissed)||0,loading:(null==r?void 0:r.loading)||!1,error:(null==r?void 0:r.error)||null}},[]),l=i.isOpen,s=i.activeNotifications,f=i.dismissedNotifications,h=i.activeCounts,y=i.dismissedCounts,v=i.loading,b=i.error;(0,u.useEffect)(function(){var e,t;e=h,(t=document.querySelector(".ngg-menu-notification-indicator"))&&(e>0?(t.textContent=e.toString(),t.style.display=""):t.style.display="none")},[h]);var w=function(){e(m.EF).closeInboxPanel()},x=function(t){e(m.EF).dismissInboxNotification(t)};if(d().useEffect(function(){var e=function(e){"Escape"===e.key&&l&&w()};if(l)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[l]),!l)return null;var E=a?f:s,_=a?y:h;return d().createElement(d().Fragment,null,d().createElement("div",{className:"fixed inset-0 bg-black bg-opacity-30 z-40",onClick:function(e){e.target===e.currentTarget&&w()}}),d().createElement("div",{className:"fixed top-10 md:top-6 right-0 bottom-0 w-full max-w-xs sm:w-80 md:w-96 lg:w-[28rem] xl:w-[32rem] 2xl:w-[36rem] bg-white shadow-lg border-l border-gray-200 z-50 flex flex-col"},d().createElement("div",{className:"bg-gray-100 border-b border-gray-200 p-3 sm:p-4 flex items-start sm:items-center justify-between"},d().createElement("div",{className:"flex-1 min-w-0 pr-2"},a?d().createElement("h3",{className:"text-sm sm:text-base md:text-lg font-semibold text-gray-900 truncate"},(0,p.__)("Notifications","nggallery")," (",_,")"):d().createElement("h3",{className:"text-sm sm:text-base md:text-lg font-semibold text-gray-900 truncate"},(0,p.__)("New Notifications","nggallery")," (",_,")"),d().createElement("button",{onClick:function(){o(!a)},className:"text-xs sm:text-sm text-blue-600 hover:text-blue-700 mt-1 block"},a?(0,p.__)("Active Notifications","nggallery"):(0,p.__)("Dismissed Notifications","nggallery"))),d().createElement("button",{onClick:w,className:"p-1 sm:p-2 hover:bg-gray-200 rounded-full flex-shrink-0","aria-label":(0,p.__)("Close notifications","nggallery")},d().createElement(t.US,{className:"w-5 h-5 sm:w-6 sm:h-6"}))),d().createElement("div",{className:"flex-1 overflow-y-auto"},v?d().createElement("div",{className:"flex items-center justify-center h-32"},d().createElement("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"})):b?d().createElement("div",{className:"p-3 sm:p-4 text-red-600 text-sm sm:text-base"},(0,p.__)("Error loading notifications:","nggallery")," ",b):0===E.length?d().createElement("div",{className:"p-3 sm:p-4 text-gray-500 text-center text-sm sm:text-base"},a?(0,p.__)("No dismissed notifications","nggallery"):(0,p.__)("No new notifications","nggallery")):d().createElement("div",{className:"divide-y divide-gray-200"},E.map(function(e){return d().createElement(jn,{key:e.id,notification:e,onDismiss:x,showDismissButton:!a})}))),!a&&h>0&&d().createElement("div",{className:"border-t border-gray-200 p-3 sm:p-4"},d().createElement("button",{onClick:function(){e(m.EF).dismissAllInboxNotifications()},className:"text-blue-600 hover:text-blue-700 text-xs sm:text-sm font-medium"},(0,p.__)("Dismiss all","nggallery")))))};var Tn=a(4880),In=a(9757),Dn=a(6261),Ln=a(6500),Rn=class extends Ln.Q{constructor(e={}){super(),this.config=e,this.#U=new Map}#U;build(e,t,n){const r=t.queryKey,a=t.queryHash??(0,Tn.F$)(r,t);let o=this.get(a);return o||(o=new In.X({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#U.has(e.queryHash)||(this.#U.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#U.get(e.queryHash);t&&(e.destroy(),t===e&&this.#U.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dn.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#U.get(e)}getAll(){return[...this.#U.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>(0,Tn.MK)(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,Tn.MK)(e,t)):t}notify(e){Dn.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dn.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dn.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fn=a(6158),Mn=class extends Ln.Q{constructor(e={}){super(),this.config=e,this.#H=new Set,this.#z=new Map,this.#K=0}#H;#z;#K;build(e,t,n){const r=new Fn.s({client:e,mutationCache:this,mutationId:++this.#K,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#H.add(e);const t=Gn(e);if("string"==typeof t){const n=this.#z.get(t);n?n.push(e):this.#z.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#H.delete(e)){const t=Gn(e);if("string"==typeof t){const n=this.#z.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#z.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Gn(e);if("string"==typeof t){const n=this.#z.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=Gn(e);if("string"==typeof t){const n=this.#z.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Dn.jG.batch(()=>{this.#H.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#H.clear(),this.#z.clear()})}getAll(){return Array.from(this.#H)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>(0,Tn.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,Tn.nJ)(e,t))}notify(e){Dn.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Dn.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(Tn.lQ))))}};function Gn(e){return e.options.scope?.id}var Qn=a(9658),Bn=a(6035),qn=a(8959),Un=new class{#V;#o;#m;#W;#X;#Y;#Z;#J;constructor(e={}){this.#V=e.queryCache||new Rn,this.#o=e.mutationCache||new Mn,this.#m=e.defaultOptions||{},this.#W=new Map,this.#X=new Map,this.#Y=0}mount(){this.#Y++,1===this.#Y&&(this.#Z=Qn.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#V.onFocus())}),this.#J=Bn.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#V.onOnline())}))}unmount(){this.#Y--,0===this.#Y&&(this.#Z?.(),this.#Z=void 0,this.#J?.(),this.#J=void 0)}isFetching(e){return this.#V.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#o.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#V.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#V.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,Tn.d2)(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#V.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#V.get(r.queryHash),o=a?.state.data,i=(0,Tn.Zw)(t,o);if(void 0!==i)return this.#V.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.jG.batch(()=>this.#V.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#V.get(t.queryHash)?.state}removeQueries(e){const t=this.#V;Dn.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#V;return Dn.jG.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Dn.jG.batch(()=>this.#V.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Tn.lQ).catch(Tn.lQ)}invalidateQueries(e,t={}){return Dn.jG.batch(()=>(this.#V.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dn.jG.batch(()=>this.#V.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Tn.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(Tn.lQ)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#V.build(this,t);return n.isStaleByTime((0,Tn.d2)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tn.lQ).catch(Tn.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,qn.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tn.lQ).catch(Tn.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,qn.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Bn.t.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#V}getMutationCache(){return this.#o}getDefaultOptions(){return this.#m}setDefaultOptions(e){this.#m=e}setQueryDefaults(e,t){this.#W.set((0,Tn.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#W.values()],n={};return t.forEach(t=>{(0,Tn.Cp)(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#X.set((0,Tn.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#X.values()],n={};return t.forEach(t=>{(0,Tn.Cp)(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#m.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,Tn.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Tn.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#m.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#V.clear(),this.#o.clear()}}({defaultOptions:{queries:{staleTime:3e5,gcTime:6e5,retry:3,refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!0},mutations:{retry:1,onError:function(e){console.error("Mutation error:",e)}}}}),Hn=function(e){var t=e.children;return d().createElement(G.Ht,{client:Un},t)},zn=a(5795),Kn={},Vn=null,Wn=function(){if(null!==document.getElementById("add-ngg-gallery-modal"))Kn={};else{var e=new URLSearchParams(window.location.search);void 0!==Kn.tab&&e.set("tab",Kn.tab),void 0!==Kn.subtab&&(null!==Kn.subtab?e.set("subtab",Kn.subtab):e.has("subtab")&&e.delete("subtab")),void 0!==Kn.page&&e.set("page",Kn.page),void 0!==Kn.id&&(null!==Kn.id?e.set("id",Kn.id.toString()):e.has("id")&&e.delete("id"));var t="".concat(window.location.pathname,"?").concat(e.toString());window.history.pushState({},"",t),Kn={},Vn=null}},Xn=function(e){null!==document.getElementById("add-ngg-gallery-modal")||(Object.assign(Kn,e),Vn&&clearTimeout(Vn),Vn=window.setTimeout(Wn,0))};function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zn(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Yn(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Jn(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return $n(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):($n(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,$n(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,$n(d,"constructor",s),$n(s,"constructor",c),c.displayName="GeneratorFunction",$n(s,a,"GeneratorFunction"),$n(d),$n(d,a,"Generator"),$n(d,r,function(){return this}),$n(d,"toString",function(){return"[object Generator]"}),(Jn=function(){return{w:o,m}})()}function $n(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}$n=function(e,t,n,r){function o(t,n){$n(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},$n(e,t,n,r)}var er={router:{currentTab:new URLSearchParams(window.location.search).get("tab")||"general",currentSubTab:new URLSearchParams(window.location.search).get("subtab")||null,currentPage:new URLSearchParams(window.location.search).get("page")||"imagely",currentId:Number(new URLSearchParams(window.location.search).get("id"))||null},ui:{activeModal:null,notifications:[],inbox:{active:[],dismissed:[],counts:{active:0,dismissed:0},isOpen:!1,loading:!1,error:null},isPageLoading:!1}},tr={DELETE_ITEM:(0,g.createRegistryControl)(function(){return function(e){var t,n=e.entityType,r=e.id,a=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce;return _()({path:"/imagely/v1/".concat(n,"/").concat(r),method:"DELETE",headers:{"X-WP-Nonce":a,"Content-Type":"application/json"},parse:!1}).then(function(e){var t=e;return 204===t.status?null:t.json()})}}),FETCH_NOTIFICATIONS:(0,g.createRegistryControl)(function(){return function(){var e,t=null===(e=window.imagelyApp)||void 0===e?void 0:e.nonce;return _()({path:"/imagely/v1/notifications",method:"GET",headers:{"X-WP-Nonce":t,"Content-Type":"application/json"}})}}),DISMISS_INBOX_NOTIFICATION:(0,g.createRegistryControl)(function(){return function(e){var t,n=e.id,r=null===(t=window.imagelyApp)||void 0===t?void 0:t.nonce;return _()({path:"/imagely/v1/notifications/dismiss",method:"POST",headers:{"X-WP-Nonce":r,"Content-Type":"application/json"},data:{id:n}})}})},nr={setCurrentTab:function(e){return Xn({tab:e}),{type:"SET_CURRENT_TAB",tab:e}},setCurrentSubTab:function(e){return Xn({subtab:e}),{type:"SET_CURRENT_SUB_TAB",subTab:e}},setCurrentPage:function(e){return Xn({page:e}),{type:"SET_CURRENT_PAGE",page:e}},setCurrentId:function(e){return Xn({id:e}),{type:"SET_CURRENT_ID",id:e}},setRouterState:function(e,t,n,r){return{type:"SET_ROUTER_STATE",page:e,tab:t,subTab:n,id:r}},navigateTo:function(e,t,n,r){var a=null,o=null;return"number"==typeof n?(o=n,a=null):"string"==typeof n?(a=n,o=r||null):(a=null,o=r||null),Xn({page:e,tab:t,subtab:a,id:o}),{type:"NAVIGATE_TO",page:e,tab:t,subTab:a,id:o}},setActiveModal:function(e,t){return{type:"SET_ACTIVE_MODAL",modalType:e,modalProps:t}},showNotice:function(e,t,n){var r={id:"notification-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:e,message:t,timestamp:Date.now(),dismissible:!1!==(null==n?void 0:n.dismissible),duration:(null==n?void 0:n.duration)||("error"===e?0:700)};return r.duration>0&&setTimeout(function(){var e;(null===(e=window.wp)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.select(m.EF))&&window.wp.data.dispatch(m.EF).dismissNotice(r.id)},r.duration),{type:"ADD_NOTIFICATION",notification:r}},dismissNotice:function(e){return{type:"DISMISS_NOTIFICATION",id:e}},clearAllNotices:function(){return{type:"CLEAR_ALL_NOTIFICATIONS"}},setPageLoading:function(e){return{type:"SET_PAGE_LOADING",loading:e}},setInboxLoading:function(e){return{type:"SET_INBOX_LOADING",loading:e}},setInboxError:function(e){return{type:"SET_INBOX_ERROR",error:e}},setInboxNotifications:function(e,t,n){return{type:"SET_INBOX_NOTIFICATIONS",active:e,dismissed:t,counts:n}},setInboxOpen:function(e){return{type:"SET_INBOX_OPEN",isOpen:e}},updateInboxCounts:function(e){return{type:"UPDATE_INBOX_COUNTS",counts:e}},deleteItem:Jn().m(function e(t,n){var r;return Jn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,{type:"DELETE_ITEM",entityType:t,id:n};case 1:return e.a(2,!0);case 2:return e.p=2,r=e.v,console.error("Error deleting ".concat(t,":"),r),e.a(2,!1)}},e,null,[[0,2]])}),fetchInboxNotifications:Jn().m(function e(){var t,n;return Jn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,nr.setInboxLoading(!0);case 1:return e.p=1,e.n=2,{type:"FETCH_NOTIFICATIONS"};case 2:return t=e.v,e.n=3,nr.setInboxNotifications(t.active,t.dismissed,t.counts);case 3:return e.n=4,nr.setInboxError(null);case 4:e.n=6;break;case 5:return e.p=5,n=e.v,console.error("Store: Error fetching inbox notifications:",n),e.n=6,nr.setInboxError(n.message);case 6:return e.p=6,e.n=7,nr.setInboxLoading(!1);case 7:return e.f(6);case 8:return e.a(2)}},e,null,[[1,5,6,8]])}),dismissInboxNotification:Jn().m(function e(t){var n,r;return Jn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,{type:"DISMISS_INBOX_NOTIFICATION",id:t};case 1:return n=e.v,e.n=2,nr.updateInboxCounts(n.counts);case 2:return e.n=3,nr.fetchInboxNotifications();case 3:e.n=5;break;case 4:return e.p=4,r=e.v,console.error("Store: Error dismissing inbox notification:",r),e.n=5,nr.setInboxError(r.message);case 5:return e.a(2)}},e,null,[[0,4]])}),dismissAllInboxNotifications:Jn().m(function e(){var t,n;return Jn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,{type:"DISMISS_INBOX_NOTIFICATION",id:"all"};case 1:return t=e.v,e.n=2,nr.updateInboxCounts(t.counts);case 2:return e.n=3,nr.fetchInboxNotifications();case 3:e.n=5;break;case 4:return e.p=4,n=e.v,console.error("Store: Error dismissing all inbox notifications:",n),e.n=5,nr.setInboxError(n.message);case 5:return e.a(2)}},e,null,[[0,4]])}),openInboxPanel:Jn().m(function e(){return Jn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,nr.setInboxOpen(!0);case 1:return e.a(2)}},e)}),closeInboxPanel:Jn().m(function e(){return Jn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,nr.setInboxOpen(!1);case 1:return e.a(2)}},e)})},rr={getCurrentTab:function(e){return e.router.currentTab},getCurrentSubTab:function(e){return e.router.currentSubTab},getCurrentPage:function(e){return e.router.currentPage},getCurrentId:function(e){return e.router.currentId},getRouteParams:function(e){return e.router},getActiveModal:function(e){return e.ui.activeModal},getNotifications:function(e){return e.ui.notifications},getPageLoading:function(e){return e.ui.isPageLoading},getUIState:function(e){return e.ui},getInboxState:function(e){return e.ui.inbox||er.ui.inbox},getInboxActive:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.active)||[]},getInboxDismissed:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.dismissed)||[]},getInboxCounts:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.counts)||{active:0,dismissed:0}},getInboxActiveCount:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t||null===(t=t.counts)||void 0===t?void 0:t.active)||0},getInboxDismissedCount:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t||null===(t=t.counts)||void 0===t?void 0:t.dismissed)||0},getInboxIsOpen:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.isOpen)||!1},getInboxLoading:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.loading)||!1},getInboxError:function(e){var t;return(null===(t=e.ui.inbox)||void 0===t?void 0:t.error)||null}},ar=(0,g.createReduxStore)(m.EF,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:er,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CURRENT_TAB":return Zn(Zn({},e),{},{router:Zn(Zn({},e.router),{},{currentTab:t.tab})});case"SET_CURRENT_SUB_TAB":return Zn(Zn({},e),{},{router:Zn(Zn({},e.router),{},{currentSubTab:t.subTab})});case"SET_CURRENT_PAGE":return Zn(Zn({},e),{},{router:Zn(Zn({},e.router),{},{currentPage:t.page})});case"SET_CURRENT_ID":return Zn(Zn({},e),{},{router:Zn(Zn({},e.router),{},{currentId:t.id})});case"SET_ROUTER_STATE":case"NAVIGATE_TO":return Zn(Zn({},e),{},{router:{currentPage:t.page,currentTab:t.tab,currentSubTab:t.subTab,currentId:t.id}});case"SET_ACTIVE_MODAL":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{activeModal:t.modalType?{type:t.modalType,props:t.modalProps||{}}:null})});case"ADD_NOTIFICATION":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{notifications:[].concat((0,l.A)(e.ui.notifications),[t.notification])})});case"DISMISS_NOTIFICATION":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{notifications:e.ui.notifications.filter(function(e){return e.id!==t.id})})});case"CLEAR_ALL_NOTIFICATIONS":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{notifications:[]})});case"SET_PAGE_LOADING":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{isPageLoading:t.loading})});case"SET_INBOX_LOADING":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{inbox:Zn(Zn({},e.ui.inbox),{},{loading:t.loading})})});case"SET_INBOX_ERROR":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{inbox:Zn(Zn({},e.ui.inbox),{},{error:t.error})})});case"SET_INBOX_NOTIFICATIONS":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{inbox:Zn(Zn({},e.ui.inbox),{},{active:t.active,dismissed:t.dismissed,counts:t.counts})})});case"SET_INBOX_OPEN":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{inbox:Zn(Zn({},e.ui.inbox),{},{isOpen:t.isOpen})})});case"UPDATE_INBOX_COUNTS":return Zn(Zn({},e),{},{ui:Zn(Zn({},e.ui),{},{inbox:Zn(Zn({},e.ui.inbox),{},{counts:t.counts})})});default:return e}},actions:nr,selectors:rr,controls:tr});try{(0,g.register)(ar)}catch(e){}const or=function(e){var n=e.children,a=e.embedContext,o=e.onClose,i=(0,r.useRef)(null),l=(0,r.useState)(!1),u=(0,c.A)(l,2),d=u[0],p=u[1];return(0,r.useEffect)(function(){var e=function(){try{var e=(0,g.select)(m.EF);if(e&&"function"==typeof e.getCurrentPage)return p(!0),!0}catch(e){console.error("Error checking store:",e)}return!1};if(!e()){var t=0,n=setInterval(function(){t++,(e()||t>=100)&&(clearInterval(n),t>=100&&p(!0))},50);return function(){return clearInterval(n)}}},[]),(0,r.useEffect)(function(){var e=document.body;e.style.overflow="hidden";var t=document.createElement("div");return t.setAttribute("id","add-ngg-gallery-modal-background"),e.appendChild(t),i.current=t,function(){e.style.overflow="auto",i.current&&e.contains(i.current)&&e.removeChild(i.current)}},[]),(0,zn.createPortal)(React.createElement("div",{id:"add-ngg-gallery-modal",className:"imagely imagely-wrap imagely-wrap-modal"},React.createElement("button",{id:"add-ngg-gallery-modal-close",onClick:function(e){e.preventDefault(),e.stopPropagation(),o()},"aria-label":"Close modal",type:"button",className:"fixed top-5 right-5 w-9 h-9 flex items-center justify-center bg-white rounded shadow-md hover:bg-gray-100 hover:shadow-lg transition-all duration-200 z-[999999] text-gray-600 hover:text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"},React.createElement(t.US,{className:"w-5 h-5"})),React.createElement("div",{className:"add-ngg-gallery-modal-content bg-gray-100"},d?React.createElement(Hn,null,React.createElement(H.h,{value:a},n,React.createElement(Sn,null),React.createElement(f,null),React.createElement(Pn,null),React.createElement(h,null))):React.createElement("div",{className:"flex items-center justify-center h-screen"},React.createElement(s.A,{size:"lg",color:"green"})))),document.body)};var ir=function(e){var t=(0,g.useDispatch)(m.EF),n=(0,H.X)();(0,r.useEffect)(function(){if(n.isEmbed&&null!=t&&t.setRouterState){var r=void 0!==e.id?e.id:null;t.setRouterState(e.page,e.tab||"general",e.subtab||null,r),e.modal&&t.setActiveModal&&setTimeout(function(){"albumCreate"===e.modal&&t.setActiveModal("album")},100)}},[e.page,e.tab,e.subtab,e.id,e.modal,t,n.isEmbed])},lr=(0,u.lazy)(function(){return Promise.all([a.e(319),a.e(818)]).then(a.bind(a,5818))}),cr=function(e){var t=e.albumId;return ir({page:"imagely-albums",tab:t?"galleries":"general",id:t,modal:t?null:"albumCreate"}),d().createElement(u.Suspense,{fallback:d().createElement(s.A,{size:"lg",color:"green"})},d().createElement(lr,null))};const sr=function(e){var t=e.albumId,n=e.onInsertAlbum,r=e.onClose;return d().createElement(or,{embedContext:{isEmbed:!0,onInsertAlbum:n,onClose:r},onClose:r},d().createElement(cr,{albumId:t}))};var ur=(0,u.lazy)(function(){return Promise.all([a.e(319),a.e(335)]).then(a.bind(a,2335))}),dr=function(e){var t=e.galleryId;return ir({page:"imagely-add-new",tab:t?"images":"general",id:t}),d().createElement(u.Suspense,{fallback:d().createElement(s.A,{size:"lg",color:"green"})},d().createElement(ur,null))};const mr=function(e){var t=e.galleryId,n=e.onInsertGallery,r=e.onClose;return d().createElement(or,{embedContext:{isEmbed:!0,onInsertGallery:n,onClose:r},onClose:r},d().createElement(dr,{galleryId:t}))};var gr=a(1313),fr=a(6629);function pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hr(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?pr(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pr(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function yr(e,t){switch(t.type){case"SET_SEARCH_TERM":return hr(hr({},e),{},{searchTerm:t.payload});case"SET_SHOW_DROPDOWN":return hr(hr({},e),{},{showDropdown:t.payload});case"SET_IS_SEARCHING":return hr(hr({},e),{},{isSearching:t.payload});case"SET_HIGHLIGHTED_INDEX":return hr(hr({},e),{},{highlightedIndex:t.payload});case"SET_IS_KEYBOARD_NAV":return hr(hr({},e),{},{isKeyboardNav:t.payload});case"TOGGLE_DROPDOWN":return hr(hr({},e),{},{showDropdown:!e.showDropdown,isSearching:!1,isKeyboardNav:!1});case"CLOSE_DROPDOWN":return hr(hr({},e),{},{showDropdown:!1,isSearching:!1,highlightedIndex:0,isKeyboardNav:!1});case"OPEN_DROPDOWN_FOR_SEARCH":return hr(hr({},e),{},{showDropdown:!0,isSearching:!0});case"RESET_HIGHLIGHTED_INDEX":return hr(hr({},e),{},{highlightedIndex:0});default:return e}}const vr=function(e){var n=e.id,r=e.name,a=e.value,o=e.onChange,i=e.options,l=e.placeholder,s=void 0===l?(0,p.__)("Select an option","nggallery"):l,m=e.label,g=e.help,f=e.tooltipPlacement,h=e.className,y=e.disabled,v=void 0!==y&&y,w=e.isLoading,x=void 0!==w&&w,E=(0,u.useMemo)(function(){return Array.isArray(i)?i.filter(function(e){return e&&"object"===(0,b.A)(e)?void 0===e.value||null===e.value?(console.warn("SearchableSelect: Option missing value:",e),!1):!!e.label||(console.warn("SearchableSelect: Option missing label:",e),!1):(console.warn("SearchableSelect: Invalid option object:",e),!1)}):(console.error("SearchableSelect: options prop must be an array"),[])},[i]),_=(0,u.useReducer)(yr,{searchTerm:"",showDropdown:!1,isSearching:!1,highlightedIndex:0,isKeyboardNav:!1}),C=(0,c.A)(_,2),N=C[0],k=C[1],O=(0,u.useRef)(null),A=(0,u.useRef)(null),S=(0,u.useRef)(null),j=(0,u.useMemo)(function(){return E.find(function(e){return e.value===a})},[E,a]);(0,u.useEffect)(function(){k(a?{type:"SET_SEARCH_TERM",payload:(null==j?void 0:j.label)||""}:{type:"SET_SEARCH_TERM",payload:""})},[a,j]);var P=(0,u.useMemo)(function(){if(!N.isSearching||!N.searchTerm)return E;var e=N.searchTerm.toLowerCase();return E.filter(function(t){return t.label.toLowerCase().includes(e)||String(t.value).includes(N.searchTerm)})},[E,N.isSearching,N.searchTerm]);(0,u.useEffect)(function(){k({type:"RESET_HIGHLIGHTED_INDEX"})},[P.length]),(0,u.useEffect)(function(){if(N.showDropdown&&N.isKeyboardNav&&O.current){var e=O.current.querySelector('[data-index="'.concat(N.highlightedIndex,'"]'));e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[N.highlightedIndex,N.showDropdown,N.isKeyboardNav]),(0,u.useEffect)(function(){if(N.showDropdown&&a&&O.current){var e=P.findIndex(function(e){return e.value===a});return-1!==e?(k({type:"SET_HIGHLIGHTED_INDEX",payload:e}),S.current=window.setTimeout(function(){var t,n=null===(t=O.current)||void 0===t?void 0:t.querySelector('[data-index="'.concat(e,'"]'));n&&n.scrollIntoView({block:"center",behavior:"smooth"})},0),function(){null!==S.current&&(clearTimeout(S.current),S.current=null)}):void 0}},[N.showDropdown,a,P]);var T=(0,u.useCallback)(function(){v||k({type:"TOGGLE_DROPDOWN"})},[v]),I=(0,u.useCallback)(function(){k({type:"CLOSE_DROPDOWN"})},[]),D=(0,u.useCallback)(function(e){var t;o(e),I(),null===(t=A.current)||void 0===t||t.blur()},[o,I]),L=(0,u.useCallback)(function(e){var t;if(!v)switch(e.key){case"ArrowDown":e.preventDefault(),k({type:"SET_IS_KEYBOARD_NAV",payload:!0}),N.showDropdown?k({type:"SET_HIGHLIGHTED_INDEX",payload:Math.min(N.highlightedIndex+1,P.length-1)}):(k({type:"SET_SHOW_DROPDOWN",payload:!0}),k({type:"SET_IS_SEARCHING",payload:!1}));break;case"ArrowUp":e.preventDefault(),k({type:"SET_IS_KEYBOARD_NAV",payload:!0}),N.showDropdown?k({type:"SET_HIGHLIGHTED_INDEX",payload:Math.max(N.highlightedIndex-1,0)}):(k({type:"SET_SHOW_DROPDOWN",payload:!0}),k({type:"SET_IS_SEARCHING",payload:!1}));break;case"Enter":e.preventDefault(),N.showDropdown&&P[N.highlightedIndex]?D(P[N.highlightedIndex].value):N.showDropdown||T();break;case"Escape":e.preventDefault(),I(),null===(t=A.current)||void 0===t||t.blur();break;case"Tab":N.showDropdown&&I();break;default:N.showDropdown||k({type:"SET_SHOW_DROPDOWN",payload:!0}),k({type:"SET_IS_SEARCHING",payload:!0})}},[v,N.showDropdown,N.highlightedIndex,P,D,T,I]),R=(0,gr.L)(function(){I()},N.showDropdown);return d().createElement("div",{ref:R,className:h},m&&d().createElement(fr.A,{htmlFor:n,help:g,tooltipPlacement:f},m),d().createElement("div",{className:"relative"},d().createElement("button",{type:"button",onClick:T,disabled:v||x,className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 cursor-pointer bg-transparent border-none p-0 disabled:cursor-not-allowed disabled:opacity-50","aria-label":(0,p.__)("Toggle dropdown","nggallery"),tabIndex:-1},d().createElement(t.WI,{className:"w-full h-full"})),d().createElement("input",{ref:A,type:"text",id:n,name:r,value:N.searchTerm,onChange:function(e){k({type:"SET_SEARCH_TERM",payload:e.target.value}),k({type:"OPEN_DROPDOWN_FOR_SEARCH"})},onFocus:function(){E.length>0&&(k({type:"SET_IS_SEARCHING",payload:!1}),k({type:"SET_IS_KEYBOARD_NAV",payload:!1}),k({type:"SET_SHOW_DROPDOWN",payload:!0}))},onKeyDown:L,placeholder:s,disabled:v||x,className:"w-full pl-10 pr-10 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500 text-gray-900 disabled:bg-gray-100 disabled:cursor-not-allowed","aria-label":s,"aria-expanded":N.showDropdown,"aria-haspopup":"listbox",role:"combobox","aria-controls":"".concat(n,"-listbox"),autoComplete:"off"}),E.length>0&&d().createElement("button",{type:"button",onClick:T,disabled:v||x,className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 hover:text-gray-600 cursor-pointer bg-transparent border-none p-0 disabled:cursor-not-allowed disabled:opacity-50","aria-label":(0,p.__)("Toggle dropdown","nggallery"),tabIndex:-1},d().createElement(t.D3,{className:"w-full h-full"})),d().createElement("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only"},N.showDropdown&&N.isSearching&&P.length>0&&(0,p.sprintf)((0,p.__)("%d results found","nggallery"),P.length),N.showDropdown&&N.isSearching&&0===P.length&&(0,p.__)("No results found","nggallery")),N.showDropdown&&P.length>0&&d().createElement("div",{ref:O,id:"".concat(n,"-listbox"),role:"listbox",className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto text-gray-900"},P.map(function(e,t){var n=e.value===a,r=t===N.highlightedIndex;return d().createElement("div",{key:e.value,"data-index":t,role:"option","aria-selected":n,className:"w-full text-left text-sm px-4 py-2 cursor-pointer transition-colors ".concat(n?"bg-green-50 text-green-900 font-medium":r?"bg-gray-100":"hover:bg-gray-100"),onMouseEnter:function(){k({type:"SET_IS_KEYBOARD_NAV",payload:!1}),k({type:"SET_HIGHLIGHTED_INDEX",payload:t})},onMouseDown:function(t){t.preventDefault(),D(e.value)}},e.label)})),N.showDropdown&&N.isSearching&&N.searchTerm&&0===P.length&&d().createElement("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg px-4 py-3 text-gray-500 text-sm"},(0,p.sprintf)((0,p.__)('No results found for "%s"',"nggallery"),N.searchTerm))))};var br=a(1648);const wr=function(e){var t=e.isOpen,n=e.children,r=e.zIndex,a=void 0===r?15e4:r;return(0,u.useEffect)(function(){return document.body.style.overflow=t?"hidden":"unset",function(){document.body.style.overflow="unset"}},[t]),t?(0,zn.createPortal)(d().createElement(Hn,null,d().createElement("div",{className:"imagely imagely-wrap imagely-wrap-block-modal-portal",style:{position:"fixed",inset:0,zIndex:a}},n)),document.body):null};function xr(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var c=r&&r.prototype instanceof l?r:l,s=Object.create(c.prototype);return Er(s,"_invoke",function(n,r,a){var o,l,c,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:g,f:g.bind(e,4),d:function(t,n){return o=t,l=0,c=e,m.n=n,i}};function g(n,r){for(l=n,c=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,o=u[t],g=m.p,f=o[2];n>3?(a=f===r)&&(c=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=g&&((a=n<2&&g<o[1])?(l=0,m.v=r,m.n=o[1]):g<f&&(a=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,f){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&g(u,f),l=u,c=f;(t=l<2?e:c)||!d;){o||(l?l<3?(l>1&&(m.n=-1),g(l,c)):m.n=c:m.v=c);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(d=m.n<0)?c:n.call(r,m))!==i)break}catch(t){o=e,l=1,c=t}finally{s=1}}return{value:t,done:d}}}(n,a,o),!0),s}var i={};function l(){}function c(){}function s(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Er(t={},r,function(){return this}),t),d=s.prototype=l.prototype=Object.create(u);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Er(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Er(d,"constructor",s),Er(s,"constructor",c),c.displayName="GeneratorFunction",Er(s,a,"GeneratorFunction"),Er(d),Er(d,a,"Generator"),Er(d,r,function(){return this}),Er(d,"toString",function(){return"[object Generator]"}),(xr=function(){return{w:o,m}})()}function Er(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Er=function(e,t,n,r){function o(t,n){Er(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Er(e,t,n,r)}const _r=function(e){var t=e.content,n=e.onInsertShortcode,a=e.blockId,o=(0,r.useState)("gallery"),u=(0,c.A)(o,2),d=u[0],f=u[1],h=(0,r.useState)(!1),y=(0,c.A)(h,2),v=y[0],b=y[1],w=(0,r.useState)("selection"),x=(0,c.A)(w,2),E=x[0],C=x[1],N=(0,r.useState)(!1),k=(0,c.A)(N,2),O=k[0],A=k[1],S=(0,r.useState)(!1),j=(0,c.A)(S,2),P=j[0],T=j[1],I=(0,r.useState)(!1),D=(0,c.A)(I,2),L=D[0],R=D[1],F=(0,r.useState)(!1),M=(0,c.A)(F,2),G=M[0],Q=M[1],B=(0,r.useState)(!1),q=(0,c.A)(B,2),U=q[0],H=q[1],z=(0,r.useState)(null),K=(0,c.A)(z,2),V=K[0],X=K[1],Y=(0,r.useState)([]),Z=(0,c.A)(Y,2),J=Z[0],$=Z[1],ee=(0,r.useState)([]),te=(0,c.A)(ee,2),ne=te[0],re=te[1],ae=(0,r.useState)(null),oe=(0,c.A)(ae,2),ie=oe[0],le=oe[1],ce=(0,r.useState)(null),se=(0,c.A)(ce,2),ue=se[0],de=se[1],me=(0,r.useState)(null),ge=(0,c.A)(me,2),fe=ge[0],pe=ge[1],he=(0,g.useSelect)(function(e){try{var t,n=e(m.EF);return{isPageLoading:(null==n||null===(t=n.getPageLoading)||void 0===t?void 0:t.call(n))||!1}}catch(e){return{isPageLoading:!1}}},[]),ye=he.isPageLoading,ve=(0,r.useCallback)(function(e){"gallery"===d?$(function(t){return t.some(function(t){return t.id===e})?t:[{id:e,galleryTitle:"#".concat(e)}].concat((0,l.A)(t))}):re(function(t){return t.some(function(t){return t.id===e})?t:[{id:e,albumTitle:"#".concat(e)}].concat((0,l.A)(t))})},[d]),be=(0,r.useCallback)(function(e){e!==d&&(f(e),le(null),de(null),X(null),b(!0),C("selection"),n(""))},[d,n]),we=(0,r.useCallback)((0,i.A)(xr().m(function e(){var t,n,r,a,o,i,l,c,s=arguments;return xr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n="gallery"===(t=d)?J:ne,s.length>0&&void 0!==s[0]&&s[0]||!(n.length>0)){e.n=1;break}return e.a(2);case 1:return e.p=1,Q(!0),X(null),a=null===(r=window.add_ngg_gallery_block_i18n)||void 0===r?void 0:r.restNonce,o="gallery"===t?"galleries":"albums",i="gallery"===t?"galleryTitle":"albumTitle",e.n=2,_()({path:"/imagely/v1/".concat(o,"?per_page=999&_fields=id,").concat(i,",thumbnail,count"),method:"GET",headers:{"X-WP-Nonce":a}});case 2:l=e.v,t===d&&("gallery"===t?$(Array.isArray(l)?l:[]):re(Array.isArray(l)?l:[]),Q(!1)),e.n=4;break;case 3:e.p=3,c=e.v,console.error("Failed to load ".concat("gallery"===t?"galleries":"albums",":"),c),t===d&&(X((0,p.sprintf)((0,p.__)("Unable to load %s. Please refresh the page.","nggallery"),"gallery"===t?(0,p.__)("galleries","nggallery"):(0,p.__)("albums","nggallery"))),Q(!1));case 4:return e.a(2)}},e,null,[[1,3]])})),[d,J,ne]),xe=(0,r.useCallback)(function(){var e=(0,i.A)(xr().m(function e(t,n){var r,a,o,i,l,c,s;return xr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,H(!0),X(null),a=null===(r=window.add_ngg_gallery_block_i18n)||void 0===r?void 0:r.restNonce,o="gallery"===n?"galleries":"albums",i="gallery"===n?"title":"name",e.n=1,_()({path:"/imagely/v1/".concat(o,"/").concat(t,"?_fields=id,").concat(i,",previewpic_url,counter"),method:"GET",headers:{"X-WP-Nonce":a}});case 1:l=e.v,d===n&&ie===t&&(c={id:l.id,galleryTitle:"gallery"===n?l.title:void 0,albumTitle:"album"===n?l.name:void 0,thumbnail:l.previewpic_url||"",count:l.counter||0},de(c),H(!1)),e.n=3;break;case 2:e.p=2,s=e.v,console.error("Failed to fetch ".concat(n,":"),s),d===n&&(X((0,p.sprintf)((0,p.__)("Unable to load %s details.","nggallery"),n)),H(!1));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t,n){return e.apply(this,arguments)}}(),[d,ie]);(0,r.useEffect)(function(){we()},[d,we]);var Ee=(0,r.useCallback)(function(e){if(!e)return{mode:"gallery",id:null};try{var t=e.toString(),n=t.match(/\[imagely\s+album\s*=\s*["']?(\d+)/i);if(n&&n[1])return{mode:"album",id:parseInt(n[1],10)};var r=t.match(/\[imagely\s+id\s*=\s*["']?(\d+)/i);if(r&&r[1])return{mode:"gallery",id:parseInt(r[1],10)}}catch(e){console.error("Failed to extract from content:",e)}return{mode:"gallery",id:null}},[]);(0,r.useEffect)(function(){if(!v){if(!t)return C("selection"),void de(null);var e=Ee(t),n=e.mode,r=e.id;"selection"!==E?(f(n),r?(le(r),xe(r,n),C("preview")):(C("selection"),de(null))):r&&null===ie&&(f(n),le(r),xe(r,n),C("preview"))}},[t,Ee,v,xe,E,ie]),(0,r.useEffect)(function(){v&&t&&Ee(t).mode===d&&b(!1)},[t,d,v,Ee]);var _e=(0,r.useCallback)(function(){("gallery"===d?(0,br.HN)():(0,br.jP)())?A(!0):R(!0)},[d]),Ce=function(){return A(!1)},Ne=(0,r.useCallback)(function(e){pe(e||null),T(!0)},[ie]),ke=function(){T(!1),pe(null)},Oe=(0,r.useCallback)(function(e){Ce(),ve(e),le(e),Ne(e),we(!0)},[ve,Ne,we]),Ae=(0,r.useCallback)(function(e){var t="string"==typeof e?parseInt(e,10):e,n=t&&!isNaN(t)?t:null;le(n),pe(null)},[]),Se=(0,r.useCallback)(function(){if(ie){b(!1);var e="gallery"===d?'[imagely id="'.concat(ie,'"]'):'[imagely album="'.concat(ie,'"]');n(e),xe(ie,d),C("preview")}},[ie,d,n,xe]),je=(0,r.useCallback)(function(){C("selection"),de(null)},[]),Pe=(0,r.useCallback)(function(e){ve(e),le(e);var t="gallery"===d?'[imagely id="'.concat(e,'"]'):'[imagely album="'.concat(e,'"]');n(t),xe(e,d),C("preview"),we(!0)},[ve,d,n,xe,we]),Te="gallery"===d?J:ne,Ie="gallery"===d?(0,p.__)("Gallery","nggallery"):(0,p.__)("Album","nggallery"),De=Ie.toLowerCase(),Le=Te.map(function(e){return{value:e.id,label:"gallery"===d?e.galleryTitle||"#".concat(e.id):e.albumTitle||"#".concat(e.id)}});return React.createElement("div",{className:"imagely-wrap imagely-wrap-block",style:{margin:"0 !important"}},React.createElement(wr,{isOpen:L},React.createElement($t,{isOpen:L,onClose:function(){return R(!1)},action:"create new ".concat("gallery"===d?"galleries":"albums")})),"gallery"===d&&React.createElement(wr,{isOpen:O},React.createElement(Ht,{isOpen:O,onClose:Ce,onGalleryCreated:Oe})),"album"===d&&React.createElement(wr,{isOpen:O},React.createElement(W,{isOpen:O,onClose:Ce,onAlbumCreated:Oe})),"gallery"===d&&P&&React.createElement(mr,{galleryId:fe||ie,onInsertGallery:function(e){Pe(e),ke()},onClose:ke}),"album"===d&&P&&React.createElement(sr,{albumId:fe||ie,onInsertAlbum:function(e){Pe(e),ke()},onClose:ke}),React.createElement("div",{className:"bg-white rounded-md shadow-md min-h-[210px] flex justify-center items-center flex-wrap relative"},ye&&React.createElement("div",{className:"absolute inset-0 bg-white bg-opacity-90 flex items-center justify-center z-10 rounded-md"},React.createElement(s.A,{size:"lg",color:"green",text:(0,p.sprintf)((0,p.__)("Creating %s...","nggallery"),Ie),centerInContainer:!1})),React.createElement("h3",{className:"text-black text-2xl tracking-wide pt-0 pb-[17px] mb-[32px] mt-[17px] px-5 w-full border-b border-gray-200"},(0,p.__)("Imagely","nggallery")),"selection"===E&&React.createElement("div",{className:"flex justify-center border-b border-gray-200 w-full mx-[32px] mb-[32px]"},React.createElement("button",{type:"button",id:"block-".concat(a,"-tab-gallery"),className:"px-6 py-3 text-sm uppercase transition-colors rounded-t-md border-b-2 w-1/2 ".concat("gallery"===d?"text-gray-900 bg-gray-100 border-green-300":"text-gray-800 bg-transparent border-transparent hover:text-gray-900 hover:bg-gray-100 hover:border-gray-100"),onClick:function(){return be("gallery")},"aria-label":(0,p.__)("Switch to Gallery mode","nggallery")},(0,p.__)("Gallery","nggallery")," (",J.length,")"),React.createElement("button",{type:"button",id:"block-".concat(a,"-tab-album"),className:"px-6 py-3 text-sm uppercase transition-colors rounded-t-md border-b-2 w-1/2 ".concat("album"===d?"text-gray-900 bg-gray-100 border-green-300":"text-gray-800 bg-transparent border-transparent hover:text-gray-900 hover:bg-gray-100 hover:border-gray-100"),onClick:function(){return be("album")},"aria-label":(0,p.__)("Switch to Album mode","nggallery")},(0,p.__)("Album","nggallery")," (",ne.length,")")),V&&React.createElement("div",{className:"bg-red-50 border border-red-200 text-red-800 px-4 py-3 rounded w-full mx-[32px] mb-4"},React.createElement("p",null,V)),"selection"===E&&React.createElement(React.Fragment,null,React.createElement("div",{className:"w-full mx-[32px] mb-[32px]"},React.createElement("div",{className:"flex gap-2 items-start"},React.createElement(vr,{id:"block-".concat(a,"-search-input"),name:"imagely-".concat(d,"-select"),value:ie,onChange:Ae,options:Le,placeholder:(0,p.sprintf)((0,p.__)("Select %s","nggallery"),Ie),className:"flex-1",isLoading:G}),React.createElement("button",{type:"button",id:"block-".concat(a,"-create-new-btn"),className:"text-sm text-green-600 hover:text-green-700 bg-transparent border-none shadow-none py-2 px-2 text-center cursor-pointer transition-colors whitespace-nowrap flex items-center gap-1",onClick:_e,"aria-label":(0,p.sprintf)((0,p.__)("Create %s","nggallery"),De)},React.createElement("span",{className:"text-lg leading-none"},"+"),(0,p.__)("Create New","nggallery")))),React.createElement("div",{className:"w-full text-center mb-[32px] flex justify-center gap-4"},React.createElement("button",{type:"button",id:"block-".concat(a,"-insert-btn"),disabled:!ie,className:"text-sm tracking-[1.2px] leading-5 border-none shadow-sm py-3 px-6 rounded-md uppercase text-center transition-colors relative z-0 ".concat(ie?"text-white bg-green-600 hover:bg-green-700 cursor-pointer":"text-gray-400 bg-gray-100 cursor-not-allowed"),onClick:Se,"aria-label":(0,p.sprintf)((0,p.__)("Insert selected %s","nggallery"),De)},(0,p.__)("Insert","nggallery")),React.createElement("button",{type:"button",id:"block-".concat(a,"-edit-btn"),disabled:!ie,className:"text-sm tracking-[1.2px] leading-5 shadow-sm py-3 px-6 rounded-md uppercase text-center transition-colors relative z-0 ".concat(ie?"text-gray-700 bg-white hover:bg-gray-50 cursor-pointer border border-black":"text-gray-400 bg-gray-100 cursor-not-allowed border-none"),onClick:function(){return ie&&Ne()},"aria-label":(0,p.sprintf)((0,p.__)("Edit selected %s","nggallery"),De)},(0,p.__)("Edit","nggallery")))),"preview"===E&&React.createElement(React.Fragment,null,U?React.createElement("div",{className:"w-full flex justify-center items-center py-12"},React.createElement(s.A,{size:"lg",color:"green",text:(0,p.__)("Loading...","nggallery"),centerInContainer:!1})):ue?React.createElement(React.Fragment,null,React.createElement("div",{className:"w-full mx-[32px] mb-[24px] flex flex-col items-center"},React.createElement("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm hover:shadow-md transition-shadow cursor-pointer flex items-center p-4 gap-4 max-w-[500px] w-full",onClick:function(){return Ne()},role:"button",tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ne())},"aria-label":(0,p.sprintf)((0,p.__)("Click to edit %s","nggallery"),De)},ue.thumbnail?React.createElement("div",{className:"flex-shrink-0 w-24 h-24 bg-gray-50 rounded-md overflow-hidden"},React.createElement("img",{src:ue.thumbnail,alt:"gallery"===d?ue.galleryTitle:ue.albumTitle,className:"w-full h-full object-cover"})):React.createElement("div",{className:"flex-shrink-0 w-24 h-24 bg-gray-100 rounded-md flex items-center justify-center"},React.createElement("span",{className:"text-gray-400 text-xs"},(0,p.__)("No preview","nggallery"))),React.createElement("div",{className:"flex-1 min-w-0"},React.createElement("h4",{className:"text-xl font-semibold text-gray-900 mb-1 truncate",title:"gallery"===d?ue.galleryTitle:ue.albumTitle},"gallery"===d?ue.galleryTitle:ue.albumTitle),React.createElement("p",{className:"text-gray-600 text-sm"},"gallery"===d?(0,p.sprintf)((0,p.__)("%d images","nggallery"),ue.count||0):(0,p.sprintf)((0,p.__)("%d galleries","nggallery"),ue.count||0))))),React.createElement("div",{className:"w-full text-center mb-[32px] flex justify-center"},React.createElement("button",{type:"button",id:"block-".concat(a,"-change-btn"),className:"text-sm tracking-[1.2px] leading-5 border border-gray-300 shadow-sm py-3 px-6 rounded-md uppercase text-center transition-colors relative z-0 text-gray-700 bg-white hover:bg-gray-50 cursor-pointer",onClick:je,"aria-label":(0,p.sprintf)((0,p.__)("Change %s","nggallery"),De)},(0,p.__)("Change","nggallery")))):null)))};function Cr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nr(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Cr(Object(r),!0).forEach(function(n){(0,e.A)(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var kr={icon:React.createElement(t.ic,null),edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.clientId;return React.createElement(_r,{content:t.content||"",onInsertShortcode:function(e){return n({content:e})},blockId:r})},save:function(e){var t=e.attributes;return React.createElement(r.RawHTML,null,t.content||"")}};(0,o.addFilter)("blocks.registerBlockType","imagely/main-block/restore-settings",function(e,t){return"imagely/main-block"===t?Nr(Nr({},e),{},{apiVersion:3}):e},99),(0,n.registerBlockType)("imagely/main-block",kr)})()})();
dvadf
dvadf
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.15 |
proxy
|
phpinfo
|
Settings