PageSourceSearch

https://www.a1.bg/_next/static/chunks/873-8be0296245a52e0a.js

js a1.bg collected 2026-09-24 09:12:04 UTC 76,707 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{82721:function(e,t,n){n.d(t,{Z:function(){return tm}});var o,r,l=n(26042),i=n(69396),a=n(99534),s=n(85893),c=n(67294),u=n(48797),d=function(){return(0,c.useContext)(u.i)},p=function(e){var t=e.code,n=e.cb,o=e.ctrl,r=void 0!==o&&o,l=e.shift,i=void 0!==l&&l,a=d().sidebarType,s=(0,c.useRef)(n);(0,c.useLayoutEffect)(function(){s.current=n});var u=(0,c.useCallback)(function(e){var n=e.keyCode,o=e.repeat,l=e.ctrlKey,c=e.shiftKey;if(!o&&n===t){if(r&&!l||i&&!c)return!1;var u=l&&c&&n===f.x,d=l&&(n===f.ArrowUp||n===f.ArrowDown);(!a||u||d)&&(e.preventDefault(),s.current(e))}},[t,r,i,a]);(0,c.useEffect)(function(){return window.addEventListener("keydown",u),function(){return window.removeEventListener("keydown",u)}},[u,a])},f={ArrowUp:38,ArrowDown:40,q:81,d:68,m:77,x:88,c:67,v:86,z:90,y:89},m=function(){var e=d(),t=e.moveComponentUp,n=e.moveSelectionUp,o=e.moveComponentDown,r=e.moveSelectionDown,l=e.showAddComponent,i=e.deleteComponent,a=e.showEditProps,c=e.closeAll,u=e.copyJson,m=e.pasteJson,h=e.undo,x=e.redo;return p({code:f.ArrowUp,cb:function(e){var o=e.shiftKey,r=e.ctrlKey;o?t():n(!!r)}
1}),p({code:f.ArrowDown,cb:function(e){var t=e.shiftKey,n=e.ctrlKey;t?o():r(!!n)}}),p({code:f.q,cb:function(){return l()},ctrl:!0}),p({code:f.d,cb:function(){return i()},ctrl:!0}),p({code:f.m,cb:function(){return a()},ctrl:!0}),p({code:f.x,cb:function(){return c()},ctrl:!0}),p({code:f.c,cb:function(){return u()},ctrl:!0,shift:!0}),p({code:f.v,cb:function(){return m()},ctrl:!0,shift:!0}),p({code:f.z,cb:function(){return h()},ctrl:!0}),p({code:f.y,cb:function(){return x()},ctrl:!0}),(0,s.jsx)(s.Fragment,{})},h=n(828),x=function(){var e=(0,h.Z)((0,c.useState)({width:void 0,height:void 0}),2),t=e[0],n=e[1];return(0,c.useEffect)(function(){var e=function(){n({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",e),e(),function(){window.removeEventListener("resize",e)}},[]),t},v=function(e){var t=e.aroundObj,n=e.componentWidth,o=void 0===n?0:n,r=null==window?void 0:window.innerWidth,l=t.top,i=void 0===l?0:l,a=t.left,s=void 0===a?0:a;return t.width,t.height,{leftPos:s+o+10<r?s+10:s-o-10,topPos:i>47?i-47:i+27}},b=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 10-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})})},g=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6 ".concat(t),children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"})})},j=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{d:"M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z"})})},w=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2.5"}),(0,s.jsx)("path",{d:"M5 15a2 2 0 01-2-2V6a2 2 0 012-2h7a2 2 0 012 2"}),(0,s.jsx)("text",{x:"14.5",y:"18.4",textAnchor:"middle",fontSize:"11",fontWeight:"700",fill:"currentColor",stroke:"none",fontFamily:"sans-serif",children:"C"})]})},y=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("path",{d:"M7 3.5H4.5A1.5 1.5 0 003 5v11A1.5 1.5 0 004.5 17.5h4"}),(0,s.jsx)("path",{d:"M13 3.5h1.5A1.5 1.5 0 0116 5v3.5"}),(0,s.jsx)("rect",{x:"7",y:"1.5",width:"6",height:"4",rx:"1.5"}),(0,s.jsx)("rect",{x:"10",y:"10",width:"13",height:"13",rx:"3"}),(0,s.jsx)("text",{x:"16.5",y:"20.6",textAnchor:"middle",fontSize:"12",fontWeight:"700",fill:"currentColor",stroke:"none",fontFamily:"sans-serif",children:"P"})]})},C=function(e){var t=e.className,n=e.onClick;return(0,s.jsx)("svg",{onClick:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})})},N=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",clipRule:"evenodd"})})},k=n(9034);function Z(e){var t=e.content,n=e.icon,o=e.placement,r=e.mouseLeaveFn,l=(0,h.Z)(c.useState(null),2),i=l[0],a=l[1],u=Boolean(i),d=u?"simple-popper":void 0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{"aria-describedby":d,type:"button",onMouseEnter:function(e){a(i?null:e.currentTarget)},onMouseLeave:function(){a(null),r&&r()},children:n||(0,s.jsx)("i",{className:"ico info size-28"})}),(0,s.jsx)(k.Z,{id:d,open:u,anchorEl:i,placement:void 0===o?"top":o,children:(0,s.jsx)("div",{className:"z-20 max-w-xs rounded bg-black p-2 text-xs text-white",children:t})})]})}var S=function(e){var t=e.children,n=e.onClick,o=e.className;return(0,s.jsx)("div",{className:"flex p-1 cursor-pointer items-center justify-center rounded-lg border-2 border-slate-800 transition-colors hover:brightness-95 ".concat(o),onClick:n,children:t})},I=function(e){var t,n=e.compPosition,o=n.top,r=n.left,l=n.width,i=n.height,a=d(),u=a.deleteComponent,p=a.canModifyComponent,f=a.showAddComponent,m=a.showEditProps,x=a.copyJson,k=a.canPasteComponent,I=a.pasteJson,P=a.closeAll,L=(a.selectedId,a.moveComponentUp),M=a.moveComponentDown,D=a.selectedComponentData,T=null==D?void 0:D.component,A=(null==T?void 0:T.parent)?T.parent.children:null,O=null!==(t=null==A?void 0:A.length)&&void 0!==t?t:0,E=!!T&&T.index>0,V=!!T&&T.index<O-1,z=v({aroundObj:{top:o,left:r,width:l,height:i},componentWidth:312}),R=z.leftPos,F=z.topPos,B=(0,h.Z)((0,c.useState)(!1),2),G=B[0],H=B[1];return(0,s.jsxs)("div",{className:"absolute z-50 flex items-center gap-1.5 rounded-xl border border-slate-300 bg-white/95 p-1.5 shadow-lg backdrop-blur",style:{left:R,top:F},children:[p()&&(0,s.jsx)(Z,{placement:"top",content:"Ctrl+D",icon:(0,s.jsx)(S,{onClick:u,className:"bg-red-500 mr-6",children:(0,s.jsx)(b,{className:" text-white"})})}),(0,s.jsx)(Z,{placement:"top",content:"Ctrl+Q",icon:(0,s.jsx)(S,{onClick:function(){return f()},className:"bg-green-500",children:(0,s.jsx)(g,{className:" text-white"})})}),p()&&(0,s.jsx)(Z,{placement:"top",content:"Ctrl+M",icon:(0,s.jsx)(S,{onClick:m,className:"bg-white",children:(0,s.jsx)(j,{className:" text-orange-800"})})}),p()&&(0,s.jsx)(Z,{placement:"top",mouseLeaveFn:function(){H(!1)},content:G?"copied!":"Ctrl+Shift+C",icon:(0,s.jsx)(S,{onClick:function(){x(),H(!0)},className:"bg-white",children:(0,s.jsx)(w,{className:""})})}),k()&&(0,s.jsx)(Z,{placement:"top",content:"Ctrl+Shift+V",icon:(0,s.jsx)(S,{onClick:function(){return I()},className:"bg-white",children:(0,s.jsx)(y,{className:""})})}),(0,s.jsxs)("div",{className:"flex h-9 flex-col overflow-hidden rounded-lg border-2 border-slate-800 bg-white",children:[(0,s.jsx)(C,{className:"h-4 w-7 border-b border-black ".concat(E?"cursor-pointer hover:bg-slate-200":"cursor-not-allowed opacity-30"),onClick:E?L:void 0}),(0,s.jsx)(C,{className:"h-4 w-7 rotate-180 ".concat(V?"cursor-pointer hover:bg-slate-200":"cursor-not-allowed opacity-30"),onClick:V?M:void 0})]}),(0,s.jsx)(Z,{placement:"top",content:"Ctrl+X",icon:(0,s.jsx)(S,{onClick:P,className:"bg-white",children:(0,s.jsx)(N,{className:""})})})]})},P=function(e){var t,n,o,r=e.selectedComponentData,l=e.index,i=e.containerRef,a=d(),u=a.showControls,p=a.getRef,f=a.mustRefresh,m=(0,h.Z)((0,c.useState)(!1),2),v=m[0],b=m[1];(0,c.useEffect)(function(){b(!1)},[r]),x();var g=(0,c.useMemo)(function(){return p(null==r?void 0:r.component.id)},[r,p,f]);if(!r)return null;var j=r.dictionaryData;if(!(null==g?void 0:g.current))return null;var w=g.current.getBoundingClientRect(),y=null==i?void 0:null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect(),C=w.top-(null!==(n=null==y?void 0:y.top)&&void 0!==n?n:0),N=w.left-(null!==(o=null==y?void 0:y.left)&&void 0!==o?o:0),k=w.width,Z=w.height;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pointer-events-none absolute z-50 border-2 border-dashed border-slate-800",style:{width:k,height:Z,left:N,top:C}}),(0,s.jsx)("div",{className:"absolute z-50 flex cursor-pointer flex-row",style:{to
1p:C,left:N+1},children:!v&&(0,s.jsx)("div",{className:"flex",onClick:function(){return b(!0)},children:(0,s.jsx)("div",{className:"bg-slate-800/80 p-1 text-white text-sm",children:null==j?void 0:j.label})})}),u&&0===(void 0===l?0:l)&&(0,s.jsx)(I,{compPosition:{top:C,left:N,width:k,height:Z}})]})},L=n(14924),M=n(47568),D=n(97582),T=n(12891),A=n(58540),O=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),(0,s.jsx)("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsxs)("g",{id:"SVGRepo_iconCarrier",children:[" ",(0,s.jsx)("path",{d:"M12 20V8M12 8L15 11M12 8L9 11M5 4H19",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})," "]})]})},E=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})})},V=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),(0,s.jsx)("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsxs)("g",{id:"SVGRepo_iconCarrier",children:[" ",(0,s.jsx)("path",{d:"M12 4V16M12 16L15 13M12 16L9 13M5 20H19",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})," "]})]})},z=n(59908),R=function(e){var t=e.position,n=e.setPosition,o=e.type,r=e.text,l=e.icon;return(0,s.jsxs)("button",{type:"button","aria-pressed":t===o,"aria-label":r,className:"flex cursor-pointer rounded-xl border-2 border-transparent p-3 text-white ".concat(t===o?"!border-white bg-green-500":"bg-green-700"),onClick:function(){return n(o)},children:[l&&(0,s.jsx)("span",{"aria-hidden":"true",children:l}),r]})},F=n(60539),B=n(92453),G=function(e){var t=e.canPaste,n=d().pasteJson,o=(0,h.Z)((0,c.useState)(null),2),r=o[0],l=o[1];(0,c.useEffect)(function(){var e;(e=(0,M.Z)(function(){var e,t;return(0,D.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,F.I)({url:"custom-components?CurrentPage=1&PerPage=100&Type=template&SortBy=id&SortOrder=ASC",readMode:!1})];case 1:return l(null==(t=n.sent())?void 0:null===(e=t.data)||void 0===e?void 0:e.items),[2]}})}),function(){return e.apply(this,arguments)})()},[]);var i=(0,h.Z)((0,c.useState)(null),2),a=i[0],u=i[1];return t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-4 gap-2 overflow-auto px-1",children:null==r?void 0:r.map(function(e){return(0,s.jsx)("button",{type:"button",className:"flex  rounded-xl border-2 border-transparent p-3 text-white ".concat(a===e.id?"!border-white bg-green-500":"bg-green-700"),onClick:function(){u(e.id)},children:e.name},e.id)})}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",disabled:!a,className:"mx-auto mt-3 block rounded-xl border-2 border-white bg-slate-800 p-3 text-white hover:bg-slate-600",onClick:function(){a&&fetch("".concat(z.X.apiCmsClient,"custom-components?id=").concat(a)).then(function(e){return e.json()}).then(function(e){n({component:e.components[0]})})},children:a?B.p.common.add:B.p.addComponent.selectTemplate})})]}):(0,s.jsx)("p",{children:B.p.addComponent.cannotInsert})},H=function(){return(0,s.jsx)("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent text-white"})};n(18446);var W=function(e){var t=e.children,n=e.colMode;return(0,s.jsx)("li",{className:"my-1 flex ".concat(n?"flex-col":"items-center"," justify-between gap-1"),children:t})},_=function(e){var t=e.name,n=e.label,o=e.value,r=e.componentId,l=e.onChange,i=d().editProps;return(0,s.jsxs)(W,{children:[(0,s.jsx)("input",{id:t,className:"h-5 w-5 rounded mt-1",name:t,onChange:function(e){l?l(e):i({key:t,value:!o,id:r})},type:"checkbox",checked:o}),(0,s.jsx)("label",{className:"text-white w-full",htmlFor:n,children:n})]})},K=n(36305),J=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{d:"M7 10l5 5 5-5z"})})},X=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{d:"M19.2991685,16.6083218 C19.6856193,16.6083218 19.9988997,16.9198596 19.9988997,17.3041609 C19.9988997,17.6884622 19.6856193,18 19.2991685,18 L0.703295369,18 C0.316844509,18 0.00356418865,17.6884622 0.00356418865,17.3041609 C0.00356418865,16.9198596 0.316844509,16.6083218 0.703295369,16.6083218 L19.2991685,16.6083218 Z M15.9807574,6.49203255 C16.2524994,6.22029048 16.6943126,6.22152264 16.9675746,6.49478466 L16.9675746,6.49478466 L19.7949155,9.32212559 C20.0681775,9.59538762 20.0694097,10.0372007 19.7976676,10.3089428 L19.7976676,10.3089428 L16.9860531,13.1205574 C16.714311,13.3922994 16.2724979,13.3910673 15.9992359,13.1178052 C15.7259738,12.8445432 15.7247417,12.4027301 15.9964837,12.130988 L15.9964837,12.130988 L18.3160657,9.81140603 L15.9835095,7.47884976 C15.7102475,7.20558773 15.7090153,6.76377462 15.9807574,6.49203255 Z M14.8173201,9.13100315 C15.2037709,9.13100315 15.5170512,9.44254093 15.5170512,9.82684226 C15.5170512,10.2111436 15.2037709,10.5226814 14.8173201,10.5226814 L0.699731181,10.5226814 C0.313280321,10.5226814 0,10.2111436 0,9.82684226 C0,9.44254093 0.313280321,9.13100315 0.699731181,9.13100315 L14.8173201,9.13100315 Z M19.2991685,2 C19.6856193,2 19.9988997,2.31153778 19.9988997,2.6958391 C19.9988997,3.08014043 19.6856193,3.3916782 19.2991685,3.3916782 L0.703295369,3.3916782 C0.316844509,3.3916782 0.00356418865,3.08014043 0.00356418865,2.6958391 C0.00356418865,2.31153778 0.316844509,2 0.703295369,2 L19.2991685,2 Z"})})},U=n(80859),q=n(77300),Y=n(79926),Q=function(e){var t,n,o,r,a,c=e.resKey,u=e.resLabel,p=e.propValues,f=e.styleProp,m=e.propName,x=e.componentId,v=d().editProps,b=(null!==(a=U.PI[f])&&void 0!==a?a:{}).category,g=null===(t=q.rS[b])||void 0===t?void 0:t.values,j=null===(n=q.rS[b])||void 0===n?void 0:n.labelType,w=p?null===(o=p[f])||void 0===o?void 0:o[c]:"",y=function(e){return b===U.Oh.colors||b===U.Oh.bgColor?"!bg-".concat(e):b===U.Oh.textColor?"!text-".concat(e):""};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"ml-3 inline-block rounded-t-xl bg-white p-1 text-sm font-bold text-black",children:[u,":"]},c),(0,s.jsxs)("select",{className:"w-full rounded-xl border text-black ".concat(y(w)),onChange:function(e){var t=p||(0,L.Z)({},f,{}),n=(0,i.Z)((0,l.Z)({},t),(0,L.Z)({},f,(0,i.Z)((0,l.Z)({},t[f]),(0,L.Z)({},c,e.target.value))));v({key:m,value:""===e.target.value?(0,Y.Mb)(n)||{}:n,id:x})},children:[(0,s.jsx)("option",{value:"",label:B.p.common.select}),g&&(null===(r=Object.entries(g))||void 0===r?void 0:r.map(function(e,t){var n=(0,h.Z)(e,2),o=n[0],r=n[1],l=j===q.kO.class?o:j===q.kO.value?r:"".concat(o," (").concat(r,")");return(0,s.jsx)("option",{className:y(o),selected:w==o,label:l,value:o},t)}))]})]})},$="transition-transofm duration-300 ease-in-out",ee="transition-transofm duration-300 ease-in-out",et=function(e){var t,n=e.name,o=e.value,r=e.label,i=e.prop,a=e.componentId,u=(0,h.Z)((0,c.useState)(!1),2),d=u[0],p=u[1],f=(0,h.Z)((0,c.useState)([]),2),m=f[0],x=f[1],v=(0,h.Z)((0,c.useState)(!1),2),b=v[0],g=v[1],j=function(e,t){e.stopPropagation(),m.includes(t)?x(function(e){return e.filter(function(e){return e!==t})}):x(function(e){return(0,K.Z)(e).concat([t])})},w=o?Object.keys(o).filter(function(e){return Object.values(o[e]).find(function(e){return e.length>0})}):[];return(0,s.jsxs)("li",{className:"mb-3 flex flex-col justify-between text-white ",children:[(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:function(){p(!d)},"aria-expanded":d,className:"flex h-6 cursor-pointer items-center gap-1 font-bold",children:[r,(0,s.jsx)("div",{className:"flex items-center ".concat(ee," ").concat(d&&"rotate-180 "),children:(0,s.jsx)(J,{fontSize:"medium","aria-hidden":"true"})})]}),d&&(0,s.jsx)("button",{type:"button",className:"h-6 cursor-pointer",onClick:function(){x([]),g(function(e){return!e})},"aria-label":b?B.p.fields.closeAll:B.p.fields.openAll,children:b?(0,s.jsx)(N,{fontSize:"medium","aria-hidden":"true"}):(0,s.jsx)(X,{fontSize:"medium","aria-hidden":"true"})})]}),null==i?void 0:null===(t=i.options)||void 0===t?void 0:t.map(function(e,t){var r,i,c=null===(r=U.PI[e])||void 0===r?void 0:r.label,u=null==w?void 0:w.includes(e);if(!c)return null;var p=((null===(i=q.rS.screens.cms)||void 0===i?void 0:i.values)?Object.entries((0,l.Z)({default:"default"},q.rS.screens.cms.values)):[["default","default"],["md","768px"],["xl","1280px"]]).map(function(r){var l=(0,h.Z)(r,2),i=l[0],c=l[1];return(0,s.jsx)(Q,{resKey:i,resLabel:c,propValues:o,styleProp:e,propName:n,componentId:a},e+i+t)}),f=e+t;return(0,s.jsxs)("div",{className:"ITEM STYLES cursor-pointer overflow-hidden ".concat($," ").concat(d?"max-h-[100rem]":"max-h-0"),children:[(0,s.jsxs)("button",{type:"button","aria-expanded":m.includes(f)||b,onClick:function(e){return j(e,f)},className:"LABEL relative flex w-fit gap-1 pl-3",children:[u&&(0,s.jsx)("div",{className:"absolute bottom-0 left-0 top-0 z-20 my-auto",children:"*"}),(0,s.jsx)("p",{children:c}),(0,s.jsx)("div",{className:"flex items-center ".concat(ee," ").concat((m.includes(f)||b)&&"rotate-180 "),children:(0,s.jsx)(J,{fontSize:"medium","aria-hidden":"true"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 overflow-hidden  md:grid-cols-3 ".concat($," ").concat(m.includes(f)||b?"mb-3 max-h-[100rem]":"max-h-0"),children:p})]},f)})]})},en=n(4219),eo="custom",er=function(e){var t,n=e.resKey,o=e.resLabel,r=e.propValues,a=e.styleProp,c=e.propName,u=e.componentId,p=d().editProps,f=en.v[a],m=r?null===(t=r[a])||void 0===t?void 0:t[n]:void 0,h=function(e){var t=r||(0,L.Z)({},a,{});p({key:c,value:(0,i.Z)((0,l.Z)({},t),(0,L.Z)({},a,(0,i.Z)((0,l.Z)({},t[a]),(0,L.Z)({},n,e)))),id:u})};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"ml-3 inline-block rounded-t-xl bg-white p-1 text-sm font-bold text-black",children:[o,":"]},n),(0,s.jsxs)("select",{className:"w-full rounded-xl border text-black",onChange:function(e){var t=e.target.value;if(!t){h(void 0);return}h({preset:t,customValue:t===eo?null==m?void 0:m.customValue:void 0})},value:(null==m?void 0:m.preset)||"",children:[(0,s.jsx)("option",{value:"",label:B.p.common.select}),f&&(Array.isArray(f)?f.map(function(e){return(0,s.jsx)("option",{value:e,label:e},e)}):Object.keys(f).map(function(e){return(0,s.jsx)("option",{value:e,label:"".concat(e," (").concat(f[e],")")},e)})),(0,s.jsx)("option",{value:eo,label:B.p.fields.customValue})]}),(null==m?void 0:m.preset)===eo&&(0,s.jsx)("input",{type:"text",className:"mt-1 w-full rounded-xl border p-1 text-black",placeholder:"напр. #ff0000, 18px, 1.2rem",value:(null==m?void 0:m.customValue)||"",onChange:function(e){h({preset:eo,customValue:e.target.value})}})]})},el="transition-transofm duration-300 ease-in-out",ei="transition-transofm duration-300 ease-in-out",ea=function(e){var t,n=e.name,o=e.value,r=e.label,i=e.prop,a=e.componentId,u=(0,h.Z)((0,c.useState)(!1),2),d=u[0],p=u[1],f=(0,h.Z)((0,c.useState)([]),2),m=f[0],x=f[1],v=(0,h.Z)((0,c.useState)(!1),2),b=v[0],g=v[1],j=function(e,t){e.stopPropagation(),m.includes(t)?x(function(e){return e.filter(function(e){return e!==t})}):x(function(e){return(0,K.Z)(e).concat([t])})},w=o?Object.keys(o).filter(function(e){return Object.values(o[e]).find(function(e){return(null==e?void 0:e.preset)||(null==e?void 0:e.customValue)})}):[];return(0,s.jsxs)("li",{className:"mb-3 flex flex-col justify-between text-white ",children:[(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:function(){p(!d)},"aria-expanded":d,className:"flex h-6 cursor-pointer items-center gap-1 font-bold",children:[r,(0,s.jsx)("div",{className:"flex items-center ".concat(ei," ").concat(d&&"rotate-180 "),children:(0,s.jsx)(J,{fontSize:"medium","aria-hidden":"true"})})]}),d&&(0,s.jsx)("button",{type:"button",className:"h-6 cursor-pointer",onClick:function(){x([]),g(function(e){return!e})},"aria-label":b?B.p.fields.closeAll:B.p.fields.openAll,children:b?(0,s.jsx)(N,{fontSize:"medium","aria-hidden":"true"}):(0,s.jsx)(X,{fontSize:"medium","aria-hidden":"true"})})]}),null==i?void 0:null===(t=i.options)||void 0===t?void 0:t.map(function(e,t){var r,i=e.replace(/([A-Z])/g," $1").toLowerCase(),c=null==w?void 0:w.includes(e),u=((null===(r=q.rS.screens.cms)||void 0===r?void 0:r.values)?Object.entries((0,l.Z)({default:"default"},q.rS.screens.cms.values)):[["default","default"],["md","768px"],["xl","1280px"]]).map(function(r){var l=(0,h.Z)(r,2),i=l[0],c=l[1];return(0,s.jsx)(er,{resKey:i,resLabel:c,propValues:o,styleProp:e,propName:n,componentId:a},e+i+t)}),p=e+t;return(0,s.jsxs)("div",{className:"ITEM STYLES cursor-pointer overflow-hidden ".concat(el," ").concat(d?"max-h-[100rem]":"max-h-0"),children:[(0,s.jsxs)("button",{type:"button","aria-expanded":m.includes(p)||b,onClick:function(e){return j(e,p)},className:"LABEL relative flex w-fit gap-1 pl-3",children:[c&&(0,s.jsx)("div",{className:"absolute bottom-0 left-0 top-0 z-20 my-auto",children:"*"}),(0,s.jsx)("p",{children:i}),(0,s.jsx)("div",{className:"flex items-center ".concat(ei," ").concat((m.includes(p)||b)&&"rotate-180 "),children:(0,s.jsx)(J,{fontSize:"medium","aria-hidden":"true"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 overflow-hidden  md:grid-cols-3 ".concat(el," ").concat(m.includes(p)||b?"mb-3 max-h-[100rem]":"max-h-0"),children:u})]},p)})]})},es=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=(0,h.Z)((0,c.useState)(e),2),o=n[0],r=n[1];return(0,c.useEffect)(function(){var n=setTimeout(function(){r(e)},t);return function(){clearTimeout(n)}},[e,t]),o}
1,ec=n(5152),eu=n.n(ec),ed=n(4111),ep=n(51438),ef=n(28668),em=n(26626),eh=n(55493),ex=function(e){var t=e.prefix,n=void 0===t?"":t,o=e.values,r=e.variation,a=void 0===r?eD.default:r,s=e.label;return o?Object.entries(o).reduce(function(e,t){var o=(0,h.Z)(t,2),r=o[0],c=o[1];return(0,i.Z)((0,l.Z)({},e),(0,L.Z)({},"".concat(a?"".concat(a,":"):"").concat(eM?"!":"").concat(n).concat(n?"-":"").concat(r),s===q.kO.class?r:q.kO.value?c:"".concat(r," - ").concat(c)))},{}):{}},ev=(o=(0,M.Z)(function(e){var t,n,o,r;return(0,D.__generator)(this,function(l){switch(l.label){case 0:(t=new FormData).append("file",e),n={},eh.LP&&(n.Authorization=(0,eh.LP)()),l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch("".concat(z.X.apiCmsEdit,"static-files"),{method:"POST",body:t,headers:n})];case 2:if(401===(o=l.sent()).status)throw Error(B.p.alerts.sessionRefresh);return[4,o.json()];case 3:if(null==(r=l.sent())?void 0:r.url)return[2,{ok:!0,url:r.url}];throw Error("missing url");case 4:return[2,{ok:!1,error:l.sent()}];case 5:return[2]}})}),function(e){return o.apply(this,arguments)}),eb=function(e,t){var n;return!e||(null===(n=e.classList)||void 0===n?void 0:n.contains(eT.root))?null:(Array.isArray(t)?t.includes(e.tagName):t===e.tagName)?e:eb(e.parentNode,t)},eg=function(e,t){if(null==e?void 0:e.classList){var n=!0,o=!1,r=void 0;try{for(var l,i=t[Symbol.iterator]();!(n=(l=i.next()).done);n=!0){var a=l.value;e.classList.contains(a)&&e.classList.remove(a)}}catch(s){o=!0,r=s}finally{try{n||null==i.return||i.return()}finally{if(o)throw r}}}},ej=function(e,t,n){if(e&&t.intersectsNode(e)&&(eg(e,n),e.childNodes)){var o=!0,r=!1,l=void 0;try{for(var i,a=Array.from(e.childNodes.values())[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var s=i.value;ej(s,t,n)}}catch(c){r=!0,l=c}finally{try{o||null==a.return||a.return()}finally{if(r)throw l}}}},ew=function(e,t,n,o){var r;ej(e,t,n),null===(r=e.classList)||void 0===r||r.add(o)},ey=function e(t){var n=t.name,o=t.icon,r=t.list,l=t.tooltip,i=t.childTemplateExtraClasses;(0,ep.Z)(this,e),(0,L.Z)(this,"defaultChildTempate",function(e){return function(t,n,o){return'<span class="'.concat(n," ").concat(e||"",'">').concat(o,"</span>")}}),this.name=n,this.icon=o,this.list=r,this.childTemplate=this.defaultChildTempate(void 0===i?null:i),this.tooltip=void 0===l?"":l},eC=function(e){(0,ef.Z)(n,e);var t=(0,em.Z)(n);function n(e){var o,r=e.name,l=e.icon,i=e.list,a=e.tooltip,s=e.childTemplateExtraClasses;return(0,ep.Z)(this,n),o=t.call(this,{name:r,icon:l,list:i,tooltip:a,childTemplateExtraClasses:s}),(0,L.Z)((0,ed.Z)(o),"exec",function(e,t,n){var r=n.control.name;if(o.list[r]){var l=e.selection.range;l&&(ej(l.commonAncestorContainer,l,Object.keys(o.list)),e.execCommand("applyclassname",!1,r))}}),o}return n}(ey),eN=function(e){(0,ef.Z)(n,e);var t=(0,em.Z)(n);function n(e){var o,r=e.name,l=e.icon,i=e.list;return(0,ep.Z)(this,n),o=t.call(this,{name:r,icon:l,list:i}),(0,L.Z)((0,ed.Z)(o),"exec",function(e,t,n){var o,r=n.control.name,l=eE[n.control.text];if(l){e.execCommand(l.command);var i=e.selection.range;if(i){var a=eb(i.startContainer,["UL","OL"]);a&&(null===(o=a.classList)||void 0===o||o.add(r))}}}),o}return n}(ey),ek=function(e){(0,ef.Z)(n,e);var t=(0,em.Z)(n);function n(e){var o,r=e.name,l=e.icon,i=e.list;return(0,ep.Z)(this,n),o=t.call(this,{name:r,icon:l,list:i,childTemplate:null}),(0,L.Z)((0,ed.Z)(o),"exec",function(e,t,n){var r=n.control.name;if(o.list[r]){var l=e.selection.range;if(l){var i=eb(l.startContainer,"TABLE");i&&ew(i,l,Object.keys(o.list),r)}}}),o}return n}(ey),eZ=function(e){(0,ef.Z)(n,e);var t=(0,em.Z)(n);function n(e){var o,r=e.name,l=e.icon,i=e.list,a=e.classesList;return(0,ep.Z)(this,n),o=t.call(this,{name:r,icon:l,list:i,childTemplate:null}),(0,L.Z)((0,ed.Z)(o),"exec",function(e,t,n){var r=n.control.name,l=e.selection.range;if(l&&r){var i=eb(l.startContainer,Object.values(o.list));if(i){var a=document.createElement(r),s=r!==eV.P?null===(u=Object.entries(o.classesList).find(function(e){var t=(0,h.Z)(e,2);return t[0],t[1]===r.toLowerCase()}))||void 0===u?void 0:u[0]:"".concat(eM?"!":"","text-base");ew(a,l,Object.keys(o.classesList),s);for(var c=0;c<i.childNodes.length;c++){var u,d,p=i.childNodes[c].cloneNode(!0);eg(p,Object.keys(o.classesList)),null===(d=p.classList)||void 0===d||d.add(s),a.appendChild(p)}i.parentNode.replaceChild(a,i)}}}),o.classesList=a,o}return n}
1(ey),eS=q.rS.fontFamily,eI=q.rS.colors,eP=q.rS.fontSize,eL=q.rS.listStyleType,eM=!0,eD={default:"",md:"md",xl:"xl"},eT={root:"jodit-wysiwyg",urlModalInput:"jodit-ui-input__input"},eA=eL.values,eO=(eA.none,(0,a.Z)(eA,["none"])),eE={disc:{command:"insertunorderedlist"},decimal:{command:"insertorderedlist"}},eV={H1:"H1",H2:"H2",H3:"H3",H4:"H4",H5:"H5",H6:"H6",P:"P"},ez={fontFamily:{name:"fontFamily",icon:"font",list:ex({prefix:"font",values:eS.values,label:q.kO.class})},fontSize:{name:"fontSize",icon:"fontsize",list:ex({prefix:"text",values:eP.values,label:q.kO.class}),tooltip:"font size"},fontSizeMd:{name:"fontSize".concat(eD.md),icon:"fontsize",list:ex({prefix:"text",values:eP.values,variation:eD.md,label:q.kO.class}),tooltip:"font size desktop"},textColor:{name:"textColor",icon:"pencil",list:ex({prefix:"text",values:eI.values,label:q.kO.class}),tooltip:"text color"},textColorMd:{name:"textColor".concat(eD.md),icon:"pencil",list:ex({prefix:"text",values:eI.values,variation:eD.md,label:q.kO.class}),tooltip:"text color desktop"},bgColor:{name:"bgColor",icon:"brush",list:ex({prefix:"bg",values:eI.values,label:q.kO.class}),childTemplateExtraClasses:"p-4 w-full"},alignTable:{name:"aling table",icon:"table",list:(r={},(0,L.Z)(r,"mr-auto","table left"),(0,L.Z)(r,"mx-auto","table center"),(0,L.Z)(r,"ml-auto","table right"),r)},heading:{name:"heading",icon:"paragraph",list:eV,classesList:ex({prefix:"text",values:eP.values,label:q.kO.class}),tooltip:"heading"},list:{name:"list",icon:"ul",list:ex({prefix:"list",values:eO,label:q.kO.class})},uploadFile:{name:"upload file",icon:"file",tooltip:"upload file",exec:function(e,t,n){var o=document.createElement("input");o.setAttribute("type","file"),o.click(),o.onchange=(0,M.Z)(function(){var t,n,r,l;return(0,D.__generator)(this,function(i){switch(i.label){case 0:if(!(t=o.files[0]))return[2];return[4,ev(t)];case 1:if((n=i.sent()).ok)return e.execCommand("openlinkdialog"),r=n.url.replace("/api/",""),l="".concat(z.X.apiCmsClient).concat(r),document.querySelector(".".concat(eT.urlModalInput)).value=l,[2];return alert(n.error),[2]}})})}}},eR=new eC(ez.fontFamily),eF=new eC(ez.fontSize),eB=new eC(ez.fontSizeMd),eG=new eC(ez.textColor),eH=new eC(ez.textColorMd),eW=new eC(ez.bgColor),e_=new eN(ez.list),eK=new ek(ez.alignTable),eJ=["bold","italic",eF,eR,eG,eW,e_,new eZ(ez.heading),"link","align",eK,"indent","outdent","fullsize","image","undo","redo","|",eB,eH,"|",ez.uploadFile,"source"],eX={readonly:!1,buttonsXS:eJ,buttonsSM:eJ,buttonsMD:eJ,commandToHotkeys:{undo:["ctrl+z","ctrl+з","ctrl+ю"],redo:["ctrl+y","ctrl+ъ","ctrl+щ"]},editHTMLDocumentMode:!0,removeButtons:[],hidePoweredByJodit:!0,placeholder:"Start typing..."},eU=eu()(function(){return Promise.all([n.e(326),n.e(911)]).then(n.t.bind(n,72911,23))},{loadableGenerated:{webpack:function(){return[72911]}},ssr:!1}),eq=function(e){var t=e.onSave,n=e.initialHtml,o=(0,h.Z)((0,c.useState)(n||""),2),r=o[0],l=o[1];return(0,s.jsx)(eU,{value:r,config:eX,tabIndex:1,onBlur:function(e){return l(e)},onChange:t})},eY=function(e){var t=e.label,n=e.name,o=e.value,r=e.componentId,l=d().editProps,i=(0,h.Z)((0,c.useState)(null),2),a=i[0],u=i[1],p=es(a);return(0,c.useEffect)(function(){(p||""===p)&&l({key:n,value:p,id:r})},[p,r,o]),(0,s.jsxs)(W,{colMode:!0,children:[(0,s.jsxs)("p",{className:"text-white",children:[t,": "]}),(0,s.jsx)(eq,{initialHtml:o,onSave:function(e){return u(e)}})]})},eQ=function(e){var t=e.name,n=e.label,o=e.value,r=e.prop,l=e.componentId,i=d().editProps,a=(0,h.Z)((0,c.useState)(!1),2),u=a[0],p=a[1],f=(0,h.Z)((0,c.useState)(o||[]),2),m=f[0],x=f[1],v=function(e,n,o){var r="".concat(t,"-").concat(o,"-").concat(n.key);switch(n.type){case"string":return(0,s.jsx)("input",{id:r,type:"text",className:"w-full rounded-lg",value:e[n.key]||"",onChange:function(e){var t=m.slice();t[o][n.key]=e.target.value,x(t)}});case"boolean":return(0,s.jsx)("input",{id:r,type:"checkbox",className:"mx-auto block h-6 w-6 rounded-md",checked:e[n.key]||!1,onChange:function(){var e=m.slice();e[o][n.key]=!e[o][n.key],x(e)}});case"select":return(0,s.jsxs)("select",{id:r,className:"w-full rounded-md",value:e[n.key]||"",onChange:function(e){var t=m.slice();t[o][n.key]=e.target.value,x(t)},children:[(0,s.jsx)("option",{value:"",children:B.p.common.select}),Object.entries(n.options).map(function(e){var t=(0,h.Z)(e,2),n=t[0],o=t[1];return(0,s.jsx)("option",{value:n,children:o},n)})]});default:return null}};return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("button",{type:"button",className:"cursor-pointer text-white",onClick:function(){return p(!u)},"aria-expanded":u,"aria-controls":"".concat(t,"-content"),children:[(0,s.jsx)("span",{className:"mr-1 text-lg font-bold",children:u?"-":"+"}),n]}),(0,s.jsxs)("div",{id:"".concat(t,"-content"),className:"flex flex-col gap-1 py-1 ".concat(u?"":"hidden"),children:[null==m?void 0:m.map(function(e,n){return(0,s.jsxs)("div",{className:"relative grid grid-cols-2 gap-2 rounded-lg border-2 border-white p-2",children:[r.fields.map(function(o){return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"".concat(t,"-").concat(n,"-").concat(o.key),className:"block text-center text-sm text-white",children:[o.label," ",n+1]}),v(e,o,n)]},o.key)}),(0,s.jsxs)("div",{className:"absolute right-1 top-1 flex gap-1",children:[0!==n&&(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.moveToPrevious,className:"flex h-5 w-5 rotate-90 items-center justify-center rounded-full border border-white bg-rose-600 text-sm text-white",onClick:function(){var e=m.slice();e[n]=m[n-1],e[n-1]=m[n],x(e)},children:"<"}),n!==m.length-1&&(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.moveToNext,className:"flex h-5 w-5 rotate-90 items-center justify-center rounded-full border border-white bg-rose-600 text-sm text-white",onClick:function(){var e=m.slice();e[n]=m[n+1],e[n+1]=m[n],x(e)},children:">"}),(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.removeItem,className:" flex h-5 w-5 items-center justify-center rounded-full border border-white bg-rose-600 text-xl text-white",onClick:function(){var e=m.slice();e.splice(n,1),x(e)},children:"X"})]})]},n)}),(0,s.jsxs)("div",{className:"flex gap-4 ",children:[(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.addToCollection,className:"self-center rounded-full border border-white bg-emerald-500 px-1 text-xl leading-5 text-white",onClick:function(){x((0,K.Z)(m).concat([{}]))},children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.saveCollectionLabel,className:"rounded-lg border-2 border-white p-2 text-white hover:bg-emerald-500 ",onClick:function(){return i({key:t,value:m,id:l})},children:B.p.fields.saveCollection})]})]})]})},e$=function(e){var t,n=e.name,o=e.label,r=e.value,l=e.prop,i=e.componentId,a=d().editProps,c=(null==r?void 0:r.length)>0,u=l.defaultIndex,p=function(e){return a({key:n,value:e,id:i})};return(0,s.jsxs)(W,{colMode:!0,children:[(0,s.jsx)("label",{className:"text-white w-full",htmlFor:n,children:o}),(0,s.jsxs)("select",{id:n,name:n,className:"min-w-[200px] rounded-lg p-1",onChange:function(e){a({key:n,value:e.target.value,id:i}
1)},children:[(0,s.jsx)("option",{value:"",selected:!0,children:B.p.common.select}),Array.isArray(t=l.options)?t.map(function(e,t){return c||t!==u||p(e),(0,s.jsx)("option",{selected:c?e==r:t===u,value:e,children:e},t)}):"object"==typeof t?Object.entries(t).map(function(e,t){var n=(0,h.Z)(e,2),o=n[0],l=n[1];return c||t!==u||p(l),(0,s.jsx)("option",{selected:c?l==r:t===u,value:l,children:o},t)}):void 0]})]})},e0=function(e){var t=e.name,n=e.label,o=e.value,r=e.componentId,l=d().editProps,i=(0,h.Z)((0,c.useState)(o||[]),2),a=i[0],u=i[1];return(0,s.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,s.jsx)("label",{className:"text-white",id:"".concat(t,"-label"),children:n}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[null==a?void 0:a.map(function(e,n){return(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("input",{id:"".concat(t,"-").concat(n),"aria-labelledby":"".concat(t,"-label"),className:"min-w-[200px] rounded-lg px-2",onChange:function(e){u(function(t){return t[n]=e.target.value,(0,K.Z)(t)})},value:e}),(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.removeFromCollection,className:"flex h-5 w-5 items-center justify-center rounded-full border border-white bg-red-700 text-white",onClick:function(){var e=a.slice();e.splice(n,1),u(e)},children:"-"})]},n)}),(0,s.jsxs)("div",{className:"flex gap-4 ",children:[(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.addToCollection,className:"flex h-5 w-5 items-center justify-center rounded-full border border-white bg-green-700 text-white",onClick:function(){return u((0,K.Z)(a).concat([""]))},children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":B.p.fields.saveCollectionLabel,onClick:function(){return l({key:t,value:a,id:r})},children:B.p.fields.saveCollection})]})]})]})},e1=function(e){var t=e.name,n=e.label,o=e.value,r=e.componentId,l=d().editProps,i=(0,h.Z)((0,c.useState)(o),2),a=i[0],u=i[1],p=es(a);return(0,c.useEffect)(function(){(p||""===p)&&l({key:t,value:p,id:r})},[p,r,o]),(0,s.jsxs)(W,{colMode:!0,children:[(0,s.jsx)("label",{className:"block text-white",htmlFor:t,children:n}),(0,s.jsx)("input",{className:"min-w-[200px] w-full rounded-lg p-1",id:t,name:t,onChange:function(e){return u(e.target.value)},type:"input",value:a})]})},e2=n(57632),e5=function(e){var t=e.label,n=e.component,o=(0,h.Z)((0,c.useState)(!0),2),r=o[0],l=o[1],i=d().setDataTree;return(0,s.jsxs)(W,{children:[(0,s.jsx)("label",{className:"text-white",htmlFor:t,children:t}),(0,s.jsx)("input",{onChange:function(){l(!r)},type:"checkbox",checked:r}),(0,s.jsx)("input",{type:"file",onChange:function(e){if(e.target.files){var t=e.target.files[0],o=new FileReader;o.onload=function(e){var t=e.target.result;r&&(n.children=[]),t.split(/\r?\n/).forEach(function(e,t){if(e){var o={id:(0,e2.Z)(),name:"TableRow",properties:{},custom_component_id:null,placeholder:null,forPlaceholder:null,children:[]};n.children.push(o),e.split(";").forEach(function(e,n){var r={};0===t?r.title={value:e}:r.text={value:e};var l={id:(0,e2.Z)(),name:0===t?"TableHeading":"TableCell",properties:r,custom_component_id:null,placeholder:null,forPlaceholder:null,children:[]};o.children.push(l)})}}),i()},o.readAsText(t,"Windows-1251")}},className:"focus:border-primary focus:shadow-primary relative m-0 block w-full min-w-0 flex-auto cursor-pointer rounded border border-solid border-neutral-300 bg-white bg-clip-padding px-3 py-1.5 text-base font-normal text-neutral-700 outline-none transition duration-300 ease-in-out file:-mx-3 file:-my-1.5 file:cursor-pointer file:overflow-hidden file:rounded-none file:border-0 file:border-solid file:border-inherit file:bg-neutral-100 file:px-3 file:py-1.5 file:text-neutral-700 file:transition file:duration-150 file:ease-in-out file:[border-inline-end-width:1px] file:[margin-inline-end:0.75rem] hover:file:bg-neutral-200 focus:bg-white focus:text-neutral-700 focus:shadow-[0_0_0_1px] focus:outline-none dark:bg-transparent dark:text-neutral-200 dark:focus:bg-transparent"})]})},e3=function(e){var t=e.title,n=e.children,o=(0,h.Z)((0,c.useState)(!1),2),r=o[0],l=o[1];return(0,s.jsxs)("div",{className:"bg-black/20",children:[(0,s.jsxs)("div",{className:"text-white text-xl flex",onClick:function(){return l(!r)},children:[(0,s.jsx)("span",{className:"text-xl font-bold mx-1",children:r?"-":"+"}),t]}),r&&(0,s.jsx)("div",{className:"p-2 ",children:n})]})},e6=function(e){var t=e.dictionaryProperties,n=e.selectedId,o=e.compProperties,r=(e.selectTableColumnIds,e.setSelectedId,e.selectWithSidebarRefresh,e.component);return Object.entries(t).map(function(e){var t,i=e[0],a={name:e[0],label:e[1].label,value:null===(t=o[e[0]])||void 0===t?void 0:t.value,componentId:n,prop:e[1]};
1switch(e[1].type){case A.iG.boolean:return(0,s.jsx)(_,(0,l.Z)({},a),i);case A.iG.select:return(0,s.jsx)(e$,(0,l.Z)({},a),i);case A.iG.string:case A.iG.number:return(0,s.jsx)(e1,(0,l.Z)({},a),i);case A.iG.classes:return(0,s.jsx)(et,(0,l.Z)({},a),i);case A.iG.styleClass:return(0,s.jsx)(ea,(0,l.Z)({},a),i);case A.iG.rte:return(0,s.jsx)(eY,(0,l.Z)({},a),i);case A.iG.strArr:return(0,s.jsx)(e0,(0,l.Z)({},a),i);case A.iG.objArr:return(0,s.jsx)(eQ,(0,l.Z)({},a),i);case A.iG.tableImporter:return(0,s.jsx)(e5,(0,l.Z)({component:r},a),i);case A.iG.groupProps:return(0,s.jsx)(e3,{title:e[1].label,wrapperClasses:"bg-success",children:(0,s.jsx)(e6,{compProperties:o,dictionaryProperties:e[1].props,selectedId:n})},e[0])}return(0,s.jsx)("div",{children:(0,s.jsx)(W,{children:JSON.stringify(e[1])},e[0])},e[0])})},e9=function(e){var t=e.dictionaryData.properties,n=e.component,o=(null==n?void 0:n.properties)&&Object.keys(n.properties).length?null==n?void 0:n.properties:t;return{dictionaryProperties:t,component:n,compProperties:o}},e4={add:{component:function(){var e=d(),t=e.canModifyComponent,n=e.addComponent,o=e.dictionary,r=e.selectedComponentData,l=e.calculatedTree,i=e.initialAddPosition,a=e.setInitialAddPosition,u=null!=r?r:{},p=u.component,f=u.dictionaryData,m=(0,h.Z)((0,c.useState)(null!=i?i:A.eg.child),2),x=m[0],v=m[1];(0,c.useEffect)(function(){i&&(v(i),a(null))},[]);var b=(0,T.ki)(null==p?void 0:p.id,o,l),g=(0,h.Z)((0,c.useState)(b),2),j=g[0],w=g[1],y=(0,h.Z)((0,c.useState)(null),2),C=y[0],N=y[1],k=(0,h.Z)((0,c.useState)(!0),2),Z=k[0],S=k[1];return(0,c.useEffect)(function(){if(p){if(N(null),x===A.eg.below||x===A.eg.above){var e,t=null===(e=p.parent)||void 0===e?void 0:e.id;t&&w((0,T.ki)(t,o,l))}else w((0,T.ki)(p.id,o,l))}},[x,p,o,l]),(0,s.jsxs)("div",{className:"flex h-full flex-col pb-10",children:[(0,s.jsxs)("div",{className:"mb-2 flex justify-center gap-5 text-white",children:[(0,s.jsx)("button",{type:"button",onClick:function(){return S(!0)},className:"border-b-2 p-1 ".concat(Z?"border-white":"border-transparent"),children:B.p.addComponent.componentTab}),(0,s.jsx)("button",{type:"button",onClick:function(){return S(!1)},className:"border-b-2 p-1 ".concat(Z?"border-transparent":"border-white"),children:B.p.addComponent.templateTab})]}),Z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mx-auto mb-5 flex gap-2 ",children:[t()&&(0,s.jsx)(R,{position:x,setPosition:v,type:A.eg.above,icon:(0,s.jsx)(O,{}),text:B.p.addComponent.before}),(null==f?void 0:f.childrenType)!==!1&&(0,s.jsx)(R,{position:x,setPosition:v,type:A.eg.child,icon:(0,s.jsx)(E,{}),text:B.p.addComponent.inside}),t()&&(0,s.jsx)(R,{position:x,setPosition:v,type:A.eg.below,icon:(0,s.jsx)(V,{}),text:B.p.addComponent.after}),(0,s.jsx)("input",{type:"text",className:"rounded-xl px-2",placeholder:B.p.addComponent.searchPlaceholder,onChange:function(e){if(""===e.target.value){N(null);return}N(Object.fromEntries(Object.entries(j).filter(function(t){var n=(0,h.Z)(t,2),o=(n[0],n[1]);return RegExp((0,T.OX)(e.target.value)).test((0,T.OX)(o.label))})))}})]}),(0,s.jsx)("div",{className:"grid grid-cols-4 gap-2 overflow-auto px-1",children:Object.entries(C||j).map(function(e){var t=(0,h.Z)(e,2),o=t[0],r=t[1];return(0,s.jsx)("button",{type:"button",onClick:function(){return n({position:x,compDict:{dictionaryData:r,name:o}})},className:"cursor-pointer rounded-xl border-2 border-white bg-slate-800 p-3 text-white hover:bg-slate-600",children:r.label},o)})})]}):(0,s.jsx)(G,{canPaste:(null==f?void 0:f.childrenType)!==!1})]})},label:B.p.sidebar.addComponentTitle},props:{component:function(){var e,t=d(),n=t.calculatedTree,o=t.selectedComponentData,r=t.selectTableColumnIds,l=t.setSelectedId,i=t.selectedId,a=t.selectWithSidebarRefresh,c=t.editComponentData,u=t.isPage;if(!o)return(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)(H,{})});var p=e9(o),f=p.dictionaryProperties,m=p.component,h=p.compProperties;return(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-auto px-3 pb-10",children:[(0,s.jsx)("ul",{className:"grow-1 m-0 flex flex-col p-0 pt-2 ",children:(0,s.jsx)(e6,{compProperties:h,dictionaryProperties:f,selectedId:i,selectTableColumnIds:r,setSelectedId:l,selectWithSidebarRefresh:a,component:m})}),!u&&!!(null==o?void 0:null===(e=o.dictionaryData)||void 0===e?void 0:e.childrenType)&&(0,s.jsx)("button",{className:"mx-auto mt-10 rounded-lg  p-1 text-sm ".concat(m.isPlaceholder?"bg-gray-200":"bg-yellow-200"),onClick:function(){if(!m.isPlaceholder&&(0,T.Mk)(n.components,"MainContent","placeholder")){alert(
1B.p.editProperties.dynamicContentAlert);return}c({key:"placeholder",value:m.isPlaceholder?null:"MainContent",id:i})},children:m.isPlaceholder?B.p.editProperties.removeDynamicContent:B.p.editProperties.markDynamicContent})]})},label:B.p.sidebar.editFieldsTitle}},e7={top:"top",bottom:"bottom",right:"right",left:"left"},e8=function(){var e,t=d(),n=t.sidebarType,o=t.setSidebarType,r=(0,h.Z)((0,c.useState)(e7.right),2),l=r[0],i=r[1],a=n&&e4[n];if(!a)return null;var u=null==a?void 0:a.component,p=(e={},(0,L.Z)(e,e7.top,"top-0 max-h-[40vh] h-full rounded-b-2xl"),(0,L.Z)(e,e7.bottom,"bottom-0  max-h-[40vh] h-full rounded-t-2xl"),(0,L.Z)(e,e7.left,"left-0 rounded-r-2xl bottom-0 top-0 max-w-xl"),(0,L.Z)(e,e7.right,"right-0 rounded-l-2xl bottom-0 top-0 max-w-xl"),e);return(0,s.jsxs)("div",{style:{zIndex:1e3,background:"linear-gradient(140deg, #4e4e4eee 0%, #9b9b9b80 100%)"},className:"fixed flex w-full  flex-col p-3 duration-150 ".concat(p[l]),children:[(0,s.jsxs)("div",{className:"mb-5 flex justify-between text-white",children:[(0,s.jsx)("p",{className:"text-lg font-bold ",children:a.label}),(0,s.jsxs)("div",{className:"flex gap-2 text-lg ",children:[(0,s.jsx)("button",{onClick:function(){return i(e7.left)},"aria-label":B.p.sidebar.moveSliderLeft,children:"<"}),(0,s.jsx)("button",{className:"rotate-90",onClick:function(){return i(e7.top)},"aria-label":B.p.sidebar.moveSliderTop,children:"<"}),(0,s.jsx)("button",{className:"rotate-90",onClick:function(){return i(e7.bottom)},"aria-label":B.p.sidebar.moveSliderBottom,children:">"}),(0,s.jsx)("button",{onClick:function(){return i(e7.right)},"aria-label":B.p.sidebar.moveSliderRight,children:">"})]}),(0,s.jsx)("button",{className:"align-center cursor-pointer text-lg",onClick:function(){return o(null)},"aria-label":B.p.sidebar.close,children:(0,s.jsx)(N,{"aria-hidden":"true"})})]}),(0,s.jsx)(u,{})]})},te=function(e){var t=e.className;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"".concat(t," h-6 w-6"),children:(0,s.jsx)("path",{d:"M21,20V8.414a1,1,0,0,0-.293-.707L16.293,3.293A1,1,0,0,0,15.586,3H4A1,1,0,0,0,3,4V20a1,1,0,0,0,1,1H20A1,1,0,0,0,21,20ZM9,8h4a1,1,0,0,1,0,2H9A1,1,0,0,1,9,8Zm7,11H8V15a1,1,0,0,1,1-1h6a1,1,0,0,1,1,1Z"})})},tt=n(98373),tn=function(){var e=d(),t=e.calculatedTree,n=e.isPage,o=e.readMode,r=e.dictionary;return o?null:(0,s.jsx)("div",{className:"fixed bottom-4 left-4",style:{zIndex:1e3},children:(0,s.jsxs)("button",{"aria-label":B.p.common.save,className:"group flex items-center overflow-hidden rounded-xl border-2 border-slate-800 bg-white p-2 text-slate-800 transition-all duration-200 hover:bg-gray-100",type:"button",onClick:function(){return(0,tt.w)((0,Y.Vu)(t,r),n)},children:[(0,s.jsx)(te,{"aria-hidden":"true"}),(0,s.jsx)("span",{className:"max-w-0 overflow-hidden whitespace-nowrap pl-0 transition-all duration-200 group-hover:max-w-xs group-hover:pl-2",children:B.p.common.save})]})})},to=n(75675),tr=function(e,t){var n,o=null==t?void 0:null===(n=t[e.name])||void 0===n?void 0:n.childrenType;return"boolean"==typeof o?o:!!Array.isArray(o)},tl=function(e,t,n){if(!n)return!1;var o,r=null==t?void 0:null===(o=t[e.name])||void 0===o?void 0:o.childrenType;return"boolean"==typeof r?r:!!Array.isArray(r)&&r.includes(n.component.name)},ti=function(e,t){return null!=e&&!!e.children&&e.children.some(function(e){return e.id===t.id||ti(e,t)})},ta=n(77763),ts=function(e){var t=e.x,n=e.y,o=e.component,r=e.onClose,l=d(),i=l.showAddComponent,a=l.showEditProps,u=l.deleteComponent,p=l.canModifyComponent,f=l.dictionary,m=l.selectWithSidebarRefresh,x=l.copyJson,v=l.pasteJson,b=(0,c.useRef)(null),g=(0,h.Z)((0,c.useState)({left:t,top:n}),2),j=g[0],w=g[1],y=tr(o,f),C=p(o),N=tl(o,f,(0,ta.bB)());(0,c.useLayoutEffect)(function(){var e=b.current;if(e){var o=e.getBoundingClientRect(),r=o.width,l=o.height;w({left:Math.max(8,Math.min(t,window.innerWidth-r-8)),top:Math.max(8,Math.min(n,window.innerHeight-l-8))})}},[t,n]),(0,c.useEffect)(function(){var e=function(e){b.current&&!b.current.contains(e.target)&&r()};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[r]);var k=function(){return m(o.id)},Z=function(e){k(),r(),setTimeout(function(){return i(e)},0)};return(0,s.jsxs)("div",{ref:b,className:"fixed z-[9999] bg-white border border-gray-200 rounded-lg shadow-lg py-1 min-w-[160px] text-sm",style:{left:j.left,top:j.top}
1,children:[C&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){return Z(A.eg.above)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"↑"})," ",B.p.contextMenu.addBefore]}),y&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){return Z(A.eg.child)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"↳"})," ",B.p.contextMenu.addInside]}),C&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){return Z(A.eg.below)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"↓"})," ",B.p.contextMenu.addAfter]}),(C||y)&&(0,s.jsx)("div",{className:"border-t border-gray-100 my-1"}),(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){k(),r(),setTimeout(function(){return x()},0)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"⧉"})," ",B.p.contextMenu.copy]}),N&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){k(),r(),setTimeout(function(){return v()},0)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"\uD83D\uDCCB"})," ",B.p.contextMenu.pasteInside]}),C&&(0,s.jsx)("div",{className:"border-t border-gray-100 my-1"}),C&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-gray-100 flex items-center gap-2",onClick:function(){k(),r(),setTimeout(function(){return a()},0)},children:[(0,s.jsx)("span",{className:"text-gray-400",children:"✏"})," ",B.p.contextMenu.editProps]}),C&&(0,s.jsxs)("button",{className:"w-full text-left px-3 py-1.5 hover:bg-red-50 text-red-600 flex items-center gap-2",onClick:function(){k(),r(),setTimeout(function(){return u()},0)},children:[(0,s.jsx)("span",{children:"✕"})," ",B.p.common.delete]})]})},tc=function(e){var t=e.component,n=e.level,o=void 0===n?0:n,r=e.onSelect,l=e.selectedId,i=e.onDragStart,a=e.draggedComponent,u=e.onDragOver,p=e.onDrop,f=e.dropPosition,m=e.readMode,x=d().dictionary,v=t.id,b=t.name,g=t.children,j=g&&g.length>0,w=null==x?void 0:x[b],y=(null==w?void 0:w.label)||b,C=l===v,N=(null==a?void 0:a.id)===v,k=(null==f?void 0:f.targetId)===v?f.position:null,Z=!1!==t.canSelect,S=tr(t,x),I=k===A.eg.child,P=k===A.eg.above,L=k===A.eg.below,M=(0,h.Z)((0,c.useState)(null),2),D=M[0],T=M[1],O=(0,h.Z)((0,c.useState)(!1),2),E=O[0],V=O[1],z=(0,h.Z)((0,c.useState)(!1),2),R=z[0],F=z[1],G=(0,c.useRef)(null);return(0,s.jsxs)("div",{className:"select-none",children:[(0,s.jsxs)("div",{className:"relative",children:[P&&(0,s.jsx)("div",{className:"absolute left-0 right-0 top-0 h-0.5 bg-blue-500 z-10 pointer-events-none",style:{marginLeft:"".concat(1.25*o+.5,"rem")},children:(0,s.jsx)("div",{className:"absolute -top-1 -left-1 w-2 h-2 rounded-full bg-blue-500"})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1.5 rounded-sm transition-colors ".concat(Z?"cursor-move":"cursor-default opacity-60"," ").concat(C?"bg-blue-600 text-white":I?"bg-green-50 ring-2 ring-inset ring-green-500":k?"bg-blue-50":N?"opacity-40":"hover:bg-gray-100 text-gray-900"),style:{paddingLeft:"".concat(1.25*o+.5,"rem")},draggable:!m&&Z,onDragStart:function(e){return i(e,t)},onDragOver:function(e){return u(e,t)},onDrop:function(e){return p(e,t)},onDragLeave:function(e){e.currentTarget.contains(e.relatedTarget)||u(e,null)},onClick:function(){return Z&&r(v)},onMouseEnter:function(){return V(!0)},onMouseLeave:function(){return V(!1)},children:[j&&(0,s.jsx)("button",{type:"button",className:"absolute top-1/2 -translate-y-1/2 flex items-center justify-center w-4 h-4 rounded text-xs leading-none ".concat(C?"text-white hover:bg-blue-500":"text-gray-500 hover:bg-gray-200"),style:{left:"".concat(Math.max(1.25*o+.5-1,0),"rem")},onClick:function(e){e.stopPropagation(),F(function(e){return!e})},title:R?B.p.treeNode.expand:B.p.treeNode.collapse,children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"
1currentColor",className:"transition-transform ".concat(R?"":"rotate-90"),children:(0,s.jsx)("path",{d:"M9 6l6 6-6 6z"})})}),!m&&Z?(0,s.jsx)("button",{ref:G,className:"shrink-0 w-4 flex items-center justify-center rounded text-xs leading-none ".concat(C?"text-white hover:bg-blue-500":"text-gray-500 hover:bg-gray-200"),onClick:function(e){e.stopPropagation();var t=G.current.getBoundingClientRect();T({x:t.right+4,y:t.top})},title:B.p.treeNode.options,children:E||D?(0,s.jsxs)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"3",y:"5",width:"18",height:"2",rx:"1"}),(0,s.jsx)("rect",{x:"3",y:"11",width:"18",height:"2",rx:"1"}),(0,s.jsx)("rect",{x:"3",y:"17",width:"18",height:"2",rx:"1"})]}):j?"├":""}):(0,s.jsx)("span",{className:"w-4 shrink-0 text-gray-400 text-xs",children:j?"├":""}),(0,s.jsx)("span",{className:"text-sm font-medium truncate min-w-12 max-w-44 ".concat(C?"text-white":Z?"text-gray-900":"text-gray-400 italic"),children:y}),I&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500 text-white ml-auto font-semibold shrink-0",children:B.p.treeNode.insideDrop}),!I&&(0,s.jsxs)("div",{className:"flex gap-1",children:[S&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 ml-auto font-semibold",children:"\uD83D\uDFE9"}),t.isPlaceholder&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-100 ml-auto font-semibold",children:"\uD83D\uDCCC"}),t.placeholder&&(0,s.jsxs)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-purple-100 text-purple-700 ml-auto",children:["Zone: ",t.placeholder]}),!S&&Z&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-red-100 text-red-700 ml-auto",children:"\uD83D\uDD34"}),!Z&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-300 text-gray-700 ml-auto",children:"\uD83D\uDCCC"})]})]}),L&&(0,s.jsx)("div",{className:"absolute left-0 right-0 bottom-0 h-0.5 bg-blue-500 z-10 pointer-events-none",style:{marginLeft:"".concat(1.25*o+.5,"rem")},children:(0,s.jsx)("div",{className:"absolute -bottom-1 -left-1 w-2 h-2 rounded-full bg-blue-500"})})]}),D&&(0,s.jsx)(ts,{x:D.x,y:D.y,component:t,onClose:function(){return T(null)}}),j&&!R&&(0,s.jsx)("div",{children:g.map(function(e){return(0,s.jsx)(tc,{component:e,level:o+1,onSelect:r,selectedId:l,onDragStart:i,draggedComponent:a,onDragOver:u,onDrop:p,dropPosition:f,readMode:m},e.id)})})]})},tu=function(){var e,t=d(),n=t.calculatedTree,o=t.selectedId,r=t.selectWithSidebarRefresh,l=t.showEditProps,i=t.readMode,a=t.setDataTree,u=t.dictionary,p=t.setViewMode,f=(0,h.Z)((0,c.useState)(null),2),m=f[0],x=f[1],v=(0,h.Z)((0,c.useState)(null),2),b=v[0],g=v[1],j=(0,h.Z)((0,c.useState)("left"),2),w=j[0],y=j[1],C=(0,h.Z)((0,c.useState)(!1),2),N=C[0],k=C[1],Z=function(e,t){!1!==t.canSelect&&(x(t),e.dataTransfer.effectAllowed="move")},S=function(e,t){if(e.preventDefault(),e.dataTransfer.dropEffect="move",!m||!t||m.id===t.id||!1===t.canSelect){g(null);return}var n,o=e.currentTarget.getBoundingClientRect(),r=e.clientY-o.top,l=o.height/3;if(r<l)n=A.eg.above;else if(r>2*l){if(t.isPlaceholder){g(null);return}n=A.eg.below}else n=tr(t,u)?A.eg.child:A.eg.below;g({targetId:t.id,position:n})},I=function(e,t){if(e.preventDefault(),e.stopPropagation(),!1===t.canSelect){alert(B.p.treeView.cannotAcceptComponents),x(null),g(null);return}if(!m||!t||m.id===t.id){x(null),g(null);return}var o=(null==b?void 0:b.position)||A.eg.child;if(o===A.eg.child&&!tr(t,u)){alert(B.p.treeView.cannotAcceptChildren),x(null),g(null);return}var r=(0,T.Mk)(n.components,m.id),l=(0,T.Mk)(n.components,t.id);if(!r||!l){x(null),g(null);return}if(ti(r,l)){alert(B.p.treeView.cannotMoveIntoOwnChild),x(null),g(null);return}var i=r.parent?r.parent.children:n.components,s=i.findIndex(function(e){return e.id===r.id});if(-1!==s&&i.splice(s,1),o===A.eg.child)l.children||(l.children=[]),l.children.push(r);else{var c=l.parent?l.parent.children:n.components,d=c.findIndex(function(e){return e.id===l.id}),p=o===A.eg.above?d:d+1;-1!==d&&c.splice(p,0,r)}a(),x(null),g(null)};return(0,s.jsxs)("div",{className:"h-full flex flex-col bg-gray-100 border-gray-300 fixed z-[999] ".concat(N?"inset-0 w-full max-w-none":"top-0 bottom-0 max-w-sm w-full ".concat("left"===w?"border-r left-0 rounded-r-2xl":"border-l right-0 rounded-l-2xl")," overflow-hidden"),children:[(0,s.jsxs)("div",{className:"border-b border-gray-200 p-3 bg-white flex items-center justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-lg font-bold truncate",children:B.p.treeView.title}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[!N&&(0,s.jsx)("button",{title:"left"
1===w?B.p.treeView.moveRight:B.p.treeView.moveLeft,onClick:function(){return y(function(e){return"left"===e?"right":"left"})},className:"p-1 rounded hover:bg-gray-100 text-gray-500 hover:text-gray-800 transition-colors text-xs",children:"left"===w?"→":"←"}),(0,s.jsx)("button",{title:N?B.p.treeView.exitFullScreen:B.p.treeView.fullScreen,onClick:function(){return k(function(e){return!e})},className:"p-1 rounded hover:bg-gray-100 text-gray-500 hover:text-gray-800 transition-colors text-base leading-none",children:N?"⤡":"⤢"}),(0,s.jsx)("button",{title:B.p.common.close,onClick:function(){return p("wysiwyg")},className:"p-1 rounded hover:bg-red-100 text-gray-500 hover:text-red-600 transition-colors font-bold text-sm leading-none",children:"✕"})]})]}),(0,s.jsxs)("div",{className:"border-b border-gray-200 px-3 py-2 bg-gray-100 text-xs text-gray-600 space-y-1",children:[(0,s.jsx)("p",{className:"text-xs text-gray-500",children:B.p.treeView.legendTitle}),(0,s.jsxs)("div",{children:["\uD83D\uDFE9 ",B.p.treeView.legendAcceptsChildren]}),(0,s.jsxs)("div",{children:["\uD83D\uDD34 ",B.p.treeView.legendNoChildren]}),(0,s.jsxs)("div",{children:["\uD83D\uDCCC ",B.p.treeView.legendTemplateComponent]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto",children:(null==n?void 0:null===(e=n.components)||void 0===e?void 0:e.length)>0?(0,s.jsx)("div",{className:"p-2 min-w-max",children:n.components.map(function(e){return(0,s.jsx)(tc,{component:e,onSelect:r,selectedId:o,onDragStart:Z,draggedComponent:m,onDragOver:S,onDrop:I,dropPosition:b,readMode:i},e.id)})}):(0,s.jsx)("div",{className:"p-4 text-center text-gray-500 text-sm",children:B.p.treeView.noComponents})}),o&&!i&&(0,s.jsx)("div",{className:"border-t border-gray-200 p-3 bg-white",children:(0,s.jsx)("button",{onClick:l,className:"w-full px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded font-medium text-sm transition-colors",children:B.p.treeView.editProps})})]})},td=n(90945),tp=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1"}),(0,s.jsx)("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1"}),(0,s.jsx)("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1"}),(0,s.jsx)("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1"})]})},tf=function(e){var t=e.className;return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"".concat(t," h-6 w-6"),children:[(0,s.jsx)("circle",{cx:"8",cy:"2.5",r:"1.5"}),(0,s.jsx)("line",{x1:"8",y1:"4",x2:"8",y2:"6"}),(0,s.jsx)("line",{x1:"8",y1:"6",x2:"4",y2:"8"}),(0,s.jsx)("line",{x1:"8",y1:"6",x2:"12",y2:"8"}),(0,s.jsx)("circle",{cx:"4",cy:"9.5",r:"1.5"}),(0,s.jsx)("circle",{cx:"12",cy:"9.5",r:"1.5"}),(0,s.jsx)("line",{x1:"4",y1:"11",x2:"4",y2:"13"}),(0,s.jsx)("circle",{cx:"4",cy:"14",r:"1"}),(0,s.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"13"}),(0,s.jsx)("circle",{cx:"12",cy:"14",r:"1"})]})},tm=function(){var e=d(),t=e.selectedComponentData,n=e.calculatedTree,o=e.setRef,r=e.dictionary,u=e.setShowControls,p=e.selectWithSidebarRefresh,f=e.readMode,h=e.viewMode,x=e.setViewMode,v=function(e){var t=e.id,d=e.name,m=e.properties,h=e.children;if(!r||!t)return null;var x=null==r?void 0:r[d];if(!x)return(0,s.jsx)(to.Z,{width:300,height:300,compName:d},"missingComponent"+t);var v=null==x?void 0:x.component;if(null==x?void 0:x.fallbackConfig)return(0,s.jsx)(to.Z,{width:x.fallbackConfig.width,height:x.fallbackConfig.height,compName:x.label},t);var g=(0,td.X)(m,x.properties,t),j=g.styleTag,w=(0,a.Z)(g,["styleTag"]),y={ref:o(t),onClick:function(e){},onContextMenu:function(n){e.canSelect&&(n.stopPropagation(),n.preventDefault(),u(!0),p(t))}};return(null==x?void 0:x.hasImg)&&(w.imageCacheList=null==n?void 0:n.mediaCacheInvalidationGuids),(0,s.jsxs)(c.Fragment,{children:[j,(0,s.jsx)(v,(0,i.Z)((0,l.Z)({id:t,cms:(0,l.Z)({},!f&&y)},w),{children:b(h)}))]},t)},b=function(e){return null==e?void 0:e.map(function(e){return e.customComponentId?b(e.children):v(e)})},g=(0,c.useRef)(null);return(0,s.jsxs)("div",{className:"relative",children:["tree"===h&&(0,s.jsx)(tu,{}),(0,s.jsx)("div",{className:"flex-1 relative",children:(0,s.jsxs)("div",{ref:g,className:"relative",children:[b(n.components),!f&&(0,s.jsx)(m,{}),(0,s.jsx)(P,{selectedComponentData:t,containerRef:g}),(0,s.jsx)(e8,{}),(0,s.jsx)(tn,{})]})}),!f&&(0,s.jsx)("div",{className:"fixed bottom-4 right-1/2 translate-x-1/2 z-50",children:(0,s.jsxs)("div",{className:"flex items-center bg-gray-900/80 backdrop-blur-sm rounded-xl shadow-xl p-1 gap-0.5",children:[(0,s.jsx)("button",{onClick:function(){return x("wysiwyg")},title:"WYSIWYG",className:"flex items-center justify-center w-10 h-10 rounded-lg transition-all duration-200 ".concat("wysiwyg"===h?"bg-white text-gray-900 shadow-sm":"text-gray-400 hover:text-white hover:bg-white/10"),children:(0,s.jsx)(tp,{className:"h-6 w-6"})}),(0,s.jsx)("button",{onClick:function(){return x("tree")},title:B.p.cms.treeToggle,className:"flex items-center justify-center w-10 h-10 rounded-lg transition-all duration-200 ".concat("tree"===h?"bg-white text-gray-900 shadow-sm":"text-gray-400 hover:text-white hover:bg-white/10"),children:(0,s.jsx)(tf,{className:"h-6 w-6"})})]})})]})}},48797:function(e,t,n){n.d(t,{i:function(){return y},I:function(){return k}});var o=n(47568),r=n(828),l=n(97582),i=n(85893),a=n(67294),s=n(58540),c=new Map,u=function(e){if(!c.has(e)){var t=(0,a.createRef)();c.set(e,t)}return c.get(e)},d=function(e){return c.get(e)},p=function(){var e=(0,r.Z)((0,a.useState)(!1),2),t=e[0],n=e[1];return(0,a.useEffect)(function(){t&&n(!1)},[t]),[t,function(){n(!0)}]},f=n(18446),m=n.n(f),h=n(79926),x=n(12891),v=function(e){var t,n=e.selectedId,o=e.json,r=(0,x.Mk)(o.components,n);return null===(t=(0,x.Ye)({node:r,json:o}))||void 0===t?void 0:t.id},b=function(e){var t,n=e.selectedId,o=e.json,r=(0,x.Mk)(o.components,n);return null===(t=(0,x.Al)({node:r,json:o}))||void 0===t?void 0:t.id},g=function(e){var t=e.selectedComponent,n=e.json,o=(0,x.l4)(t,n);t.index>
10&&(0,x.uR)(o,t.index,t.index-1)},j=function(e){var t=e.selectedComponent,n=e.json,o=(0,x.l4)(t,n);t.index<o.length-1&&(0,x.uR)(o,t.index,t.index+1)},w=n(77763),y=(0,a.createContext)(),C=new x.Kq,N=new x.Kq,k=function(e){var t,n=e.children,c=e.json,f=e.dictionary,k=e.readMode,Z=e.isPage,S=(0,r.Z)((0,a.useState)(null),2),I=S[0],P=S[1],L=(0,r.Z)((0,a.useState)({}),2),M=L[0],D=L[1],T=(0,r.Z)((0,a.useState)("wysiwyg"),2),A=T[0],O=T[1],E=(0,a.useMemo)(function(){return(0,h.U1)(M,Z)},[M,Z]),V=(0,r.Z)([d,u],2),z=V[0],R=V[1],F=(0,r.Z)(p(),2),B=F[0],G=F[1],H=(0,r.Z)((0,a.useState)(null),2),W=H[0],_=H[1],K=(0,r.Z)((0,a.useState)(!1),2),J=K[0],X=K[1],U=(0,r.Z)((0,a.useState)(null),2),q=U[0],Y=U[1],Q=function(e,t){try{var n=(0,r.Z)(e.pop(),2),o=n[0],l=n[1];t.push([M,I]),D(o),P(l),G()}catch(i){}},$=(0,a.useCallback)(function(){var e=(0,h.x9)(E);m()(M,e)||(N.getLength()>0&&N.clear(),C.push([M,I]),D(e),G())},[E,M,I]),ee=(0,a.useMemo)(function(){var e;return(e=(0,x.Mk)(E.components,I))?{component:e,dictionaryData:f[null==e?void 0:e.name]}:null},[I,E,f]),et=function(e){if(W!==s.KW.props){P(e);return}P(null),(0,x.Ds)(function(){P(e)},1)()};(0,a.useEffect)(function(){D(c?{pageId:c.pageId,pageVersionId:c.pageVersionId,customComponentId:c.customComponentId,customComponentVersionId:c.customComponentVersionId,components:c.components,mediaCacheInvalidationGuids:c.mediaCacheInvalidationGuids}:{})},[c]);var en=(0,a.useCallback)(function(e){if(I){var t=v({selectedId:I,json:E});t&&(e?et(t):P(t))}},[I,E]),eo=(0,a.useCallback)(function(e){if(I){var t=b({selectedId:I,json:E});t&&(e?et(t):P(t))}},[I,E]),er=(0,a.useCallback)(function(){ee&&(j({selectedComponent:ee.component,json:E}),$())},[ee,E,$,G]),el=(0,a.useCallback)(function(){ee&&(g({selectedComponent:ee.component,json:E}),$())},[ee,E,$,G]),ei=(0,a.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Y(e),_(s.KW.add)},[]),ea=(0,a.useCallback)(function(){ee&&((0,w.Vx)({current:ee.component,json:E,dictionary:f}),$(),P(null),_(null))},[E,ee,f,$]),es=(0,a.useCallback)(function(){_(s.KW.props)},[]),ec=(0,a.useCallback)(function(){(0,w.wl)(ee.component,E,f)},[ee]),eu=(0,a.useCallback)((t=(0,o.Z)(function(e){return(0,l.__generator)(this,function(t){return(0,w.rC)({selectedComponent:null==ee?void 0:ee.component,calculatedTree:E,dictionary:f,jsonComp:e}),$(),[2]})}),function(e){return t.apply(this,arguments)}),[E,f,ee,$]),ed=(0,a.useCallback)(function(){X(!1),_(null)},[]);return(0,i.jsx)(y.Provider,{value:{calculatedTree:E,setDataTree:$,setRef:R,getRef:z,mustRefresh:B,sidebarType:W,setSidebarType:_,showControls:J,setShowControls:X,canModifyComponent:function(e){var t=null!=e?e:null==ee?void 0:ee.component;return!!t&&(!Z||!t.isPlaceholder&&!1!==t.canSelect&&!!t.isInPlaceholder)},showAddComponent:ei,addComponent:function(e){var t=e.position,n=e.compDict,o=(0,w.eE)({current:null==ee?void 0:ee.component,compDict:n,position:t,json:E});$(),P(o),_(s.KW.props),X(!0)},deleteComponent:ea,showEditProps:es,editProps:function(e){var t=e.key,n=e.value,o=e.id;(0,x.Mk)(E.components,o).properties[t]={value:n},$()},dictionary:f,setSelectedId:P,selectedComponentData:ee,moveComponentUp:el,moveSelectionUp:en,moveComponentDown:er,moveSelectionDown:eo,selectWithSidebarRefresh:et,copyJson:ec,canPasteComponent:function(){var e=(0,w.bB)();if(!e)return!1;var t=(null!=ee?ee:{}).dictionaryData;return!!t&&("boolean"==typeof t.childrenType?t.childrenType:!!Array.isArray(t.childrenType)&&t.childrenType.includes(e.component.name))},pasteJson:eu,closeAll:ed,initialAddPosition:q,setInitialAddPosition:Y,readMode:k,isPage:Z,undo:function(){return Q(C,N)},redo:function(){return Q(N,C)},selectedId:I,editComponentData:function(e){var t=e.key,n=e.value,o=e.id;(0,x.Mk)(E.components,o)[t]=n,$()},viewMode:A,setViewMode:O},children:n})}},77763:function(e,t,n){n.d(t,{Vx:function(){return d},bB:function(){return m},eE:function(){return u},rC:function(){return f},wl:function(){return p}});var o=n(26042),r=n(57632),l=n(58540),i=n(79926),a=n(90945),s=n(12891),c=n(92453),u=function(e){var t,n,o=e.current,i=e.compDict,c=e.position,u=e.json,d=(0,r.Z)(),p=i.dictionaryData,f={id:d,name:i.name,properties:(0,a.h)({dictionaryData:p}),custom_component_id:null,placeholder:null,forPlaceholder:null,children:[]};switch(c){case l.eg.child:f.forPlaceholder=null==o?void 0:o.placeholder,o?o.children.push(f):u.components.push(f);break;case l.eg.above:f.forPlaceholder=null===(t=o.parent)||void 0===t?void 0:t.placeholder,(0,s.l4)(o,u).splice(o.index,0,f);break;case l.eg.below:f.forPlaceholder=null===(n=o.parent)||void 0===n?void 0:n.placeholder,(0,s.l4)(o,u).splice(o.index+1,0,f)}return d},d=function(e){var t=e.current,n=e.json;e.dictionary,(0,s.l4)(t,n).splice(t.index,1)},p=function(e,t,n){var o=(0,i.ts)(e),r=t.mediaCacheInvalidationGuids?(0,i.Cg)(e,t):{};localStorage.setItem("copiedJson",JSON.stringify({component:o,mediaCacheInvalidationGuids:r}))},f=function(e){var t=e.selectedComponent,n=e.calculatedTree,r=e.dictionary,l=e.jsonComp||m(!0);if(l){var a=(0,i.ts)(l.component,!0,l,r);a.forPlaceholder=null==t?void 0:t.placeholder,n.mediaCacheInvalidationGuids=(0,o.Z)({},n.mediaCacheInvalidationGuids,l.mediaCacheInvalidationGuids),t.children.push(a)}},m=function(e){var t=localStorage.getItem("copiedJson");try{var n=JSON.parse(t),o=(0,s.XA)(n);if(!o){if(!e)return null;throw Error(c.p.alerts.invalidComponent)}return o}catch(r){return alert(r),null}}},79926:function(e,t,n){n.d(t,{Cg:function(){return f},Mb:function(){return g},U1:function(){return s},Vu:function(){return m},ts:function(){return p},x9:function(){return u}});var o=n(828),r=n(57632),l=n(50361),i=n.n(l),a=n(58540),s=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n={mediaCacheInvalidationGuids:null==e?void 0:e.mediaCacheInvalidationGuids,components:c({components:e.components,isPage:t})};return x({data:e,result:n}),n},c=function(e){for(var t=e.components,n=e.parent,o=void 0===n?null:n,r=e.isInCustomComponent,l=void 0!==r&&r,a=e.isInPlaceholder,s=void 0!==a&&a,u=e.isPage,d=void 0===u||u,p=[],f=0;f<(null==t?void 0:t.length);f++){var m=i()(t[f]);m.parent=o,m.isInCustomComponent=l||!!m.customComponentId,m.isPlaceholder=!!m.placeholder,m.isInPlaceholder=(null==o?void 0:o.isPlaceholder)||s,m.canSelect=!d||m.isPlaceholder||m.isInPlaceholder,m.siblings=p,m.index=f,m.children=c({components:m.children,parent:m,isInCustomComponent:m.isInCustomComponent,isInPlaceholder:m.isInPlaceholder,isPage:d}),p.push(m)}return p},u=function(e){var t={mediaCacheInvalidationGuids:null==e?void 0:e.mediaCacheInvalidationGuids,components:d(e.components)};return x({data:e,result:t}),t},d=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=[],l=0;l<(null==e?void 0:e.length);l++){var i=p(e[l],t,n,o);
1r.push(i)}return r},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{id:t?(0,r.Z)():e.id,name:e.name,customComponentId:e.customComponentId,placeholder:e.placeholder,forPlaceholder:e.forPlaceholder,properties:i()(e.properties),children:d(e.children,t,n,o)}},f=function(e,t){var n={},o=function(e){for(var r in null==e?void 0:e.properties){var l=e.properties[r].value;l in(null==t?void 0:t.mediaCacheInvalidationGuids)&&(n[l]=t.mediaCacheInvalidationGuids[l])}var i=!0,a=!1,s=void 0;try{for(var c,u=e.children[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value;o(d)}}catch(p){a=!0,s=p}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}};return o(e),n},m=function(e,t){var n={mediaCacheInvalidationGuids:null==e?void 0:e.mediaCacheInvalidationGuids,components:h(e.components,t),translations:{}};return x({data:e,result:n}),n},h=function(e,t){for(var n=[],o=0;o<(null==e?void 0:e.length);o++){var r,l=e[o],a=t[l.name],s={id:l.id,name:l.name,customComponentId:l.customComponentId,placeholder:l.placeholder,forPlaceholder:l.forPlaceholder,properties:v(null!==(r=i()(l.properties))&&void 0!==r?r:{},a)};s.children=h(l.children,t),n.push(s)}return n},x=function(e){var t=e.data,n=e.result;t.pageId&&(n.pageId=t.pageId,n.pageVersionId=t.pageVersionId),t.customComponentId&&(n.customComponentId=t.customComponentId,n.customComponentVersionId=t.customComponentVersionId)},v=function(e,t){var n={};return Object.entries(e).forEach(function(e){var r,l=(0,o.Z)(e,2),i=l[0],s=l[1];if((null===(r=t.properties[i])||void 0===r?void 0:r.type)!==a.iG.classes)n[i]=s;else{var c=b(s);c&&(n[i]=c)}}),n},b=function(e){var t={};return Object.entries(e).forEach(function(e){var n=(0,o.Z)(e,2),r=n[0],l=g(n[1]);l&&(t[r]=l)}),Object.entries(t).length>0?t:null},g=function(e){var t={};return Object.entries(e).forEach(function(e){var n=(0,o.Z)(e,2),r=n[0],l=j(n[1]);l&&(t[r]=l)}),Object.entries(t).length>0?t:null},j=function(e){var t={};return Object.entries(e).forEach(function(e){var n=(0,o.Z)(e,2),r=n[0],l=n[1];l&&(t[r]=l)}),Object.entries(t).length>0?t:null}},12891:function(e,t,n){n.d(t,{Al:function(){return x},Ds:function(){return s},Kq:function(){return v},Mk:function(){return p},OX:function(){return g},XA:function(){return u},Ye:function(){return h},ki:function(){return a},l4:function(){return f},uR:function(){return d}});var o=n(51438),r=n(52951),l=n(828),i=n(36305),a=function(e,t,n){if(!e)return t;var o=p(n.components,e),r=t[null==o?void 0:o.name].childrenType;return!0===r?t:!1===r?{}:Object.fromEntries(Object.entries(t).filter(function(e){var t=(0,l.Z)(e,1)[0];return r.includes(t)}))},s=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var o=arguments.length,r=Array(o),l=0;l<o;l++)r[l]=arguments[l];clearTimeout(t),t=setTimeout(function(){e.apply(void 0,(0,i.Z)(r))},n)}},c={component:"component"},u=function(e){if(e&&"object"==typeof e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertyNames(c).every(function(e){return t.includes(e)})?e:null}return null},d=function(e,t,n){var o=e[t];e[t]=e[n],e[n]=o},p=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",o=null,r=0;r<(null==e?void 0:e.length);r++){var l=e[r];if(o=l[n]===t?l:p(l.children,t,n))break}return o},f=function(e,t){return e.parent?e.parent.children:t.components},m=function(e){var t=[],n=function(e){if(e){var o=!0,r=!1,l=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var s=i.value;t.push(s),n(s.children)}}catch(c){r=!0,l=c}finally{try{o||null==a.return||a.return()}finally{if(r)throw l}}}};return n(e),t},h=function(e){var t=e.node,n=e.json;if(!t||!n)return null;var o=m(n.components),r=o.findIndex(function(e){return e.id===t.id});if(r<=0)return null;for(var l=r-1;l>=0;l--)if(o[l].canSelect)return o[l];return null},x=function(e){var t=e.node,n=e.json;if(!t||!n)return null;var o=m(n.components),r=o.findIndex(function(e){return e.id===t.id});if(r<0||r===o.length-1)return null;for(var l=r+1;l<o.length;l++)if(o[l].canSelect)return o[l];return null},v=function(){function e(){(0,o.Z)(this,e),this.items=[],this.size=20}return(0,r.Z)(e,[{key:"push",value:function(e){this.items.length===this.size&&this.items.shift(),this.items.push(e)}},{key:"pop",value:function(){if(0==this.items.length)throw Error("Stack underflow");return this.items.pop()}},{key:"clear",value:function(){this.items=[]}},{key:"getLength",value:function(){return this.items.length}}]),e}(),b={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"ts",ч:"ch",ш:"sh",щ:"sht",ъ:"y",ь:"y",ю:"yu",я:"q"},g=function(e){return e.toLowerCase().split("").map(function(e){return b[e]||e}).join()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.