whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
insta-gallery
/
build
/
gutenberg
/
js
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/insta-gallery/build/gutenberg/js/index.js
/*! For license information please see index.js.LICENSE.txt */ (()=>{var e={500:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=i(e,r(a)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)l.call(e,a)&&e[a]&&(t=i(t,a));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var r=t[l]={exports:{}};return e[l](r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.i18n,l=window.wp.blocks,n=window.wp.blockEditor,r=window.wp.compose,i=window.wp.hooks,o=(0,r.createHigherOrderComponent)((t=>a=>("qligg/box"===a.name&&(a.attributes.username&&(a.attributes.account_id=a.attributes.username,a.attributes.username=void 0),a.attributes.type&&(a.atributes.source=a.attributes.type,a.attributes.type=void 0),a.attributes.popup&&(a.attributes.modal=a.attributes.popup,a.attributes.popup=void 0)),(0,e.createElement)(t,{...a}))),"withCustomBlockEdit");(0,i.addFilter)("editor.BlockEdit","qligg/box/edit",o);const s=window.qligg.store;var c=a(500),m=a.n(c);const g=window.wp.element,d=window.wp.components,_=a=>{const{attributes:l,setAttributes:i}=a,[o,c]=(0,g.useState)(l.tag),[_,u]=(0,g.useState)(l.limit),p=(0,r.useDebounce)((e=>{i({tag:e})}),1e3),y=(0,r.useDebounce)((e=>{i({limit:e})}),1e3);(0,g.useEffect)((()=>{p(o)}),[o,p]),(0,g.useEffect)((()=>{y(_)}),[_,y]);const{accounts:h}=(0,s.useAccountsEntities)(),b=qligg_gutenberg.image_url,f=h?.find((e=>e.id===l.account_id)),[E,v]=(0,g.useState)(!1);return(0,e.createElement)(n.InspectorControls,{key:"inspector"},(0,e.createElement)(d.PanelBody,{initialOpen:!0,title:(0,t.__)("Cache","insta-gallery")},(0,e.createElement)(d.Button,{variant:"secondary",onClick:async()=>{confirm((0,t.__)("You are about to reset the cache of this feed.","insta-gallery"))&&(v(!0),await(0,s.clearFeedCache)({method:"POST",data:{feedSettings:l}}),v(!1))}},"Clear cache"),E&&(0,e.createElement)("span",{style:{visibility:"visible",position:"absolute"},className:"spinner"})),(0,e.createElement)(d.PanelBody,{initialOpen:!0,title:(0,t.__)("General","insta-gallery")},(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Account","insta-gallery"),help:(0,t.__)("Please select Instagram account","insta-gallery"),value:l.account_id,onChange:e=>i({account_id:e}),options:h.map(((e,t)=>({value:e.id,label:e.nickname||e.username,disabled:!window?.QLIGG_IS_PREMIUM&&t>0})))}),(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Source","insta-gallery"),value:l.source,onChange:e=>i({source:e}),options:[{value:"tag",label:(0,t.__)("Tag","insta-gallery")},{value:"username",label:(0,t.__)("Username","insta-gallery")},{value:"tagged",label:(0,t.__)("Tagged","insta-gallery"),disabled:!window?.QLIGG_IS_PREMIUM||"BUSINESS"!==f?.access_token_type},{value:"stories",label:(0,t.__)("Stories","insta-gallery"),disabled:!window?.QLIGG_IS_PREMIUM||"BUSINESS"!==f?.access_token_type}]}),"BUSINESS"!==f?.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,e.createElement)("p",null,(0,t.__)("Hashtag, Tagged, and Stories options are only available for business accounts.","insta-gallery"))),"tag"===l.source&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.TextControl,{label:(0,t.__)("Tag","insta-gallery"),help:(0,t.__)("Please enter Instagram tag","insta-gallery"),value:o,onChange:function(e){c(e)}}),(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Order by","insta-gallery"),help:(0,t.__)("Please enter Instagram tag order","insta-gallery"),value:l.order_by,onChange:e=>i({order_by:e}),options:[{value:"recent_media",label:(0,t.__)("Recent (Within 24 hours)","insta-gallery")},{value:"top_media",label:(0,t.__)("Top (Most popular first)","insta-gallery")}]}),(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,t.__)("Instagram API limitation: You are limited to 30 unique hashtags in a 7-day period.","insta-gallery"))),"tagged"===l.source&&"BUSINESS"===f?.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,t.__)("This feed will display photos where your Instagram account has been tagged by other users.","insta-gallery")),"stories"===l.source&&"BUSINESS"===f?.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,t.__)("This feed will display your active Instagram stories. Stories expire after 24 hours.","insta-gallery")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("ul",{className:"qligg-list-videos"},["carousel","gallery","masonry","highlight"].filter((e=>!("stories"===l.source&&"carousel"===e))).map(((t,a)=>(0,e.createElement)("li",{key:a,className:m()("qligg-modal-image",l.layout==t&&"active","carousel"!==t&&"gallery"!==t&&"qligg-premium-field"),onClick:()=>i({layout:t})},(0,e.createElement)("span",null,t.replace("-"," ")),(0,e.createElement)("img",{src:`${b}/${t}.png`,alt:"layout"})))))),"tag"!==l.source&&"stories"!==l.source&&(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Hide feed reels","insta-gallery"),help:(0,t.__)("Hide reels from feed","insta-gallery"),checked:!!l.reel.hide,onChange:e=>i({reel:{...l.reel,hide:e}})}),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Hide feed copyright","insta-gallery"),help:(0,t.__)("Hide the feeds that have copyright","insta-gallery"),checked:!!l.copyright.hide,onChange:e=>i({copyright:{...l.copyright,hide:e}})})),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Limit","insta-gallery"),help:(0,t.__)("Number of videos to display","insta-gallery"),value:_,onChange:function(e){u(e)},min:1,max:33}),"highlight"===l.layout&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.TextControl,{label:(0,t.__)(" highlight by tag","insta-gallery"),help:(0,t.__)("Highlight feeds items with this tags","insta-gallery"),value:l.highlight.tag,onChange:e=>i({highlight:{...l.highlight,tag:e}})}),(0,e.createElement)(d.TextControl,{label:(0,t.__)(" highlight by id","insta-gallery"),help:(0,t.__)(" highlight by id","insta-gallery"),value:l.highlight.id,onChange:e=>i({highlight:{...l.highlight,id:e}})}),(0,e.createElement)(d.TextControl,{label:(0,t.__)(" highlight by position","insta-gallery"),help:(0,t.__)("Highlight feeds items in this positions","insta-gallery"),value:l.highlight.position,onChange:e=>i({highlight:{...l.highlight,position:e}})}))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Responsive","insta-gallery")},(0,e.createElement)("div",{className:"qligg-premium-field"},(0,e.createElement)("p",null,(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,t.__)("These responsive settings will override the main feed settings for different screen sizes.","insta-gallery"))))),(0,e.createElement)("div",{className:"qligg-premium-field"},(0,e.createElement)("p",null,(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"dashicons dashicons-desktop"})," ",(0,t.__)("Desktop","insta-gallery"))),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Columns","insta-gallery"),min:1,max:10,value:l.responsive?.desktop?.columns||3,onChange:e=>i({responsive:{...l.responsive,desktop:{...l.responsive?.desktop,columns:e}}}),help:(0,t.__)("Number of columns for Desktop devices","insta-gallery")}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Spacing","insta-gallery"),min:0,max:50,value:l.responsive?.desktop?.spacing||10,onChange:e=>i({responsive:{...l.responsive,desktop:{...l.responsive?.desktop,spacing:e}}}),help:(0,t.__)("Space between items in pixels","insta-gallery")})),(0,e.createElement)("div",{className:"qligg-premium-field"},(0,e.createElement)("p",null,(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"dashicons dashicons-tablet"})," ",(0,t.__)("Tablet","insta-gallery"))),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Breakpoint (px)","insta-gallery"),min:320,max:1200,value:l.responsive?.breakpoints?.tablet||768,onChange:e=>i({responsive:{...l.responsive,breakpoints:{...l.responsive?.breakpoints,tablet:e}}}),help:(0,t.__)("Screen width at which Tablet layout starts","insta-gallery")}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Columns","insta-gallery"),min:1,max:8,value:l.responsive?.tablet?.columns||2,onChange:e=>i({responsive:{...l.responsive,tablet:{...l.responsive?.tablet,columns:e}}}),help:(0,t.__)("Number of columns for Tablet devices","insta-gallery")}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Spacing","insta-gallery"),min:0,max:50,value:l.responsive?.tablet?.spacing||8,onChange:e=>i({responsive:{...l.responsive,tablet:{...l.responsive?.tablet,spacing:e}}}),help:(0,t.__)("Space between items in pixels","insta-gallery")})),(0,e.createElement)("div",{className:"qligg-premium-field"},(0,e.createElement)("p",null,(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"dashicons dashicons-smartphone"})," ",(0,t.__)("Mobile","insta-gallery"))),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Breakpoint (px)","insta-gallery"),min:320,max:767,value:l.responsive?.breakpoints?.mobile||480,onChange:e=>i({responsive:{...l.responsive,breakpoints:{...l.responsive?.breakpoints,mobile:e}}}),help:(0,t.__)("Screen width at which Mobile layout starts","insta-gallery")}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Columns","insta-gallery"),min:1,max:6,value:l.responsive?.mobile?.columns||1,onChange:e=>i({responsive:{...l.responsive,mobile:{...l.responsive?.mobile,columns:e}}}),help:(0,t.__)("Number of columns for Mobile devices","insta-gallery")}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Spacing","insta-gallery"),min:0,max:50,value:l.responsive?.mobile?.spacing||6,onChange:e=>i({responsive:{...l.responsive,mobile:{...l.responsive?.mobile,spacing:e}}}),help:(0,t.__)("Space between items in pixels","insta-gallery")}))),"carousel"==l.layout&&(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Carousel","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Autoplay","insta-gallery"),help:(0,t.__)("Autoplay carousel items","insta-gallery"),checked:!!l.carousel.autoplay,onChange:e=>i({carousel:{...l.carousel,autoplay:e}})}),l.carousel.autoplay&&(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Autoplay Interval","insta-gallery"),help:(0,t.__)("Moves carousel after a certain amount of time ","insta-gallery"),value:l.carousel.autoplay_interval,onChange:e=>i({carousel:{...l.carousel,autoplay_interval:e}}),min:1e3,max:3e5,step:100}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Navigation","insta-gallery"),help:(0,t.__)("Display navigation arrows","insta-gallery"),checked:!!l.carousel.navarrows,onChange:e=>i({carousel:{...l.carousel,navarrows:e}})}),l.carousel.navarrows&&(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Navigation color","insta-gallery"),help:(0,t.__)("Change navigation arrows color","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.carousel.navarrows_color,onChange:e=>i({carousel:{...l.carousel,navarrows_color:e}})})),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Pagination","insta-gallery"),help:(0,t.__)("Display pagination dots","insta-gallery"),checked:!!l.carousel.pagination,onChange:e=>i({carousel:{...l.carousel,pagination:e}})}),l.carousel.pagination&&(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Pagination color","insta-gallery"),help:(0,t.__)("Change pagination dots color","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.carousel.pagination_color,onChange:e=>i({carousel:{...l.carousel,pagination_color:e}})}))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Profile","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Display user profile or tag info","insta-gallery"),checked:!!l.profile.display,onChange:e=>i({profile:{...l.profile,display:e}})}),l.profile.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.TextControl,{label:(0,t.__)("Full name","insta-gallery"),help:(0,t.__)("Feed profile full name","insta-gallery"),value:l.profile.nickname,onChange:e=>{i({profile:{...l.profile,nickname:e}})}}),(0,e.createElement)(d.TextControl,{label:(0,t.__)("Follow text","insta-gallery"),help:(0,t.__)("Follow text here","insta-gallery"),value:l.profile.link_text,onChange:e=>{i({profile:{...l.profile,link_text:e}})}}),(0,e.createElement)(d.TextControl,{label:(0,t.__)("Website","insta-gallery"),help:(0,t.__)("Website url here","insta-gallery"),value:l.profile.website,onChange:e=>{i({profile:{...l.profile,website:e}})}}),(0,e.createElement)(d.TextControl,{label:(0,t.__)("Website link text","insta-gallery"),help:(0,t.__)("Website link text here","insta-gallery"),value:l.profile.website_text,onChange:e=>{i({profile:{...l.profile,website_text:e}})}}),(0,e.createElement)("div",{style:{display:"flex",flexDirection:"column",alignItems:"right"}},(0,e.createElement)("img",{alt:"",width:"150",height:"150",src:l.profile.avatar||f.avatar||"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g"}),(0,e.createElement)(n.MediaUpload,{onSelect:e=>{i({profile:{...l.profile,avatar:e.url}})},allowedTypes:["image"],value:l.profile.avatar,render:({open:a})=>(0,e.createElement)("div",null,(0,e.createElement)(d.Button,{style:{margin:"15px 5px 15px 0"},variant:"secondary",onClick:a},(0,t.__)("Upload","insta-gallery")),(0,e.createElement)(d.Button,{style:{margin:"15px 0"},variant:"secondary",disabled:!l.profile.avatar||l.profile.avatar===f.avatar,onClick:()=>{i({profile:{...l.profile,avatar:f.avatar||""}})}},"×"))}),(0,e.createElement)(d.TextareaControl,{label:(0,t.__)("Biography","insta-gallery"),help:(0,t.__)("Feed profile biography","insta-gallery"),value:l.profile.biography,onChange:e=>{i({profile:{...l.profile,biography:e}})}})))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Box","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Display the Instagram Feed inside a customizable box","insta-gallery"),checked:!!l.box.display,onChange:e=>i({box:{...l.box,display:e}})}),l.box.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Padding","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Add padding to the box","insta-gallery"),value:l.box.padding,onChange:e=>i({box:{...l.box,padding:e}}),min:0,max:300}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Radius","insta-gallery"),help:(0,t.__)("Add radius to the box","insta-gallery"),className:"qligg-premium-field",value:l.box.radius,onChange:e=>i({box:{...l.box,radius:e}}),min:0,max:1e3}),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background","insta-gallery"),help:(0,t.__)("Change background color in box","insta-gallery"),className:"qligg-premium-field"},(0,e.createElement)(n.ColorPalette,{value:l.box.background,onChange:e=>i({box:{...l.box,background:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Text color","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Change text color in box","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.box.text_color,onChange:e=>i({box:{...l.box,text_color:e}})})))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Image","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Lazy load","insta-gallery"),help:(0,t.__)("Defers image load","insta-gallery"),checked:!!l.lazy,onChange:e=>i({lazy:e})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Mask","insta-gallery"),help:(0,t.__)("Display mask on hover","insta-gallery"),checked:!!l.mask.display,onChange:e=>i({mask:{...l.mask,display:e}})}),l.mask.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background","insta-gallery"),help:(0,t.__)("Change background color in mask","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.mask.background,onChange:e=>i({mask:{...l.mask,background:e}})})),"PERSONAL"===f.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,e.createElement)("p",null,(0,t.__)("Likes and comments options are only available for business account.","insta-gallery"))),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Likes count","insta-gallery"),help:(0,t.__)("Display likes count in mask","insta-gallery"),checked:!!l.mask.likes_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({mask:{...l.mask,likes_count:e}})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Comments count","insta-gallery"),help:(0,t.__)("Display comments count in mask","insta-gallery"),checked:!!l.mask.comments_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({mask:{...l.mask,comments_count:e}})}),(l.mask.comments_count||l.mask.likes_count)&&(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Icons color","insta-gallery"),help:(0,t.__)("Change icons color in mask","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.mask.icon_color,onChange:e=>i({mask:{...l.mask,icon_color:e}})})))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Card","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Display card in image","insta-gallery"),checked:!!l.card.display,onChange:e=>i({card:{...l.card,display:e}})}),l.card.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Radius","insta-gallery"),help:(0,t.__)("Add radius to the card","insta-gallery"),className:"qligg-premium-field",value:l.card.radius,onChange:e=>i({card:{...l.card,radius:e}}),min:0,max:1e3}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Font size","insta-gallery"),help:(0,t.__)("Change font size in cards","insta-gallery"),className:"qligg-premium-field",value:l.card.font_size,onChange:e=>i({card:{...l.card,font_size:e}}),min:8,max:36}),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Change background color in cards","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.card.background,onChange:e=>i({card:{...l.card,background:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background hover","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Change background color hover in cards","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.card.background_hover,onChange:e=>i({card:{...l.card,background_hover:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Text color","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Change text color","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.card.text_color,onChange:e=>i({card:{...l.card,text_color:e}})})),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Padding","insta-gallery"),help:(0,t.__)("Add padding in cards","insta-gallery"),className:"qligg-premium-field",value:l.card.padding,onChange:e=>i({card:{...l.card,padding:e}}),min:0,max:20}),"PERSONAL"===f.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,e.createElement)("p",null,(0,t.__)("Likes and comments options are only available for business account.","insta-gallery"))),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Likes","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Display likes count in cards","insta-gallery"),checked:!!l.card.likes_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({card:{...l.card,likes_count:e}})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Comments","insta-gallery"),className:"qligg-premium-field",help:(0,t.__)("Display comments count in cards","insta-gallery"),checked:!!l.card.comments_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({card:{...l.card,comments_count:e}})}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Length","insta-gallery"),help:(0,t.__)("Limit the length of the description in the card","insta-gallery"),className:"qligg-premium-field",value:l.card.text_length,onChange:e=>i({card:{...l.card,text_length:e}}),min:1,max:100}),(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Text align","insta-gallery"),help:(0,t.__)("Align description in card","insta-gallery"),className:"qligg-premium-field",value:l.card.text_align||"",onChange:e=>i({card:{...l.card,text_align:e}}),options:[{value:"left",label:(0,t.__)("Left","insta-gallery")},{value:"center",label:(0,t.__)("Center","insta-gallery")},{value:"right",label:(0,t.__)("Right","insta-gallery")}]}))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Modal","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),help:(0,t.__)("Display Modal by clicking on image","insta-gallery"),checked:!!l.modal.display,onChange:e=>i({modal:{...l.modal,display:e}})}),l.modal.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Sidebar align","insta-gallery"),help:(0,t.__)("Align sidebar in modal on desktop","insta-gallery"),className:"qligg-premium-field",value:l.modal.modal_align||"",onChange:e=>i({modal:{...l.modal,modal_align:e}}),options:[{value:"top",label:(0,t.__)("Top","insta-gallery")},{value:"right",label:(0,t.__)("Right","insta-gallery")},{value:"bottom",label:(0,t.__)("Bottom","insta-gallery")},{value:"left",label:(0,t.__)("Left","insta-gallery")}]}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Profile","insta-gallery"),help:(0,t.__)("Display user profile or tag info","insta-gallery"),className:"qligg-premium-field",checked:!!l.modal.profile,onChange:e=>i({modal:{...l.modal,profile:e}})}),"PERSONAL"===f.access_token_type&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,e.createElement)("p",null,(0,t.__)("Likes and comments options are only available for business account.","insta-gallery"))),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Show likes count","insta-gallery"),help:(0,t.__)("Display likes count in sidebar","insta-gallery"),className:"qligg-premium-field",checked:!!l.modal.likes_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({modal:{...l.modal,likes_count:e}})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Show comments count","insta-gallery"),help:(0,t.__)("Display comments count in sidebar","insta-gallery"),className:"qligg-premium-field",checked:!!l.modal.comments_count,disabled:"PERSONAL"===f.access_token_type,onChange:e=>i({modal:{...l.modal,comments_count:e}})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Show description","insta-gallery"),help:(0,t.__)("Display description in the sidebar","insta-gallery"),className:"qligg-premium-field",checked:!!l.modal.media_description,onChange:e=>i({modal:{...l.modal,media_description:e}})}),(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Show comments list","insta-gallery"),help:(0,t.__)("Display comments list in sidebar","insta-gallery"),className:"qligg-premium-field",checked:!!l.modal.comments_list,disabled:"BUSINESS"!==f?.access_token_type,onChange:e=>i({modal:{...l.modal,comments_list:e}})}),"stories"===l.source&&(0,e.createElement)(d.Notice,{status:"info",isDismissible:!1},(0,e.createElement)("p",null,(0,t.__)("Comments option for Instagram feeds (all sources except Stories)","insta-gallery"))),(0,e.createElement)(d.SelectControl,{label:(0,t.__)("Text align","insta-gallery"),help:(0,t.__)("Align description in sidebar","insta-gallery"),className:"qligg-premium-field",value:l.modal.text_align||"",onChange:e=>i({modal:{...l.modal,text_align:e}}),options:[{value:"left",label:(0,t.__)("Left","insta-gallery")},{value:"center",label:(0,t.__)("Center","insta-gallery")},{value:"right",label:(0,t.__)("Right","insta-gallery")}]}),(0,e.createElement)(d.RangeControl,{label:(0,t.__)("Font size","insta-gallery"),help:(0,t.__)("Change font size in sidebar","insta-gallery"),className:"qligg-premium-field",value:l.modal.font_size,onChange:e=>i({modal:{...l.modal,font_size:e}}),min:8,max:36}))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Button","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),help:(0,t.__)("Display the button to open Instagram site link","insta-gallery"),checked:!!l.button.display,onChange:e=>i({button:{...l.button,display:e}})}),l.button.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.TextControl,{label:(0,t.__)("Text","insta-gallery"),help:(0,t.__)("Change button text","insta-gallery"),value:l.button.text,onChange:e=>i({button:{...l.button,text:e}})}),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Text color","insta-gallery"),help:(0,t.__)("Change Color text in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button.text_color,onChange:e=>i({button:{...l.button,text_color:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background","insta-gallery"),help:(0,t.__)("Change background color in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button.background,onChange:e=>i({button:{...l.button,background:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background hover","insta-gallery"),help:(0,t.__)("Change background hover in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button.background_hover,onChange:e=>i({button:{...l.button,background_hover:e}})})))),(0,e.createElement)(d.PanelBody,{initialOpen:!1,title:(0,t.__)("Button Load More","insta-gallery")},(0,e.createElement)(d.ToggleControl,{label:(0,t.__)("Display","insta-gallery"),help:(0,t.__)("Display the button to load more videos","insta-gallery"),className:"qligg-premium-field",checked:!!l.button_load.display,onChange:e=>i({button_load:{...l.button_load,display:e}})}),l.button_load.display&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d.TextControl,{label:(0,t.__)("Text","insta-gallery"),help:(0,t.__)("Change button text","insta-gallery"),value:l.button_load.text,onChange:e=>i({button_load:{...l.button_load,text:e}})}),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Text color","insta-gallery"),help:(0,t.__)("Change Color text in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button_load.text_color,onChange:e=>i({button_load:{...l.button_load,text_color:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background","insta-gallery"),help:(0,t.__)("Change background color in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button_load.background,onChange:e=>i({button_load:{...l.button_load,background:e}})})),(0,e.createElement)(d.BaseControl,{label:(0,t.__)("Background hover","insta-gallery"),help:(0,t.__)("Change background hover in button","insta-gallery")},(0,e.createElement)(n.ColorPalette,{value:l.button_load.background_hover,onChange:e=>i({button_load:{...l.button_load,background_hover:e}})})))))},u=(0,g.createContext)({}),p=()=>(0,g.useContext)(u),y=(e,t)=>{switch(t.type){case"SET_CURRENT_FEED_INDEX":case"SET_IS_OPEN":case"SET_IS_IMAGE_LOAD":case"SET_COUNTER":return{...e,...t.payload}}},h=t=>{const{children:a}=t,[l,n]=(0,g.useReducer)(y,{currentFeedIndex:0,isOpen:!1,isImageLoad:!1,counter:0});return(0,e.createElement)(u.Provider,{value:{...l,setCurrentFeedIndex:e=>{l.currentFeedIndex!=e&&n({type:"SET_CURRENT_FEED_INDEX",payload:{currentFeedIndex:e}})},setIsOpen:e=>{l.isOpen!=e&&n({type:"SET_IS_OPEN",payload:{isOpen:e}})},setIsImageLoad:e=>{l.isImageLoad!=e&&n({type:"SET_IS_IMAGE_LOAD",payload:{isImageLoad:e}})},setCounter:e=>{l.counter!=e&&n({type:"SET_COUNTER",payload:{counter:e}})}}},a)};async function b({url:e,data:t,method:a}){if(!e)throw new Error(`Empty url: ${e}`);return await fetch(e,{body:JSON.stringify(t),method:a}).then((e=>e.json())).then((e=>{if(e.code)throw new Error(`${e.code}: ${e?.message||"Unknown"}`);return e})).catch((e=>{throw new Error(e)}))}function f(e,t){const a=[];for(const l in e)if(e.hasOwnProperty(l)){const n=t?t+"["+l+"]":l,r=e[l];a.push(null!==r&&"object"==typeof r?f(r,n):encodeURIComponent(n)+"="+encodeURIComponent(r))}return a.join("&")}u.Consumer;const E=({href:t,className:a,children:l,onClick:n,disabled:r})=>(0,e.createElement)("a",{href:t,target:"blank",onClick:n,className:m()("instagram-gallery__button",a,r&&"instagram-gallery__button--disabled")},l);function v(e,t){const{tag:a,source:l}=e,{username:n}=t;switch(l){case"username":return`https://www.instagram.com/${n}`;case"tag":return`https://www.instagram.com/explore/tags/${a}`;default:return"https://www.instagram.com"}}const k=({userProfile:t,feedSettings:a,onClick:l,after:n})=>{const r=!!a?.button?.display,i=!!a?.button_load?.display;return(0,e.createElement)("div",{className:"instagram-gallery__actions"},r&&(0,e.createElement)(E,{feedSettings:a,href:v(a,t),target:"blank",className:"instagram-gallery__button--follow"},(0,e.createElement)("i",{className:"qligg-icon-instagram "}),a.button.text),i&&(0,e.createElement)(E,{feedSettings:a,className:"instagram-gallery__button--load",disabled:""===n,onClick:l},a.button_load.text))},C=()=>{const t=window?.qligg_frontend?.settings?.spinner_image_url;return(0,e.createElement)("div",{className:"instagram-gallery__spinner",style:t?{backgroundImage:`url(${t})`}:{}})},w=({errorUserProfile:t,errorUserMediaList:a})=>(0,e.createElement)("div",{className:"instagram-gallery__alert"},(0,e.createElement)("ul",null,t&&(0,e.createElement)("li",null,(0,e.createElement)("b",null,t.error),(0,e.createElement)("p",null,t.message)),a&&(0,e.createElement)("li",null,(0,e.createElement)("b",null,a.error),(0,e.createElement)("p",null,a.message)))),x=(0,g.memo)((({feedSettings:t,userProfile:a})=>{const l={...a,...function(e){const t={};for(const a in e)e.hasOwnProperty(a)&&""!==e[a]&&(t[a]=e[a]);return t}(t.profile)};return!!t?.profile?.display&&(0,e.createElement)("div",{className:"instagram-gallery__profile"},(0,e.createElement)("div",{className:"avatar"},(0,e.createElement)("img",{src:l.avatar||"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g",alt:l.nickname})),(0,e.createElement)("div",{className:"info"},(0,e.createElement)("div",null,(0,e.createElement)("span",{className:"user"},"@",l.username),l.nickname&&(0,e.createElement)(g.Fragment,null,(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("span",{className:"user"},l.nickname)),(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("a",{className:"follow",href:l.link,target:"_blank",rel:"noopener noreferrer"},l.link_text),!!l.website&&(0,e.createElement)(g.Fragment,null,(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("a",{className:"follow",href:l.website,target:"_blank",rel:"noopener noreferrer"},l.website_text)),(0,e.createElement)("div",{className:"description"},l.biography))))}));var N,S,I,q,P,L,D,T,A,M,B,$={},R=[],F=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,O=Array.isArray;function U(e,t){for(var a in t)e[a]=t[a];return e}function z(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function j(e,t,a,l,n){var r={type:e,props:t,key:a,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++I:n,__i:-1,__u:0};return null==n&&null!=S.vnode&&S.vnode(r),r}function G(e){return e.children}function V(e,t){this.props=e,this.context=t}function W(e,t){if(null==t)return e.__?W(e.__,e.__i+1):null;for(var a;t<e.__k.length;t++)if(null!=(a=e.__k[t])&&null!=a.__e)return a.__e;return"function"==typeof e.type?W(e):null}function H(e){var t,a;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(a=e.__k[t])&&null!=a.__e){e.__e=e.__c.base=a.__e;break}return H(e)}}function Z(e){(!e.__d&&(e.__d=!0)&&q.push(e)&&!J.__r++||P!=S.debounceRendering)&&((P=S.debounceRendering)||L)(J)}function J(){for(var e,t,a,l,n,r,i,o=1;q.length;)q.length>o&&q.sort(D),e=q.shift(),o=q.length,e.__d&&(a=void 0,n=(l=(t=e).__v).__e,r=[],i=[],t.__P&&((a=U({},l)).__v=l.__v+1,S.vnode&&S.vnode(a),le(t.__P,a,l,t.__n,t.__P.namespaceURI,32&l.__u?[n]:null,r,null==n?W(l):n,!!(32&l.__u),i),a.__v=l.__v,a.__.__k[a.__i]=a,ne(r,a,i),a.__e!=n&&H(a)));J.__r=0}function X(e,t,a,l,n,r,i,o,s,c,m){var g,d,_,u,p,y,h=l&&l.__k||R,b=t.length;for(s=Y(a,t,h,s,b),g=0;g<b;g++)null!=(_=a.__k[g])&&(d=-1==_.__i?$:h[_.__i]||$,_.__i=g,y=le(e,_,d,n,r,i,o,s,c,m),u=_.__e,_.ref&&d.ref!=_.ref&&(d.ref&&oe(d.ref,null,_),m.push(_.ref,_.__c||u,_)),null==p&&null!=u&&(p=u),4&_.__u||d.__k===_.__k?s=Q(_,s,e):"function"==typeof _.type&&void 0!==y?s=y:u&&(s=u.nextSibling),_.__u&=-7);return a.__e=p,s}function Y(e,t,a,l,n){var r,i,o,s,c,m=a.length,g=m,d=0;for(e.__k=new Array(n),r=0;r<n;r++)null!=(i=t[r])&&"boolean"!=typeof i&&"function"!=typeof i?(s=r+d,(i=e.__k[r]="string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?j(null,i,null,null,null):O(i)?j(G,{children:i},null,null,null):null==i.constructor&&i.__b>0?j(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,o=null,-1!=(c=i.__i=K(i,a,s,g))&&(g--,(o=a[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(n>m?d--:n<m&&d++),"function"!=typeof i.type&&(i.__u|=4)):c!=s&&(c==s-1?d--:c==s+1?d++:(c>s?d--:d++,i.__u|=4))):e.__k[r]=null;if(g)for(r=0;r<m;r++)null!=(o=a[r])&&!(2&o.__u)&&(o.__e==l&&(l=W(o)),se(o,o));return l}function Q(e,t,a){var l,n;if("function"==typeof e.type){for(l=e.__k,n=0;l&&n<l.length;n++)l[n]&&(l[n].__=e,t=Q(l[n],t,a));return t}e.__e!=t&&(t&&e.type&&!a.contains(t)&&(t=W(e)),a.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function K(e,t,a,l){var n,r,i=e.key,o=e.type,s=t[a];if(null===s&&null==e.key||s&&i==s.key&&o==s.type&&!(2&s.__u))return a;if(l>(null==s||2&s.__u?0:1))for(n=a-1,r=a+1;n>=0||r<t.length;){if(n>=0){if((s=t[n])&&!(2&s.__u)&&i==s.key&&o==s.type)return n;n--}if(r<t.length){if((s=t[r])&&!(2&s.__u)&&i==s.key&&o==s.type)return r;r++}}return-1}function ee(e,t,a){"-"==t[0]?e.setProperty(t,null==a?"":a):e[t]=null==a?"":"number"!=typeof a||F.test(t)?a:a+"px"}function te(e,t,a,l,n){var r;e:if("style"==t)if("string"==typeof a)e.style.cssText=a;else{if("string"==typeof l&&(e.style.cssText=l=""),l)for(t in l)a&&t in a||ee(e.style,t,"");if(a)for(t in a)l&&a[t]==l[t]||ee(e.style,t,a[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(T,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=a,a?l?a.u=l.u:(a.u=A,e.addEventListener(t,r?B:M,r)):e.removeEventListener(t,r?B:M,r);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==a?"":a;break e}catch(e){}"function"==typeof a||(null==a||!1===a&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==a?"":a))}}function ae(e){return function(t){if(this.l){var a=this.l[t.type+e];if(null==t.t)t.t=A++;else if(t.t<a.u)return;return a(S.event?S.event(t):t)}}}function le(e,t,a,l,n,r,i,o,s,c){var m,g,d,_,u,p,y,h,b,f,E,v,k,C,w,x,N,I=t.type;if(null!=t.constructor)return null;128&a.__u&&(s=!!(32&a.__u),r=[o=t.__e=a.__e]),(m=S.__b)&&m(t);e:if("function"==typeof I)try{if(h=t.props,b="prototype"in I&&I.prototype.render,f=(m=I.contextType)&&l[m.__c],E=m?f?f.props.value:m.__:l,a.__c?y=(g=t.__c=a.__c).__=g.__E:(b?t.__c=g=new I(h,E):(t.__c=g=new V(h,E),g.constructor=I,g.render=ce),f&&f.sub(g),g.props=h,g.state||(g.state={}),g.context=E,g.__n=l,d=g.__d=!0,g.__h=[],g._sb=[]),b&&null==g.__s&&(g.__s=g.state),b&&null!=I.getDerivedStateFromProps&&(g.__s==g.state&&(g.__s=U({},g.__s)),U(g.__s,I.getDerivedStateFromProps(h,g.__s))),_=g.props,u=g.state,g.__v=t,d)b&&null==I.getDerivedStateFromProps&&null!=g.componentWillMount&&g.componentWillMount(),b&&null!=g.componentDidMount&&g.__h.push(g.componentDidMount);else{if(b&&null==I.getDerivedStateFromProps&&h!==_&&null!=g.componentWillReceiveProps&&g.componentWillReceiveProps(h,E),!g.__e&&null!=g.shouldComponentUpdate&&!1===g.shouldComponentUpdate(h,g.__s,E)||t.__v==a.__v){for(t.__v!=a.__v&&(g.props=h,g.state=g.__s,g.__d=!1),t.__e=a.__e,t.__k=a.__k,t.__k.some((function(e){e&&(e.__=t)})),v=0;v<g._sb.length;v++)g.__h.push(g._sb[v]);g._sb=[],g.__h.length&&i.push(g);break e}null!=g.componentWillUpdate&&g.componentWillUpdate(h,g.__s,E),b&&null!=g.componentDidUpdate&&g.__h.push((function(){g.componentDidUpdate(_,u,p)}))}if(g.context=E,g.props=h,g.__P=e,g.__e=!1,k=S.__r,C=0,b){for(g.state=g.__s,g.__d=!1,k&&k(t),m=g.render(g.props,g.state,g.context),w=0;w<g._sb.length;w++)g.__h.push(g._sb[w]);g._sb=[]}else do{g.__d=!1,k&&k(t),m=g.render(g.props,g.state,g.context),g.state=g.__s}while(g.__d&&++C<25);g.state=g.__s,null!=g.getChildContext&&(l=U(U({},l),g.getChildContext())),b&&!d&&null!=g.getSnapshotBeforeUpdate&&(p=g.getSnapshotBeforeUpdate(_,u)),x=m,null!=m&&m.type===G&&null==m.key&&(x=re(m.props.children)),o=X(e,O(x)?x:[x],t,a,l,n,r,i,o,s,c),g.base=t.__e,t.__u&=-161,g.__h.length&&i.push(g),y&&(g.__E=g.__=null)}catch(e){if(t.__v=null,s||null!=r)if(e.then){for(t.__u|=s?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,t.__e=o}else for(N=r.length;N--;)z(r[N]);else t.__e=a.__e,t.__k=a.__k;S.__e(e,t,a)}else null==r&&t.__v==a.__v?(t.__k=a.__k,t.__e=a.__e):o=t.__e=ie(a.__e,t,a,l,n,r,i,s,c);return(m=S.diffed)&&m(t),128&t.__u?void 0:o}function ne(e,t,a){for(var l=0;l<a.length;l++)oe(a[l],a[++l],a[++l]);S.__c&&S.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){S.__e(e,t.__v)}}))}function re(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:O(e)?e.map(re):U({},e)}function ie(e,t,a,l,n,r,i,o,s){var c,m,g,d,_,u,p,y=a.props,h=t.props,b=t.type;if("svg"==b?n="http://www.w3.org/2000/svg":"math"==b?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((_=r[c])&&"setAttribute"in _==!!b&&(b?_.localName==b:3==_.nodeType)){e=_,r[c]=null;break}if(null==e){if(null==b)return document.createTextNode(h);e=document.createElementNS(n,b,h.is&&h),o&&(S.__m&&S.__m(t,r),o=!1),r=null}if(null==b)y===h||o&&e.data==h||(e.data=h);else{if(r=r&&N.call(e.childNodes),y=a.props||$,!o&&null!=r)for(y={},c=0;c<e.attributes.length;c++)y[(_=e.attributes[c]).name]=_.value;for(c in y)if(_=y[c],"children"==c);else if("dangerouslySetInnerHTML"==c)g=_;else if(!(c in h)){if("value"==c&&"defaultValue"in h||"checked"==c&&"defaultChecked"in h)continue;te(e,c,null,_,n)}for(c in h)_=h[c],"children"==c?d=_:"dangerouslySetInnerHTML"==c?m=_:"value"==c?u=_:"checked"==c?p=_:o&&"function"!=typeof _||y[c]===_||te(e,c,_,y[c],n);if(m)o||g&&(m.__html==g.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(g&&(e.innerHTML=""),X("template"==t.type?e.content:e,O(d)?d:[d],t,a,l,"foreignObject"==b?"http://www.w3.org/1999/xhtml":n,r,i,r?r[0]:a.__k&&W(a,0),o,s),null!=r)for(c=r.length;c--;)z(r[c]);o||(c="value","progress"==b&&null==u?e.removeAttribute("value"):null!=u&&(u!==e[c]||"progress"==b&&!u||"option"==b&&u!=y[c])&&te(e,c,u,y[c],n),c="checked",null!=p&&p!=e[c]&&te(e,c,p,y[c],n))}return e}function oe(e,t,a){try{if("function"==typeof e){var l="function"==typeof e.__u;l&&e.__u(),l&&null==t||(e.__u=e(t))}else e.current=t}catch(e){S.__e(e,a)}}function se(e,t,a){var l,n;if(S.unmount&&S.unmount(e),(l=e.ref)&&(l.current&&l.current!=e.__e||oe(l,null,t)),null!=(l=e.__c)){if(l.componentWillUnmount)try{l.componentWillUnmount()}catch(e){S.__e(e,t)}l.base=l.__P=null}if(l=e.__k)for(n=0;n<l.length;n++)l[n]&&se(l[n],t,a||"function"!=typeof e.type);a||z(e.__e),e.__c=e.__=e.__e=void 0}function ce(e,t,a){return this.constructor(e,a)}N=R.slice,S={__e:function(e,t,a,l){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,l||{}),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},I=0,V.prototype.setState=function(e,t){var a;a=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=U({},this.state),"function"==typeof e&&(e=e(U({},a),this.props)),e&&U(a,e),null!=e&&this.__v&&(t&&this._sb.push(t),Z(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Z(this))},V.prototype.render=G,q=[],L="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D=function(e,t){return e.__v.__b-t.__v.__b},J.__r=0,T=/(PointerCapture)$|Capture$/i,A=0,M=ae(!1),B=ae(!0);const me=({feedSettings:t,feedItem:a})=>(0,e.createElement)(g.Fragment,null,(0,e.createElement)("div",{className:"instagram-gallery-item__media-mask"}),(0,e.createElement)("div",{className:"instagram-gallery-item__media-mask--content"},!!t.mask.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__likes_count--mask"},(0,e.createElement)("i",{className:"qligg-icon-heart instagram-gallery-item__icon-heart"}),a.likes_count||0),!!t.mask.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__comments_count--mask"},(0,e.createElement)("i",{className:"qligg-icon-comment instagram-gallery-item__icon-bubble_chat"}),a.comments_count||0))),ge=({feedItem:t,length:a,index:l,feedSettings:n})=>{const{setIsImageLoad:r}=p(),i="CAROUSEL_ALBUM"===t.media_type&&"VIDEO"===t.media.type,o=null===t.media.url,s=()=>{r(l===a-1)};return console.log("feedItem",t),(0,e.createElement)("div",{className:"instagram-gallery-item__media-wrap"},o?(0,e.createElement)("img",{alt:"instagram",className:m()("instagram-gallery-item__media"),src:n.copyright.placeholder?n.copyright.placeholder:t.media.thumbnail,onLoad:()=>s()}):"VIDEO"===t.media_type||i?(0,e.createElement)("video",{alt:"instagram",poster:t.media.thumbnail,className:"instagram-gallery-item__media",src:t.media.url,onLoadedData:()=>s()}):(0,e.createElement)("img",{alt:"instagram",className:"instagram-gallery-item__media",src:t.media.url,onLoad:()=>s()}),n.mask.display&&(0,e.createElement)(me,{feedItem:t,feedSettings:n}),"VIDEO"===t.media_type&&!o&&(0,e.createElement)("i",{className:"instagram-gallery-item__icon qligg-icon-video instagram-gallery-item__icon--views"}),"CAROUSEL_ALBUM"===t.media_type&&(0,e.createElement)("i",{className:"instagram-gallery-item__icon qligg-icon-gallery instagram-gallery-item__icon--views"}),!!t.share_url&&(0,e.createElement)("a",{className:"instagram-gallery-item__icon qligg-icon-instagram instagram-gallery-item__icon--link",href:t.share_url,target:"_blank",rel:"noreferrer"}))},de=e=>{const t=e.highlight.tag?.split(" ");return t.map((e=>e.includes("#")?e:e.split(" ").map((e=>"#"+e)).join(" ")))},_e=(e,t)=>{if(!e)return;const a=e.replace(/<[^>]+>/g,"");let l=a;return l=e.match("[-ヿ㐀-䶿一-鿿豈-ヲ-゚]")?a.split("",t).join(""):a.split(" ",t).join(" "),l.length<e.length?`${l}...`:l},ue=(0,g.memo)((({feedSettings:t,feedItem:a})=>(0,e.createElement)("div",{className:"instagram-gallery-item__media-card"},(0,e.createElement)("div",{className:"instagram-gallery-item__info"},!!a.date&&(0,e.createElement)("span",{className:"instagram-gallery-item__date"},(0,e.createElement)("i",{className:"qligg-icon-date"}),a.date),"BUSINESS"==a.user_type&&(0,e.createElement)("div",{className:"instagram-gallery-item__icons"},!!t.card.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__likes_count"},(0,e.createElement)("i",{className:"qligg-icon-heart"}),a.likes_count||0),!!t.card.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__comments_count"},(0,e.createElement)("i",{className:"qligg-icon-comment"}),a.comments_count||0))),!!t.card.text_length&&!!a.media_description&&(0,e.createElement)("p",{className:"instagram-gallery-item__media_description"},_e(a.media_description,t.card.text_length))))),pe=({index:t,length:a,feedSettings:l,feedItem:n,onClick:r})=>{const i=function(e,t,a){if(!["highlight","highlight-square"].includes(e.layout))return!1;if(!e?.highlight)return!1;for(const l in e.highlight){const n=e.highlight[l].split(",").map((e=>e.toString().trim()));switch(l){case"position":if(n.includes(a.toString()))return!0;break;case"id":if(n.includes(t.id))return!0;break;case"tag":const l=t.tags?.filter((t=>de(e).includes(t))).length;if(l)return!0}}return!1}(l,n,t),o=function(e){return["carousel","carousel-vertical"].includes(e.layout)}(l),s=!l?.modal?.display&&!!n?.share_url,c=s?"a":"div";return(0,e.createElement)(c,{href:s?n.share_url:void 0,target:s?"_blank":void 0,rel:s?"noopener noreferrer":void 0,className:m()("instagram-gallery-item",o&&"swiper-slide",i&&"highlight",`instagram-gallery-item--cols-${l.columns}`),"data-elementor-open-lightbox":"no","data-feed-item-index":t,onClick:r,onKeyDown:s?void 0:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(e))},tabIndex:s?void 0:0,role:s?void 0:"button","aria-label":(()=>{const e="VIDEO"===n.media_type?"Video":"Image";let t=n.media_description?`: ${n.media_description.replace(/<[^>]*>?/gm,"")}`:"";return t.length>100&&(t=t.substring(0,100)+"..."),`Instagram ${e}${t}`})()},(0,e.createElement)("div",{className:"instagram-gallery-item__wrap"},(0,e.createElement)(ge,{index:t,feedItem:n,length:a,feedSettings:l}),l.card.display&&(0,e.createElement)(ue,{feedItem:n,feedSettings:l})))},ye="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE2IDE3SDJsMy41LTQuNWwyLjUgM2wzLTMuODFBMiAyIDAgMCAxIDEwIDEwVjZIMmEyIDIgMCAwIDAtMiAydjEwYTIgMiAwIDAgMCAyIDJoMTRhMiAyIDAgMCAwIDItMnYtNmgtNS43NXoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTkgNGgtLjVWMi41YTIuNSAyLjUgMCAwIDAtNSAwVjRIMTNhMSAxIDAgMCAwLTEgMXY0YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjVhMSAxIDAgMCAwLTEtMXptLTMgNGExIDEgMCAxIDEgMS0xYTEgMSAwIDAgMS0xIDF6bTEuNS00aC0zVjIuNzVDMTQuNSAyIDE0LjUgMSAxNiAxczEuNSAxIDEuNSAxLjc1eiIvPjwvc3ZnPgo=",he=({currentFeedItem:t,feedSettings:a})=>{const l=(0,g.useRef)(null);return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container insta-gallery-slider-container"},(0,e.createElement)("div",{ref:l,className:"insta-gallery-slider"},t.children.map((t=>(0,e.createElement)("div",{key:t.id,className:"insta-gallery__media"},null===t.media.url?(0,e.createElement)("img",{className:m()("instagram-gallery-modal__media",!a.copyright.placeholder&&"instagram-gallery-modal__media--placeholder"),src:a.copyright.placeholder?a.copyright.placeholder:ye,alt:t.media.alt}):"VIDEO"===t.media.type?(0,e.createElement)("video",{controls:!0,poster:t.media.thumbnail,className:"instagram-gallery-modal__media",src:t.media.url}):(0,e.createElement)("img",{className:"instagram-gallery-modal__media",src:t.media.url,alt:t.media.alt}))))),(0,e.createElement)("div",{className:"insta-gallery-slider__button-container"},(0,e.createElement)("span",{onClick:()=>{if(l.current.children.length>0){const e=l.current.children.length-1,t=l.current.children[e];l.current.insertBefore(t,l.current.firstChild),l.current.style.transition="none";const a=l.current.children[0].offsetWidth;l.current.style.transform=`translateX(-${a}px)`,setTimeout((()=>{l.current.style.transition="200ms ease-out all",l.current.style.transform="translateX(0)"}),30)}},className:"insta-gallery-slider__button insta-gallery-slider__button--left qligg-icon-prev"}),(0,e.createElement)("span",{onClick:()=>{if(l.current.children.length>0){const e=l.current.children[0];l.current.style.transition="300ms ease-out all";const t=l.current.children[0].offsetWidth;l.current.style.transform=`translateX(-${t}px)`;const a=()=>{l.current.style.transition="none",l.current.style.transform="translateX(0)",l.current.appendChild(e),l.current.removeEventListener("transitionend",a)};l.current.addEventListener("transitionend",a)}},className:"insta-gallery-slider__button insta-gallery-slider__button--right qligg-icon-next"})))},be=(0,g.memo)((({currentFeedItem:t,feedSettings:a})=>{var l;const n=!t?.media?.url;switch(t.media_type){case"CAROUSEL_ALBUM":return(0,e.createElement)(he,{feedSettings:a,currentFeedItem:t});case"VIDEO":return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container"},n?(0,e.createElement)("img",{src:ye,alt:"thumbnail",className:"instagram-gallery-item__icon qligg-icon-video instagram-gallery-item__icon--views"}):(0,e.createElement)("video",{poster:t.media.thumbnail,src:t.media.url,controls:!0,className:"instagram-gallery-modal__media"}));default:return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container"},n?(0,e.createElement)("img",{src:null!==(l=t?.media?.thumbnail)&&void 0!==l?l:a?.copyright?.placeholder,className:"instagram-gallery-modal__media"}):(0,e.createElement)("img",{src:t.media.url,className:"instagram-gallery-modal__media"}))}})),fe=({currentFeedItem:t,userProfile:a,feedItemsNumber:l,feedSettings:n})=>{const{currentFeedIndex:r}=p(),[i,o]=(0,g.useState)(5),{comments:s,loading:c,error:m}=(({feedSettings:e,currentFeedItem:t,maxRetries:a=2,retryDelay:l=1500})=>{const[n,r]=(0,g.useState)([]),[i,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null);return window?.qligg_frontend?.restRoutePaths.comments,(0,g.useEffect)((()=>{if(!(e?.modal?.comments_list&&"BUSINESS"===t?.user_type&&t?.id&&e?.account_id))return;let n=!0;return(async()=>{o(!0),r([]),c(null);const i=async s=>{try{const a=await async function({account_id:e,media_id:t,limit:a=25}){const l=window?.qligg_frontend?.restRoutePaths.comments,n=f({account_id:e,media_id:t,limit:a}).toString(),r=`${l}${l.includes("?")?"&":"?"}${n}`,i=await b({url:r,method:"GET"}),{data:o}=i;return Array.isArray(o)?o:o&&"object"==typeof o?[o]:[]}({account_id:e.account_id,media_id:t.id});n&&(r(a),o(!1))}catch(e){if(!n)return;s<a?setTimeout((()=>{n&&i(s+1)}),l):(c(e),o(!1))}};await i(0)})(),()=>{n=!1}}),[t?.id,e?.account_id,a,l]),{comments:n,loading:i,error:s}})({feedSettings:n,currentFeedItem:t}),d=(0,g.useCallback)((e=>new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})),[]),_=(0,g.useCallback)((()=>{o((e=>e+5))}),[]),u=s.slice(0,i),y=s.length>i,h="BUSINESS"===t.user_type;return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-sidebar"},n.modal.profile&&a.nickname&&a.avatar&&(0,e.createElement)("div",{className:"instagram-gallery-modal__profile"},(0,e.createElement)("img",{alt:a.nickname,src:a.avatar}),(0,e.createElement)("div",null,(0,e.createElement)("span",null,a.nickname),(0,e.createElement)("a",{href:a.link,title:a.nickname,target:"_blank",rel:"noopener noreferrer","aria-label":`Visit ${a.nickname}'s Instagram profile`},`@${a.username}`))),(0,e.createElement)("div",{className:"instagram-gallery-modal__icons"},(0,e.createElement)("span",{className:"instagram-gallery-modal__counter","aria-live":"polite"},`${r+1} / ${l}`),(0,e.createElement)("a",{className:"instagram-gallery-modal__link",href:t.share_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Instagram"},(0,e.createElement)("i",{className:"qligg-icon-instagram","aria-hidden":"true"})," ","Instagram")),n.modal.media_description&&(0,e.createElement)("div",{className:"instagram-gallery-modal__media_description"},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:_e(t.media_description,n.modal.text_length)}})),(n.modal.likes_count||n.modal.comments_count)&&h&&(0,e.createElement)("div",{className:"instagram-gallery-modal__info"},n.modal.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-modal__likes_count"},(0,e.createElement)("i",{className:"qligg-icon-heart","aria-hidden":"true"}),t.likes_count||0),n.modal.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-modal__comments_count"},(0,e.createElement)("i",{className:"qligg-icon-comment","aria-hidden":"true"}),t.comments_count||0)),n.modal.comments_list&&h&&(0,e.createElement)("div",{className:"instagram-gallery-modal__comments-list"},(0,e.createElement)("p",null,(0,e.createElement)("b",null,"Comments")),c?(0,e.createElement)("p",{"aria-live":"polite"},"Loading comments..."):m?(0,e.createElement)("p",{className:"instagram-gallery-modal__error","aria-live":"assertive"},"Unable to load comments. Please try again later."):u.length>0?(0,e.createElement)(g.Fragment,null,(0,e.createElement)("ul",null,u.map((t=>(0,e.createElement)("li",{key:t.id,className:"instagram-gallery-modal__comment"},(0,e.createElement)("div",{className:"instagram-gallery-modal__comment-header"},(0,e.createElement)("strong",null,t.username),(0,e.createElement)("span",{className:"instagram-gallery-modal__comment-time"},d(t.timestamp))),(0,e.createElement)("p",null,t.text),t.replies&&t.replies.length>0&&(0,e.createElement)("ul",{className:"instagram-gallery-modal__comment-replies"},t.replies.map((t=>(0,e.createElement)("li",{key:t.id,className:"instagram-gallery-modal__comment-reply"},(0,e.createElement)("div",{className:"instagram-gallery-modal__comment-header"},(0,e.createElement)("strong",null,t.username),(0,e.createElement)("span",{className:"instagram-gallery-modal__comment-time"},d(t.timestamp))),(0,e.createElement)("p",null,t.text))))))))),y&&(0,e.createElement)("button",{className:"instagram-gallery-modal__load-more",onClick:_,"aria-label":"Load more comments"},"Load more comments")):(0,e.createElement)("div",null,(0,e.createElement)("p",null,"No comments available for this post."),window.qligg_frontend&&window.qligg_frontend.QLIGG_DEVELOPER&&(0,e.createElement)("p",null,"Comment count in feed item:"," ",t.comments_count))))},Ee=({isPrevious:t,classname:a,onClick:l,...n})=>(0,e.createElement)("span",{className:m()("instagram-gallery-modal__button-arrow",a,t&&"qligg-icon-prev",!t&&"qligg-icon-next"),onClick:l,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l(e))},role:"button",tabIndex:"0",...n}),ve=({onClick:t,...a})=>(0,e.createElement)("span",{className:"instagram-gallery-modal__button-close",onClick:t,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e))},role:"button",...a}),ke=({children:t,id:a})=>{const{isOpen:l,setIsOpen:n}=p();return l?(0,e.createElement)("div",{className:"instagram-gallery-modal__overlay",id:a,onClick:()=>n(!1),onKeyDown:e=>{"Escape"===e.key&&n(!1)},role:"dialog","aria-modal":"true",tabIndex:"-1"},t):null},Ce=({feedItems:t,feedSettings:a,userProfile:l})=>{const{currentFeedIndex:n,setCurrentFeedIndex:r}=p(),{setIsOpen:i,isOpen:o}=p(),s=(0,g.useRef)(null),[c,d]=(0,g.useState)(t[n]),_=!!t[n-1]||t.length>1,u=!!t[n+1]||t.length>1,y=(0,g.useCallback)((()=>{_&&(t[n-1]?r(n-1):r(t.length-1))}),[n,t,_,r]),h=(0,g.useCallback)((()=>{u&&(t[n+1]?r(n+1):r(0))}),[n,t,u,r]),b=(0,g.useCallback)((e=>{"ArrowLeft"===e.key?y():"ArrowRight"===e.key?h():"Escape"===e.key&&i(!1)}),[y,h,i]);return(0,g.useEffect)((()=>{d(t[n])}),[n,t]),(0,g.useEffect)((()=>(document.addEventListener("keydown",b),s.current&&s.current.focus(),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",b),document.body.style.overflow=""})),[b,o]),(0,e.createElement)(ke,{id:`instagram-gallery-modal-${a.id}`},(0,e.createElement)("div",{className:"instagram-gallery-modal",onClick:e=>e.stopPropagation(),ref:s,tabIndex:"-1","aria-modal":"true",role:"dialog","aria-label":"Instagram media viewer"},(0,e.createElement)("div",{className:"instagram-gallery-modal__options"},(0,e.createElement)("div",{className:"instagram-gallery-modal__options--arrows"},(0,e.createElement)(Ee,{isPrevious:!0,onClick:e=>{e.stopPropagation(),y()},"aria-label":"Previous image",tabIndex:"0"}),(0,e.createElement)(Ee,{next:!0,onClick:e=>{e.stopPropagation(),h()},"aria-label":"Next image",tabIndex:"0"})),(0,e.createElement)(ve,{onClick:()=>i(!1),"aria-label":"Close modal",tabIndex:"0"})),(0,e.createElement)("section",{className:m()("instagram-gallery-modal__body","right"!==a.modal.modal_align&&`instagram-gallery-modal__body--sidebar-${a.modal.modal_align}`)},(0,e.createElement)(be,{feedSettings:a,currentFeedItem:c}),(0,e.createElement)(fe,{feedSettings:a,currentFeedItem:c,userProfile:l,feedItemsNumber:t.length}))))},we=(e,t,a="")=>null==t||""===t?"":`${e}: ${t}${a};`,xe=(0,g.forwardRef)((Ne=t=>{const a=t.target.parentNode,{masonryRef:l,userMediaList:n,feedSettings:r,className:i,userProfile:o}=t,{currentFeedIndex:s,setCurrentFeedIndex:c}=p(),{setIsOpen:d}=p(),_=!!r?.modal?.display;return(0,e.createElement)(g.Fragment,null,(0,e.createElement)("div",{ref:l,className:m()("instagram-gallery-list",i),"data-feed_layout":r.layout},n.data.map(((t,a)=>{const l=n.data.length;return(0,e.createElement)(pe,{key:t.id,index:a,length:l,feedItem:t,feedSettings:r,onClick:()=>{_&&(c(a),d(!0))}})}))),_&&(0,g.createPortal)((0,e.createElement)(Ce,{userProfile:o,feedSettings:r,currentFeedIndex:s,feedItems:n.data}),a))},(t,a)=>{const{feedSettings:l}=t,n=l.responsive||{desktop:{columns:l.columns||3,spacing:l.spacing||10},tablet:{columns:2,spacing:8},mobile:{columns:1,spacing:6},breakpoints:{tablet:768,mobile:480}},r=n.breakpoints?.tablet||768,i=n.breakpoints?.mobile||480,o=!!l.box?.display,s=!!l.card?.display,c="carousel"===l.layout,m=!!l.mask?.display,d=!!l.button?.display,_=!!l.button_load?.display,u=`instagram-gallery-feed-${l.id}`,p=`instagram-gallery-modal-${l.id}`;return(0,e.createElement)(g.Fragment,null,(0,e.createElement)("style",null,`\n\t\t\t\t\t#${p} {\n\t\t\t\t\t\t${we("--qligg-modal-text-align",l.modal?.text_align||"left")}\n\t\t\t\t\t\t${we("--qligg-modal-font-size",l.modal?.font_size||14,"px")}\n\t\t\t\t\t\t--qligg-modal-body-height: 75vh;\n\t\t\t\t\t\t--qligg-modal-body-width: 75vw;\n\t\t\t\t\t\t--qligg-modal-sidebar-width: 360px;\n\t\t\t\t\t\t--qligg-modal-button-size: 40px;\n\t\t\t\t\t\t--qligg-modal-comments-height: 400px;\n\t\t\t\t\t\t--qligg-modal-border-color: #eeeeee;\n\t\t\t\t\t\t--qligg-modal-border-color-dark: #dddddd;\n\t\t\t\t\t\t--qligg-modal-button-border: #efefef;\n\t\t\t\t\t\t--qligg-modal-button-hover: #fafafa;\n\t\t\t\t\t\t--qligg-modal-error-color: #e74c3c;\n\t\t\t\t\t}\n\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t#${u} {\n\t\t\t\t\t\t\t--qligg-columns: ${n.desktop?.columns||3};\n\t\t\t\t\t\t\t--qligg-spacing: ${n.desktop?.spacing||10}px;\n\t\t\t\t\t\t\t--qligg-item-width: calc(100% / var(--qligg-columns));\n\t\t\t\t\t\t\t${o?we("--qligg-box-bg",l.box.background):""}\n\t\t\t\t\t\t\t${o?we("--qligg-box-color",l.box.text_color):""}\n\t\t\t\t\t\t\t${o?we("--qligg-box-radius",l.box.radius,"px"):""}\n\t\t\t\t\t\t\t${o?we("--qligg-box-padding",l.box.padding,"px"):""}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Feed card settings */\n\t\t\t\t\t\t\t${s?we("--qligg-card-bg",l.card.background):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-bg-hover",l.card.background_hover):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-color",l.card.text_color):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-font-size",l.card.font_size,"px"):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-padding",l.card.padding,"px"):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-radius",l.card.radius,"px"):""}\n\t\t\t\t\t\t\t${s&&l.card.boxed?we("--qligg-card-boxed","1px solid #f5f5f5"):""}\n\t\t\t\t\t\t\t${s&&l.card.boxed?we("--qligg-card-shadow","0 1px 3px rgba(0,0,0,0.05)"):""}\n\t\t\t\t\t\t\t${s&&l.card.boxed?we("--qligg-card-shadow-hover","0 3px 10px rgba(0,0,0,0.06)"):""}\n\t\t\t\t\t\t\t${s?we("--qligg-card-text-align",l.card.text_align||"left"):""}\n\t\t\t\t\t\t\t${m?we("--qligg-mask-bg",l.mask.background):""}\n\t\t\t\t\t\t\t${m?we("--qligg-mask-icon-color",l.mask.icon_color||"#ffffff"):""}\n\t\t\t\t\t\t\t${c?we("--qligg-carousel-arrow-color",l.carousel.navarrows_color):""}\n\t\t\t\t\t\t\t${c?we("--qligg-carousel-pagination-color",l.carousel.pagination_color):""}\n\t\t\t\t\t\t\t${d?we("--qligg-button-color",l.button.text_color):""}\n\t\t\t\t\t\t\t${d?we("--qligg-button-bg",l.button.background):""}\n\t\t\t\t\t\t\t${d?we("--qligg-button-bg-hover",l.button.background_hover):""}\n\t\t\t\t\t\t\t${_?we("--qligg-load-button-color",l.button_load.text_color):""}\n\t\t\t\t\t\t\t${_?we("--qligg-load-button-bg",l.button_load.background):""}\n\t\t\t\t\t\t\t${_?we("--qligg-load-button-bg-hover",l.button_load.background_hover):""}\n\t\t\t\t\t\t}\n\t\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t@media (max-width: ${r}px) {\n\t\t\t\t\t\t\t#${u} {\n\t\t\t\t\t\t\t\t--qligg-columns: ${n.tablet?.columns||2};\n\t\t\t\t\t\t\t\t--qligg-spacing: ${n.tablet?.spacing||8}px;\n\t\t\t\t\t\t\t\t--qligg-mask-icon-size: 26px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${p} {\n\t\t\t\t\t\t\t\t--qligg-modal-body-height: 80vh;\n\t\t\t\t\t\t\t\t--qligg-modal-body-width: 80vw;\n\t\t\t\t\t\t\t\t--qligg-modal-sidebar-width: 100%;\n\t\t\t\t\t\t\t\t--qligg-modal-button-size: 36px;\n\t\t\t\t\t\t\t\t--qligg-modal-comments-height: 250px;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__body {\n\t\t\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\t\t\toverflow-x: hidden;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__media-sidebar {\n\t\t\t\t\t\t\t\tmax-height: 40vh;\n\t\t\t\t\t\t\t\tborder-left: none;\n\t\t\t\t\t\t\t\tborder-top: 1px solid #f5f5f5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__media-container {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\toverflow: visible;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__button-close:before, \n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__button-close:after {\n\t\t\t\t\t\t\t\twidth: 18px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t@media (max-width: ${i}px) {\n\t\t\t\t\t\t\t#${u} {\n\t\t\t\t\t\t\t\t--qligg-columns: ${n.mobile?.columns||1};\n\t\t\t\t\t\t\t\t--qligg-spacing: ${n.mobile?.spacing||6}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${p} {\n\t\t\t\t\t\t\t\t--qligg-modal-body-height: 85vh;\n\t\t\t\t\t\t\t\t--qligg-modal-body-width: 90vw;\n\t\t\t\t\t\t\t\t--qligg-modal-sidebar-width: 100%;\n\t\t\t\t\t\t\t\t--qligg-modal-button-size: 32px;\n\t\t\t\t\t\t\t\t--qligg-modal-comments-height: 200px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${u} [data-feed_layout="highlight"] .instagram-gallery-item.highlight {\n\t\t\t\t\t\t\t\twidth: var(--qligg-item-width);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#${p} .instagram-gallery-modal__button-arrow {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\tfont-size: 1rem;\n\t\t\t\t\t\t\t\ttop: auto;\n\t\t\t\t\t\t\t\tleft: auto;\n\t\t\t\t\t\t\t\tright: auto;\n\t\t\t\t\t\t\t\tbottom: auto;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t`),(0,e.createElement)(Ne,{...t,forwardRef:a}))}));var Ne;const Se=t=>{const{target:a,userMediaList:l}=t,[n,r]=(0,g.useState)(!0),{isImageLoad:i}=p(),o=function(e,t){const a=(0,g.useRef)();return(0,g.useCallback)((t=>{t?a.current=e(t):a.current&&a.current()}),t)}((e=>{const{ownerDocument:t}=e,{defaultView:l}=t;if(!l.Masonry&&!i)return;const n=new l.Masonry(e,{itemSelector:".instagram-gallery-item",isResizable:!0,isAnimated:!1,transitionDuration:0,percentPosition:!0,columnWidth:".instagram-gallery-item",gutter:0});r(!1),a.classList.add("loaded");const o=new l.MutationObserver((()=>{n.layout()})),s=e.querySelector(".instagram-gallery-item__wrap");return s&&o.observe(s,{childList:!0,subtree:!0}),()=>{o.disconnect(),n.destroy()}}),[l,i]);return(0,e.createElement)(g.Fragment,null,n&&(0,e.createElement)(C,null),(0,e.createElement)(xe,{...t,masonryRef:o}))},Ie=t=>{const{userMediaList:a,feedSettings:l}=t,{setCurrentFeedIndex:n}=p(),{setIsOpen:r}=p(),i=(0,g.useCallback)((e=>{if(e){const{defaultView:t}=document;if(!t.Swiper)return;new t.Swiper(e,{slideClass:"instagram-gallery-item",loop:!0,loopedSlidesLimit:!1,centeredSlides:l.carousel.centered_slides,allowTouchMove:!1,slidesPerView:l.responsive?.desktop?.columns||l.carousel.slidespv||3,spaceBetween:l.responsive?.desktop?.spacing||l.spacing||10,autoplay:l.carousel.autoplay&&{delay:l.carousel.autoplay_interval},pagination:{el:e.querySelector(".swiper-pagination"),dynamicBullets:!0,clickable:!0,type:"bullets"},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:l.responsive?.mobile?.columns||1,spaceBetween:l.responsive?.mobile?.spacing||6},[l.responsive?.breakpoints?.mobile||480]:{slidesPerView:l.responsive?.tablet?.columns||2,spaceBetween:l.responsive?.tablet?.spacing||8},[l.responsive?.breakpoints?.tablet||768]:{slidesPerView:l.responsive?.desktop?.columns||3,spaceBetween:l.responsive?.desktop?.spacing||10}}});const a=()=>{e.addEventListener("click",(e=>{(e.target.classList.contains(".swiper-slide-duplicate")||e.target.closest(".swiper-slide-duplicate"))&&(r(!0),n(Number(e.target.closest(".swiper-slide-duplicate").dataset.feedItemIndex)))}))};a()}}),[a,l]);return(0,e.createElement)("div",{ref:i,className:"swiper-container"},(0,e.createElement)(xe,{className:"swiper-wrapper instagram-gallery-square",...t}),l.carousel.pagination&&(0,e.createElement)("div",{className:"swiper-pagination"}),l.carousel.navarrows&&(0,e.createElement)(g.Fragment,null,(0,e.createElement)("div",{tabIndex:"1",className:"swiper-button-prev"}),(0,e.createElement)("div",{tabIndex:"1",className:"swiper-button-next"})))},qe=t=>{const a=(0,g.useRef)();return(0,e.createElement)(xe,{ref:a,className:"instagram-gallery-square",...t})},Pe=t=>{const{feedSettings:a}=t,{layout:l}=a;switch(l){case"masonry":case"highlight":return(0,e.createElement)(Se,{...t});case"carousel":return(0,e.createElement)(Ie,{...t});default:return(0,e.createElement)(qe,{...t})}},Le=t=>{const{target:a,feedSettings:l}=t,{isLoading:n,userProfile:r,error:i}=(e=>{const{account_id:t}=e,[a,l]=(0,g.useState)(!0),[n,r]=(0,g.useState)(null),[i,o]=(0,g.useState)(null);return(0,g.useEffect)((()=>{(async()=>{l(!0);try{const t=await async function(e){const t=window?.qligg_frontend?.restRoutePaths.userprofile,a=f({account_id:e.account_id}).toString(),l=`${t}${t.includes("?")?"&":"?"}${a}`;return await b({url:l,method:"GET"})}(e);r(t),l(!1)}catch(e){l(!1),o(e)}})()}),[t]),{isLoading:a,userProfile:n,error:i}})(l),{isLoading:o,isLoadingMore:s,userMediaList:c,error:m,setAfter:d}=(e=>{const{source:t,limit:a,account_id:l,tag:n,order_by:r,copyright:i,reel:o}=e,{counter:s}=p(),[c,m]=(0,g.useState)(!0),[d,_]=(0,g.useState)(!1),[u,y]=(0,g.useState)({paging:{next:null,prev:null},data:[]}),[h,E]=(0,g.useState)(""),[v,k]=(0,g.useState)(null),{setIsImageLoad:C}=p();return(0,g.useEffect)((()=>{k(null),(async()=>{0===s?m(!0):_(!0),C(!1);try{const t=await async function(e,t="",a=0){const l=e?.account_id,n=e?.limit,r=e?.copyright?.hide,i=e?.reel?.hide,o=e?.order_by,s=e?.tag,c=e?.source,m=window?.qligg_frontend?.restRoutePaths?.[c];if(!m)throw new Error(`Unknown source: ${c}`);const g=f({account_id:l,limit:n,hide_items_with_copyright:r,hide_reels:i,after:t,pagination:a,order_by:o,tag:s}).toString(),d=`${m}${m.includes("?")?"&":"?"}${g}`;return await b({url:d,method:"GET"})}(e,h,s);y(0===s?{paging:t?.paging,data:t?.data}:{paging:t?.paging,data:[...u?.data,...t?.data]}),m(!1),_(!1)}catch(e){m(!1),_(!1),k(e)}})()}),[a,r,l,t,n,i?.hide,o?.hide,s]),{isLoading:c,isLoadingMore:d,userMediaList:u,error:v,setAfter:E}})(l),_=n||o,u=i||m,{counter:y,setCounter:h}=p();return(0,g.useEffect)((()=>{_||["masonry","highlight"].includes(l.layout)||a.classList.add("loaded")}),[_]),_?(0,e.createElement)(C,null):u?(0,e.createElement)(w,{errorUserProfile:i,errorUserMediaList:m}):(0,e.createElement)(g.Fragment,null,!!l?.profile?.display&&(0,e.createElement)(x,{feedSettings:l,userProfile:r}),(0,e.createElement)(Pe,{target:a,feedSettings:l,userMediaList:c,userProfile:r}),s&&(0,e.createElement)(C,null),(0,e.createElement)(k,{userProfile:r,feedSettings:l,onClick:e=>{e.preventDefault(),d(c.paging.next),h(y+1)},after:c?.paging?.next}))},De=t=>{const{attributes:a,setAttributes:l}=t,i=(0,g.useRef)(null),[o,s]=(0,g.useState)(!1),[c,m]=(0,g.useState)("desktop"),d=(0,n.useBlockProps)({className:"qligg-box-editor"}),_=(0,r.useInstanceId)(De,"qligg");return(0,g.useEffect)((()=>{l({id:_})}),[_,l]),(0,g.useEffect)((()=>{i.current&&!o&&s(!0)}),[i.current]),(0,g.useEffect)((()=>{const e=()=>{const e=document.querySelector(".edit-post-visual-editor");e&&(e.classList.contains("is-mobile-preview")?m("mobile"):e.classList.contains("is-tablet-preview")?m("tablet"):m("desktop"))};e();const t=document.querySelector(".edit-post-visual-editor");if(t){const a=new MutationObserver(e);return a.observe(t,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()}}),[]),(0,e.createElement)("div",{...d},(0,e.createElement)("div",{className:"instagram-gallery-feed",ref:i,id:`instagram-gallery-feed-${_}`,"data-view-mode":c},o&&(0,e.createElement)(h,null,(0,e.createElement)(Le,{target:i.current,feedSettings:a}))))},Te=(0,g.forwardRef)(De),Ae=t=>{const{href:a,target:l="_self",title:n,children:r,className:i,alert:o}=t;return(0,e.createElement)("a",{href:a,className:m()("insta-gallery__account-button",i),target:l,title:n,onClick:e=>!confirm(o)&&e.preventDefault()},r)},{QLIGG_PERSONAL_LINK:Me,QLIGG_BUSSINESS_LINK:Be}="undefined"!=typeof qligg_gutenberg?qligg_gutenberg:{},$e=()=>(0,e.createElement)(d.Placeholder,{label:(0,t.__)("Please create access token","insta-gallery"),instructions:(0,t.__)("Before you start creating feeds, you have to create an access token. Please go to the account tab to connect your Instagram account and then reload this page.","insta-gallery")},(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,e.createElement)(Ae,{href:Me||"#",target:"_blank",title:(0,t.__)("Add Basic Account","insta-gallery")},(0,t.__)("Add Basic Account","insta-gallery")),(0,e.createElement)(Ae,{className:"qligg-premium-field",href:Be||"#",target:"_blank",title:(0,t.__)("Add Advanced Account","insta-gallery")},(0,t.__)("Add Advanced Account","insta-gallery"))))),Re=({attributes:a,setAttributes:l,accounts:n})=>(0,e.createElement)(d.Placeholder,{label:(0,t.__)("Please select account","insta-gallery"),instructions:(0,t.__)("Before you start creating feeds, you have to select your Instagram account.","insta-gallery")},(0,e.createElement)("p",null,(0,e.createElement)(d.RadioControl,{selected:a.account_id,onChange:e=>l({account_id:e}),options:n.map((e=>({value:e.id,label:e.nickname||e.username})))}))),{U:Fe}={U:"qligg/box"};(0,l.registerBlockType)(Fe,{title:(0,t.__)("Social Feed Gallery","insta-gallery"),description:(0,t.__)("Display beautiful and responsive galleries on your website from your Instagram feed account.","insta-gallery"),icon:"awards",keywords:[(0,t.__)("qligg","insta-gallery"),(0,t.__)("instagram","insta-gallery"),(0,t.__)("quadlayers","insta-gallery")],edit:a=>{const{attributes:l}=a,{accounts:n,hasResolvedAccounts:r}=(0,s.useAccountsEntities)();return r?n&&0!==n.length?n?.find((e=>e.id===l.account_id))?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(_,{...a}),(0,e.createElement)(Te,{...a})):(0,e.createElement)(Re,{...a,accounts:n}):(0,e.createElement)($e,{...a}):(0,e.createElement)("p",null,(0,e.createElement)("span",{style:{visibility:"visible"},className:"spinner"}),(0,t.__)("Loading…","insta-gallery"))},save:()=>(0,e.createElement)(n.InnerBlocks.Content,null)})})()})();
Copyright ©2021 || Defacer Indonesia