FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
post-views
/
build
Edit File: index.js
(()=>{var e,t={453:(e,t,n)=>{"use strict";const o=window.wp.blocks,i=window.wp.i18n,r=window.wp.blockEditor,s=window.wp.element,a=window.wp.components,u=window.wp.primitives,l=window.ReactJSXRuntime,c=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),h=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),d=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),f=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})}),p=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),v=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),y=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),b=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M5 11.25h14v1.5H5z"})}),g=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})}),m=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})}),x=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})}),C=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),w=(0,l.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(u.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),_=window.wp.apiFetch;var j=n.n(_);const O=window.wp.data,S=(0,s.memo)((({attributes:e,setAttributes:t,searchQuery:n,handleSearch:o,filteredIcons:u,handleIconClick:_})=>{const j=function(){let e=[{label:"Default",value:""}];if("object"==typeof cozyBlockAssets.googleFonts)for(let t in cozyBlockAssets.googleFonts)e.push({label:cozyBlockAssets.googleFonts[t],value:t});return e}(),S=(0,O.select)("core/editor").getEditorSettings().colors,[z,P]=(0,s.useState)("general");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.InspectorControls,{group:"settings",children:[(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("General","cozy-addons"),opened:"general"===z,onToggle:()=>P("general"),children:[(0,l.jsx)(a.SelectControl,{label:(0,i.__)("Display","cozy-addons"),options:[{label:(0,i.__)("Inline","cozy-addons"),value:"inline"},{label:(0,i.__)("Block","cozy-addons"),value:"block"}],value:e.display,onChange:n=>t({...e,display:n})}),e.enableOptions.labelBefore&&(0,l.jsx)(a.TextControl,{label:(0,i.__)("Preceding Label","cozy-addons"),type:"text",value:e.labelBefore,onChange:n=>t({...e,labelBefore:n})}),e.enableOptions.labelAfter&&(0,l.jsx)(a.TextControl,{label:(0,i.__)("Subsequent Label","cozy-addons"),type:"text",value:e.labelAfter,onChange:n=>t({...e,labelAfter:n})}),(0,l.jsx)(r.HeightControl,{label:(0,i.__)("Content Gap","cozy-addons"),value:e.contentGap,onChange:n=>t({...e,contentGap:n})}),"inline"===e.display&&(0,l.jsx)("div",{style:{margin:"22px 0"},children:(0,l.jsxs)(a.__experimentalToggleGroupControl,{label:(0,i.__)("Content Justification","cozy-addons"),value:e.contentJustify,isBlock:!0,onChange:n=>t({...e,contentJustify:n}),children:[(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"left",label:(0,i.__)("Left","cozy-addons"),icon:c}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"center",label:(0,i.__)("Center","cozy-addons"),icon:h}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"right",label:(0,i.__)("Right","cozy-addons"),icon:d}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"space-between",label:(0,i.__)("Space Between","cozy-addons"),icon:f})]})}),"block"===e.display&&(0,l.jsx)("div",{style:{margin:"22px 0"},children:(0,l.jsxs)(a.__experimentalToggleGroupControl,{label:(0,i.__)("Text Align","cozy-addons"),value:e.textAlign,isBlock:!0,onChange:n=>t({...e,textAlign:n}),children:[(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"left",label:(0,i.__)("Left","cozy-addons"),icon:p}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"center",label:(0,i.__)("Center","cozy-addons"),icon:v}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{value:"right",label:(0,i.__)("Right","cozy-addons"),icon:y})]})})]}),e.enableOptions.icon&&(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("Icon","cozy-addons"),opened:"icon"===z,onToggle:()=>P("icon"),children:[(0,l.jsx)("div",{style:{position:"relative"},children:(0,l.jsxs)(a.BaseControl,{children:[(0,l.jsx)(a.BaseControl.VisualLabel,{children:(0,i.__)("Select Icon","cozy-addons")}),(0,l.jsx)("svg",{style:{position:"absolute",right:"0"},width:16,height:16,xmlns:"http://www.w3.org/2000/svg",viewBox:`${e.icon.viewBox.vx} ${e.icon.viewBox.vy} ${e.icon.viewBox.vw} ${e.icon.viewBox.vh}`,"aria-hidden":"true",fill:"black",children:(0,l.jsx)("path",{d:e.icon.path})}),(0,l.jsx)("input",{type:"text",className:"cozy-icon-search",placeholder:(0,i.__)("Search Icons...","cozy-addons"),value:n,onChange:o}),(0,l.jsx)("div",{className:"cozy-icon-list",children:u.map((e=>{const t=cozyIcons.collection[e],n=t.match(/d="([^"]+)"/),o=t.match(/viewBox\s*=\s*"([^"]*)"/),i=n?n[1]:"",r=o?o[1]:"";return(0,l.jsx)(a.Button,{onClick:()=>_(i,r),children:(0,l.jsx)("div",{className:"cozy-icon",title:e,dangerouslySetInnerHTML:{__html:t}})},e)}))})]})}),(0,l.jsx)(a.SelectControl,{label:(0,i.__)("Position","cozy-addons"),options:[{label:(0,i.__)("Before Views Count","cozy-addons"),value:"before"},{label:(0,i.__)("After Views Count","cozy-addons"),value:"after"}],value:e.icon.position,onChange:n=>t({...e,icon:{...e.icon,position:n}})})]}),(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("Query Options","cozy-addons"),opened:"query-options"===z,onToggle:()=>P("query-options"),children:[(0,l.jsx)(a.ToggleControl,{label:(0,i.__)("Preceding Label","cozy-addons"),checked:e.enableOptions.labelBefore,onChange:n=>t({...e,enableOptions:{...e.enableOptions,labelBefore:n}})}),(0,l.jsx)(a.ToggleControl,{label:(0,i.__)("Icon","cozy-addons"),checked:e.enableOptions.icon,onChange:n=>t({...e,enableOptions:{...e.enableOptions,icon:n}})}),(0,l.jsx)(a.ToggleControl,{label:(0,i.__)("Views","cozy-addons"),checked:e.enableOptions.views,onChange:n=>t({...e,enableOptions:{...e.enableOptions,views:n}})}),(0,l.jsx)(a.ToggleControl,{label:(0,i.__)("Subsequent Label","cozy-addons"),checked:e.enableOptions.labelAfter,onChange:n=>t({...e,enableOptions:{...e.enableOptions,labelAfter:n}})})]})]},"setting"),(0,l.jsxs)(r.InspectorControls,{group:"styles",children:[e.enableOptions.icon&&(0,l.jsxs)(l.Fragment,{children:["stacked"===e.icon.view&&(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("Icon Box Styles","cozy-addons"),opened:"icon-box-styles"===z,onToggle:()=>P("icon-box-styles"),children:[(0,l.jsxs)(a.BaseControl,{className:"cozy-box-control",children:[(0,l.jsx)(a.BaseControl.VisualLabel,{children:(0,i.__)("Padding","cozy-addons")}),(0,l.jsx)(a.__experimentalBoxControl,{label:"",resetValues:{top:"0",right:"0",bottom:"0",left:"0"},values:e.iconBox.padding,onChange:n=>t({...e,iconBox:{...e.iconBox,padding:n}})})]}),(0,l.jsx)("div",{className:"components-base-control",children:(0,l.jsx)(a.__experimentalBorderControl,{label:(0,i.__)("Border","cozy-addons"),enableAlpha:!0,colors:S,isCompact:!0,value:e.iconBox.border,onChange:n=>t({...e,iconBox:{...e.iconBox,border:n}})})}),(0,l.jsx)("div",{className:"components-base-control",children:(0,l.jsx)(r.HeightControl,{label:(0,i.__)("Border Radius","cozy-addons"),value:e.iconBox.borderRadius,onChange:n=>t({...e,iconBox:{...e.iconBox,borderRadius:n}})})}),(0,l.jsx)(r.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,i.__)("Color","cozy-addons"),colorSettings:[{label:(0,i.__)("Background","cozy-addons"),value:e.iconBox.bgColor,onChange:n=>t({...e,iconBox:{...e.iconBox,bgColor:n}})}]})]}),(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("Icon Styles","cozy-addons"),opened:"icon-styles"===z,onToggle:()=>P("icon-styles"),children:[(0,l.jsx)(a.SelectControl,{label:(0,i.__)("View","cozy-addons"),options:[{label:(0,i.__)("Default","cozy-addons"),value:"default"},{label:(0,i.__)("Stacked","cozy-addons"),value:"stacked"}],value:e.icon.view,onChange:n=>t({...e,icon:{...e.icon,view:n}})}),(0,l.jsx)(a.SelectControl,{label:(0,i.__)("Layout","cozy-addons"),options:[{label:(0,i.__)("Fill","cozy-addons"),value:"fill"},{label:(0,i.__)("Outline","cozy-addons"),value:"outline"}],value:e.icon.layout,onChange:n=>t({...e,icon:{...e.icon,layout:n}})}),(0,l.jsx)(r.HeightControl,{label:(0,i.__)("Size","cozy-addons"),value:e.icon.size,onChange:n=>t({...e,icon:{...e.icon,size:n}})}),(0,l.jsx)("div",{style:{margin:"22px 0"},children:(0,l.jsx)(r.HeightControl,{label:(0,i.__)("Gap","cozy-addons"),value:e.icon.gap,onChange:n=>t({...e,icon:{...e.icon,gap:n}})})}),"outline"===e.icon.layout&&(0,l.jsx)(a.RangeControl,{label:(0,i.__)("Outline Width","cozy-addons"),min:1,max:10,step:1,value:e.icon.strokeWidth,onChange:n=>t({...e,icon:{...e.icon,strokeWidth:Math.abs(n)}})}),(0,l.jsx)(a.RangeControl,{label:(0,i.__)("Rotate","cozy-addons"),min:0,max:360,step:1,value:e.icon.rotate,onChange:n=>t({...e,icon:{...e.icon,rotate:Math.abs(n)}})}),(0,l.jsx)(a.RangeControl,{label:(0,i.__)("Opacity","cozy-addons"),min:0,max:100,step:1,value:e.icon.opacity,onChange:n=>t({...e,icon:{...e.icon,opacity:Math.abs(n)}})}),(0,l.jsx)(r.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,i.__)("Color","cozy-addons"),colorSettings:[{label:(0,i.__)("Icon","cozy-addons"),value:e.icon.color,onChange:n=>t({...e,icon:{...e.icon,color:n}})}]})]})]}),(e.enableOptions.labelBefore||e.enableOptions.labelAfter)&&(0,l.jsxs)(a.PanelBody,{title:(0,i.__)("Label Typography","cozy-addons"),opened:"label-typography"===z,onToggle:()=>P("label-typography"),children:[(0,l.jsx)(a.SelectControl,{label:(0,i.__)("Font Family","cozy-addons"),options:j,value:e.label.fontFamily,onChange:n=>t({...e,label:{...e.label,fontFamily:n}})}),(0,l.jsx)("div",{style:{marginBottom:"22px"},children:(0,l.jsx)(r.HeightControl,{label:(0,i.__)("Font Size","cozy-addons"),value:e.label.fontSize,onChange:n=>t({...e,label:{...e.label,fontSize:n}})})}),(0,l.jsx)(a.SelectControl,{label:(0,i.__)("Font Weight","cozy-addons"),options:[{label:(0,i.__)("Light","cozy-addons"),value:"300"},{label:(0,i.__)("Regular","cozy-addons"),value:"400"},{label:(0,i.__)("Medium","cozy-addons"),value:"500"},{label:(0,i.__)("Semi Bold","cozy-addons"),value:"600"},{label:(0,i.__)("Bold","cozy-addons"),value:"700"},{label:(0,i.__)("Extra Bold","cozy-addons"),value:"800"},{label:(0,i.__)("Black","cozy-addons"),value:"900"}],value:e.label.fontWeight,onChange:n=>t({...e,label:{...e.label,fontWeight:n}})}),(0,l.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsxs)(a.__experimentalToggleGroupControl,{label:(0,i.__)("Letter Case","cozy-addons"),value:e.label?.letterCase,onChange:n=>t({...e,label:{...e.label,letterCase:n}}),children:[(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("None","cozy-addons"),value:"none",icon:b}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("Uppercase","cozy-addons"),value:"uppercase",icon:g}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("Lowercase","cozy-addons"),value:"lowercase",icon:m}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("Capitalize","cozy-addons"),value:"capitalize",icon:x})]})}),(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsxs)(a.__experimentalToggleGroupControl,{label:(0,i.__)("Decoration","cozy-addons"),value:e.label?.decoration,onChange:n=>t({...e,label:{...e.label,decoration:n}}),children:[(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("None","cozy-addons"),value:"none",icon:b}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("Underline","cozy-addons"),value:"underline",icon:C}),(0,l.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,i.__)("Strikethrough","cozy-addons"),value:"line-through",icon:w})]})})]}),(0,l.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)(a.__experimentalUnitControl,{label:(0,i.__)("Line Height","cozy-addons"),value:e.label?.lineHeight,onChange:n=>t({...e,label:{...e.label,lineHeight:n}})})}),(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)(a.__experimentalUnitControl,{label:(0,i.__)("Letter Spacing","cozy-addons"),value:e.label?.letterSpacing,onChange:n=>t({...e,label:{...e.label,letterSpacing:n}})})})]}),(0,l.jsx)(r.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,i.__)("Color","cozy-addons"),colorSettings:[{label:(0,i.__)("Text","cozy-addons"),value:e.label.color,onChange:n=>t({...e,label:{...e.label,color:n}})}]})]})]},"style")]})}));function z(e,t){function n(e,t){return t&&Object.keys(t).length<4?1===Object.keys(t).length?`\n ${e}: ${t};\n `:`\n ${e}: ${t.width} ${t.style} ${t.color};\n `:t&&4===Object.keys(t).length?"border"===e?`\n border-top: ${t.top.width} ${t.top.style} ${t.top.color};\n border-right: ${t.right.width} ${t.right.style} ${t.right.color};\n border-bottom: ${t.bottom.width} ${t.bottom.style} ${t.bottom.color};\n border-left: ${t.left.width} ${t.left.style} ${t.left.color};\n `:`\n ${e}: ${t.top} ${t.right} ${t.bottom} ${t.left};\n `:""}return`\n #${e}.display-block {\n text-align: ${t.textAlign};\n }\n #${e}.display-block .cozy-block-post-views__wrapper {\n justify-content: ${t.textAlign};\n margin: ${t.contentGap} 0;\n }\n #${e}.display-inline {\n justify-content: ${t.contentJustify};\n gap: ${t.contentGap};\n }\n\n #${e} .cozy-block-post-views__wrapper {\n gap: ${t.icon.gap};\n }\n\n #${e} .cozy-block-post-views__icon-wrapper.view-stacked {\n ${n("padding",t.iconBox.padding)}\n ${n("border",t.iconBox.border)}\n border-radius: ${t.iconBox.borderRadius};\n background-color: ${t.iconBox.bgColor};\n }\n #${e} .cozy-block-post-views__icon {\n transform: rotate(${t.icon.rotate}deg);\n }\n\n #${e} .cozy-block-post-views__label {\n font-family: ${t.label.fontFamily};\n font-size: ${t.label.fontSize};\n font-weight: ${t.label.fontWeight};\n text-transform: ${t.label?.letterCase};\n text-decoration: ${t.label?.decoration};\n line-height: ${t.label?.lineHeight};\n letter-spacing: ${t.label?.letterSpacing};\n color: ${t.label.color};\n }\n `}var P=n(942);const Q=(0,s.memo)((({icon:e})=>(0,l.jsx)("div",{className:`cozy-block-post-views__icon-wrapper view-${e.view} layout-${e.layout}`,children:(0,l.jsx)("svg",{width:e.size,height:e.size,className:"cozy-block-post-views__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:`${e.viewBox.vx} ${e.viewBox.vy} ${e.viewBox.vw} ${e.viewBox.vh}`,"aria-hidden":"true",fill:"fill"===e.layout?e.color:"none",stroke:"outline"===e.layout?e.color:"none",strokeWidth:"outline"===e.layout?e.strokeWidth:"",strokeOpacity:"outline"===e.layout?parseFloat(e.opacity)/100:"",children:(0,l.jsx)("path",{d:e.path})})}))),A=(0,s.memo)((({blockID:e,attributes:t,postId:n,setAttributes:o})=>{const{data:s,isLoading:a}=(0,P.useQuery)(["postViews",n],(()=>(async e=>{if(!e)return console.error("Invalid post_id:",e),"";try{return await j()({path:`/cozy-block/v1/post-views/${e}`})}catch(e){return console.error("Error fetching post views:",e),""}})(n)));return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:z(e,t)}}),(0,l.jsxs)("div",{className:`cozy-block-post-views display-${t.display}`,id:e,children:[""!=t.label.fontFamily&&null!=t.label.fontFamily&&(0,l.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${t.label.fontFamily}:wght@300;400;500;600;700;800;900`}),t.enableOptions.labelBefore&&(0,l.jsx)(r.RichText,{className:"cozy-block-post-views__label cozy-block-post-views__label-before",value:t.labelBefore,onChange:e=>o({...t,labelBefore:e})}),(0,l.jsxs)("div",{className:"cozy-block-post-views__wrapper",children:[t.enableOptions.icon&&"before"===t.icon.position&&(0,l.jsx)(Q,{icon:t.icon}),t.enableOptions.views&&(0,l.jsx)("p",{className:"cozy-block-post-views__view-count",children:(0,i.__)(s,"cozy-addons")}),t.enableOptions.icon&&"after"===t.icon.position&&(0,l.jsx)(Q,{icon:t.icon})]}),t.enableOptions.labelAfter&&(0,l.jsx)(r.RichText,{className:"cozy-block-post-views__label cozy-block-post-views__label-after",value:t.labelAfter,onChange:e=>o({...t,labelAfter:e})})]})]})})),F=({children:e})=>{const t=new P.QueryClient;return(0,l.jsx)(P.QueryClientProvider,{client:t,children:e})},R=JSON.parse('{"UU":"cozy-block/post-views","h_":"Unlock the Engagement Power! See what captivates your audience with our \'Post Views\' block. Gain valuable insights to refine your content strategy and maximize impact."}'),q=(0,l.jsxs)("svg",{width:"27",height:"21",viewBox:"0 0 27 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("rect",{fill:"none",x:"1",y:"1",width:"25",height:"19",stroke:"#0C50FF",strokeWidth:"2"}),(0,l.jsx)("path",{d:"M20.9094 10.6198C19.4971 7.86432 16.7013 6 13.5 6C10.2987 6 7.50207 7.86563 6.09061 10.6201C6.03104 10.7379 6 10.8681 6 11.0001C6 11.1322 6.03104 11.2624 6.09061 11.3802C7.50285 14.1357 10.2987 16 13.5 16C16.7013 16 19.4979 14.1344 20.9094 11.3799C20.9689 11.2621 21 11.1319 21 10.9999C21 10.8678 20.9689 10.7376 20.9094 10.6198ZM13.5 14.75C12.7583 14.75 12.0333 14.5301 11.4166 14.118C10.7999 13.706 10.3193 13.1203 10.0354 12.4351C9.75161 11.7498 9.67735 10.9958 9.82204 10.2684C9.96674 9.54098 10.3239 8.8728 10.8483 8.34835C11.3728 7.8239 12.041 7.46675 12.7684 7.32206C13.4958 7.17736 14.2498 7.25162 14.935 7.53545C15.6203 7.81928 16.2059 8.29993 16.618 8.91661C17.0301 9.5333 17.25 10.2583 17.25 11C17.2502 11.4925 17.1534 11.9803 16.965 12.4353C16.7767 12.8904 16.5004 13.3039 16.1522 13.6522C15.8039 14.0005 15.3904 14.2767 14.9353 14.465C14.4803 14.6534 13.9925 14.7502 13.5 14.75ZM13.5 8.5C13.2768 8.50312 13.0551 8.53632 12.8409 8.5987C13.0175 8.83872 13.1022 9.13408 13.0798 9.43124C13.0573 9.72839 12.9291 10.0076 12.7183 10.2184C12.5076 10.4291 12.2284 10.5573 11.9312 10.5798C11.6341 10.6023 11.3387 10.5175 11.0987 10.3409C10.962 10.8444 10.9867 11.3781 11.1692 11.8669C11.3518 12.3557 11.683 12.7749 12.1163 13.0656C12.5496 13.3563 13.0631 13.5038 13.5846 13.4873C14.1061 13.4708 14.6093 13.2912 15.0234 12.9738C15.4375 12.6563 15.7416 12.217 15.8929 11.7177C16.0442 11.2184 16.0352 10.6842 15.867 10.1903C15.6988 9.69635 15.38 9.26761 14.9554 8.9644C14.5307 8.66119 14.0217 8.49877 13.5 8.5Z",fill:"#0C50FF"})]});(0,o.registerBlockType)(R.UU,{title:(0,i.__)("Post Views","cozy-addons"),description:(0,i.__)(R.h_,"cozy-addons"),icon:{src:q},edit:function({attributes:e,setAttributes:t,context:{postType:n,postId:o,queryId:i},clientId:a}){if(e.cover)return(0,l.jsx)("img",{src:e.cover});e.clientId=a;const u=`cozyBlock_${a.replace(/-/gi,"_")}`,c=(0,r.useBlockProps)({className:"cozy-block-wrapper"});e.postType=n;const[h,d]=(0,s.useState)(""),f=Object.keys(cozyIcons.collection).filter((e=>e.toLowerCase().includes(h.toLowerCase())));return(0,l.jsxs)(F,{children:[(0,l.jsx)("div",{...c,children:"post"===e.postType&&(0,l.jsx)(A,{blockID:u,attributes:e,setAttributes:t,postId:o})}),(0,l.jsx)(S,{attributes:e,setAttributes:t,searchQuery:h,handleSearch:e=>{d(e.target.value)},filteredIcons:f,handleIconClick:(n,o)=>{const i=o.split(" ");t({...e,icon:{...e.icon,path:n,viewBox:{vx:i[0],vy:i[1],vw:i[2],vh:i[3]}}})}})]})},save:function({attributes:e}){}})},289:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var o=n(540),i=n(287),r=n(941),s=new(function(e){function t(){var t;return(t=e.call(this)||this).setup=function(e){var t;if(!r.S$&&(null==(t=window)?void 0:t.addEventListener)){var n=function(){return e()};return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),function(){window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}},t}(0,o.A)(t,e);var n=t.prototype;return n.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},n.onUnsubscribe=function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)},n.setEventListener=function(e){var t,n=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"==typeof e?n.setFocused(e):n.onFocus()}))},n.setFocused=function(e){this.focused=e,e&&this.onFocus()},n.onFocus=function(){this.listeners.forEach((function(e){e()}))},n.isFocused=function(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)},t}(i.Q))},468:(e,t,n)=>{"use strict";n.d(t,{QueryClient:()=>o.E});var o=n(687),i=n(449);n.o(i,"QueryClientProvider")&&n.d(t,{QueryClientProvider:function(){return i.QueryClientProvider}}),n.o(i,"useQuery")&&n.d(t,{useQuery:function(){return i.useQuery}})},690:(e,t,n)=>{"use strict";n.d(t,{B:()=>r,t:()=>i});var o=console;function i(){return o}function r(e){o=e}},428:(e,t,n)=>{"use strict";n.d(t,{j:()=>i});var o=n(941),i=new(function(){function e(){this.queue=[],this.transactions=0,this.notifyFn=function(e){e()},this.batchNotifyFn=function(e){e()}}var t=e.prototype;return t.batch=function(e){var t;this.transactions++;try{t=e()}finally{this.transactions--,this.transactions||this.flush()}return t},t.schedule=function(e){var t=this;this.transactions?this.queue.push(e):(0,o.G6)((function(){t.notifyFn(e)}))},t.batchCalls=function(e){var t=this;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];t.schedule((function(){e.apply(void 0,o)}))}},t.flush=function(){var e=this,t=this.queue;this.queue=[],t.length&&(0,o.G6)((function(){e.batchNotifyFn((function(){t.forEach((function(t){e.notifyFn(t)}))}))}))},t.setNotifyFunction=function(e){this.notifyFn=e},t.setBatchNotifyFunction=function(e){this.batchNotifyFn=e},e}())},622:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});var o=n(540),i=n(287),r=n(941),s=new(function(e){function t(){var t;return(t=e.call(this)||this).setup=function(e){var t;if(!r.S$&&(null==(t=window)?void 0:t.addEventListener)){var n=function(){return e()};return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n)}}},t}(0,o.A)(t,e);var n=t.prototype;return n.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},n.onUnsubscribe=function(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)},n.setEventListener=function(e){var t,n=this;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((function(e){"boolean"==typeof e?n.setOnline(e):n.onOnline()}))},n.setOnline=function(e){this.online=e,e&&this.onOnline()},n.onOnline=function(){this.listeners.forEach((function(e){e()}))},n.isOnline=function(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine},t}(i.Q))},687:(e,t,n)=>{"use strict";n.d(t,{E:()=>b});var o=n(168),i=n(941),r=n(540),s=n(428),a=n(690),u=n(281),l=function(){function e(e){this.abortSignalConsumed=!1,this.hadObservers=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||this.getDefaultState(this.options),this.state=this.initialState,this.meta=e.meta,this.scheduleGc()}var t=e.prototype;return t.setOptions=function(e){var t;this.options=(0,o.A)({},this.defaultOptions,e),this.meta=null==e?void 0:e.meta,this.cacheTime=Math.max(this.cacheTime||0,null!=(t=this.options.cacheTime)?t:3e5)},t.setDefaultOptions=function(e){this.defaultOptions=e},t.scheduleGc=function(){var e=this;this.clearGcTimeout(),(0,i.gn)(this.cacheTime)&&(this.gcTimeout=setTimeout((function(){e.optionalRemove()}),this.cacheTime))},t.clearGcTimeout=function(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)},t.optionalRemove=function(){this.observers.length||(this.state.isFetching?this.hadObservers&&this.scheduleGc():this.cache.remove(this))},t.setData=function(e,t){var n,o,r=this.state.data,s=(0,i.Zw)(e,r);return(null==(n=(o=this.options).isDataEqual)?void 0:n.call(o,r,s))?s=r:!1!==this.options.structuralSharing&&(s=(0,i.BH)(r,s)),this.dispatch({data:s,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt}),s},t.setState=function(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})},t.cancel=function(e){var t,n=this.promise;return null==(t=this.retryer)||t.cancel(e),n?n.then(i.lQ).catch(i.lQ):Promise.resolve()},t.destroy=function(){this.clearGcTimeout(),this.cancel({silent:!0})},t.reset=function(){this.destroy(),this.setState(this.initialState)},t.isActive=function(){return this.observers.some((function(e){return!1!==e.options.enabled}))},t.isFetching=function(){return this.state.isFetching},t.isStale=function(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some((function(e){return e.getCurrentResult().isStale}))},t.isStaleByTime=function(e){return void 0===e&&(e=0),this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,i.j3)(this.state.dataUpdatedAt,e)},t.onFocus=function(){var e,t=this.observers.find((function(e){return e.shouldFetchOnWindowFocus()}));t&&t.refetch(),null==(e=this.retryer)||e.continue()},t.onOnline=function(){var e,t=this.observers.find((function(e){return e.shouldFetchOnReconnect()}));t&&t.refetch(),null==(e=this.retryer)||e.continue()},t.addObserver=function(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.hadObservers=!0,this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))},t.removeObserver=function(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter((function(t){return t!==e})),this.observers.length||(this.retryer&&(this.retryer.isTransportCancelable||this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.cacheTime?this.scheduleGc():this.cache.remove(this)),this.cache.notify({type:"observerRemoved",query:this,observer:e}))},t.getObserversCount=function(){return this.observers.length},t.invalidate=function(){this.state.isInvalidated||this.dispatch({type:"invalidate"})},t.fetch=function(e,t){var n,o,r,s=this;if(this.state.isFetching)if(this.state.dataUpdatedAt&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(this.promise){var l;return null==(l=this.retryer)||l.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){var c=this.observers.find((function(e){return e.options.queryFn}));c&&this.setOptions(c.options)}var h=(0,i.HN)(this.queryKey),d=(0,i.jY)(),f={queryKey:h,pageParam:void 0,meta:this.meta};Object.defineProperty(f,"signal",{enumerable:!0,get:function(){if(d)return s.abortSignalConsumed=!0,d.signal}});var p,v,y={fetchOptions:t,options:this.options,queryKey:h,state:this.state,fetchFn:function(){return s.options.queryFn?(s.abortSignalConsumed=!1,s.options.queryFn(f)):Promise.reject("Missing queryFn")},meta:this.meta};return(null==(n=this.options.behavior)?void 0:n.onFetch)&&(null==(p=this.options.behavior)||p.onFetch(y)),this.revertState=this.state,this.state.isFetching&&this.state.fetchMeta===(null==(o=y.fetchOptions)?void 0:o.meta)||this.dispatch({type:"fetch",meta:null==(v=y.fetchOptions)?void 0:v.meta}),this.retryer=new u.eJ({fn:y.fetchFn,abort:null==d||null==(r=d.abort)?void 0:r.bind(d),onSuccess:function(e){s.setData(e),null==s.cache.config.onSuccess||s.cache.config.onSuccess(e,s),0===s.cacheTime&&s.optionalRemove()},onError:function(e){(0,u.wm)(e)&&e.silent||s.dispatch({type:"error",error:e}),(0,u.wm)(e)||(null==s.cache.config.onError||s.cache.config.onError(e,s),(0,a.t)().error(e)),0===s.cacheTime&&s.optionalRemove()},onFail:function(){s.dispatch({type:"failed"})},onPause:function(){s.dispatch({type:"pause"})},onContinue:function(){s.dispatch({type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay}),this.promise=this.retryer.promise,this.promise},t.dispatch=function(e){var t=this;this.state=this.reducer(this.state,e),s.j.batch((function(){t.observers.forEach((function(t){t.onQueryUpdate(e)})),t.cache.notify({query:t,type:"queryUpdated",action:e})}))},t.getDefaultState=function(e){var t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==e.initialData?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0,o=void 0!==t;return{data:t,dataUpdateCount:0,dataUpdatedAt:o?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isFetching:!1,isInvalidated:!1,isPaused:!1,status:o?"success":"idle"}},t.reducer=function(e,t){var n,i;switch(t.type){case"failed":return(0,o.A)({},e,{fetchFailureCount:e.fetchFailureCount+1});case"pause":return(0,o.A)({},e,{isPaused:!0});case"continue":return(0,o.A)({},e,{isPaused:!1});case"fetch":return(0,o.A)({},e,{fetchFailureCount:0,fetchMeta:null!=(n=t.meta)?n:null,isFetching:!0,isPaused:!1},!e.dataUpdatedAt&&{error:null,status:"loading"});case"success":return(0,o.A)({},e,{data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(i=t.dataUpdatedAt)?i:Date.now(),error:null,fetchFailureCount:0,isFetching:!1,isInvalidated:!1,isPaused:!1,status:"success"});case"error":var r=t.error;return(0,u.wm)(r)&&r.revert&&this.revertState?(0,o.A)({},this.revertState):(0,o.A)({},e,{error:r,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return(0,o.A)({},e,{isInvalidated:!0});case"setState":return(0,o.A)({},e,t.state);default:return e}},e}(),c=n(287),h=function(e){function t(t){var n;return(n=e.call(this)||this).config=t||{},n.queries=[],n.queriesMap={},n}(0,r.A)(t,e);var n=t.prototype;return n.build=function(e,t,n){var o,r=t.queryKey,s=null!=(o=t.queryHash)?o:(0,i.F$)(r,t),a=this.get(s);return a||(a=new l({cache:this,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r),meta:t.meta}),this.add(a)),a},n.add=function(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"queryAdded",query:e}))},n.remove=function(e){var t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter((function(t){return t!==e})),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"queryRemoved",query:e}))},n.clear=function(){var e=this;s.j.batch((function(){e.queries.forEach((function(t){e.remove(t)}))}))},n.get=function(e){return this.queriesMap[e]},n.getAll=function(){return this.queries},n.find=function(e,t){var n=(0,i.b_)(e,t)[0];return void 0===n.exact&&(n.exact=!0),this.queries.find((function(e){return(0,i.MK)(n,e)}))},n.findAll=function(e,t){var n=(0,i.b_)(e,t)[0];return Object.keys(n).length>0?this.queries.filter((function(e){return(0,i.MK)(n,e)})):this.queries},n.notify=function(e){var t=this;s.j.batch((function(){t.listeners.forEach((function(t){t(e)}))}))},n.onFocus=function(){var e=this;s.j.batch((function(){e.queries.forEach((function(e){e.onFocus()}))}))},n.onOnline=function(){var e=this;s.j.batch((function(){e.queries.forEach((function(e){e.onOnline()}))}))},t}(c.Q),d=function(){function e(e){this.options=(0,o.A)({},e.defaultOptions,e.options),this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.observers=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0},this.meta=e.meta}var t=e.prototype;return t.setState=function(e){this.dispatch({type:"setState",state:e})},t.addObserver=function(e){-1===this.observers.indexOf(e)&&this.observers.push(e)},t.removeObserver=function(e){this.observers=this.observers.filter((function(t){return t!==e}))},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(i.lQ).catch(i.lQ)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var e,t=this,n="loading"===this.state.status,o=Promise.resolve();return n||(this.dispatch({type:"loading",variables:this.options.variables}),o=o.then((function(){null==t.mutationCache.config.onMutate||t.mutationCache.config.onMutate(t.state.variables,t)})).then((function(){return null==t.options.onMutate?void 0:t.options.onMutate(t.state.variables)})).then((function(e){e!==t.state.context&&t.dispatch({type:"loading",context:e,variables:t.state.variables})}))),o.then((function(){return t.executeMutation()})).then((function(n){e=n,null==t.mutationCache.config.onSuccess||t.mutationCache.config.onSuccess(e,t.state.variables,t.state.context,t)})).then((function(){return null==t.options.onSuccess?void 0:t.options.onSuccess(e,t.state.variables,t.state.context)})).then((function(){return null==t.options.onSettled?void 0:t.options.onSettled(e,null,t.state.variables,t.state.context)})).then((function(){return t.dispatch({type:"success",data:e}),e})).catch((function(e){return null==t.mutationCache.config.onError||t.mutationCache.config.onError(e,t.state.variables,t.state.context,t),(0,a.t)().error(e),Promise.resolve().then((function(){return null==t.options.onError?void 0:t.options.onError(e,t.state.variables,t.state.context)})).then((function(){return null==t.options.onSettled?void 0:t.options.onSettled(void 0,e,t.state.variables,t.state.context)})).then((function(){throw t.dispatch({type:"error",error:e}),e}))}))},t.executeMutation=function(){var e,t=this;return this.retryer=new u.eJ({fn:function(){return t.options.mutationFn?t.options.mutationFn(t.state.variables):Promise.reject("No mutationFn found")},onFail:function(){t.dispatch({type:"failed"})},onPause:function(){t.dispatch({type:"pause"})},onContinue:function(){t.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(e){var t=this;this.state=function(e,t){switch(t.type){case"failed":return(0,o.A)({},e,{failureCount:e.failureCount+1});case"pause":return(0,o.A)({},e,{isPaused:!0});case"continue":return(0,o.A)({},e,{isPaused:!1});case"loading":return(0,o.A)({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return(0,o.A)({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return(0,o.A)({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return(0,o.A)({},e,t.state);default:return e}}(this.state,e),s.j.batch((function(){t.observers.forEach((function(t){t.onMutationUpdate(e)})),t.mutationCache.notify(t)}))},e}(),f=function(e){function t(t){var n;return(n=e.call(this)||this).config=t||{},n.mutations=[],n.mutationId=0,n}(0,r.A)(t,e);var n=t.prototype;return n.build=function(e,t,n){var o=new d({mutationCache:this,mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:n,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0,meta:t.meta});return this.add(o),o},n.add=function(e){this.mutations.push(e),this.notify(e)},n.remove=function(e){this.mutations=this.mutations.filter((function(t){return t!==e})),e.cancel(),this.notify(e)},n.clear=function(){var e=this;s.j.batch((function(){e.mutations.forEach((function(t){e.remove(t)}))}))},n.getAll=function(){return this.mutations},n.find=function(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find((function(t){return(0,i.nJ)(e,t)}))},n.findAll=function(e){return this.mutations.filter((function(t){return(0,i.nJ)(e,t)}))},n.notify=function(e){var t=this;s.j.batch((function(){t.listeners.forEach((function(t){t(e)}))}))},n.onFocus=function(){this.resumePausedMutations()},n.onOnline=function(){this.resumePausedMutations()},n.resumePausedMutations=function(){var e=this.mutations.filter((function(e){return e.state.isPaused}));return s.j.batch((function(){return e.reduce((function(e,t){return e.then((function(){return t.continue().catch(i.lQ)}))}),Promise.resolve())}))},t}(c.Q),p=n(289),v=n(622);function y(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}var b=function(){function e(e){void 0===e&&(e={}),this.queryCache=e.queryCache||new h,this.mutationCache=e.mutationCache||new f,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var t=e.prototype;return t.mount=function(){var e=this;this.unsubscribeFocus=p.m.subscribe((function(){p.m.isFocused()&&v.t.isOnline()&&(e.mutationCache.onFocus(),e.queryCache.onFocus())})),this.unsubscribeOnline=v.t.subscribe((function(){p.m.isFocused()&&v.t.isOnline()&&(e.mutationCache.onOnline(),e.queryCache.onOnline())}))},t.unmount=function(){var e,t;null==(e=this.unsubscribeFocus)||e.call(this),null==(t=this.unsubscribeOnline)||t.call(this)},t.isFetching=function(e,t){var n=(0,i.b_)(e,t)[0];return n.fetching=!0,this.queryCache.findAll(n).length},t.isMutating=function(e){return this.mutationCache.findAll((0,o.A)({},e,{fetching:!0})).length},t.getQueryData=function(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state.data},t.getQueriesData=function(e){return this.getQueryCache().findAll(e).map((function(e){return[e.queryKey,e.state.data]}))},t.setQueryData=function(e,t,n){var o=(0,i.vh)(e),r=this.defaultQueryOptions(o);return this.queryCache.build(this,r).setData(t,n)},t.setQueriesData=function(e,t,n){var o=this;return s.j.batch((function(){return o.getQueryCache().findAll(e).map((function(e){var i=e.queryKey;return[i,o.setQueryData(i,t,n)]}))}))},t.getQueryState=function(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state},t.removeQueries=function(e,t){var n=(0,i.b_)(e,t)[0],o=this.queryCache;s.j.batch((function(){o.findAll(n).forEach((function(e){o.remove(e)}))}))},t.resetQueries=function(e,t,n){var r=this,a=(0,i.b_)(e,t,n),u=a[0],l=a[1],c=this.queryCache,h=(0,o.A)({},u,{active:!0});return s.j.batch((function(){return c.findAll(u).forEach((function(e){e.reset()})),r.refetchQueries(h,l)}))},t.cancelQueries=function(e,t,n){var o=this,r=(0,i.b_)(e,t,n),a=r[0],u=r[1],l=void 0===u?{}:u;void 0===l.revert&&(l.revert=!0);var c=s.j.batch((function(){return o.queryCache.findAll(a).map((function(e){return e.cancel(l)}))}));return Promise.all(c).then(i.lQ).catch(i.lQ)},t.invalidateQueries=function(e,t,n){var r,a,u,l=this,c=(0,i.b_)(e,t,n),h=c[0],d=c[1],f=(0,o.A)({},h,{active:null==(r=null!=(a=h.refetchActive)?a:h.active)||r,inactive:null!=(u=h.refetchInactive)&&u});return s.j.batch((function(){return l.queryCache.findAll(h).forEach((function(e){e.invalidate()})),l.refetchQueries(f,d)}))},t.refetchQueries=function(e,t,n){var r=this,a=(0,i.b_)(e,t,n),u=a[0],l=a[1],c=s.j.batch((function(){return r.queryCache.findAll(u).map((function(e){return e.fetch(void 0,(0,o.A)({},l,{meta:{refetchPage:null==u?void 0:u.refetchPage}}))}))})),h=Promise.all(c).then(i.lQ);return(null==l?void 0:l.throwOnError)||(h=h.catch(i.lQ)),h},t.fetchQuery=function(e,t,n){var o=(0,i.vh)(e,t,n),r=this.defaultQueryOptions(o);void 0===r.retry&&(r.retry=!1);var s=this.queryCache.build(this,r);return s.isStaleByTime(r.staleTime)?s.fetch(r):Promise.resolve(s.state.data)},t.prefetchQuery=function(e,t,n){return this.fetchQuery(e,t,n).then(i.lQ).catch(i.lQ)},t.fetchInfiniteQuery=function(e,t,n){var o=(0,i.vh)(e,t,n);return o.behavior={onFetch:function(e){e.fetchFn=function(){var t,n,o,r,s,a,l,c,h,d=null==(t=e.fetchOptions)||null==(n=t.meta)?void 0:n.refetchPage,f=null==(o=e.fetchOptions)||null==(r=o.meta)?void 0:r.fetchMore,p=null==f?void 0:f.pageParam,v="forward"===(null==f?void 0:f.direction),b="backward"===(null==f?void 0:f.direction),g=(null==(s=e.state.data)?void 0:s.pages)||[],m=(null==(a=e.state.data)?void 0:a.pageParams)||[],x=(0,i.jY)(),C=null==x?void 0:x.signal,w=m,_=!1,j=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},O=function(e,t,n,o){return w=o?[t].concat(w):[].concat(w,[t]),o?[n].concat(e):[].concat(e,[n])},S=function(t,n,o,i){if(_)return Promise.reject("Cancelled");if(void 0===o&&!n&&t.length)return Promise.resolve(t);var r={queryKey:e.queryKey,signal:C,pageParam:o,meta:e.meta},s=j(r),a=Promise.resolve(s).then((function(e){return O(t,o,e,i)}));return(0,u.dd)(s)&&(a.cancel=s.cancel),a};if(g.length)if(v){var z=void 0!==p,P=z?p:y(e.options,g);l=S(g,z,P)}else if(b){var Q=void 0!==p,A=Q?p:(c=e.options,h=g,null==c.getPreviousPageParam?void 0:c.getPreviousPageParam(h[0],h));l=S(g,Q,A,!0)}else!function(){w=[];var t=void 0===e.options.getNextPageParam,n=!d||!g[0]||d(g[0],0,g);l=n?S([],t,m[0]):Promise.resolve(O([],m[0],g[0]));for(var o=function(n){l=l.then((function(o){if(!d||!g[n]||d(g[n],n,g)){var i=t?m[n]:y(e.options,o);return S(o,t,i)}return Promise.resolve(O(o,m[n],g[n]))}))},i=1;i<g.length;i++)o(i)}();else l=S([]);var F=l.then((function(e){return{pages:e,pageParams:w}}));return F.cancel=function(){_=!0,null==x||x.abort(),(0,u.dd)(l)&&l.cancel()},F}}},this.fetchQuery(o)},t.prefetchInfiniteQuery=function(e,t,n){return this.fetchInfiniteQuery(e,t,n).then(i.lQ).catch(i.lQ)},t.cancelMutations=function(){var e=this,t=s.j.batch((function(){return e.mutationCache.getAll().map((function(e){return e.cancel()}))}));return Promise.all(t).then(i.lQ).catch(i.lQ)},t.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},t.executeMutation=function(e){return this.mutationCache.build(this,e).execute()},t.getQueryCache=function(){return this.queryCache},t.getMutationCache=function(){return this.mutationCache},t.getDefaultOptions=function(){return this.defaultOptions},t.setDefaultOptions=function(e){this.defaultOptions=e},t.setQueryDefaults=function(e,t){var n=this.queryDefaults.find((function(t){return(0,i.Od)(e)===(0,i.Od)(t.queryKey)}));n?n.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})},t.getQueryDefaults=function(e){var t;return e?null==(t=this.queryDefaults.find((function(t){return(0,i.Cp)(e,t.queryKey)})))?void 0:t.defaultOptions:void 0},t.setMutationDefaults=function(e,t){var n=this.mutationDefaults.find((function(t){return(0,i.Od)(e)===(0,i.Od)(t.mutationKey)}));n?n.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})},t.getMutationDefaults=function(e){var t;return e?null==(t=this.mutationDefaults.find((function(t){return(0,i.Cp)(e,t.mutationKey)})))?void 0:t.defaultOptions:void 0},t.defaultQueryOptions=function(e){if(null==e?void 0:e._defaulted)return e;var t=(0,o.A)({},this.defaultOptions.queries,this.getQueryDefaults(null==e?void 0:e.queryKey),e,{_defaulted:!0});return!t.queryHash&&t.queryKey&&(t.queryHash=(0,i.F$)(t.queryKey,t)),t},t.defaultQueryObserverOptions=function(e){return this.defaultQueryOptions(e)},t.defaultMutationOptions=function(e){return(null==e?void 0:e._defaulted)?e:(0,o.A)({},this.defaultOptions.mutations,this.getMutationDefaults(null==e?void 0:e.mutationKey),e,{_defaulted:!0})},t.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},e}()},281:(e,t,n)=>{"use strict";n.d(t,{dd:()=>a,eJ:()=>c,wm:()=>l});var o=n(289),i=n(622),r=n(941);function s(e){return Math.min(1e3*Math.pow(2,e),3e4)}function a(e){return"function"==typeof(null==e?void 0:e.cancel)}var u=function(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent};function l(e){return e instanceof u}var c=function(e){var t,n,l,c,h=this,d=!1;this.abort=e.abort,this.cancel=function(e){return null==t?void 0:t(e)},this.cancelRetry=function(){d=!0},this.continueRetry=function(){d=!1},this.continue=function(){return null==n?void 0:n()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise((function(e,t){l=e,c=t}));var f=function(t){h.isResolved||(h.isResolved=!0,null==e.onSuccess||e.onSuccess(t),null==n||n(),l(t))},p=function(t){h.isResolved||(h.isResolved=!0,null==e.onError||e.onError(t),null==n||n(),c(t))};!function l(){if(!h.isResolved){var c;try{c=e.fn()}catch(e){c=Promise.reject(e)}t=function(e){if(!h.isResolved&&(p(new u(e)),null==h.abort||h.abort(),a(c)))try{c.cancel()}catch(e){}},h.isTransportCancelable=a(c),Promise.resolve(c).then(f).catch((function(t){var a,u;if(!h.isResolved){var c=null!=(a=e.retry)?a:3,f=null!=(u=e.retryDelay)?u:s,v="function"==typeof f?f(h.failureCount,t):f,y=!0===c||"number"==typeof c&&h.failureCount<c||"function"==typeof c&&c(h.failureCount,t);!d&&y?(h.failureCount++,null==e.onFail||e.onFail(h.failureCount,t),(0,r.yy)(v).then((function(){if(!o.m.isFocused()||!i.t.isOnline())return new Promise((function(t){n=t,h.isPaused=!0,null==e.onPause||e.onPause()})).then((function(){n=void 0,h.isPaused=!1,null==e.onContinue||e.onContinue()}))})).then((function(){d?p(t):l()}))):p(t)}}))}}()}},287:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var o=function(){function e(){this.listeners=[]}var t=e.prototype;return t.subscribe=function(e){var t=this,n=e||function(){};return this.listeners.push(n),this.onSubscribe(),function(){t.listeners=t.listeners.filter((function(e){return e!==n})),t.onUnsubscribe()}},t.hasListeners=function(){return this.listeners.length>0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}()},449:()=>{},941:(e,t,n)=>{"use strict";n.d(t,{BH:()=>g,Cp:()=>y,F$:()=>p,G6:()=>j,HN:()=>u,MK:()=>d,Od:()=>v,S$:()=>i,Zw:()=>s,b_:()=>h,f8:()=>m,gn:()=>a,j3:()=>l,jY:()=>O,lQ:()=>r,nJ:()=>f,vh:()=>c,yy:()=>_});var o=n(168),i="undefined"==typeof window;function r(){}function s(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e){return Array.isArray(e)?e:[e]}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t,n){return w(e)?"function"==typeof t?(0,o.A)({},n,{queryKey:e,queryFn:t}):(0,o.A)({},t,{queryKey:e}):e}function h(e,t,n){return w(e)?[(0,o.A)({},t,{queryKey:e}),n]:[e||{},t]}function d(e,t){var n=e.active,o=e.exact,i=e.fetching,r=e.inactive,s=e.predicate,a=e.queryKey,u=e.stale;if(w(a))if(o){if(t.queryHash!==p(a,t.options))return!1}else if(!y(t.queryKey,a))return!1;var l=function(e,t){return!0===e&&!0===t||null==e&&null==t?"all":!1===e&&!1===t?"none":(null!=e?e:!t)?"active":"inactive"}(n,r);if("none"===l)return!1;if("all"!==l){var c=t.isActive();if("active"===l&&!c)return!1;if("inactive"===l&&c)return!1}return!("boolean"==typeof u&&t.isStale()!==u||"boolean"==typeof i&&t.isFetching()!==i||s&&!s(t))}function f(e,t){var n=e.exact,o=e.fetching,i=e.predicate,r=e.mutationKey;if(w(r)){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(r))return!1}else if(!y(t.options.mutationKey,r))return!1}return!("boolean"==typeof o&&"loading"===t.state.status!==o||i&&!i(t))}function p(e,t){return((null==t?void 0:t.queryKeyHashFn)||v)(e)}function v(e){var t;return t=u(e),JSON.stringify(t,(function(e,t){return x(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}))}function y(e,t){return b(u(e),u(t))}function b(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((function(n){return!b(e[n],t[n])}))}function g(e,t){if(e===t)return e;var n=Array.isArray(e)&&Array.isArray(t);if(n||x(e)&&x(t)){for(var o=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),r=i.length,s=n?[]:{},a=0,u=0;u<r;u++){var l=n?u:i[u];s[l]=g(e[l],t[l]),s[l]===e[l]&&a++}return o===r&&a===o?e:s}return t}function m(e,t){if(e&&!t||t&&!e)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}function x(e){if(!C(e))return!1;var t=e.constructor;if(void 0===t)return!0;var n=t.prototype;return!!C(n)&&!!n.hasOwnProperty("isPrototypeOf")}function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return"string"==typeof e||Array.isArray(e)}function _(e){return new Promise((function(t){setTimeout(t,e)}))}function j(e){Promise.resolve().then(e).catch((function(e){return setTimeout((function(){throw e}))}))}function O(){if("function"==typeof AbortController)return new AbortController}},942:(e,t,n)=>{"use strict";n.d(t,{QueryClient:()=>o.QueryClient,QueryClientProvider:()=>i.QueryClientProvider,useQuery:()=>i.useQuery});var o=n(468);n.o(o,"QueryClientProvider")&&n.d(t,{QueryClientProvider:function(){return o.QueryClientProvider}}),n.o(o,"useQuery")&&n.d(t,{useQuery:function(){return o.useQuery}});var i=n(974)},974:(e,t,n)=>{"use strict";n.d(t,{QueryClientProvider:()=>p,useQuery:()=>Q});var o=n(428);const i=window.ReactDOM;var r=n.n(i)().unstable_batchedUpdates;o.j.setBatchNotifyFunction(r);var s=n(690),a=console;(0,s.B)(a);const u=window.React;var l=n.n(u),c=l().createContext(void 0),h=l().createContext(!1);function d(e){return e&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=c),window.ReactQueryClientContext):c}var f=function(){var e=l().useContext(d(l().useContext(h)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},p=function(e){var t=e.client,n=e.contextSharing,o=void 0!==n&&n,i=e.children;l().useEffect((function(){return t.mount(),function(){t.unmount()}}),[t]);var r=d(o);return l().createElement(h.Provider,{value:o},l().createElement(r.Provider,{value:t},i))},v=n(168),y=n(540),b=n(941),g=n(289),m=n(287),x=n(281),C=function(e){function t(t,n){var o;return(o=e.call(this)||this).client=t,o.options=n,o.trackedProps=[],o.selectError=null,o.bindMethods(),o.setOptions(n),o}(0,y.A)(t,e);var n=t.prototype;return n.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},n.onSubscribe=function(){1===this.listeners.length&&(this.currentQuery.addObserver(this),w(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},n.onUnsubscribe=function(){this.listeners.length||this.destroy()},n.shouldFetchOnReconnect=function(){return _(this.currentQuery,this.options,this.options.refetchOnReconnect)},n.shouldFetchOnWindowFocus=function(){return _(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},n.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},n.setOptions=function(e,t){var n=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();var i=this.hasListeners();i&&j(this.currentQuery,o,this.options,n)&&this.executeFetch(),this.updateResult(t),!i||this.currentQuery===o&&this.options.enabled===n.enabled&&this.options.staleTime===n.staleTime||this.updateStaleTimeout();var r=this.computeRefetchInterval();!i||this.currentQuery===o&&this.options.enabled===n.enabled&&r===this.currentRefetchInterval||this.updateRefetchInterval(r)},n.getOptimisticResult=function(e){var t=this.client.defaultQueryObserverOptions(e),n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)},n.getCurrentResult=function(){return this.currentResult},n.trackResult=function(e,t){var n=this,o={},i=function(e){n.trackedProps.includes(e)||n.trackedProps.push(e)};return Object.keys(e).forEach((function(t){Object.defineProperty(o,t,{configurable:!1,enumerable:!0,get:function(){return i(t),e[t]}})})),(t.useErrorBoundary||t.suspense)&&i("error"),o},n.getNextResult=function(e){var t=this;return new Promise((function(n,o){var i=t.subscribe((function(t){t.isFetching||(i(),t.isError&&(null==e?void 0:e.throwOnError)?o(t.error):n(t))}))}))},n.getCurrentQuery=function(){return this.currentQuery},n.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},n.refetch=function(e){return this.fetch((0,v.A)({},e,{meta:{refetchPage:null==e?void 0:e.refetchPage}}))},n.fetchOptimistic=function(e){var t=this,n=this.client.defaultQueryObserverOptions(e),o=this.client.getQueryCache().build(this.client,n);return o.fetch().then((function(){return t.createResult(o,n)}))},n.fetch=function(e){var t=this;return this.executeFetch(e).then((function(){return t.updateResult(),t.currentResult}))},n.executeFetch=function(e){this.updateQuery();var t=this.currentQuery.fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(b.lQ)),t},n.updateStaleTimeout=function(){var e=this;if(this.clearStaleTimeout(),!b.S$&&!this.currentResult.isStale&&(0,b.gn)(this.options.staleTime)){var t=(0,b.j3)(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout((function(){e.currentResult.isStale||e.updateResult()}),t)}},n.computeRefetchInterval=function(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e},n.updateRefetchInterval=function(e){var t=this;this.clearRefetchInterval(),this.currentRefetchInterval=e,!b.S$&&!1!==this.options.enabled&&(0,b.gn)(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval((function(){(t.options.refetchIntervalInBackground||g.m.isFocused())&&t.executeFetch()}),this.currentRefetchInterval))},n.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},n.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},n.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},n.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},n.createResult=function(e,t){var n,o=this.currentQuery,i=this.options,r=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,l=e!==o,c=l?e.state:this.currentQueryInitialState,h=l?this.currentResult:this.previousQueryResult,d=e.state,f=d.dataUpdatedAt,p=d.error,v=d.errorUpdatedAt,y=d.isFetching,g=d.status,m=!1,x=!1;if(t.optimisticResults){var C=this.hasListeners(),_=!C&&w(e,t),S=C&&j(e,o,t,i);(_||S)&&(y=!0,f||(g="loading"))}if(t.keepPreviousData&&!d.dataUpdateCount&&(null==h?void 0:h.isSuccess)&&"error"!==g)n=h.data,f=h.dataUpdatedAt,g=h.status,m=!0;else if(t.select&&void 0!==d.data)if(r&&d.data===(null==a?void 0:a.data)&&t.select===this.selectFn)n=this.selectResult;else try{this.selectFn=t.select,n=t.select(d.data),!1!==t.structuralSharing&&(n=(0,b.BH)(null==r?void 0:r.data,n)),this.selectResult=n,this.selectError=null}catch(e){(0,s.t)().error(e),this.selectError=e}else n=d.data;if(void 0!==t.placeholderData&&void 0===n&&("loading"===g||"idle"===g)){var z;if((null==r?void 0:r.isPlaceholderData)&&t.placeholderData===(null==u?void 0:u.placeholderData))z=r.data;else if(z="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==z)try{z=t.select(z),!1!==t.structuralSharing&&(z=(0,b.BH)(null==r?void 0:r.data,z)),this.selectError=null}catch(e){(0,s.t)().error(e),this.selectError=e}void 0!==z&&(g="success",n=z,x=!0)}return this.selectError&&(p=this.selectError,n=this.selectResult,v=Date.now(),g="error"),{status:g,isLoading:"loading"===g,isSuccess:"success"===g,isError:"error"===g,isIdle:"idle"===g,data:n,dataUpdatedAt:f,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&"loading"!==g,isLoadingError:"error"===g&&0===d.dataUpdatedAt,isPlaceholderData:x,isPreviousData:m,isRefetchError:"error"===g&&0!==d.dataUpdatedAt,isStale:O(e,t),refetch:this.refetch,remove:this.remove}},n.shouldNotifyListeners=function(e,t){if(!t)return!0;var n=this.options,o=n.notifyOnChangeProps,i=n.notifyOnChangePropsExclusions;if(!o&&!i)return!0;if("tracked"===o&&!this.trackedProps.length)return!0;var r="tracked"===o?this.trackedProps:o;return Object.keys(e).some((function(n){var o=n,s=e[o]!==t[o],a=null==r?void 0:r.some((function(e){return e===n})),u=null==i?void 0:i.some((function(e){return e===n}));return s&&!u&&(!r||a)}))},n.updateResult=function(e){var t=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!(0,b.f8)(this.currentResult,t)){var n={cache:!0};!1!==(null==e?void 0:e.listeners)&&this.shouldNotifyListeners(this.currentResult,t)&&(n.listeners=!0),this.notify((0,v.A)({},n,e))}},n.updateQuery=function(){var e=this.client.getQueryCache().build(this.client,this.options);if(e!==this.currentQuery){var t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}},n.onQueryUpdate=function(e){var t={};"success"===e.type?t.onSuccess=!0:"error"!==e.type||(0,x.wm)(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()},n.notify=function(e){var t=this;o.j.batch((function(){e.onSuccess?(null==t.options.onSuccess||t.options.onSuccess(t.currentResult.data),null==t.options.onSettled||t.options.onSettled(t.currentResult.data,null)):e.onError&&(null==t.options.onError||t.options.onError(t.currentResult.error),null==t.options.onSettled||t.options.onSettled(void 0,t.currentResult.error)),e.listeners&&t.listeners.forEach((function(e){e(t.currentResult)})),e.cache&&t.client.getQueryCache().notify({query:t.currentQuery,type:"observerResultsUpdated"})}))},t}(m.Q);function w(e,t){return function(e,t){return!(!1===t.enabled||e.state.dataUpdatedAt||"error"===e.state.status&&!1===t.retryOnMount)}(e,t)||e.state.dataUpdatedAt>0&&_(e,t,t.refetchOnMount)}function _(e,t,n){if(!1!==t.enabled){var o="function"==typeof n?n(e):n;return"always"===o||!1!==o&&O(e,t)}return!1}function j(e,t,n,o){return!1!==n.enabled&&(e!==t||!1===o.enabled)&&(!n.suspense||"error"!==e.state.status)&&O(e,n)}function O(e,t){return e.isStaleByTime(t.staleTime)}var S,z=l().createContext((S=!1,{clearReset:function(){S=!1},reset:function(){S=!0},isReset:function(){return S}})),P=function(){return l().useContext(z)};function Q(e,t,n){return function(e,t){var n=l().useRef(!1),i=l().useState(0)[1],r=f(),s=P(),a=r.defaultQueryObserverOptions(e);a.optimisticResults=!0,a.onError&&(a.onError=o.j.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=o.j.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=o.j.batchCalls(a.onSettled)),a.suspense&&("number"!=typeof a.staleTime&&(a.staleTime=1e3),0===a.cacheTime&&(a.cacheTime=1)),(a.suspense||a.useErrorBoundary)&&(s.isReset()||(a.retryOnMount=!1));var u,c,h,d=l().useState((function(){return new t(r,a)}))[0],p=d.getOptimisticResult(a);if(l().useEffect((function(){n.current=!0,s.clearReset();var e=d.subscribe(o.j.batchCalls((function(){n.current&&i((function(e){return e+1}))})));return d.updateResult(),function(){n.current=!1,e()}}),[s,d]),l().useEffect((function(){d.setOptions(a,{listeners:!1})}),[a,d]),a.suspense&&p.isLoading)throw d.fetchOptimistic(a).then((function(e){var t=e.data;null==a.onSuccess||a.onSuccess(t),null==a.onSettled||a.onSettled(t,null)})).catch((function(e){s.clearReset(),null==a.onError||a.onError(e),null==a.onSettled||a.onSettled(void 0,e)}));if(p.isError&&!s.isReset()&&!p.isFetching&&(u=a.suspense,c=a.useErrorBoundary,h=[p.error,d.getCurrentQuery()],"function"==typeof c?c.apply(void 0,h):"boolean"==typeof c?c:u))throw p.error;return"tracked"===a.notifyOnChangeProps&&(p=d.trackResult(p,a)),p}((0,b.vh)(e,t,n),C)}},168:(e,t,n)=>{"use strict";function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},o.apply(null,arguments)}n.d(t,{A:()=>o})},540:(e,t,n)=>{"use strict";function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}n.d(t,{A:()=>i})}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,o),r.exports}o.m=t,e=[],o.O=(t,n,i,r)=>{if(!n){var s=1/0;for(c=0;c<e.length;c++){for(var[n,i,r]=e[c],a=!0,u=0;u<n.length;u++)(!1&r||s>=r)&&Object.keys(o.O).every((e=>o.O[e](n[u])))?n.splice(u--,1):(a=!1,r<s&&(s=r));if(a){e.splice(c--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[n,i,r]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,r,[s,a,u]=n,l=0;if(s.some((t=>0!==e[t]))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(u)var c=u(o)}for(t&&t(n);l<s.length;l++)r=s[l],o.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return o.O(c)},n=globalThis.webpackChunkpost_views=globalThis.webpackChunkpost_views||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=o.O(void 0,[350],(()=>o(453)));i=o.O(i)})();
Save
Back