Files
roi-theme/wp-content/plugins/thrive-visual-editor/admin/assets/js/stock-library.min.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

1 line
30 KiB
JavaScript
Executable File

(()=>{var t={23779:t=>{t.exports=()=>'\n <div class="tcb-stock-images">\n <div class="tcb-unsplash-top">\n <div class="tcb-unsplash-header">\n <svg fill="#000000" width="20px" height="20px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg"><title>Unsplash icon</title><path d="M7.5 6.75V0h9v6.75h-9zm9 3.75H24V24H0V10.5h7.5v6.75h9V10.5z"/></svg>\n <h2>Unsplash</h2>\n </div>\n <div class="tcb-unsplash-search">\n <input type="text" id="tcb-unsplash-search-input" placeholder="Search..." />\n <button id="tcb-unsplash-clear-search-btn" style="display: none;">&times;</button>\n <button id="tcb-unsplash-search-btn"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"/></svg></button>\n </div>\n </div>\n <div id="tcb-unsplash-loader" style="display:flex; position:fixed; top:50%; width: 80px; height: 80px; left:50%; transform:translate(-50%, -50%); z-index:1000; align-items:center; justify-content:center;">\n <svg class="spin-svg" xmlns="http://www.w3.org/2000/svg" height="32" width="32" viewBox="0 0 512 512">\x3c!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path fill="#2b5e92" d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"/></svg>\n </div>\n <div class="tcb-unsplash-holder" style="display:none;">\n <div class="tcb-unsplash-filters">\n <div class="tcb-unsplash-total-count"><svg fill="#fff" width="12px" height="12px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 448H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h416c26.5 0 48 21.5 48 48v288c0 26.5-21.5 48-48 48zM112 120c-30.9 0-56 25.1-56 56s25.1 56 56 56 56-25.1 56-56-25.1-56-56-56zM64 384h384V272l-87.5-87.5c-4.7-4.7-12.3-4.7-17 0L208 320l-55.5-55.5c-4.7-4.7-12.3-4.7-17 0L64 336v48z"/></svg> Photos</div>\n <div class="tcb-unsplash-dropdown-container">\n <div class="tcb-unsplash-category hidden">\n <label for="tcb-unsplash-category-dropdown">Category</label>\n <select id="tcb-unsplash-category-dropdown" class="tcb-unsplash-select">\n <option value="">All</option>\n <option value="animals">Animals</option>\n <option value="arts">Arts</option>\n <option value="beauty">Beauty</option>\n <option value="background-abstract">Background/Abstract</option>\n <option value="buildings">Buildings</option>\n <option value="business-finance">Business/Finance</option>\n <option value="cars-transportation">Cars/Transportation</option>\n <option value="education">Education</option>\n <option value="events-holidays">Events/Holidays</option>\n <option value="fashion">Fashion</option>\n <option value="food-drink">Food/Drink</option>\n <option value="feelings">Feelings</option>\n <option value="food">Food</option>\n <option value="healthcare-medical">Healthcare/Medical</option>\n <option value="industrial">Industrial</option>\n <option value="indoors">Indoors</option>\n <option value="nature-landscape-plants">Nature/Landscape/Plants</option>\n <option value="people">People</option>\n <option value="places">Places</option>\n <option value="religion">Religion</option>\n <option value="science">Science</option>\n <option value="sports">Sports</option>\n <option value="objects">Objects</option>\n <option value="travel">Travel</option>\n <option value="technology">Technology</option>\n </select>\n </div> \n <div class="tcb-unsplash-ordination hidden">\n <div id="tcb-full-search-term" data-full-search-term=""></div>\n <label for="tcb-unsplash-ordination-dropdown">Orientation</label>\n <select id="tcb-unsplash-ordination-dropdown">\n <option value="">All</option>\n <option value="landscape">Landscape</option>\n <option value="portrait">Portrait</option>\n <option value="squarish">Squarish</option>\n </select>\n </div> \n <div id="tcb-unsplash-order">\n <label for="tcb-unsplash-order-dropdown">Order</label>\n <select id="tcb-unsplash-order-dropdown">\n <option value="relevant">Relevance</option>\n <option value="latest">Latest</option>\n </select>\n </div>\n </div> \n </div>\n <div class="tcb-unsplash-grid"></div>\n </div>\n </div>'},45523:t=>{t.exports={loaderSVG:()=>'<svg class="spin-svg" xmlns="http://www.w3.org/2000/svg" height="32" width="32" viewBox="0 0 512 512">\x3c!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path fill="#2b5e92" d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"/></svg>',getStockImageSVG:()=>'<svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 0.647886C14.7338 0.652805 14.6321 0.691774 14.4421 0.774821C14.2245 0.865246 14 1.0321 13.8305 1.19687L13.4145 1.63651C13.3753 1.67964 13.3755 1.68758 13.3463 1.72958C12.5716 2.79406 12.3977 2.96431 11.789 4.31274C11.5058 4.94155 11.1813 5.52969 10.8309 6.10931C10.5899 6.50431 10.3699 6.90309 10.0969 7.27292C10.07 7.31132 10.0511 7.32854 10.0242 7.36259C9.85644 7.59357 9.63988 7.80166 9.43929 8.00048C9.30499 8.1346 9.13806 8.26305 8.98414 8.37807C8.85157 8.47152 8.72438 8.57462 8.57671 8.66031L8.35981 8.78895C8.31296 8.81903 8.29838 8.83606 8.25118 8.86084C8.21648 8.87805 8.18108 8.9 8.14655 8.9174C8.10438 8.93859 8.06551 8.95164 8.02161 8.97359C7.16129 9.45144 6.02628 9.76301 5.04327 9.89259L4.43802 9.97431C4.26207 10.0033 3.78089 10.029 3.3391 10.0371C2.97054 10.0439 2.63026 10.0369 2.52077 10.0152L2.58792 9.82676C2.73039 9.47073 2.89055 9.12247 3.06511 8.7863C3.09565 8.73258 3.11005 8.68642 3.14493 8.62759L3.49926 7.97797L4.38597 6.62784L5.19267 5.70221C5.21558 5.67705 5.22703 5.66003 5.25063 5.63411C5.28516 5.60063 5.28932 5.60498 5.32056 5.57528L5.50918 5.39689C5.53625 5.37627 5.54753 5.36359 5.57893 5.34184C5.62908 5.29928 5.65112 5.2743 5.70196 5.23174L6.56055 4.57985C6.84773 4.37062 7.15764 4.17937 7.45246 3.9902L8.38219 3.43687C8.73132 3.2441 9.3324 2.89734 9.66279 2.74109L10.6335 2.24432C10.4931 2.26097 10.3107 2.35007 10.1783 2.4019C10.022 2.45979 9.88629 2.51181 9.72994 2.56837L8.84758 2.91683C8.41586 3.07952 7.9883 3.2948 7.56941 3.48113L6.75681 3.88294C6.45453 4.02103 5.98047 4.29306 5.67472 4.48413C5.3301 4.69468 5.00527 4.94174 4.66759 5.16345L3.54299 6.03573C3.51592 6.05843 3.48868 6.07829 3.46161 6.1008L2.8253 6.69745C2.63651 6.91273 2.41336 7.12007 2.23637 7.34764C2.20548 7.38983 2.20565 7.39853 2.16713 7.44072C2.00194 7.62762 1.85722 7.83684 1.71458 8.04361C1.50497 8.3548 1.31028 8.6781 1.13155 9.00915L0.835692 9.62585C0.718391 9.88597 0.236865 11.1322 0.214828 11.4773L0.179082 11.4779C0.178215 11.4328 0.0446023 10.8665 0.00625379 10.378L6.97819e-06 9.97336C-0.000166544 9.96202 0.00295686 9.94877 0.00260982 9.93288C0.0334968 9.66974 0.0275971 9.49589 0.0772246 9.162C0.199385 8.24205 0.560138 7.31321 1.02969 6.53079L1.51139 5.77486C1.64552 5.57717 2.16713 4.93152 2.32226 4.80062C2.4727 4.66876 2.60684 4.47108 2.76873 4.33828C2.83849 4.28058 2.90773 4.19886 2.98512 4.13473C3.06563 4.06776 3.12376 4.00401 3.20497 3.93969L3.66515 3.5655C4.13262 3.19132 4.63514 2.85875 5.15571 2.57007C5.71081 2.26475 6.26261 2.01428 6.84114 1.76155C7.59561 1.43314 8.61263 1.18571 9.38949 1.00864C10.2085 0.814169 12.2835 0.381909 13.2818 0.363559L13.4963 0.359586C14.0135 0.349939 14.8117 0.360721 15 0.647886Z" fill="#4BB35E"/></svg>',photosIconSvg:()=>'<svg fill="#fff" width="12px" height="12px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 448H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h416c26.5 0 48 21.5 48 48v288c0 26.5-21.5 48-48 48zM112 120c-30.9 0-56 25.1-56 56s25.1 56 56 56 56-25.1 56-56-25.1-56-56-56zM64 384h384V272l-87.5-87.5c-4.7-4.7-12.3-4.7-17 0L208 320l-55.5-55.5c-4.7-4.7-12.3-4.7-17 0L64 336v48z"/></svg>',unsplashOutboundLinkSVG:()=>'<svg xmlns="http://www.w3.org/2000/svg" height="14" width="14" viewBox="0 0 512 512">\x3c!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--\x3e<path fill="#77848f" d="M304 24c0 13.3 10.7 24 24 24l102.1 0L207 271c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l223-223L464 184c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24L328 0c-13.3 0-24 10.7-24 24zM72 32C32.2 32 0 64.2 0 104L0 440c0 39.8 32.2 72 72 72l336 0c39.8 0 72-32.2 72-72l0-128c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 128c0 13.3-10.7 24-24 24L72 464c-13.3 0-24-10.7-24-24l0-336c0-13.3 10.7-24 24-24l128 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L72 32z"/></svg>',searchButtonSVG:()=>'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"/></svg>',downloadButtonSVG:()=>'<svg fill="#fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"/></svg>',gearButtonSVG:()=>'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--\x3e<path fill="#77848f" d="M256 0c17 0 33.6 1.7 49.8 4.8c7.9 1.5 21.8 6.1 29.4 20.1c2 3.7 3.6 7.6 4.6 11.8l9.3 38.5C350.5 81 360.3 86.7 366 85l38-11.2c4-1.2 8.1-1.8 12.2-1.9c16.1-.5 27 9.4 32.3 15.4c22.1 25.1 39.1 54.6 49.9 86.3c2.6 7.6 5.6 21.8-2.7 35.4c-2.2 3.6-4.9 7-8 10L459 246.3c-4.2 4-4.2 15.5 0 19.5l28.7 27.3c3.1 3 5.8 6.4 8 10c8.2 13.6 5.2 27.8 2.7 35.4c-10.8 31.7-27.8 61.1-49.9 86.3c-5.3 6-16.3 15.9-32.3 15.4c-4.1-.1-8.2-.8-12.2-1.9L366 427c-5.7-1.7-15.5 4-16.9 9.8l-9.3 38.5c-1 4.2-2.6 8.2-4.6 11.8c-7.7 14-21.6 18.5-29.4 20.1C289.6 510.3 273 512 256 512s-33.6-1.7-49.8-4.8c-7.9-1.5-21.8-6.1-29.4-20.1c-2-3.7-3.6-7.6-4.6-11.8l-9.3-38.5c-1.4-5.8-11.2-11.5-16.9-9.8l-38 11.2c-4-1.2-8.1 1.8-12.2 1.9c-16.1 .5-27-9.4-32.3-15.4c-22-25.1-39.1-54.6-49.9-86.3c-2.6-7.6-5.6-21.8 2.7-35.4c2.2-3.6 4.9-7 8-10L53 265.7c4.2-4 4.2-15.5 0-19.5L24.2 218.9c-3.1-3-5.8-6.4-8-10C8 195.3 11 181.1 13.6 173.6c10.8-31.7 27.8-61.1 49.9-86.3c5.3-6 16.3-15.9 32.3-15.4c4.1 .1 8.2 .8 12.2 1.9L146 85c5.7 1.7 15.5-4 16.9-9.8l9.3-38.5c1-4.2 2.6-8.2 4.6-11.8c7.7-14 21.6-18.5 29.4-20.1C222.4 1.7 239 0 256 0zM218.1 51.4l-8.5 35.1c-7.8 32.3-45.3 53.9-77.2 44.6L97.9 120.9c-16.5 19.3-29.5 41.7-38 65.7l26.2 24.9c24 22.8 24 66.2 0 89L59.9 325.4c8.5 24 21.5 46.4 38 65.7l34.6-10.2c31.8-9.4 69.4 12.3 77.2 44.6l8.5 35.1c24.6 4.5 51.3 4.5 75.9 0l8.5-35.1c7.8-32.3 45.3-53.9 77.2-44.6l34.6 10.2c16.5-19.3 29.5-41.7 38-65.7l-26.2-24.9c-24-22.8-24-66.2 0-89l26.2-24.9c-8.5-24-21.5-46.4-38-65.7l-34.6 10.2c-31.8 9.4-69.4-12.3-77.2-44.6l-8.5-35.1c-24.6-4.5-51.3-4.5-75.9 0zM208 256a48 48 0 1 0 96 0 48 48 0 1 0 -96 0zm48 96a96 96 0 1 1 0-192 96 96 0 1 1 0 192z"/></svg>',checkSVG:()=>'<svg xmlns="http://www.w3.org/2000/svg" height="86" width="86" viewBox="0 0 448 512">\x3c!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--\x3e<path fill="#2b5e92" d="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>'}},78410:(t,e,n)=>{const o=n(45523),a=n(23779);t.exports=t=>{const e=wp.media.view.MediaFrame.Select.prototype.browseRouter,n=".tcb-unsplash-grid";let s=1;const i="#tcb-unsplash-loader",l="#tcb-unsplash-search-input",c="#tcb-unsplash-clear-search-btn",r="#tcb-unsplash-order-dropdown",d="#tcb-unsplash-ordination-dropdown",p="#tcb-unsplash-category-dropdown";let h=!1;wp.media.view.MediaFrame.Select.prototype.browseRouter=function(n){const a=this;setTimeout(()=>{const e=t('.media-menu-item:contains("Stock Library")');e.length&&e.html(`Stock Library ${o.getStockImageSVG()}`)},100),e.call(this,n),window.originalBrowseRouterFrame=this,n.set({upload:{text:wp.media.view.l10n.uploadFilesTitle,priority:20,click:()=>this.content.mode("upload")},browse:{text:wp.media.view.l10n.mediaLibraryTitle,priority:40,click:()=>this.content.mode("browse")},unsplash:{text:"Stock Library",priority:60,click:()=>{s=1,"unsplash"!==this.content.mode()&&(this.content.mode("unsplash"),this.loadUnsplashContent(),t('[aria-labelledby="menu-item-unsplash"]').css("overflow-y","scroll"))}}}),this.content.mode("browse"),this.on("close",function(){s=1}),t(document).on("click",".media-menu-item",function(){s=1});const i=setInterval(()=>{const e=t(".media-frame-content");e.length>0&&(e.off("scroll",a.checkScrollPosition.bind(this)).on("scroll",a.checkScrollPosition.bind(this)),clearInterval(i))},100)},wp.media.view.MediaFrame.Select.prototype.loadUnsplashContent=function(){if(window.isUnsplashContentLoaded)return;const e=this;this.unsplashContent=new wp.media.View({className:"unsplash-content"}),this.unsplashContent.render(),this.unsplashContent.$el.html(a),this.loadUnsplashImages(s,"",t(r).val(),t(d).val()),e.$el.on("focus",l,function(){t(this).on("input",function(){const n=t(this).val();n&&n.length>0?e.$el.find(c).show():e.$el.find(c).hide()})}),e.$el.on("keypress",l,function(t){l&&"Enter"===t.key&&(t.preventDefault(),e.$el.find("#tcb-unsplash-search-btn").click())}),e.$el.find(r).on("change input",function(){e.$el.find("#tcb-unsplash-search-btn").click(),console.log("Order by changed")}),e.$el.on("click","#tcb-unsplash-search-btn",function(){const t=e.$el.find(l).val();if(!t.trim()&&!e.$el.find(r).val())return;let o=t;const a=e.$el.find(p).val();a&&(o+=` ${a}`,e.$el.find("#tcb-full-search-term").data("full-search-term",o));const i=e.$el.find(r).val(),h=e.$el.find(d).val();s=1,e.unsplashContent.$el.find(n).empty(),e.loadUnsplashImages(s,o,i,h),t&&t.length>0&&e.$el.find(c).show()}),e.$el.on("click",c,function(){e.$el.find(l).val(""),e.$el.find(r).val("relevant"),e.$el.find(d).val(""),e.$el.find(p).val(""),s=1,e.$el.find("#tcb-full-search-term").data("full-search-term",""),e.unsplashContent.$el.find(n).empty(),e.loadUnsplashImages(s,"",e.$el.find(r).val(),e.$el.find(d).val()),e.$el.find(".tcb-unsplash-ordination").addClass("hidden"),e.$el.find(".tcb-unsplash-category").addClass("hidden"),e.$el.find(".tcb-unsplash-total-count").html(`${o.photosIconSvg()} Photos`),e.$el.find(c).hide()}),this.content.set(this.unsplashContent)},wp.media.view.MediaFrame.Select.prototype.loadUnsplashImages=function(e,o="",a="relevant",s=""){const l=this;h||(h=!0,l.$el.find(i).show(),t.ajax({url:unsplashApi.ajax_url,method:"POST",data:{action:"unsplash_list",nonce:unsplashApi.nonce,count:20,page:e,search:o,order_by:a,orientation:s},success:t=>{l.processImagesResponse(t)},error:()=>{t(n).append("<p>Unable to load images from Unsplash.</p>")},complete:()=>{h=!1,l.unsplashContent.$el.find(i).hide(),t(".tcb-unsplash-holder").css({display:"block",opacity:1})}}))},wp.media.view.MediaFrame.Select.prototype.processImagesResponse=function(t){const e=this;if(!t.success)return void e.$el.find(n).append("<p>Unable to load images from Unsplash.</p>");const a=t.data.results.map(t=>{const e=t.height/t.width;return`\n\t\t\t\t<div class="tcb-unsplash-grid-item" data-photo-id="${t.id}" style="grid-row-end: span ${Math.floor(5*e)}; opacity: 0;">\n\t\t\t\t\t${function(t){const{id:e,urls:n,unsplash_link:a,unsplash_author_link:s,user_name:i,user_photo:l,alt_description:c}=t;return`<img src="${n}" class="tcb-unsplash-image" alt="${c}" photo-title="Photo by ${i}" filename="${e}">\n\t\t\t\t<div id="tcb-unsplash-loading-container">\n\t\t\t\t\t\t<div class="loading-background"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="tcb-unsplash-stock-author">\n\t\t\t\t\t<img src="${l}" alt="${i}'s profile picture" class="tcb-author-image">\n\t\t\t\t\t<a href="${s}" target="_blank" rel="noopener noreferrer">${i}</a>\n\t\t\t\t</div>\n\t\t\t\t<div class="tcb-stock-image-buttons">\n\t\t\t\t\t<button class="tcb-unsplash-download-button">${o.downloadButtonSVG()}</button>\n\t\t\t\t\t<button class="tcb-unsplash-gear-button">${o.gearButtonSVG()}</button>\n\t\t\t\t\t<a href="${a}" target="_blank" rel="noopener noreferrer">\n\t\t\t\t\t\t<button class="tcb-unsplash-outbound-link">\n\t\t\t\t\t\t\t${o.unsplashOutboundLinkSVG()}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</a>\n\t\t\t\t</div>`}(t)}\n\t\t\t\t</div>\n\t\t\t`}).join("");e.unsplashContent.$el.find(n).append(a);const i=e.unsplashContent.$el.find(n).children();_.debounce(()=>{i.css("opacity",1)},400)(),t.data.total>0&&e.$el.find(l).val()&&(e.$el.find(".tcb-unsplash-ordination").removeClass("hidden"),e.$el.find(".tcb-unsplash-category").removeClass("hidden"),e.updatePhotoCount(t.data.total)),s++},wp.media.view.MediaFrame.Select.prototype.updatePhotoCount=function(t){const e=this,n=(e.$el.find(l).val().trim(),e.$el.find(p).val(),function(t){if(t>=1e3){const e=(t/1e3).toFixed(1);return e.endsWith(".0")?e.slice(0,-2)+"k":e+"k"}return t}(t));e.$el.find(".tcb-unsplash-total-count").html(`${o.photosIconSvg()} Photos ${n}`)},wp.media.view.MediaFrame.Select.prototype.checkScrollPosition=function(){const t=this,e=t.$el.find(".media-frame-content");if(0===e.length)return;const n=e.scrollTop();if(e.prop("scrollHeight")-n-e.innerHeight()<200&&!h){const e=t.$el.find(l).val(),n=t.$el.find("#tcb-full-search-term").data("full-search-term")||e,o=t.$el.find(r).val(),a=t.$el.find(d).val();t.loadUnsplashImages(s,n,o,a)}},wp.media.events.on("close",function(){s=1})}}},e={};function n(o){var a=e[o];if(void 0!==a)return a.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}const o=n(45523),a=n(78410);window.originalBrowseRouterFrame="",jQuery(document).ready(function(t){a(t),t(document).on("click",'body:not([data-element="image_gallery"]) .tcb-unsplash-download-button',function(){const e=t(this);if(e.data("clicked"))return void console.warn("This button click is already being handled.");e.data("clicked",!0);const n=e.closest(".tcb-unsplash-grid-item"),a=n.data("photo-id"),s=n.find(".tcb-unsplash-image").attr("photo-title")||"No Title",i=t(".tcb-unsplash-stock-author"),l=t(".tcb-stock-image-buttons");i.hide(),l.hide();const c=n.find("#tcb-unsplash-loading-container .loading-background");c.html(o.loaderSVG()).show().css("display","flex"),t.ajax({url:unsplashApi.ajax_url,method:"POST",data:{action:"unsplash_download_image",nonce:unsplashApi.nonce,photo_id:a,title:s},beforeSend(){},success(t){if(t.success){wp.media.frames.unsplashFrame||(wp.media.frames.unsplashFrame=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1})),wp.media.frames.unsplashFrame;const n=t.data.attachment_id;wp.media.attachment(n).fetch().then(function(t){const n=window.originalBrowseRouterFrame.state().get("selection");n.add(new wp.media.model.Attachment(t)),e.closest(".tcb-editor-main").length>0?(window.originalBrowseRouterFrame.state().trigger("insert",n),window.originalBrowseRouterFrame.state().trigger("reset",n),window.originalBrowseRouterFrame.close(),window.originalBrowseRouterFrame.content.mode("browse"),window.originalBrowseRouterFrame.content.get().collection.props.set({ignore:Date.now()})):(window.originalBrowseRouterFrame.content.mode("browse"),window.originalBrowseRouterFrame.content.get().collection.props.set({ignore:Date.now()}))}).catch(function(t){console.error("Failed to fetch attachment details:",t)})}else console.error("Server-side error:",t.data)},error(t,e,n){console.error("AJAX request failed. Status:",e,"Error:",n)},complete(){c.empty().hide(),e.removeData("clicked"),i.show(),l.show()}})}),t(document).on("click",'body:not([data-element="image_gallery"]) .tcb-unsplash-gear-button',function(e){t(".unsplash-gear-popup").remove();const n=t(this),a=n.closest(".tcb-unsplash-grid-item"),s=a.find(".tcb-unsplash-image"),i=n.closest(".tcb-unsplash-grid-item").find("#tcb-unsplash-loading-container .loading-background"),l=s.attr("photo-title")||"No Title Available",c=s.attr("filename")||"No Title Available",r=s.attr("alt")||"No Title Available",d=a.data("photo-id"),p=s.position(),h=s.outerWidth()-18,u=s.outerHeight()-18,m=p.top+(s.outerHeight()-u)/2,w=p.left+(s.outerWidth()-h)/2,f=t(".tcb-unsplash-stock-author"),g=t(".tcb-stock-image-buttons");f.hide(),g.hide();const v=t('<div class="unsplash-gear-popup">').css({width:h+"px",height:u+"px",top:m+"px",left:w+"px"}),b=t('<form class="tcb-stock-library-form">');function x(e,n){const o=t("<label>").text(e);return t('<div class="tcb-stock-library-form-field">').append(o).append(n)}const y=x("Filename",t('<input type="text">').val(c)),C=x("Title",t('<input type="text">').val(l)),k=x("Alt text",t('<input type="text">').val(r)),$=x("Caption",t('<input type="text">')),F=x("Description",t("<textarea>")),S=t('<button type="button" class="upload">').text("Upload"),L=t('<button type="button" class="cancel">').text("Cancel");S.on("click",function(){const e=C.find("input").val(),a=y.find("input").val(),s=k.find("input").val(),l=$.find("input").val(),c=F.find("textarea").val();t(".unsplash-gear-popup").remove(),i.html(o.loaderSVG()).show().css("display","flex"),t.ajax({url:unsplashApi.ajax_url,method:"POST",data:{action:"unsplash_download_image",nonce:unsplashApi.nonce,photo_id:d,title:e,filename:a,alt_text:s,caption:l,description:c},success(t){if(t.success){wp.media.frames.unsplashFrame||(wp.media.frames.unsplashFrame=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1})),wp.media.frames.unsplashFrame;const e=t.data.attachment_id;wp.media.attachment(e).fetch().then(function(t){const e=window.originalBrowseRouterFrame.state().get("selection");e.add(new wp.media.model.Attachment(t)),n.closest(".tcb-editor-main").length>0?(window.originalBrowseRouterFrame.state().trigger("insert",e),window.originalBrowseRouterFrame.state().trigger("reset",e),window.originalBrowseRouterFrame.close(),window.originalBrowseRouterFrame.content.mode("browse"),window.originalBrowseRouterFrame.content.get().collection.props.set({ignore:Date.now()})):(window.originalBrowseRouterFrame.content.mode("browse"),window.originalBrowseRouterFrame.content.get().collection)}).catch(function(t){console.error("Failed to fetch attachment details:",t)})}else console.error("Server-side error:",t.data)},error(t,e,n){console.error("AJAX request failed. Status:",e,"Error:",n)},complete(){i.empty().hide(),f.show(),g.show()}})}),L.on("click",function(){t(".unsplash-gear-popup").remove(),f.show(),g.show()}),b.append(y).append(C).append(k).append($).append(F);const A=t('<div class="button-container">');A.append(L).append(S),b.append(A),v.append(b),a.append(v),e.stopPropagation()}),t(document).on("click",'body[data-element="image_gallery"] .tcb-unsplash-download-button',function(){const e=t(this);if(e.data("clicked"))return void console.warn("This button click is already being handled.");e.data("clicked",!0);const n=e.closest(".tcb-unsplash-grid-item"),a=n.data("photo-id"),s=n.find(".tcb-unsplash-image").attr("photo-title")||"No Title Available",i=n.find("#tcb-unsplash-loading-container .loading-background");i.html(o.loaderSVG()).show().css("display","flex");const l=n.find(".tcb-unsplash-stock-author"),c=n.find(".tcb-stock-image-buttons");t.ajax({url:unsplashApi.ajax_url,method:"POST",data:{action:"unsplash_download_image",nonce:unsplashApi.nonce,photo_id:a,title:s},beforeSend(){},success(t){if(t.success){const e=t.data.attachment_id;wp.media.frames.unsplashFrame||(wp.media.frames.unsplashFrame=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!0})),wp.media.frames.unsplashFrame,wp.media.attachment(e).fetch().then(function(t){window.originalBrowseRouterFrame.state().get("selection").add(new wp.media.model.Attachment(t)),this.controller&&this.controller.setState("gallery-edit")}).catch(function(t){console.error("Failed to fetch attachment details:",t)})}else console.error("Server-side error:",t.data)},error(t,e,n){console.error("AJAX request failed. Status:",e,"Error:",n)},complete(){i.empty().hide(),e.removeData("clicked"),i.html(o.checkSVG()).show(),l.hide(),c.hide()}})}),t(document).on("click",'body[data-element="image_gallery"] .tcb-unsplash-gear-button',function(e){t(".unsplash-gear-popup").remove();const n=t(this),a=n.closest(".tcb-unsplash-grid-item"),s=a.find(".tcb-unsplash-image"),i=n.closest(".tcb-unsplash-grid-item"),l=i.find("#tcb-unsplash-loading-container .loading-background"),c=i.find(".tcb-unsplash-stock-author"),r=i.find(".tcb-stock-image-buttons"),d=s.attr("photo-title")||"No Title Available",p=s.attr("filename")||"No Title Available",h=s.attr("alt")||"No Title Available",u=a.data("photo-id"),m=s.position(),w=s.outerWidth()-18,f=s.outerHeight()-18,g=m.top+(s.outerHeight()-f)/2,v=m.left+(s.outerWidth()-w)/2,b=t('<div class="unsplash-gear-popup">').css({width:w+"px",height:f+"px",top:g+"px",left:v+"px"}),x=t('<form class="tcb-stock-library-form">');function y(e,n){const o=t("<label>").text(e);return t('<div class="tcb-stock-library-form-field">').append(o).append(n)}const C=y("Filename",t('<input type="text">').val(p)),k=y("Title",t('<input type="text">').val(d)),$=y("Alt text",t('<input type="text">').val(h)),F=y("Caption",t('<input type="text">')),S=y("Description",t("<textarea>")),L=t('<button type="button" class="upload">').text("Upload"),A=t('<button type="button" class="cancel">').text("Cancel");L.on("click",function(){const e=k.find("input").val(),n=C.find("input").val(),a=$.find("input").val(),s=F.find("input").val(),i=S.find("textarea").val();t(".unsplash-gear-popup").remove(),l.html(o.loaderSVG()).show().css("display","flex"),t.ajax({url:unsplashApi.ajax_url,method:"POST",data:{action:"unsplash_download_image",nonce:unsplashApi.nonce,photo_id:u,title:e,filename:n,alt_text:a,caption:s,description:i},success(t){if(t.success){wp.media.frames.unsplashFrame||(wp.media.frames.unsplashFrame=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1})),wp.media.frames.unsplashFrame;const e=t.data.attachment_id;wp.media.attachment(e).fetch().then(function(t){window.originalBrowseRouterFrame.state().get("selection").add(new wp.media.model.Attachment(t)),this.controller&&this.controller.setState("gallery-edit")}).catch(function(t){console.error("Failed to fetch attachment details:",t)})}else console.error("Server-side error:",t.data)},error(t,e,n){console.error("AJAX request failed. Status:",e,"Error:",n)},complete(){l.empty().hide(),l.html(o.checkSVG()).show(),c.hide(),r.hide()}})}),A.on("click",function(){t(".unsplash-gear-popup").remove()}),x.append(C).append(k).append($).append(F).append(S);const B=t('<div class="button-container">');B.append(A).append(L),x.append(B),b.append(x),a.append(b),e.stopPropagation()})})})();