Changeset 2833326
- Timestamp:
- 12/13/2022 11:10:11 PM (2 years ago)
- Location:
- imajinn-ai
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
imajinn-ai/tags/1.5/build/block.asset.php
r2796851 r2833326 1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 16c8312a94c47e1d8fa7');1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'dd32228479f2ada5e837'); -
imajinn-ai/tags/1.5/build/block.css
r2796851 r2833326 1 1 .wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-base-control__field{margin-bottom:7px}.wp-block-infinite-uploads-imajinn-ai .prompt-genie label{line-height:1.2}.wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-button.has-icon{height:30px;margin-bottom:0!important;min-width:90px;padding:0 8px 0 0}.wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-button.has-icon svg{height:18px;margin-right:0}button.genie-generate{margin-left:10px} 2 2 .wp-block-infinite-uploads-imajinn-ai .connect-wrapper{align-content:space-between;align-items:end;margin-top:10px}.wp-block-infinite-uploads-imajinn-ai .connect-wrapper .components-base-control__help{font-size:80%}.wp-block-infinite-uploads-imajinn-ai .components-placeholder__fieldset .components-button.connect-button{margin-bottom:8px} 3 .imajinn-preview-modal{height:80%}.imajinn-preview-modal .components-modal__content.hide-header{overflow:hidden;padding:0}.imajinn-preview-modal img{height:100% }3 .imajinn-preview-modal{height:80%}.imajinn-preview-modal .components-modal__content.hide-header{overflow:hidden;padding:0}.imajinn-preview-modal img{height:100%!important;-o-object-fit:contain!important;object-fit:contain!important;width:100%!important} 4 4 .imajinn-history .components-panel__body-title{height:50px}.imajinn-history .components-panel__body-title .components-button{float:right;margin-right:10px;margin-top:7px}.imajinn-history .components-panel__body-title img{float:left;height:50px;width:50px}.imajinn-history .components-panel__row{clear:both} 5 5 .imajinn-upgrade-modal-buttons{text-align:right}.imajinn-upgrade-modal-buttons a,.imajinn-upgrade-modal-buttons button{float:right;margin-left:10px} -
imajinn-ai/tags/1.5/build/block.js
r2796851 r2833326 1 !function(){"use strict";var e={352:function(e,t,n){n.d(t,{DT:function(){return a},ZZ:function(){return o},mC:function(){return r}});var i=n(307);function a(e){const t=e.iconSize||30;return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68.99 99",height:t,width:t},(0,i.createElement)("path",{d:"M65.19,60.78c3.9-3.9,6.19-17.59-.2-23.67-4.3-2.8-10.87,1.08-18.09,.8-.51-.02-1.02,.07-1.49,.26-.67,.28-1.44,.72-2.26,1.42-2.56,2.19-5.99,3.51-8.31,2.21-1.84-1.23-1.39-3.92-1.31-4.32-3.97,.8-4.55-.88-8.17,.24-6.84,2.12-18.72,17.38-9.96,22.27,3.89,1.73,11.79,.79,11.79,.79,0,0,6.33,8.55,.95,12.41-5.03,3.61-9.48-.45-15.51-.97-12.95-1.21-19.27,16.96-2.54,26.78-3.64-6.18-4.42-14.42,3.76-14.42,5.68,0,13.27,8.43,24.48,7.03,9.69-1.21,13.03-5.15,17.38-16.07,2.01-4.71,6.92-10.71,6.92-10.71-6.91,2.54-10.67-.61-14.5-1.96-3.83-1.34-8.87-2.09-8.87-2.09,6.29,0,11.48,2.43,15.72,3.05,4.07,.6,7.6-.43,10.22-3.05Z"}),(0,i.createElement)("path",{d:"M54.55,13.82c-2.78-2.37-5.77-6.73-8.76-7.16-4.03-.58-5.66,1.64-6.51,4.46,0-.19-.01-.38-.03-.57L38.55,.04c0-.05-.08-.05-.08,0l-.88,10.25c-.1,1.36,.04,2.72,.4,4.03l.58,1.15c-.02,.39-.01,.62-.01,.62-1.14,1.24-1.97,3.51-2.59,5.14l.53,1.44s.1,2.24-1.84,4.55c0,0-1.2,1.43-1.34,1.77-.17,.4-.16,.96,.47,1.01,.64,.05,2.02,.23,2.02,.23l-.03,2.06c0,.58,.27,2.39,.42,2.86,.58,1.79,.37,3.29-.15,3.43-1.56,.45-1.92-1.14-1.92-1.14,0,0-1.22,4.58,3.55,3.85,3.06-.47,4.72-4.09,7.57-5.19h0c.18-.07,.36-.1,.55-.11,4.53-.1,7.41-.84,7.93-3.92,4.84-.42,6.65-2.72,7.81-7.44,1.21-4.91-2.73-7.17-7.01-10.81Z"}))}function r(){return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55.435381255341",height:"60",viewBox:"0 0 1167.58 1263.72",version:"1.1"},(0,i.createElement)("defs",null,(0,i.createElement)("clipPath",{id:"clip1"},(0,i.createElement)("path",{d:"M 525 1006 L 595 1006 L 595 1263.71875 L 525 1263.71875 Z M 525 1006 "})),(0,i.createElement)("clipPath",{id:"clip2"},(0,i.createElement)("path",{d:"M 1018 1006 L 1167.578125 1006 L 1167.578125 1212 L 1018 1212 Z M 1018 1006 "}))),(0,i.createElement)("g",{id:"surface1"},(0,i.createElement)("path",{d:"M 883.503906 564.917969 C 919.703125 528.71875 941.007813 401.410156 881.6875 344.964844 C 841.726563 318.957031 780.652344 354.957031 713.5625 352.410156 C 708.824219 352.230469 704.105469 353.039063 699.722656 354.847656 C 693.507813 357.414063 686.355469 361.507813 678.730469 368.042969 C 654.972656 388.40625 623.070313 400.625 601.488281 388.585938 C 584.429688 377.132813 588.597656 352.140625 589.332031 348.394531 C 552.476563 355.824219 547.042969 340.191406 513.355469 350.644531 C 449.75 370.382813 339.335938 512.171875 420.820313 557.613281 C 456.992188 573.714844 530.402344 564.917969 530.402344 564.917969 C 530.402344 564.917969 589.253906 644.367188 539.238281 680.246094 C 492.445313 713.808594 451.089844 676.105469 395.078125 671.234375 C 274.757813 660.003906 216.007813 828.910156 371.429688 920.136719 C 337.640625 862.695313 330.320313 786.113281 406.339844 786.113281 C 459.125 786.113281 529.695313 864.453125 633.84375 851.433594 C 723.941406 840.171875 754.910156 803.570313 795.363281 702.039063 C 814.039063 658.285156 859.652344 602.535156 859.652344 602.535156 C 795.457031 626.1875 760.519531 596.839844 724.90625 584.359375 C 689.289063 571.878906 642.421875 564.917969 642.421875 564.917969 C 700.839844 564.917969 749.109375 587.472656 788.523438 593.257813 C 826.324219 598.800781 859.152344 589.269531 883.503906 564.917969 "}),(0,i.createElement)("path",{d:"M 784.621094 128.429688 C 758.757813 106.421875 730.980469 65.921875 703.167969 61.910156 C 665.6875 56.5 650.527344 77.128906 642.636719 103.398438 C 642.59375 101.628906 642.523438 99.859375 642.386719 98.089844 L 635.902344 0.351563 C 635.871094 -0.121094 635.1875 -0.121094 635.15625 0.351563 L 626.976563 95.570313 C 626.089844 108.179688 627.359375 120.851563 630.730469 133.03125 L 636.097656 143.699219 C 635.9375 147.328125 635.964844 149.46875 635.964844 149.46875 C 625.332031 161.011719 617.640625 182.050781 611.933594 197.261719 L 616.851563 210.640625 C 616.851563 210.640625 617.800781 231.441406 599.78125 252.960938 C 599.78125 252.960938 588.667969 266.253906 587.359375 269.429688 C 585.824219 273.152344 585.828125 278.3125 591.742188 278.785156 C 597.652344 279.257813 610.558594 280.914063 610.558594 280.914063 L 610.324219 300.066406 C 610.324219 305.457031 612.859375 322.316406 614.246094 326.636719 C 619.597656 343.292969 617.640625 357.179688 612.886719 358.539063 C 598.386719 362.683594 595.0625 347.902344 595.0625 347.902344 C 595.0625 347.902344 583.699219 390.441406 628.046875 383.652344 C 656.480469 379.300781 671.941406 345.640625 698.414063 335.460938 C 700.050781 334.828125 701.785156 334.496094 703.539063 334.457031 C 745.660156 333.558594 772.402344 326.636719 777.207031 298.027344 C 822.210938 294.09375 838.976563 272.722656 849.785156 228.890625 C 861.050781 183.21875 824.402344 162.28125 784.621094 128.429688 "}),(0,i.createElement)("path",{d:"M 0 1211.832031 L 0 1006.238281 L 14.34375 1006.238281 L 14.34375 1211.832031 L 0 1211.832031 "}),(0,i.createElement)("path",{d:"M 191.785156 1211.832031 L 115.144531 1021.988281 L 114.019531 1021.988281 C 114.769531 1033.609375 115.144531 1045.519531 115.144531 1057.710938 L 115.144531 1211.832031 L 101.363281 1211.832031 L 101.363281 1006.238281 L 123.582031 1006.238281 L 196.425781 1187.082031 L 197.269531 1187.082031 L 270.113281 1006.238281 L 291.769531 1006.238281 L 291.769531 1211.832031 L 277.285156 1211.832031 L 277.285156 1056.019531 C 277.285156 1045.140625 277.847656 1033.890625 278.972656 1022.269531 L 277.847656 1022.269531 L 200.925781 1211.832031 L 191.785156 1211.832031 "}),(0,i.createElement)("path",{d:"M 399.320313 1126.328125 L 472.867188 1126.328125 L 444.882813 1052.21875 C 442.535156 1046.410156 439.722656 1038.351563 436.445313 1028.03125 C 433.914063 1037.03125 431.144531 1045.191406 428.148438 1052.5 Z M 477.648438 1139.269531 L 394.117188 1139.269531 L 365.429688 1211.832031 L 349.539063 1211.832031 L 432.226563 1005.390625 L 441.367188 1005.390625 L 522.367188 1211.832031 L 506.195313 1211.832031 L 477.648438 1139.269531 "}),(0,i.createElement)("g",{clipPath:"url(#clip1)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 546.523438 1263.71875 C 537.902344 1263.71875 530.824219 1262.460938 525.289063 1259.921875 L 525.289063 1247.550781 C 532.601563 1249.421875 539.589844 1250.359375 546.242188 1250.359375 C 568.929688 1250.359375 580.273438 1237.988281 580.273438 1213.238281 L 580.273438 1006.238281 L 594.617188 1006.238281 L 594.617188 1211.832031 C 594.617188 1246.421875 578.585938 1263.71875 546.523438 1263.71875 "})),(0,i.createElement)("path",{d:"M 680.230469 1211.832031 L 680.230469 1006.238281 L 694.574219 1006.238281 L 694.574219 1211.832031 L 680.230469 1211.832031 "}),(0,i.createElement)("path",{d:"M 931.078125 1211.832031 L 916.59375 1211.832031 L 794.8125 1029.300781 L 793.6875 1029.300781 C 794.8125 1051.050781 795.375 1067.460938 795.375 1078.519531 L 795.375 1211.832031 L 781.59375 1211.832031 L 781.59375 1006.238281 L 795.9375 1006.238281 L 917.578125 1188.488281 L 918.421875 1188.488281 C 917.578125 1171.609375 917.15625 1155.578125 917.15625 1140.390625 L 917.15625 1006.238281 L 931.078125 1006.238281 L 931.078125 1211.832031 "}),(0,i.createElement)("g",{clipPath:"url(#clip2)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 1167.578125 1211.832031 L 1153.101563 1211.832031 L 1031.320313 1029.300781 L 1030.191406 1029.300781 C 1031.320313 1051.050781 1031.878906 1067.460938 1031.878906 1078.519531 L 1031.878906 1211.832031 L 1018.101563 1211.832031 L 1018.101563 1006.238281 L 1032.441406 1006.238281 L 1154.078125 1188.488281 L 1154.929688 1188.488281 C 1154.078125 1171.609375 1153.660156 1155.578125 1153.660156 1140.390625 L 1153.660156 1006.238281 L 1167.578125 1006.238281 L 1167.578125 1211.832031 "}))))}function o(){return(0,i.useEffect)((()=>{var t,i;t=this,i=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var a=Math.abs;function r(e){return e}function o(e,t,n){var i=1-n;return 3*n*i*(e*i+t*n)+n*n*n}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return e<0||e>1||n<0||n>1?null:a(e-t)<=1e-5&&a(n-i)<=1e-5?r:function(r){if(r<=0)return e>0?r*t/e:0===t&&n>0?r*i/n:0;if(r>=1)return n<1?1+(r-1)*(i-1)/(n-1):1===n&&e<1?1+(r-1)*(t-1)/(e-1):1;for(var s,l=0,c=1;l<c;){var u=o(e,n,s=(l+c)/2);if(a(r-u)<1e-5)break;u<r?l=s:c=s}return o(t,i,s)}}function l(){return 1}function c(e){return 1===e?1:0}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(1===e){if(0===t)return c;if(1===t)return l}var n=1/e;return function(e){return e>=1?1:(e+=t*n)-e%n}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(Number.isInteger(e))return e;var n=Math.pow(10,t);return Math.round(e*n)/n}var d=Math.PI/180;function m(e,t,n){return e>=.5?n:t}function p(e,t,n){return 0===e||t===n?t:e*(n-t)+t}function f(e,t,n){var i=p(e,t,n);return i<=0?0:i}function g(e,t,n){return 0===e?t:1===e?n:{x:p(e,t.x,n.x),y:p(e,t.y,n.y)}}function y(e,t,n){return 0===e?t:1===e?n:{x:f(e,t.x,n.x),y:f(e,t.y,n.y)}}function v(e,t,n){var i=function(e,t,n){return Math.round(p(e,t,n))}(e,t,n);return i<=0?0:i>=255?255:i}function w(e,t,n){return 0===e?t:1===e?n:{r:v(e,t.r,n.r),g:v(e,t.g,n.g),b:v(e,t.b,n.b),a:p(e,null==t.a?1:t.a,null==n.a?1:n.a)}}function b(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=[],r=0;r<i;r++)a.push(w(e,t[r],n[r]));return a}function _(e,t,n){var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=new Array(i),r=0;r<i;r++)a[r]=p(e,t[r],n[r]);return a}function E(e,t){for(var n=[],i=0;i<e;i++)n.push(t);return n}function x(e,t){if(--t<=0)return e;var n=(e=Object.assign([],e)).length;do{for(var i=0;i<n;i++)e.push(e[i])}while(--t>0);return e}var j=/\.0+$/g;function M(e){return Number.isInteger(e)?e+"":e.toFixed(6).replace(j,"")}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e&&e.length?e.map(M).join(t):""}function k(e){return M(e.x)+","+M(e.y)}function C(e){return e?null==e.a||e.a>=1?"rgb("+e.r+","+e.g+","+e.b+")":"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"transparent"}var I={f:null,i:y,u:function(e,t){return function(n){var i=t(n);e.setAttribute("rx",M(i.x)),e.setAttribute("ry",M(i.y))}}},D={f:null,i:function(e,t,n){return 0===e?t:1===e?n:{width:f(e,t.width,n.width),height:f(e,t.height,n.height)}},u:function(e,t){return function(n){var i=t(n);e.setAttribute("width",M(i.width)),e.setAttribute("height",M(i.height))}}},A=Math.sin,T=Math.cos,L=Math.acos,P=Math.asin,N=Math.tan,O=Math.atan2,R=Math.PI/180,z=180/Math.PI,B=Math.sqrt,W=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;t(this,e),this.m=[n,i,a,r,o,s],this.i=null,this.w=null,this.s=null}return i(e,[{key:"point",value:function(e,t){var n=this.m;return{x:n[0]*e+n[2]*t+n[4],y:n[1]*e+n[3]*t+n[5]}}},{key:"translateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e&&!t)return this;var n=this.m;return n[4]+=n[0]*e+n[2]*t,n[5]+=n[1]*e+n[3]*t,this.w=this.s=this.i=null,this}},{key:"rotateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e%=360){var t=A(e*=R),n=T(e),i=this.m,a=i[0],r=i[1];i[0]=a*n+i[2]*t,i[1]=r*n+i[3]*t,i[2]=i[2]*n-a*t,i[3]=i[3]*n-r*t,this.w=this.s=this.i=null}return this}},{key:"scaleSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==e||1!==t){var n=this.m;n[0]*=e,n[1]*=e,n[2]*=t,n[3]*=t,this.w=this.s=this.i=null}return this}},{key:"skewSelf",value:function(e,t){if(t%=360,(e%=360)||t){var n=this.m,i=n[0],a=n[1],r=n[2],o=n[3];e&&(e=N(e*R),n[2]+=i*e,n[3]+=a*e),t&&(t=N(t*R),n[0]+=r*t,n[1]+=o*t),this.w=this.s=this.i=null}return this}},{key:"resetSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.m;return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o[4]=a,o[5]=r,this.w=this.s=this.i=null,this}},{key:"recomposeSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return this.isIdentity||this.resetSelf(),e&&(e.x||e.y)&&this.translateSelf(e.x,e.y),t&&this.rotateSelf(t),n&&(n.x&&this.skewSelf(n.x,0),n.y&&this.skewSelf(0,n.y)),!i||1===i.x&&1===i.y||this.scaleSelf(i.x,i.y),a&&(a.x||a.y)&&this.translateSelf(a.x,a.y),this}},{key:"decompose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.m,i=n[0]*n[0]+n[1]*n[1],a=[[n[0],n[1]],[n[2],n[3]]],r=B(i);if(0===r)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:0,y:0},skew:{x:0,y:0},rotate:0};a[0][0]/=r,a[0][1]/=r;var o=n[0]*n[3]-n[1]*n[2]<0;o&&(r=-r);var s=a[0][0]*a[1][0]+a[0][1]*a[1][1];a[1][0]-=a[0][0]*s,a[1][1]-=a[0][1]*s;var l=B(a[1][0]*a[1][0]+a[1][1]*a[1][1]);if(0===l)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:0},skew:{x:0,y:0},rotate:0};a[1][0]/=l,a[1][1]/=l,s/=l;var c=0;return a[1][1]<0?(c=L(a[1][1])*z,a[0][1]<0&&(c=360-c)):c=P(a[0][1])*z,o&&(c=-c),s=O(s,B(a[0][0]*a[0][0]+a[0][1]*a[0][1]))*z,{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:l},skew:{x:s,y:0},rotate:c}}},{key:"toString",value:function(){return null===this.s&&(this.s="matrix("+this.m.map(F).join(" ")+")"),this.s}},{key:"determinant",get:function(){var e=this.m;return e[0]*e[3]-e[1]*e[2]}},{key:"isIdentity",get:function(){if(null===this.i){var e=this.m;this.i=1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}return this.i}}]),e}(),Y=/\.0+$/;function F(e){return Number.isInteger(e)?e:e.toFixed(14).replace(Y,"")}function V(e,t,n){return e+(t-e)*n}function G(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a={x:V(e.x,t.x,n),y:V(e.y,t.y,n)};return i&&(a.a=H(e,t)),a}function H(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function U(e,t,n,i){var a=1-i;return a*a*e+2*a*i*t+i*i*n}function J(e,t,n,i){return 2*(1-i)*(t-e)+2*i*(n-t)}function q(e,t,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={x:U(e.x,t.x,n.x,i),y:U(e.y,t.y,n.y,i)};return a&&(r.a=Z(e,t,n,i)),r}function Z(e,t,n,i){return Math.atan2(J(e.y,t.y,n.y,i),J(e.x,t.x,n.x,i))}function X(e,t,n,i,a){var r=a*a;return a*r*(i-e+3*(t-n))+3*r*(e+n-2*t)+3*a*(t-e)+e}function Q(e,t,n,i,a){var r=1-a;return 3*(r*r*(t-e)+2*r*a*(n-t)+a*a*(i-n))}function $(e,t,n,i,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o={x:X(e.x,t.x,n.x,i.x,a),y:X(e.y,t.y,n.y,i.y,a)};return r&&(o.a=K(e,t,n,i,a)),o}function K(e,t,n,i,a){return Math.atan2(Q(e.y,t.y,n.y,i.y,a),Q(e.x,t.x,n.x,i.x,a))}function ee(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(ne(t)){if(ie(n))return q(t,n.start,n,e,i)}else if(ne(n)){if(t.end)return q(t,t.end,n,e,i)}else{if(t.end)return n.start?$(t,t.end,n.start,n,e,i):q(t,t.end,n,e,i);if(n.start)return q(t,n.start,n,e,i)}return G(t,n,e,i)}function te(e,t,n){var i=ee(e,t,n,!0);return i.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?e+Math.PI:e}(i.a)/d,i}function ne(e){return!e.type||"corner"===e.type}function ie(e){return null!=e.start&&!ne(e)}Object.freeze({M:2,L:2,Z:0,H:1,V:1,C:6,Q:4,T:2,S:4,A:7});var ae=new W,re={f:function(e){return e?e.join(" "):""},i:function(t,n,i){if(0===t)return n;if(1===t)return i;var a=n.length;if(a!==i.length)return m(t,n,i);for(var r,o=new Array(a),s=0;s<a;s++){if((r=e(n[s]))!==e(i[s]))return m(t,n,i);if("number"===r)o[s]=p(t,n[s],i[s]);else{if(n[s]!==i[s])return m(t,n,i);o[s]=n[s]}}return o}},oe={f:null,i:_,u:function(e,t){return function(n){var i=t(n);e.setAttribute("x1",M(i[0])),e.setAttribute("y1",M(i[1])),e.setAttribute("x2",M(i[2])),e.setAttribute("y2",M(i[3]))}}},se={f:M,i:p},le={f:M,i:function(e,t,n){var i=p(e,t,n);return i<=0?0:i>=1?1:i}},ce={f:S,i:function(e,t,n){var i,a,r,o=t.length,s=n.length;if(o!==s)if(0===o)t=E(o=s,0);else if(0===s)s=o,n=E(o,0);else{var l=(r=(i=o)*(a=s)/function(e,t){for(var n;t;)n=t,t=e%t,e=n;return e||1}(i,a))<0?-r:r;t=x(t,Math.floor(l/o)),n=x(n,Math.floor(l/s)),o=s=l}for(var c=[],u=0;u<o;u++)c.push(h(f(e,t[u],n[u]),6));return c}};function ue(e,t,n,i,a,r,o,s){return t=function(e,t,n){for(var i,a,r,o=e.length-1,s={},l=0;l<=o;l++)(i=e[l]).e&&(i.e=t(i.e)),i.v&&"g"===(a=i.v).t&&a.r&&(r=n.getElementById(a.r))&&(s[a.r]=r.querySelectorAll("stop"));return s}(e,i,s),function(i){var a,r=n(i,e,he);return r?"c"===r.t?C(r.v):"g"===r.t?(t[r.r]&&function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].setAttribute("stop-color",C(t[n]))}(t[r.r],r.v),(a=r.r)?"url(#"+a+")":"none"):"none":"none"}}function he(e,t,n){if(0===e)return t;if(1===e)return n;if(t&&n){var i=t.t;if(i===n.t)switch(t.t){case"c":return{t:i,v:w(e,t.v,n.v)};case"g":if(t.r===n.r)return{t:i,v:b(e,t.v,n.v),r:t.r}}}return m(e,t,n)}var de={blur:y,brightness:f,contrast:f,"drop-shadow":function(e,t,n){return 0===e?t:1===e?n:{blur:y(e,t.blur,n.blur),offset:g(e,t.offset,n.offset),color:w(e,t.color,n.color)}},grayscale:f,"hue-rotate":p,invert:f,opacity:f,saturate:f,sepia:f};function me(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a,r=[],o=0;o<i;o++){if(t[o].type!==n[o].type)return t;if(!(a=de[t[o].type]))return m(e,t,n);r.push({type:t.type,value:a(e,t[o].value,n[o].value)})}return r}var pe={blur:function(e){return e?function(t){e.setAttribute("stdDeviation",k(t))}:null},brightness:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t),e.map((function(e){return e.setAttribute("slope",t)}))}:null},contrast:function(e,t,n){return(e=ge(n,t))?function(t){var n=M((1-t)/2);t=M(t),e.map((function(e){e.setAttribute("slope",t),e.setAttribute("intercept",n)}))}:null},"drop-shadow":function(e,t,n){var i=n.getElementById(t+"-blur");if(!i)return null;var a=n.getElementById(t+"-offset");if(!a)return null;var r=n.getElementById(t+"-flood");return r?function(e){i.setAttribute("stdDeviation",k(e.blur)),a.setAttribute("dx",M(e.offset.x)),a.setAttribute("dy",M(e.offset.y)),r.setAttribute("flood-color",C(e.color))}:null},grayscale:function(e){return e?function(t){e.setAttribute("values",S(function(e){return[.2126+.7874*(e=1-e),.7152-.7152*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152+.2848*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152-.7152*e,.0722+.9278*e,0,0,0,0,0,1,0]}(t)))}:null},"hue-rotate":function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},invert:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t)+" "+M(1-t),e.map((function(e){return e.setAttribute("tableValues",t)}))}:null},opacity:function(e,t,n){return(e=n.getElementById(t+"-A"))?function(t){return e.setAttribute("tableValues","0 "+M(t))}:null},saturate:function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},sepia:function(e){return e?function(t){return e.setAttribute("values",S(function(e){return[.393+.607*(e=1-e),.769-.769*e,.189-.189*e,0,0,.349-.349*e,.686+.314*e,.168-.168*e,0,0,.272-.272*e,.534-.534*e,.131+.869*e,0,0,0,0,0,1,0]}(t)))}:null}},fe=["R","G","B"];function ge(e,t){var n=fe.map((function(n){return e.getElementById(t+"-"+n)||null}));return-1!==n.indexOf(null)?null:n}var ye={fill:ue,"fill-opacity":le,stroke:ue,"stroke-opacity":le,strokeWidth:se,strokeDashoffset:{f:M,i:p},strokeDasharray:ce,opacity:le,transform:function(t,n,i,a){if(!(t=function(t,n){if(!t||"object"!==e(t))return null;var i=!1;for(var a in t)t.hasOwnProperty(a)&&(t[a]&&t[a].length?(t[a].forEach((function(e){e.e&&(e.e=n(e.e))})),i=!0):delete t[a]);return i?t:null}(t,a)))return null;var r=function(e,a,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t[e]?i(a,t[e],r):n&&n[e]?n[e]:o};return n&&n.a&&t.o?function(e){var n=i(e,t.o,te);return ae.recomposeSelf(n,r("r",e,p,0)+n.a,r("k",e,g),r("s",e,g),r("t",e,g)).toString()}:function(e){return ae.recomposeSelf(r("o",e,ee,null),r("r",e,p,0),r("k",e,g),r("s",e,g),r("t",e,g)).toString()}},"#filter":function(e,t,n,i,a,r,o,s){if(!t.items||!e||!e.length)return null;var l=function(e,t){var n=(e=e.map((function(e){return e&&pe[e[0]]?(t.getElementById(e[1]),pe[e[0]](t.getElementById(e[1]),e[1],t)):null}))).length;return function(t){for(var i=0;i<n;i++)e[i]&&e[i](t[i].value)}}(t.items,s);return l?(e=function(e,t){return e.map((function(e){return e.e=t(e.e),e}))}(e,i),function(t){l(n(t,e,me))}):null},"#line":oe,points:{f:S,i:_},d:re,r:se,"#size":D,"#radius":I,_:function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)this[e[n]]=t;else this[e]=t}},ve=function(){function e(n){t(this,e),this.list=n,this.length=n.length}return i(e,[{key:"setAttribute",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].setAttribute(e,t)}},{key:"removeAttribute",value:function(e){for(var t=this.list,n=0;n<this.length;n++)t[n].removeAttribute(e)}},{key:"style",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].style[e]=t}}]),e}(),we=/-./g,be=function(e,t){return t.toUpperCase()};function _e(e){return"function"==typeof e?e:m}function Ee(e){return e?"function"==typeof e?e:Array.isArray(e)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;if(!Array.isArray(e))return t;switch(e.length){case 1:return u(e[0])||t;case 2:return u(e[0],e[1])||t;case 4:return s(e[0],e[1],e[2],e[3])||t}return t}(e,null):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;switch(e){case"linear":return r;case"steps":return u(t.steps||1,t.jump||0)||n;case"bezier":case"cubic-bezier":return s(t.x1||0,t.y1||0,t.x2||0,t.y2||0)||n}return n}(e.type,e.value,null):null}function xe(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length-1;if(e<=t[0].t)return i?[0,0,t[0].v]:t[0].v;if(e>=t[a].t)return i?[a,1,t[a].v]:t[a].v;var r,o=t[0],s=null;for(r=1;r<=a;r++){if(!(e>t[r].t)){s=t[r];break}o=t[r]}return null==s?i?[a,1,t[a].v]:t[a].v:o.t===s.t?i?[r,1,s.v]:s.v:(e=(e-o.t)/(s.t-o.t),o.e&&(e=o.e(e)),i?[r,e,n(e,o.v,s.v)]:n(e,o.v,s.v))}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e&&e.length?"function"!=typeof t?null:("function"!=typeof n&&(n=null),function(i){var a=xe(i,e,t);return null!=a&&n&&(a=n(a)),a}):null}function Me(e,t){return e.t-t.t}function Se(t,n,i,a){if(!a||"object"!==e(a))return null;var r=null,o=null;return Array.isArray(a)?o=function(e){if(!e||!e.length)return null;for(var t=0;t<e.length;t++)e[t].e&&(e[t].e=Ee(e[t].e));return e.sort(Me)}(a):(o=a.keys,r=a.data||null),o?function(t,n,i,a,r){var o,s="@"===i[0],l="#"===i[0],c=ye[i],u=m;switch(s?(o=i.substr(1),i=o.replace(we,be)):l&&(i=i.substr(1)),e(c)){case"function":if(u=c(a,r,xe,Ee,i,s,n,t),l)return u;break;case"string":u=je(a,_e(c));break;case"object":if((u=je(a,_e(c.i),c.f))&&"function"==typeof c.u)return c.u(n,u,i,s,t)}return u?function(e,t,n){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3])return e instanceof ve?function(i){return e.style(t,n(i))}:function(i){return e.style[t]=n(i)};if(Array.isArray(t)){var i=t.length;return function(a){var r=n(a);if(null==r)for(var o=0;o<i;o++)e[o].removeAttribute(t);else for(var s=0;s<i;s++)e[s].setAttribute(t,r)}}return function(i){var a=n(i);null==a?e.removeAttribute(t):e.setAttribute(t,a)}}(n,i,u,s):null}(t,n,i,o,r):null}function ke(e,t,n){if(!n)return null;var i=[];for(var a in n)if(n.hasOwnProperty(a)){var r=Se(e,t,a,n[a]);r&&i.push(r)}return i.length?i:null}var Ce=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(this,e),this._id=0,this._running=!1,this._animations=n,this.direction=i.direction||1,this.speed=i.speed||1,this.fps=i.fps||100,this.offset=i.offset||0}return i(e,[{key:"_start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=-1/0,i=null,a={},r=function r(o){e._running=!0,null==i&&(i=o);var s=Math.round((o-i+t)*e.speed),l=e.fps?1e3/e.fps:0;if(s>n+l){e.offset=s,n=s;for(var c=e._animations,u=c.length,h=0,d=0;d<u;d++)a[d]?h++:(a[d]=c[d](s,e.direction),a[d]&&h++);if(h===u)return void e._stop()}e._id=window.requestAnimationFrame(r)};this._id=window.requestAnimationFrame(r)}},{key:"_stop",value:function(){this._id&&window.cancelAnimationFrame(this._id),this._running=!1}},{key:"play",value:function(){this._running||this._start(this.offset)}},{key:"stop",value:function(){this._stop(),this.offset=0;var e=this.direction,t=this._animations;requestAnimationFrame((function(){for(var n=0;n<t.length;n++)t[n](0,e)}))}},{key:"restart",value:function(){this._stop(),this.offset=0,this._start()}},{key:"pause",value:function(){this._stop()}},{key:"reverse",value:function(){this.direction=-this.direction}}],[{key:"build",value:function(t){if(!(t=function(e){if(!e||!e.root||!Array.isArray(e.animations))return null;var t=window.document.getElementById(e.root);if(!t)return null;var n=e.animations.map((function(e){return function(e,t){if(!t.duration||t.duration<0)return null;var n=function(e,t){if(!t)return null;var n=[];if(Array.isArray(t))for(var i=t.length,a=0;a<i;a++){var r=t[a];if(2===r.length){var o=null;if("string"==typeof r[0])o=e.getElementById(r[0]);else if(Array.isArray(r[0])){o=[];for(var s=0;s<r[0].length;s++)if("string"==typeof r[0][s]){var l=e.getElementById(r[0][s]);l&&o.push(l)}o=o.length?1===o.length?o[0]:new ve(o):null}if(o){var c=ke(e,o,r[1]);c&&(n=n.concat(c))}}}else for(var u in t)if(t.hasOwnProperty(u)){var h=e.getElementById(u);if(h){var d=ke(e,h,t[u]);d&&(n=n.concat(d))}}return n.length?n:null}(e,t.elements);return n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=e.length,s=i>0?t:0;a&&n%2==0&&(s=t-s);var l=null;return function(c,u){var h=c%t,d=1+(c-h)/t;u*=i,a&&d%2==0&&(u=-u);var m=!1;if(d>n)h=s,m=!0,-1===r&&(h=i>0?0:t);else if(u<0&&(h=t-h),h===l)return!1;l=h;for(var p=0;p<o;p++)e[p](h);return m}}(n,t.duration,t.iterations||1/0,t.direction||1,!!t.alternate,t.fill||1):null}(t,e)})).filter((function(e){return!!e}));return n.length?{element:t,animations:n,options:e.options||void 0}:null}(t)))return null;var n=t.element,i=t.options||{},a=new e(t.animations,t.options);return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if("click"!==n){if("hover"===n)return t.addEventListener("mouseenter",(function(){return e.play()})),void t.addEventListener("mouseleave","freeze"===i?function(){return e.pause()}:function(){return e.stop()});e.play()}else{var a=function n(){t.removeEventListener("click",n),e.play()};t.addEventListener("click",a)}}(a,n,i.start,i.hover),a}}]),e}();return function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var n=Date.now(),i=Math.max(0,16-(n-e)),a=window.setTimeout((function(){t(n+i)}),i);return e=n+i,a},window.cancelAnimationFrame=window.clearTimeout)}(),Ce},"object"==typeof exports?e.exports=i():"function"==typeof define&&n.amdO?define(i):(t=t||self).__SVGATOR_PLAYER__=i(),__SVGATOR_PLAYER__.build({root:"e29gnwghxaec1",animations:[{duration:3e3,direction:1,iterations:0,fill:1,alternate:!1,elements:{e29gnwghxaec4:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160,y:60.000000000000085,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.0000000000001,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:160.00000000000009,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:70.00000000000013,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000011,y:110.00000000000003,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec5:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:209.99999999999997,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70,y:109.99999999999996,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160,y:59.999999999999986,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.00000000000006,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000003,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000006,y:210,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec6:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70.00000000000003,y:210.00000000000003,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.0000000033166,y:110.00000000017586,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999559876,y:59.99999999808161,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250.00000000133716,y:109.99999999826927,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250.00000000074502,y:209.99999999748923,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:160.00000000328416,y:259.99999999938586,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec7:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:209.99999999827637,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160.00000000000003,y:259.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.00000000000003,y:209.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000003,y:109.99999999827641,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:159.99999999999997,y:59.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250,y:109.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250.00000000000003,y:209.99999999827642,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec8:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:250.00000000000009,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160.00000000000006,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000006,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:70.00000000000003,y:110.00000000000007,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000006,y:60.000000000000064,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250,y:110.00000000000006,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec9:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:60,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:249.99999999999997,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:249.99999999999994,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999999991,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:69.99999999999991,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:69.99999999999994,y:110.00000000000001,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:159.99999999999994,y:60.00000000000004,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}}}}],options:{start:"load",hover:"restart"}})}),[]),(0,i.createElement)("svg",{id:"e29gnwghxaec1",className:"imajinn-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 300",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision"},(0,i.createElement)("defs",null,(0,i.createElement)("filter",{id:"e29gnwghxaec4-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec4-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec5-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec5-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec6-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec6-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec7-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec7-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec8-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec8-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec9-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec9-filter-blur-0",stdDeviation:"0,0",result:"result"}))),(0,i.createElement)("circle",{id:"e29gnwghxaec2",r:"50",transform:"matrix(-1 0 -0 -1 149.99999999999997 50.00000000379265)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("circle",{id:"e29gnwghxaec3",r:"50",transform:"matrix(-1 0 -0 -1 49.99999999999997 150.00000000379259)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("path",{id:"e29gnwghxaec4",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 110.00000000344897)",filter:"url(#e29gnwghxaec4-filter)",fill:"rgb(239,237,39)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec5",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 210.00000000344886)",filter:"url(#e29gnwghxaec5-filter)",fill:"rgb(236,0,140)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec6",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 260.00000000344897)",filter:"url(#e29gnwghxaec6-filter)",fill:"rgb(238,124,30)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec7",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 210.00000000172525)",filter:"url(#e29gnwghxaec7-filter)",fill:"rgb(0,161,103)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec8",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 110.00000000344897)",filter:"url(#e29gnwghxaec8-filter)",fill:"rgb(192,53,226)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec9",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 60.00000000344890)",filter:"url(#e29gnwghxaec9-filter)",fill:"rgb(38,169,224)",stroke:"none",strokeWidth:"6"}))}n(609),e=n.hmd(e)},380:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(873))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.segments,i=void 0===n?50:n,a=t.iterationLimit,s=void 0===a?100:a;o(this,e),this.p1=new r.default,this.p2=new r.default,this.segments=i,this.iterationLimit=s}return a(e,[{key:"drawToCanvas",value:function(e,t,n,i){this.p1.update(t),this.p2.update(n);var a=this.p1.x>this.p2.x,r=a?this.p2:this.p1,o=a?this.p1:this.p2,s=[],l=!0;if(r.getDistanceTo(o)<i)if(o.x-r.x>.01){var c=o.x-r.x,u=o.y-r.y,h=-this.getCatenaryParameter(c,u,i,this.iterationLimit),d=.5*(h*Math.log((i+u)/(i-u))-c),m=h*Math.cosh(d/h),p=r.x-d,f=r.y-m;s=this.getCurve(h,r,o,p,f,this.segments),l=!1}else{var g=.5*(r.x+o.x),y=.5*(r.y+o.y+i);s=[[r.x,r.y],[g,y],[o.x,o.y]]}else s=[[r.x,r.y],[o.x,o.y]];return l?this.drawLine(s,e):this.drawCurve(s,e),s}},{key:"getCatenaryParameter",value:function(e,t,n,i){for(var a=Math.sqrt(n*n-t*t)/e,r=Math.acosh(a)+1,o=-1,s=0;Math.abs(r-o)>1e-6&&s<i;)o=r,r-=(Math.sinh(r)-a*r)/(Math.cosh(r)-a),s++;return e/(2*r)}},{key:"getCurve",value:function(e,t,n,i,a,r){for(var o=[t.x,e*Math.cosh((t.x-i)/e)+a],s=n.x-t.x,l=r-1,c=0;c<l;c++){var u=t.x+s*(c+.5)/l,h=e*Math.cosh((u-i)/e)+a;o.push(u,h)}return o.push(n.x,e*Math.cosh((n.x-i)/e)+a),o}},{key:"drawLine",value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:"drawCurve",value:function(e,t){var n=.5*e.length-1,i=e[2],a=e[3],r=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[2*o],l=e[2*o+1],c=.5*(s+i),u=.5*(l+a);r.push([i,a,c,u]),t.quadraticCurveTo(i,a,c,u),i=s,a=l}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),r}}]),e}();t.default=s},873:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return n(e,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"getDifferenceTo",value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}}]),e}();t.default=i},301:function(e,t,n){t.oT=void 0;var i=r(n(380)),a=r(n(873));function r(e){return e&&e.__esModule?e:{default:e}}t.oT=i.default,a.default},630:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(195))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.radius,i=void 0===n?30:n,a=t.enabled,s=void 0===a||a,l=t.initialPoint,c=void 0===l?{x:0,y:0}:l;o(this,e),this.radius=i,this._isEnabled=s,this.pointer=new r.default(c.x,c.y),this.brush=new r.default(c.x,c.y),this.angle=0,this.distance=0,this._hasMoved=!1}return a(e,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"isEnabled",value:function(){return this._isEnabled}},{key:"setRadius",value:function(e){this.radius=e}},{key:"getRadius",value:function(){return this.radius}},{key:"getBrushCoordinates",value:function(){return this.brush.toObject()}},{key:"getPointerCoordinates",value:function(){return this.pointer.toObject()}},{key:"getBrush",value:function(){return this.brush}},{key:"getPointer",value:function(){return this.pointer}},{key:"getAngle",value:function(){return this.angle}},{key:"getDistance",value:function(){return this.distance}},{key:"brushHasMoved",value:function(){return this._hasMoved}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.both,i=void 0!==n&&n;return this._hasMoved=!1,!(this.pointer.equalsTo(e)&&!i||(this.pointer.update(e),i?(this._hasMoved=!0,this.brush.update(e),0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),0)))}}]),e}();t.default=s},195:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(93))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"moveByAngle",value:function(e,t){var n=e+Math.PI/2;this.x=this.x+Math.sin(n)*t,this.y=this.y-Math.cos(n)*t}},{key:"equalsTo",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"getDifferenceTo",value:function(e){return new r.default(this.x-e.x,this.y-e.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}},{key:"getAngleTo",value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:"toObject",value:function(){return{x:this.x,y:this.y}}}]),t}(r.default);t.default=l},93:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}},227:function(e,t,n){t.xv=void 0;var i=o(n(630)),a=o(n(93)),r=o(n(195));function o(e){return e&&e.__esModule?e:{default:e}}t.xv=i.default,a.default,r.default},609:function(e){e.exports=window.wp.components},307:function(e){e.exports=window.wp.element}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i](r,r.exports,n),r.loaded=!0,r.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),function(){var e=window.wp.blocks,t=n(307),i=window.wp.i18n,a=window.wp.blockEditor,r=n(609),o=window.wp.primitives,s=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"infinite-uploads/imajinn-ai","version":"0.1.0","title":"Imajinn AI","category":"media","icon":"art","description":"Generate the perfect images from a text prompt in seconds with cutting-edge AI. Creates stunning images for any topic with just your imagination.","keywords":["img","image","photo","picture","ai","art","infinite"],"supports":{"html":false,"multiple":false,"customClassName":false,"reusable":false,"lock":false},"example":{"attributes":{"mode":"preview"}},"textdomain":"imajinn-ai","editorScript":"file:./block.js","editorStyle":"file:./block.css"}'),c=n(352);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)}var h=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),d=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function m(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{className:"imajinn-prompt-tips",onClick:()=>a(!0),icon:h,label:(0,i.__)("Prompt Tips","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Basics of Prompt Engineering","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)('"Prompt Engineering" is an important skill to create better generations with this text to image AI. After reading this document and applying these simple steps, you’ll be able to generate better images with the same amount of effort.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Note: Your prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. If you speak another language you can use a online translation tool, which should provide excellent results as it does not have to be perfect.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("1. Raw prompt","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Raw prompt is the simplest way of describing what you want to generate, for instance;","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Panda"),(0,t.createElement)("li",null,"A warrior with a sword"),(0,t.createElement)("li",null,"Skeleton")),(0,t.createElement)("p",null,(0,i.__)("This is the basic building block of any prompt. Most new people start by only using raw prompts, this is usually a mistake as the images you generate like this tend to get random and chaotic. It's best to include as much detail as possible in your prompt describing exactly what you want to see in the scene.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("2. Style","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Style is a crucial part of the prompt. The AI, when missing a specified style, usually chooses the one it has seen the most in related images, for example, if you generated landscape, it would probably generate realistic or oil painting looking images. Having a well chosen style + raw prompt is sometimes enough, as the style influences the image the most right after the raw prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most commonly used styles include:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Realistic"),(0,t.createElement)("li",null,"Oil painting"),(0,t.createElement)("li",null,"Pencil drawing"),(0,t.createElement)("li",null,"Concept art")),(0,t.createElement)("p",null,(0,i.__)("In the case of a realistic image, there are various ways of making it the style, most resulting in similar images. Here are some commonly used techniques of making the image realistic:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"a photo of + raw prompt"),(0,t.createElement)("li",null,"a photograph of + raw prompt"),(0,t.createElement)("li",null,"raw prompt, hyperrealistic"),(0,t.createElement)("li",null,"raw prompt, realistic")),(0,t.createElement)("p",null,(0,i.__)("You can of course combine these to get more and more realistic images.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To get oil painting you can just simply add “an oil painting of” to your prompt. This sometimes results in the image showing an oil painting in a frame, to fix this you can just re-run the prompt or use raw prompt + “oil painting”","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make a pencil drawing just simply add “a pencil drawing of” to your raw prompt or make your prompt raw prompt + “pencil drawing”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The same applies to landscape art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("3. Artist","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make your style more specific, or the image more coherent, you can use artists’ names in your prompt. For instance, if you want a very abstract image, you can add “made by Pablo Picasso” or just simply, “Picasso”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Below are lists of artists in different styles that you can use, but we encourage you to search for different artists as it is a cool way of discovering new art.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Portrait:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"John Singer Sargent"),(0,t.createElement)("li",null,"Edgar Degas"),(0,t.createElement)("li",null,"Paul Cézanne"),(0,t.createElement)("li",null,"Jan van Eyck")),(0,t.createElement)("p",null,(0,i.__)("Oil painting:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Leonardo DaVinci"),(0,t.createElement)("li",null,"Vincent Van Gogh"),(0,t.createElement)("li",null,"Johannes Vermeer"),(0,t.createElement)("li",null,"Rembrandt")),(0,t.createElement)("p",null,(0,i.__)("Pencil/Pen drawing:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Albrecht Dürer"),(0,t.createElement)("li",null,"Leonardo da Vinci"),(0,t.createElement)("li",null,"Michelangelo"),(0,t.createElement)("li",null,"Jean-Auguste-Dominique Ingres")),(0,t.createElement)("p",null,(0,i.__)("Landscape art:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Thomas Moran"),(0,t.createElement)("li",null,"Claude Monet"),(0,t.createElement)("li",null,"Alfred Bierstadt"),(0,t.createElement)("li",null,"Frederic Edwin Church")),(0,t.createElement)("p",null,(0,i.__)("Mixing the artists is highly encouraged, as it can lead to interesting-looking art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("4. Finishing touches","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("This is the part that some people take to extremes, leading to longer prompts than this article. Finishing touches are the final things that you add to your prompt to make it look like you want. For instance, if you want to make your image more artistic, add “trending on artstation”. If you want to add more realistic lighting add “Unreal Engine.” You can add anything you want, but here are some examples:","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Highly detailed, surrealism, trending on art station, triadic color scheme, smooth, sharp focus, matte, elegant, the most beautiful image ever seen, illustration, digital paint, dark, gloomy, octane render, 8k, 4k, washed colors, sharp, dramatic lighting, beautiful, post processing, picture of the day, ambient lighting, epic composition, bokeh, etc.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("5. Conclusion","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Prompt engineering allows you to have better control of what the image will look like. It (if done right) improves the image quality by a lot in every aspect. But if you want to keep it simple, just use our Prompt Genie or style presets.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function p(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.ToolbarButton,{onClick:()=>a(!0),icon:d,label:(0,i.__)("Help","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:d}),title:(0,i.__)("Usage Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI is a powerful tool that uses the latest technology in AI to generate images from text. It is a great tool for writers, artists, and anyone who needs to visualize their ideas.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The Imajinn AI interface is a block that you can add to your post or page. You can add it by clicking on the plus button in the top left corner of the editor and selecting Imajinn AI. You can also add it by clicking on the Imajinn AI icon in the block inserter. It does not output any content on your site on its own, but allows you to generate and insert images into the same location in the block editor. When finished you can just close the block.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Connecting","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Running an artificial intelligence neural network requires a lot of computing power. To make this possible, we run a cloud service to run the neural network. This means that you need to connect to our service before you can use the plugin. To connect to Imajinn AI, you need to have a user account. You can create one for free with just your valid email address and a password, or if you already have an account, you can log in with your Infinite Uploads/Imajinn AI email and password.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompts","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To generate images, you need to write a prompt. A prompt is a text that describes what you want the image to look like. The prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. The prompt can be as short as a a few words, or as long as a paragraph. The longer the prompt, the more detailed the image will be. Please see our prompt engineering guide for more information on how to write a good prompt.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt Genie","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Because writing prompts is hard, we have created a tool called Prompt Genie that can help you turn your simple prompts into amazing masterpieces. Prompt Genie uses a custom AI model to transform your prompt into ten different powerful options to generate an image in beautiful artistic styles. Simply enter your simple prompt like "a dog running on a beach", then click on the Prompt Genie button. After a few moments it will present you with ten different expanded prompts to choose from. You can then select the one you like best and click on the Generate button to generate a set of images. If you want to try a different prompt, just click on the Prompt Genie button again and choose a new option.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Summoning Prompt Genie does not use any of your credits, so you can summon it as many times as you like. However each time you generate a set of images from one of it's prompts you will use one credit like normal.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prefilled Styles","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To give you inspiration and make it easier to generate images in specific styles, we have added some dropdowns with prefilled styles that you can optionally select from. When optionally choosing options here it will append specific keywords to your prompt to achieve that style when sent to our servers.","imajinn-ai")),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Image Style","imajinn-ai")),"-",(0,i.__)("Choose from many common photographic or artistic styles and mediums.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Artist Style","imajinn-ai")),"-",(0,i.__)("Choose to generate your images based on the styles of some famous artists.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Modifier","imajinn-ai")),"-",(0,i.__)("Some fun and common styles to give the image output that special uniqueness.","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Image Ratio","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("You can control the output ratio of the generated images. Square images are the default, while rectangular images have more pixels and take longer to process.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The AI model was trained on square images, so depending on the prompt rectangular images may produce strange results such as duplication of the main subject. For example a rectangular image of a person may produce two of the same person, or multiple mouths on the same face. So it may require more prompt editing and generation attempts to get the desired result. Rectangular images are best used for landscapes, scenes, and other objects that do not have a singular main subject.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Saving Images","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI allows you to save images to your media library, and optionally insert them into your post/page. You can save images by clicking on the save button in the bottom right corner of each image generation. You can insert images into the editor in the same location as the Imajinn block by clicking on the insert button in the bottom right corner. Inserting an image also saves it to your media library, so you don't need to choose both.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you save or insert an image, it can take a few seconds because we send it to our servers to be upscaled using our advanced AI models so that you get a high resolution optimized image in your media library with no watermarks.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Image Actions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("For each image result for a generation, you can perform some actions on the image. You can share the image on social media, generate a set of variations, perform a face repair, or enter touchup mode.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've found an image you like, you can click the Generate Variations button to generate a set of images with similar styles and layout to give you more options to choose from. This will take into account any modifications you've made to the prompt, while still roughly following the original image. Creating variations uses one credit just like a normal generation.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've generated an image of a person and the face looks slightly deformed or unrealistic, you can click the Face Repair button to try and repair any issues with the face. This processes the image on our servers with AI-based facial restoration to restore facial details and enhance colors with a good balance of realness and fidelity. It can't fix every problem with a face, but it can help with some common issues. This tool is most effective for photographic or realistic art; if you try to use it on more abstract artistic faces results may be strange. Face repairs are not stored in your prompt history so that you can easily undo, and do not use any credits.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('The Touchup button (or "Inpainting") allows you to customize and make modifications to the image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, and duplicate objects. You can also use it to add new objects to the image, such as a new background or foreground. Using touchup can be a bit tricky, so be sure to read the tips popup inside of the image editor so you can make good use of your credits.',"imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt History","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn saves your prompt history to your site so that you can easily access previous prompts and their results later. Currently the editor will show the last 20 generated prompts and their image results. To jump back in time simply click the Load button next to an item. You can then edit, save, adjust the prompt, styles, or any other action you can normally do after generating a set of images.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Credits","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you first signup for Imajinn AI, you get a chunk of free credits. You can use these credits to generate images and get a feel for how the plugin functions and learn how to write effective prompts. If you run out, you can purchase more credits from the Imajinn AI website via our plans.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Each prompt generation uses one credit, and creates four images that you can choose to save and/or insert into your content. There is no limit to the number of images you can save.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Filters and Restrictions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To ensure that the images generated are appropriate for all audiences, we have a set of filters and restrictions that are applied to prompts and the image outputs. We block the use of specific words and phrases in prompts, and we scan all generations with an AI moderation filter to block images that appear to contain nudity, or other inappropriate content.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Depending on your prompt construction, it can be a fairly common occurrence for it to detect a potentially inappropriate image. If this happens, you will see a warning message. You can either change your prompt, or try generating again. We currently don't charge credits for images that are blocked by the filter, but may need to change this policy in the future. We monitor prompt violations and if we find that you are purposely using inappropriate prompts and attempting to bypass our restrictions, we may disable your account.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function f(e){let{isMobile:n,...a}=e;const[o,s]=(0,t.useState)(!1),l=()=>s(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>s(!0),icon:h,label:n&&(0,i.__)("Tips","imajinn-ai")},!n&&(0,i.__)("Tips","imajinn-ai")),o&&(0,t.createElement)(r.Modal,u({},a,{onRequestClose:l,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Touchup (Inpainting) Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("The Touchup feature allows you to customize and make modifications to an image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, or duplicates. Or you can also use it to add new objects to the image, such as a new object or background. Touchup allows you to create the exact image you want by choosing where each element in the image goes. You can create the complex image you have in mind, even if it is too specific to get right with one initial prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Touchup works by choosing an image as an input, masking an area with the brush that you want to modify, then adjusting your prompt to describe what you want in that area. However, this can be quite difficult to work with if you don’t use it right, because sometimes you select an area and put in the prompt, but the image doesn't change. So, here are some tips to help you get the best results from Touchup.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Best Practices","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Prompt Modification","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most important thing to keep in mind is whether you should describe the entire image you want or only what you want to add. For example, let’s say you want to change an image of an empty shoreline to add a boat floating on the water. You select an area where you want the boat to go, and your prompt in most cases shouldn’t be “a boat”. Instead it should be “Shoreline with a boat floating on the water”. This is because Imajinn needs to know what the context of the entire image should look like, and then it will fill in the area you selected with the boat. If you just say “a boat”, you are more likely to just get an erased area.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('There are some cases when you do want to describe only the thing you want to add instead of the final result. For example, if you are trying to simply erase parts of the image, it may work better to describe "a gray background", or whatever it should be replaced with. Also if you are building an image step-by-step and there are a lot of different subjects, focus your prompt on the section you are painting and generalize the rest of the image as detailed below.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When modifying the prompt, there is no need to get too poetic or descriptive because most of the image and its styles are already still there and taken into account, unless you paint out a very large portion of the image. Also if Prompt Genie or our style selectors were used initially, the styles will already be applied to your modified prompt. If you entered your own styles and modifiers to the prompt field, it is best to leave them there so they will be applied to the selected area. Be careful not to change or add styles in the modified prompt that will clash with the rest of the image.","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Step-by-Step Image Building","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('If you are trying to create a complex image with lots of subjects like people, animals, or objects, it can be impossible to do this with just one long prompt. Instead you can use Touchup to add new elements to the image one-by-one. For example, if you are building a landscape, you can use Touchup to add a new tree, mountain, or different characters one at a time. In this case as you add more objects, you should not describe the entire image in your modified prompt, but instead describe the new object you are adding, and summarize or skip the rest. For example, if you were adding a "girl with a dog", you would not put "girl with a dog, boy dancing, other boy with red shirt sitting" as then Imajinn would loose focus on what you want to put in the masked area. Instead summarize the existing objects like "a bunch of children including a girl with a dog".',"imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Other Tips","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you are making adjustments to part of an existing object, make sure you mask enough of that object so that Imajinn can make a smooth transition between old and new. For example to add a hat to a person, include the top of their head in the masked area. If you want a person next to a cat to be petting the cat, mask their entire arm and part of the cat where their hand would go before prompting “person petting a cat”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Be careful with shadows and reflections. Be sure to select not just the object but its shadow and reflection so that the replacement will look more realistic.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Size matters! Try to select larger areas to replace rather than smaller ones, because the smaller the area is, the less likely it is to actually do anything. Also, the contextual size of the new object to the rest of the image is important too. For example, if you try to replace a cat with an elephant, the size does not make sense to Imajinn, so either nothing will happen or you\'ll only get a piece of the elephant. Either stick with similar sized replacements, or make the prompt ask for a "tiny elephant".',"imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:l},(0,i.__)("Close","imajinn-ai"))))}function g(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(!1),[l,h]=(0,t.useState)([]),[d,m]=(0,t.useState)([]),[p,f]=(0,t.useState)(null),g=()=>a(!0),y=()=>a(!1),v=l.map(((n,a)=>(0,t.createElement)(r.PanelBody,{key:a.toString(),opened:!0},(0,t.createElement)(r.PanelRow,null,(0,t.createElement)("span",null,(0,t.createElement)("em",null,e.prompt)," ",n),(0,t.createElement)(r.Button,{variant:"primary",isSmall:!0,disabled:d.some((e=>e.index===a)),className:"genie-generate",onClick:()=>{if(e.clearStyles(),e.prompt)e.setPromptStyle(n),e.startJob(null,null,null,null,n);else{let t=n.split(",")[0];e.setPrompt(t);let i=n.split(",").slice(1).join();e.setPromptStyle(i),e.startJob(null,null,null,t,i)}m((e=>[...e,{index:a}])),y()}},(0,i.__)("Generate","imajinn-ai"))))));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.BaseControl,{label:(0,i.__)("Prompt Genie","imajinn-ai"),id:"imajinn-prompt-genie-button",className:"prompt-genie"},(0,t.createElement)("div",null,(0,t.createElement)((()=>o?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Generating prompt masterpieces...","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:e.isLoading,variant:"secondary",id:"imajinn-prompt-genie-button",label:(0,i.__)("Prompt Genie: AI generated prompt masterpiece","imajinn-ai"),onClick:()=>{e.setError(""),e.prompt===p?g():(async t=>{s(!0);const n=await fetch(`${ajaxurl}?action=imajinn-create-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,nonce:IMAJINN.nonce})}),i=await n.json();s(!1),i.success?(h(i.data.prompts),m([]),f(t),g()):(e.setError(i.data[0].message),y())})(e.prompt)},icon:(0,t.createElement)(c.DT,null)},(0,i.__)("Summon","imajinn-ai"))),null))),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:y,style:{maxWidth:"90%"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("AI Generated Prompt Ideas","imajinn-ai")}),(0,t.createElement)(r.Panel,null,v)))}function y(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>a(!0)},e.buttonLabel||(0,i.__)("License / Restrictions","imajinn-ai")),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:(0,t.createElement)(r.Icon,{icon:h})}),title:(0,i.__)("License / Usage Restrictions","imajinn-ai")}),(0,t.createElement)("p",null,"CreativeML Open RAIL-M dated August 22, 2022"),(0,t.createElement)("p",null,"Section I: PREAMBLE"),(0,t.createElement)("p",null,"Multimodal generative models are being widely adopted and used, and have the potential to transform the way artists, among other individuals, conceive and benefit from AI or ML technologies as a tool for content creation."),(0,t.createElement)("p",null,"Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations."),(0,t.createElement)("p",null,"In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the Model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for art and content generation."),(0,t.createElement)("p",null,"Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this License aims to strike a balance between both in order to enable responsible open-science in the field of AI."),(0,t.createElement)("p",null,"This License governs the use of the model (and its derivatives) and is informed by the model card associated with the model."),(0,t.createElement)("p",null,"NOW THEREFORE, You and Licensor agree as follows:"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,t.createElement)("p",null,"Definitions")),(0,t.createElement)("li",null,(0,t.createElement)("p",null,'"License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.')),(0,t.createElement)("li",null,'"Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.'),(0,t.createElement)("li",null,'"Output" means the results of operating a Model as embodied in informational content resulting therefrom.'),(0,t.createElement)("li",null,'"Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.'),(0,t.createElement)("li",null,'"Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.'),(0,t.createElement)("li",null,'"Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.'),(0,t.createElement)("li",null,'"Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.'),(0,t.createElement)("li",null,'"Licensor" means the copyright owner or entity authorized by the copyright owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.'),(0,t.createElement)("li",null,'"You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, image generator.'),(0,t.createElement)("li",null,'"Third Parties" means individuals or legal entities that are not under common control with Licensor or You.'),(0,t.createElement)("li",null,'"Contribution" means any work of authorship, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."'),(0,t.createElement)("li",null,'"Contributor" means Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.')),(0,t.createElement)("p",null,"Section II: INTELLECTUAL PROPERTY RIGHTS"),(0,t.createElement)("p",null,"Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in Section III."),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model."),(0,t.createElement)("li",null,"Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material or a Contribution incorporated within the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Work shall terminate as of the date such litigation is asserted or filed.")),(0,t.createElement)("p",null,"Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions: Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License; You must cause any modified files to carry prominent notices stating that You changed the files; You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. - for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License."),(0,t.createElement)("li",null,"Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5)."),(0,t.createElement)("li",null,"The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.")),(0,t.createElement)("p",null,"Section IV: OTHER PROVISIONS"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License, update the Model through electronic means, or modify the Output of the Model based on updates. You shall undertake reasonable efforts to use the latest version of the Model."),(0,t.createElement)("li",null,"Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors."),(0,t.createElement)("li",null,'Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model and the Complementary Material (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.'),(0,t.createElement)("li",null,"Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages."),(0,t.createElement)("li",null,"Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability."),(0,t.createElement)("li",null,"If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.")),(0,t.createElement)("p",null,"END OF TERMS AND CONDITIONS"),(0,t.createElement)("p",null,"Attachment A"),(0,t.createElement)("p",null,"Use Restrictions"),(0,t.createElement)("p",null,"You agree not to use the Model or Derivatives of the Model:"),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,"In any way that violates any applicable national, federal, state, local or international law or regulation;"),(0,t.createElement)("li",null,"For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;"),(0,t.createElement)("li",null,"To generate or disseminate verifiably false information and/or content with the purpose of harming others;"),(0,t.createElement)("li",null,"To generate or disseminate personal identifiable information that can be used to harm an individual;"),(0,t.createElement)("li",null,"To defame, disparage or otherwise harass others;"),(0,t.createElement)("li",null,"For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;"),(0,t.createElement)("li",null,"To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;"),(0,t.createElement)("li",null,"To provide medical advice and medical results interpretation;"),(0,t.createElement)("li",null,"To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}var v=n.p+"images/imajinn-demo.6ce7fccc.jpg";function w(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null),[l,c]=(0,t.useState)(null),[u,h]=(0,t.useState)(IMAJINN.email),[d,m]=(0,t.useState)(""),[p,f]=(0,t.useState)(!1),[g,w]=(0,t.useState)(!1);if(e.isConnected)return null;const b=e=>e.target.select();return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("img",{src:v,alt:(0,i.__)("Example images generated by Imajinn AI","imajinn-ai"),style:{width:"100%"}}),(0,t.createElement)("p",null,(0,i.__)("We hope you are excited to turn your imagination into creative media for your WordPress site. To get started please create a free account or login with your existing Infinite Uploads/Imajinn credentials and we'll connect your site to our cloud.","imajinn-ai")),(0,t.createElement)((()=>o?(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,o,"incorrect_password"===l&&(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/wp-login.php?action=lostpassword",target:"_blank"},(0,i.__)("Reset Password","imajinn-ai")))):null),null),(0,t.createElement)(r.__experimentalHeading,{as:"label"},(0,i.__)("Register / Login","imajinn-ai")),(0,t.createElement)(r.Flex,{align:"bottom",wrap:"true",className:"connect-wrapper"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.TextControl,{label:(0,i.__)("Email","imajinn-ai"),type:"email",value:u,onFocus:b,onChange:e=>h(e),help:(0,i.__)("You'll need a valid email to enable your credits.","imajinn-ai")}),(0,t.createElement)(r.TextControl,{label:(0,i.__)("Password","imajinn-ai"),type:"password",autoComplete:"off",value:d,onFocus:b,onChange:e=>m(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("I agree to the Terms of Service and Usage Restrictions:","imajinn-ai"),checked:g,value:"1",onChange:e=>w(e)}),(0,t.createElement)("div",{className:"license-links"},(0,t.createElement)(y,{buttonLabel:(0,i.__)("Usage Restrictions","imajinn-ai")}),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/terms-of-service/",target:"_blank"},(0,i.__)("Terms of Service","imajinn-ai")),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/privacy/",target:"_blank"},(0,i.__)("Privacy Policy","imajinn-ai"))),(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("Notify me about usage tips & new features (unsubscribe anytime)","imajinn-ai"),checked:p,value:"1",onChange:e=>f(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)((()=>n?(0,t.createElement)(r.Button,{className:"connect-button",disabled:!0},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{className:"connect-button",variant:"primary",disabled:n,onClick:()=>{a(!0),s(null),fetch(`${ajaxurl}?action=imajinn-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:d,signup_tos:g,signup_newsletter:p,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((t=>{console.log(t),t.success?(e.setIsConnected(!0),IMAJINN.connected=!0,e.setCredits(t.data.remaining_credits)):(a(!1),c(t.data[0].code),s(t.data[0].message))})).catch((e=>{a(!1),s(e)}))}},(0,i.__)("Connect","imajinn-ai"))),null))))}var b={styles:[{id:"painting, digital art, trending on artstation",name:(0,i.__)("Painting","imajinn-ai"),children:[{id:"digital art, trending on artstation, hd",name:(0,i.__)("Digital Art","imajinn-ai")},{id:"oil painting, award winning",name:(0,i.__)("Oil Painting","imajinn-ai")},{id:"watercolor painting",name:(0,i.__)("Watercolor","imajinn-ai")},{id:"acrylic painting, award winning art, trending",name:(0,i.__)("Acrylic","imajinn-ai")},{id:"airbrush art",name:(0,i.__)("Airbrushed","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")}]},{id:"artistic drawing, trending on artstation",name:(0,i.__)("Drawing","imajinn-ai"),children:[{id:"illustration, trending on artstation",name:(0,i.__)("Illustration","imajinn-ai")},{id:"cyberpunk, trending on artstation",name:(0,i.__)("Cyberpunk","imajinn-ai")},{id:"pencil sketch, drawing, trending on artstation",name:(0,i.__)("Pencil","imajinn-ai")},{id:"drawn in blue biro pen, artistic drawing, trending on artstation",name:(0,i.__)("Pen","imajinn-ai")},{id:"Ink dripping drawing, trending on artstation",name:(0,i.__)("Ink","imajinn-ai")},{id:"caligraphy",name:(0,i.__)("Caligraphy","imajinn-ai")},{id:"charcoal shaded, artistic drawing, trending on artstation",name:(0,i.__)("Charcoal","imajinn-ai")},{id:"cartoon",name:(0,i.__)("Cartoon","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"technical sketch",name:(0,i.__)("Technical Sketch","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")},{id:"line art",name:(0,i.__)("Line Art","imajinn-ai")},{id:"crayon drawing",name:(0,i.__)("Crayon","imajinn-ai")},{id:"pastel drawing, artistic",name:(0,i.__)("Pastel","imajinn-ai")},{id:"chalkboard drawing",name:(0,i.__)("Chalkboard","imajinn-ai")}]},{id:"animation",name:(0,i.__)("Animation","imajinn-ai"),children:[{id:"vintage disney animation",name:(0,i.__)("Vintage Disney","imajinn-ai")},{id:"Rendered by octane, disney animation studios",name:(0,i.__)("Disney Animation","imajinn-ai")},{id:"simpsons style animation",name:(0,i.__)("Simpsons","imajinn-ai")},{id:"anime style, Studio Ghibli, manga, trending on artstation",name:(0,i.__)("Anime","imajinn-ai")},{id:"disney pixar style animation, octane render",name:(0,i.__)("Pixar","imajinn-ai")}]},{id:"unreal engine, 3d render, Rendered by octane",name:(0,i.__)("Screen","imajinn-ai"),children:[{id:"Unreal Engine, Cinema 4D",name:(0,i.__)("Video Game HD","imajinn-ai")},{id:"animal crossing, mario, nintendo, pokemon",name:(0,i.__)("Nintendo","imajinn-ai")},{id:"3D render, composite",name:(0,i.__)("3D Render","imajinn-ai")},{id:"8bit graphics",name:(0,i.__)("8bit","imajinn-ai")},{id:"emoji",name:(0,i.__)("Emoji","imajinn-ai")},{id:"low poly ps1 graphics",name:(0,i.__)("Low Poly","imajinn-ai")},{id:"pixel art",name:(0,i.__)("Pixel Art","imajinn-ai")},{id:"ASCII art",name:(0,i.__)("ASCII","imajinn-ai")}]},{id:"photograph of, photo, 50mm portrait photograph",name:(0,i.__)("Photography (avoid people)","imajinn-ai"),children:[{id:"realistic photo of, award winning photograph, 50mm",name:(0,i.__)("Realistic","imajinn-ai")},{id:"Portrait photograph, symmetrical, award winning, bokeh, dof, Annie Leibovitz",name:(0,i.__)("Portrait","imajinn-ai")},{id:"polaroid photograph, polaroid frame",name:(0,i.__)("Polaroid","imajinn-ai")},{id:"war photograph, WWI photograph, WWII photograph",name:(0,i.__)("War","imajinn-ai")},{id:"Wildlife Photograph, national geographic photo, zoom, telephoto",name:(0,i.__)("Wildlife","imajinn-ai")},{id:"Photojournalism, award winning, photo of, magazine photograph",name:(0,i.__)("Photojournalism","imajinn-ai")},{id:"macro photograph, close up, zoom, depth of field",name:(0,i.__)("Macro","imajinn-ai")},{id:"long exposure, photograph, realistic",name:(0,i.__)("Long Exposure","imajinn-ai")},{id:"photograph, fish eye lense, wide-angle",name:(0,i.__)("Fish Eye","imajinn-ai")}]},{id:"realistic",name:(0,i.__)("Real Life Materials","imajinn-ai"),children:[{children:[{id:"marble statue",name:(0,i.__)("Marble","imajinn-ai")},{id:"stone statue",name:(0,i.__)("stone","imajinn-ai")},{id:"statue carved from wax",name:(0,i.__)("Wax","imajinn-ai")}],id:"statue",name:(0,i.__)("Statue","imajinn-ai")},{id:"origami paper folding",name:(0,i.__)("Origami","imajinn-ai")},{id:"paper mache art",name:(0,i.__)("Paper Mache","imajinn-ai")},{id:"paper cutout art",name:(0,i.__)("Paper Cutout","imajinn-ai")},{id:"graffiti street art",name:(0,i.__)("Graffiti","imajinn-ai")},{id:"halftone print",name:(0,i.__)("Halftone","imajinn-ai")},{id:"cross stitch art",name:(0,i.__)("Cross Stitch","imajinn-ai")},{id:"stained glass",name:(0,i.__)("Stained Glass","imajinn-ai")},{id:"made of crystals",name:(0,i.__)("Crystal","imajinn-ai")},{id:"made of flowers",name:(0,i.__)("Flowery","imajinn-ai")}]}],artists:[{value:"",label:""},{value:"by Albert Bierstadt",label:(0,i.__)("Albert Bierstadt","imajinn-ai")},{value:"by Andy Warhol",label:(0,i.__)("Andy Warhol","imajinn-ai")},{value:"by Asaf Hanuka",label:(0,i.__)("Asaf Hanuka","imajinn-ai")},{value:"by Aubrey Beardsley",label:(0,i.__)("Aubrey Beardsley","imajinn-ai")},{value:"by Claude Monet",label:(0,i.__)("Claude Monet","imajinn-ai")},{value:"by Diego Rivera",label:(0,i.__)("Diego Rivera","imajinn-ai")},{value:"by Frida Kahlo",label:(0,i.__)("Frida Kahlo","imajinn-ai")},{value:"by Greg Rutkowski",label:(0,i.__)("Greg Rutkowski","imajinn-ai")},{value:"by Hayao Miyazaki",label:(0,i.__)("Hayao Miyazaki","imajinn-ai")},{value:"by Hieronymus Bosch",label:(0,i.__)("Hieronymus Bosch","imajinn-ai")},{value:"by Jackson Pollock",label:(0,i.__)("Jackson Pollock","imajinn-ai")},{value:"by Leonardo da Vinci",label:(0,i.__)("Leonardo da Vinci","imajinn-ai")},{value:"by Michelangelo",label:(0,i.__)("Michelangelo","imajinn-ai")},{value:"by Pablo Picasso",label:(0,i.__)("Pablo Picasso","imajinn-ai")},{value:"by Salvador Dali",label:(0,i.__)("Salvador Dali","imajinn-ai")},{value:"by artgerm, art germ",label:(0,i.__)("Stanley Artgerm","imajinn-ai")},{value:"by Thomas Kinkade",label:(0,i.__)("Thomas Kinkade","imajinn-ai")},{value:"by Vincent van Gogh",label:(0,i.__)("Vincent van Gogh","imajinn-ai")}],modifiers:[{value:"",label:""},{value:"in the style of steampunk",label:(0,i.__)("Steampunk","imajinn-ai")},{value:"synthwave",label:(0,i.__)("Synthwave","imajinn-ai")},{value:"in the style of cyberpunk",label:(0,i.__)("Cyberpunk","imajinn-ai")},{value:"insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Detailed & Intricate","imajinn-ai")},{value:"in a symbolic and meaningful style, insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Symbolic & Meaningful","imajinn-ai")},{value:"Cinematic Lighting",label:(0,i.__)("Cinematic Lighting","imajinn-ai")},{value:"Contre-Jour",label:(0,i.__)("Contre-Jour","imajinn-ai")},{value:"futuristic",label:(0,i.__)("Futuristic","imajinn-ai")},{value:"black and white",label:(0,i.__)("Black & White","imajinn-ai")},{value:"technicolor",label:(0,i.__)("Technicolor","imajinn-ai")},{value:"warm color palette",label:(0,i.__)("Warm","imajinn-ai")},{value:"neon",label:(0,i.__)("Neon","imajinn-ai")},{value:"colorful",label:(0,i.__)("Colorful","imajinn-ai")}]},_=e=>{let{image:n,setImage:i,generations:a}=e;return(0,t.createElement)(t.Fragment,null,null!==n&&(0,t.createElement)(r.Modal,{__experimentalHideHeader:!0,onRequestClose:()=>i(null),className:"imajinn-preview-modal",onKeyDown:e=>{const t=a.length-1;"ArrowRight"===e.key?i(n<t?n+1:0):"ArrowLeft"===e.key&&i(n>0?n-1:t)}},(0,t.createElement)("img",{s rc:a[n].preview,onClick:()=>i(null)})))},E=e=>{let{history:n,setPrompt:o,setPromptStyle:s,setGenerations:l,setRatio:c,clearStyles:u,setQueryRatio:h,setSaved:d,setFaceFixed:m}=e;return n.length<=0?null:(0,t.createElement)(a.InspectorControls,{key:"setting"},(0,t.createElement)(r.Panel,{header:(0,i.__)("Generation History","imajinn-ai"),className:"imajinn-history"},n.map(((e,n)=>(0,t.createElement)(r.PanelBody,{key:n},(0,t.createElement)("h2",{className:"components-panel__body-title"},e.generations.map(((e,n)=>(0,t.createElement)("img",{key:n,src:e.thumbnail,alt:sprintf((0,i.__)("Result %d","imajinn-ai"),(n+1).toString())}))),(0,t.createElement)(r.Button,{variant:"secondary",label:(0,i.__)("Load prompt results","imajinn-ai"),onClick:()=>{u(),o(e.prompt),s(e.prompt_style),l(e.generations),c(e.ratio),h(e.ratio),d([]),m([])}},(0,i.__)("Load","imajinn-ai"))),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.__experimentalText,{numberOfLines:2,truncate:!0},e.prompt)))))))},x=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),j=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})),M=e=>{let{ratio:n,isLoading:a,setRatio:o}=e;const s={"1:1":(0,i.__)("Square","imajinn-ai"),"3:2":(0,i.__)("Wide","imajinn-ai"),"2:3":(0,i.__)("Tall","imajinn-ai")}[n]+" images"+("1:1"!==n?" - "+(0,i.__)("slower to generate","imajinn-ai"):"");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-ratio",label:(0,i.__)("Select an image ratio to generate.","imajinn-ai"),defaultChecked:"1:1",disabled:a,onChange:o,checked:n},(0,t.createElement)(r.__experimentalRadio,{value:"1:1",icon:x},"1:1"),(0,t.createElement)(r.__experimentalRadio,{value:"3:2",icon:j},"3:2"),(0,t.createElement)(r.__experimentalRadio,{className:"ratio-3-2",value:"2:3",icon:j},"2:3")),(0,t.createElement)("br",null),(0,t.createElement)(r.__experimentalText,null,s))},S=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})),k=function(e){const[n,a]=(0,t.useState)(e.showUpgrade),o=()=>{a(!1),e.setShowUpgrade(!1)};return(0,t.useEffect)((()=>{a(e.showUpgrade)}),[a,e]),(0,t.createElement)(t.Fragment,null,n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"400px"},icon:S,title:(0,i.__)("Upgrade Plan","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Sorry, you are out of available image generation credits. You can get more credits by upgrading your account to one of our premium plans.","imajinn-ai")),(0,t.createElement)("div",{className:"imajinn-upgrade-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",href:IMAJINN.checkout_url,target:"_blank"},(0,i.__)("Get More Credits","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i._x)("Cancel","Don't upgrade now","imajinn-ai")))))},C=window.React,I=n.n(C),D=e=>{let{isConnected:n,credits:o,refreshInfo:s,visitAccount:l}=e;const[c,u]=(0,C.useState)(!1),[h,d]=(0,C.useState)("refreshing-button");return(0,C.useEffect)((()=>{d(c?"refreshing-button is-refreshing":"refreshing-button")}),[c]),(0,t.createElement)(a.BlockControls,null,(0,t.createElement)(r.Toolbar,{label:(0,i.__)("Imajinn AI","imajinn-ai"),className:"imajinn-toolbar"},(0,t.createElement)(r.ToolbarGroup,null,n&&!1!==o&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"credit-label"},(0,i.__)("Credits:","imajinn-ai")),(0,t.createElement)("div",{className:"credits"},o),(0,t.createElement)(r.ToolbarButton,{className:h,disabled:c,icon:(0,t.createElement)(r.Dashicon,{icon:"update"}),label:(0,i.__)("Refresh count","imajinn-ai"),onClick:async()=>{u(!0),await s(),u(!1)}})),(0,t.createElement)(r.ToolbarButton,{onClick:l,icon:(0,t.createElement)(r.Dashicon,{icon:"admin-users"}),label:(0,i.__)("Account / Upgrade","imajinn-ai")}),(0,t.createElement)(p,null))))};const A=e=>{let{setImageStyle:n,isLoading:a,imageStyle:o,optionData:s}=e;return(0,t.createElement)(r.TreeSelect,{disabled:a,label:(0,i.__)("Select an image style","imajinn-ai"),noOptionLabel:" ",selectedId:o,onChange:e=>{n(e)},__next36pxDefaultSize:!0,tree:s.styles})},T=e=>{let{setImageArtist:n,isLoading:a,imageArtist:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select an Artist style","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.artists})},L=e=>{let{setImageModifier:n,isLoading:a,imageModifier:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select a style modifier","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.modifiers})};var P=e=>{let{hasError:n}=e;return(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,n))},N=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),O=e=>{let{saved:n,saveImage:a,...o}=e;const[s,l]=(0,C.useState)(!1);return IMAJINN.custom_editor?null:s?(0,t.createElement)(r.Button,{disabled:!0,className:"imajinn-image-insert",label:(0,i.__)("Inserting","imajinn-ai")},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{variant:"primary",className:"imajinn-image-insert",disabled:s,icon:N,onClick:async()=>{l(!0),await(async e=>{let t=!1;if(t=n.some((t=>t.index===e))?n.find((t=>t.index===e)).data:await a(e),t){const e=wp.data.select("core/block-editor").getBlocks().map((function(e){return"infinite-uploads/imajinn-ai"===e.name})).indexOf(!0),n=wp.blocks.createBlock("core/image",{id:t.attachment_id,url:t.url,width:t.width,height:t.height,sizeSlug:t.size,alt:o.prompt,title:o.prompt});return wp.data.dispatch("core/block-editor").insertBlocks(n,e),!0}return!1})(o.genindex)||l(!1)}},(0,i.__)("Insert","imajinn-ai"))},R=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),z=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),B=e=>{const[n,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{e.saved.some((t=>t.index===e.genindex))?(s(!0),a(!1)):(s(!1),a(!1))}),[e.saved]),o?(0,t.createElement)(r.Button,{disabled:!0,icon:R,label:(0,i.__)("Saved","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saved","imajinn-ai"):""):n?(0,t.createElement)(r.Button,{disabled:!0,style:IMAJINN.custom_editor?{}:{maxWidth:"36px"},icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Saving","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saving","imajinn-ai"):""):(0,t.createElement)(r.Button,{variant:IMAJINN.custom_editor?"primary":"secondary",disabled:n,icon:z,label:(0,i.__)("Save to Media Library","imajinn-ai"),onClick:async()=>{a(!0),await e.saveImage(e.genindex)||a(!1)}},IMAJINN.custom_editor?(0,i.__)("Save","imajinn-ai"):"")},W=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Y=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),F=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),V=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),G=n(227),H=n(301),U=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var a=i[n];e.call(t,a[1],a[0])}},t}()}(),J="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,q=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Z="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(q):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},X=["top","right","bottom","left","width","height","size","weight"],Q="undefined"!=typeof MutationObserver,$=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,a=0;function r(){n&&(n=!1,e()),i&&s()}function o(){Z(r)}function s(){var e=Date.now();if(n){if(e-a<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){J&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Q?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){J&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;X.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),K=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var a=i[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ee=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||q},te=oe(0,0,0,0);function ne(e){return parseFloat(e)||0}function ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ne(e["border-"+n+"-width"])}),0)}var ae="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof ee(e).SVGGraphicsElement}:function(e){return e instanceof ee(e).SVGElement&&"function"==typeof e.getBBox};function re(e){return J?ae(e)?function(e){var t=e.getBBox();return oe(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return te;var i=ee(e).getComputedStyle(e),a=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var a=i[n],r=e["padding-"+a];t[a]=ne(r)}return t}(i),r=a.left+a.right,o=a.top+a.bottom,s=ne(i.width),l=ne(i.height);if("border-box"===i.boxSizing&&(Math.round(s+r)!==t&&(s-=ie(i,"left","right")+r),Math.round(l+o)!==n&&(l-=ie(i,"top","bottom")+o)),!function(e){return e===ee(e).document.documentElement}(e)){var c=Math.round(s+r)-t,u=Math.round(l+o)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return oe(a.left,a.top,s,l)}(e):te}function oe(e,t,n,i){return{x:e,y:t,width:n,height:i}}var se=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=re(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),le=function(e,t){var n,i,a,r,o,s,l,c=(i=(n=t).x,a=n.y,r=n.width,o=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),K(l,{x:i,y:a,width:r,height:o,top:a,right:i+r,bottom:o+a,left:i}),l);K(this,{target:e,contentRect:c})},ce=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new U,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new se(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new le(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ue="undefined"!=typeof WeakMap?new WeakMap:new U,he=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=$.getInstance(),i=new ce(t,n,this);ue.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){he.prototype[e]=function(){var t;return(t=ue.get(this))[e].apply(t,arguments)}}));var de=void 0!==q.ResizeObserver?q.ResizeObserver:he;function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},me.apply(this,arguments)}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),ye=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:ge,viewMax:ge}),ve=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),we=function(){function e(e){var t=this,n=e.scaleExtents,i=e.documentSize;fe(this,"_scaleExtents",void 0),fe(this,"_documentSize",void 0),fe(this,"_canvas",null),fe(this,"_view",{scale:1,x:0,y:0}),fe(this,"_viewChangeListeners",new Set),fe(this,"setScale",(function(e){t.setView({scale:e})})),fe(this,"clampView",(function(e){var n=e.scale,i=e.x,a=e.y,r=t.scaleExtents,o=r.min,s=r.max,l=t.documentSize,c=l.width,u=l.height,h=t.canvasRect||ye,d=h.left,m=h.top,p=h.right-d,f=h.bottom-m,g=p/2,y=-(c*t._view.scale-p/2),v=f/2,w=-(u*t._view.scale-f/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(i,y),g),y:Math.min(Math.max(a,w),v)}})),fe(this,"resetView",(function(){t.setView({scale:1,x:0,y:0})})),fe(this,"setView",(function(e){var n=t.clampView(me({},t._view,e||{})),i=t._view,a=i.scale,r=i.x,o=i.y;return n.scale===a&&n.x===r&&n.y===o||(t._view=n,t._viewChangeListeners.forEach((function(e){return e&&e(n)}))),me({},t._view)})),fe(this,"scaleAtClientPoint",(function(e,n){var i=t.clientPointToViewPoint(n),a=t.clampView(me({},t._view,{scale:t._view.scale+e})),r=t.viewPointToClientPoint(i,a);return a.x=t._view.x-(r.clientX-n.clientX),a.y=t._view.y-(r.clientY-n.clientY),t.setView(a)})),fe(this,"clientPointToViewPoint",(function(e,n){var i=e.clientX,a=e.clientY;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=i-r.left,s=a-r.top;return{x:(o-n.x)/n.scale,y:(s-n.y)/n.scale,relativeClientX:o,relativeClientY:s}})),fe(this,"viewPointToClientPoint",(function(e,n){var i=e.x,a=e.y;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=r.left,s=r.top,l=i*n.scale+n.x,c=a*n.scale+n.y,u=l+o,h=c+s;return{clientX:u,clientY:h,relativeX:l,relativeY:c,x:u,y:h}})),fe(this,"attachViewChangeListener",(function(e){t._viewChangeListeners.add(e)})),this._scaleExtents=n,this._documentSize=i}var t,n;return t=e,(n=[{key:"canvas",get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:"scale",get:function(){return this._view.scale}},{key:"x",get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:"y",get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:"view",get:function(){return me({},this._view)}},{key:"scaleExtents",get:function(){return me({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:"documentSize",get:function(){return me({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:"transformMatrix",get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:"canvasBounds",get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,i=e.right,a=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:i,clientY:a}),left:t,top:n,right:i,bottom:a,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}}},{key:"canvasRect",get:function(){return this.canvas?this.canvas.getBoundingClientRect():void 0}}])&&pe(t.prototype,n),e}();function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=function(e){e.preventDefault()},Ee=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){var i=n.props,a=i.disabled,r=i.enablePanAndZoom,o=i.mouseZoomFactor;return a?new xe:(r&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Ae(t))),e)})),be(this,"handleDrawStart",(function(e,t){return t.props.disabled?new xe:e.ctrlKey&&t.props.enablePanAndZoom?(new je).handleDrawStart(e,t):(new Me).handleDrawStart(e,t)})),be(this,"handleDrawMove",(function(t,n){if(n.props.disabled)return new xe;var i=Te(n.coordSystem,t),a=i.x,r=i.y;return n.lazy.update({x:a,y:r}),e})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?new xe:e}))},xe=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){return n.props.disabled?e:(new Ee).handleMouseWheel(t,n)})),be(this,"handleDrawStart",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawMove(t,n)})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawEnd(t,n)}))},je=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),e.dragStart=Ae(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Ae(t),a=i.clientX,r=i.clientY,o=a-e.dragStart.clientX,s=r-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e})),be(this,"handleDrawEnd",(function(){return new Ee}))},Me=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){var i=n.props.enablePanAndZoom;return t.preventDefault(),t.touches&&t.touches.length&&i?i&&t.touches&&t.touches.length>=2?(new Se).handleDrawStart(t,n):e.handleDrawMove(t,n):(new Ie).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return(new Se).handleDrawStart(t,n);var i=Ae(t);return e.deferredPoints.push(i),(new Date).valueOf()-e.startTimestamp<250&&(null===e.startClientPoint&&(e.startClientPoint=i),Math.abs(i.clientX-e.startClientPoint.clientX)+Math.abs(i.clientY-e.startClientPoint.clientY)<10)?e:e.issueDeferredPoints(n)})),be(this,"handleDrawEnd",(function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)})),be(this,"issueDeferredPoints",(function(t){for(var n=new Ie,i=0;i<e.deferredPoints.length;i++){var a=e.deferredPoints[i],r=new De(a);n=(0===i?n.handleDrawStart:n.handleDrawMove)(r,t)}return n})),this.startClientPoint=null,this.startTimestamp=(new Date).valueOf(),this.deferredPoints=[]},Se=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Ee:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Ee;var i=e.recentMetrics=e.getTouchMetrics(t),a=i.centroid,r=i.distance;if(Math.abs(r-e.start.distance)>=10)return new Ce(e).handleDrawMove(t,n);var o=a.clientX-e.start.centroid.clientX,s=a.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=10?new ke(e).handleDrawMove(t,n):e})),be(this,"handleDrawEnd",(function(){return new Ee})),be(this,"getTouchMetrics",(function(e){var t=Ae(e.touches[0]),n=t.clientX,i=t.clientY,a=Ae(e.touches[1]),r=a.clientX,o=a.clientY,s=r-n,l=o-i;return{t1:{clientX:n,clientY:i},t2:{clientX:r,clientY:o},distance:Math.sqrt(s*s+l*l),centroid:{clientX:(n+r)/2,clientY:(i+o)/2}}}))},ke=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=(a.distance,r.clientX-i.start.centroid.clientX),s=r.clientY-i.start.centroid.clientY;return n.setView({x:i.panStart.x+o,y:i.panStart.y+s}),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ce=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=a.distance,s=i.scaleStart*(o/i.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,r),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ie=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r},{both:!0})}return e.handleDrawMove(t,n)})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r});var o=!n.lazy.isEnabled();return e.isDrawing&&!o||(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e})),be(this,"handleDrawEnd",(function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Ee})),this.isDrawing=!1},De=function(e){var t=e.clientX,n=e.clientY;be(this,"preventDefault",(function(){})),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Ae(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Te(e,t){return e.clientPointToViewPoint(Ae(t))}var Le=!1;try{var Pe={get passive(){return Le=!0,!1}};window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(e){Le=!1}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Oe.apply(this,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var We={display:"block",position:"absolute"},Ye=["grid","drawing","temp","interface"],Fe=function(e){var t,n;function i(t){var n;return ze(Re(n=e.call(this,t)||this),"undo",(function(){var e=[];n.lines.length?e=n.lines.slice(0,-1):n.erasedLines.length&&(e=n.erasedLines.pop()),n.clearExceptErasedLines(),n.simulateDrawingLines({lines:e,immediate:!0}),n.triggerOnChange()})),ze(Re(n),"eraseAll",(function(){n.erasedLines.push([].concat(n.lines)),n.clearExceptErasedLines(),n.triggerOnChange()})),ze(Re(n),"clear",(function(){n.erasedLines=[],n.clearExceptErasedLines(),n.resetView()})),ze(Re(n),"resetView",(function(){return n.coordSystem.resetView()})),ze(Re(n),"setView",(function(e){return n.coordSystem.setView(e)})),ze(Re(n),"getSaveData",(function(){return JSON.stringify({lines:n.lines,width:n.props.canvasWidth,height:n.props.canvasHeight})})),ze(Re(n),"getDataURL",(function(e,t,i){var a=n.canvas.drawing,r=a.getContext("2d"),o=a.width,s=a.height,l=r.getImageData(0,0,o,s),c=r.globalCompositeOperation;if(r.globalCompositeOperation="destination-over",t){if(!n.props.imgSrc)return"Background image source not set";n.drawImage()}else null!=i&&(r.fillStyle=i,r.fillRect(0,0,o,s));e||(e="png");var u=a.toDataURL("image/"+e);return r.clearRect(0,0,o,s),r.putImageData(l,0,0),r.globalCompositeOperation=c,u})),ze(Re(n),"loadSaveData",(function(e,t){if(void 0===t&&(t=n.props.immediateLoading),"string"!=typeof e)throw new Error("saveData needs to be of type string!");var i=JSON.parse(e),a=i.lines,r=i.width,o=i.height;if(!a||"function"!=typeof a.push)throw new Error("saveData.lines needs to be an array!");if(n.clear(),r===n.props.canvasWidth&&o===n.props.canvasHeight)n.simulateDrawingLines({lines:a,immediate:t});else{var s=n.props.canvasWidth/r,l=n.props.canvasHeight/o,c=(s+l)/2;n.simulateDrawingLines({lines:a.map((function(e){return Oe({},e,{points:e.points.map((function(e){return{x:e.x*s,y:e.y*l}})),brushRadius:e.brushRadius*c})})),immediate:t})}})),ze(Re(n),"componentWillUnmount",(function(){n.canvasObserver.unobserve(n.canvasContainer),n.canvas.interface&&n.canvas.interface.removeEventListener("wheel",n.handleWheel)})),ze(Re(n),"handleWheel",(function(e){n.interactionSM=n.interactionSM.handleMouseWheel(e,Re(n))})),ze(Re(n),"handleDrawStart",(function(e){n.interactionSM=n.interactionSM.handleDrawStart(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawMove",(function(e){n.interactionSM=n.interactionSM.handleDrawMove(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawEnd",(function(e){n.interactionSM=n.interactionSM.handleDrawEnd(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"applyView",(function(){if(n.ctx.drawing&&(Ye.map((function(e){return n.ctx[e]})).forEach((function(e){n.clearWindow(e);var t=n.coordSystem.transformMatrix;e.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)})),!n.deferRedrawOnViewChange)){n.drawGrid(n.ctx.grid),n.redrawImage(),n.loop({once:!0});var e=n.lines;n.lines=[],n.simulateDrawingLines({lines:e,immediate:!0})}})),ze(Re(n),"handleCanvasResize",(function(e){var t=n.getSaveData();n.deferRedrawOnViewChange=!0;try{for(var i,a=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(i=a()).done;){var r=i.value.contentRect,o=r.width,s=r.height;n.setCanvasSize(n.canvas.interface,o,s),n.setCanvasSize(n.canvas.drawing,o,s),n.setCanvasSize(n.canvas.temp,o,s),n.setCanvasSize(n.canvas.grid,o,s),n.coordSystem.documentSize={width:o,height:s},n.drawGrid(n.ctx.grid),n.drawImage(),n.loop({once:!0})}n.loadSaveData(t,!0)}finally{n.deferRedrawOnViewChange=!1}})),ze(Re(n),"clampPointToDocument",(function(e){return n.props.clampLinesToDocument?{x:Math.max(Math.min(e.x,n.props.canvasWidth),0),y:Math.max(Math.min(e.y,n.props.canvasHeight),0)}:e})),ze(Re(n),"redrawImage",(function(){n.image&&n.image.complete&&function(e){var t=void 0===e?{}:e,n=t.ctx,i=t.img,a=t.x,r=t.y,o=t.w,s=t.h,l=t.offsetX,c=t.offsetY;"number"!=typeof a&&(a=0),"number"!=typeof r&&(r=0),"number"!=typeof o&&(o=n.canvas.width),"number"!=typeof s&&(s=n.canvas.height),"number"!=typeof l&&(l=.5),"number"!=typeof c&&(c=.5),l<0&&(l=0),c<0&&(c=0),l>1&&(l=1),c>1&&(c=1);var u,h,d,m,p=i.width,f=i.height,g=Math.min(o/p,s/f),y=p*g,v=f*g,w=1;y<o&&(w=o/y),Math.abs(w-1)<1e-14&&v<s&&(w=s/v),(u=(p-(d=p/((y*=w)/o)))*l)<0&&(u=0),(h=(f-(m=f/((v*=w)/s)))*c)<0&&(h=0),d>p&&(d=p),m>f&&(m=f),n.drawImage(i,u,h,d,m,a,r,o,s)}({ctx:n.ctx.grid,img:n.image})})),ze(Re(n),"simulateDrawingLines",(function(e){var t=e.lines,i=e.immediate,a=0,r=i?0:n.props.loadTimeOffset;t.forEach((function(e){var t=e.points,o=e.brushColor,s=e.brushRadius;if(i)return n.drawPoints({points:t,brushColor:o,brushRadius:s}),n.points=t,void n.saveLine({brushColor:o,brushRadius:s});for(var l=function(e){a+=r,window.setTimeout((function(){n.drawPoints({points:t.slice(0,e+1),brushColor:o,brushRadius:s})}),a)},c=1;c<t.length;c++)l(c);a+=r,window.setTimeout((function(){n.points=t,n.saveLine({brushColor:o,brushRadius:s})}),a)}))})),ze(Re(n),"setCanvasSize",(function(e,t,n){e.width=t,e.height=n,e.style.width=t,e.style.height=n})),ze(Re(n),"drawPoints",(function(e){var t=e.points,i=e.brushColor,a=e.brushRadius;n.ctx.temp.lineJoin="round",n.ctx.temp.lineCap="round",n.ctx.temp.strokeStyle=i,n.clearWindow(n.ctx.temp),n.ctx.temp.lineWidth=2*a;var r=t[0],o=t[1];n.ctx.temp.moveTo(o.x,o.y),n.ctx.temp.beginPath();for(var s=1,l=t.length;s<l;s++){var c=Be(r,o);n.ctx.temp.quadraticCurveTo(r.x,r.y,c.x,c.y),r=t[s],o=t[s+1]}n.ctx.temp.lineTo(r.x,r.y),n.ctx.temp.stroke()})),ze(Re(n),"saveLine",(function(e){var t=void 0===e?{}:e,i=t.brushColor,a=t.brushRadius;n.points.length<2||(n.lines.push({points:[].concat(n.points),brushColor:i||n.props.brushColor,brushRadius:a||n.props.brushRadius}),n.points.length=0,n.inClientSpace([n.ctx.drawing,n.ctx.temp],(function(){n.ctx.drawing.drawImage(n.canvas.temp,0,0,n.canvas.drawing.width,n.canvas.drawing.height)})),n.clearWindow(n.ctx.temp),n.triggerOnChange())})),ze(Re(n),"triggerOnChange",(function(){n.props.onChange&&n.props.onChange(Re(n))})),ze(Re(n),"clearWindow",(function(e){n.inClientSpace([e],(function(){return e.clearRect(0,0,e.canvas.width,e.canvas.height)}))})),ze(Re(n),"clearExceptErasedLines",(function(){n.lines=[],n.valuesChanged=!0,n.clearWindow(n.ctx.drawing),n.clearWindow(n.ctx.temp)})),ze(Re(n),"loop",(function(e){var t=(void 0===e?{}:e).once,i=void 0!==t&&t;if(n.lazy&&(n.mouseHasMoved||n.valuesChanged)){var a=n.lazy.getPointerCoordinates(),r=n.lazy.getBrushCoordinates();n.drawInterface(n.ctx.interface,a,r),n.mouseHasMoved=!1,n.valuesChanged=!1}i||window.requestAnimationFrame((function(){n.loop()}))})),ze(Re(n),"inClientSpace",(function(e,t){e.forEach((function(e){e.save(),e.setTransform(ve.a,ve.b,ve.c,ve.d,ve.e,ve.f)}));try{t()}finally{e.forEach((function(e){return e.restore()}))}})),ze(Re(n),"drawImage",(function(){n.props.imgSrc&&(n.image=new Image,n.image.crossOrigin="anonymous",n.image.onload=n.redrawImage,n.image.src=n.props.imgSrc)})),ze(Re(n),"drawGrid",(function(e){if(!n.props.hideGrid){n.clearWindow(e);var t=25,i=n.coordSystem.canvasBounds,a=i.viewMin,r=i.viewMax,o=Math.floor(a.x/t-1)*t,s=Math.floor(a.y/t-1)*t,l=r.x+t,c=r.y+t;if(e.beginPath(),e.setLineDash([5,1]),e.setLineDash([]),e.strokeStyle=n.props.gridColor,e.lineWidth=n.props.gridLineWidth,!n.props.hideGridX){for(var u=o,h=n.props.gridSizeX;u<l;)u+=h,e.moveTo(u,s),e.lineTo(u,c);e.stroke()}if(!n.props.hideGridY){for(var d=s,m=n.props.gridSizeY;d<c;)d+=m,e.moveTo(o,d),e.lineTo(l,d);e.stroke()}}})),ze(Re(n),"drawInterface",(function(e,t,i){n.props.hideInterface||(n.clearWindow(e),e.beginPath(),e.fillStyle=n.props.brushColor,e.arc(i.x,i.y,n.props.brushRadius,0,2*Math.PI,!0),e.fill(),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(t.x,t.y,4,0,2*Math.PI,!0),e.fill(),n.lazy.isEnabled()&&(e.beginPath(),e.lineWidth=2,e.lineCap="round",e.setLineDash([2,4]),e.strokeStyle=n.props.catenaryColor,n.catenary.drawToCanvas(n.ctx.interface,i,t,n.chainLength),e.stroke()),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(i.x,i.y,2,0,2*Math.PI,!0),e.fill())})),n.canvas={},n.ctx={},n.catenary=new H.oT,n.points=[],n.lines=[],n.erasedLines=[],n.mouseHasMoved=!0,n.valuesChanged=!0,n.isDrawing=!1,n.isPressing=!1,n.deferRedrawOnViewChange=!1,n.interactionSM=new Ee,n.coordSystem=new we({scaleExtents:t.zoomExtents,documentSize:{width:t.canvasWidth,height:t.canvasHeight}}),n.coordSystem.attachViewChangeListener(n.applyView.bind(Re(n))),n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.componentDidMount=function(){var e,t=this;this.lazy=new G.xv({radius:this.props.lazyRadius*window.devicePixelRatio,enabled:!0,initialPoint:{x:window.innerWidth/2,y:window.innerHeight/2}}),this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.canvasObserver=new de((function(e,n){return t.handleCanvasResize(e,n)})),this.canvasObserver.observe(this.canvasContainer),this.drawImage(),this.loop(),window.setTimeout((function(){var e=window.innerWidth/2,n=window.innerHeight/2;t.lazy.update({x:e-t.chainLength/4,y:n},{both:!0}),t.lazy.update({x:e+t.chainLength/4,y:n},{both:!1}),t.mouseHasMoved=!0,t.valuesChanged=!0,t.clearExceptErasedLines(),t.props.saveData&&t.loadSaveData(t.props.saveData)}),100),this.canvas.interface&&this.canvas.interface.addEventListener("wheel",this.handleWheel,Le?{passive:e}:e)},a.componentDidUpdate=function(e){e.lazyRadius!==this.props.lazyRadius&&(this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.lazy.setRadius(this.props.lazyRadius*window.devicePixelRatio)),e.saveData!==this.props.saveData&&this.loadSaveData(this.props.saveData),JSON.stringify(e)!==JSON.stringify(this.props)&&(this.valuesChanged=!0),this.coordSystem.scaleExtents=this.props.zoomExtents,this.props.enablePanAndZoom||this.coordSystem.resetView(),e.imgSrc!==this.props.imgSrc&&this.drawImage()},a.render=function(){var e=this;return I().createElement("div",{className:this.props.className,style:Oe({display:"block",background:this.props.backgroundColor,touchAction:"none",width:this.props.canvasWidth,height:this.props.canvasHeight},this.props.style),ref:function(t){t&&(e.canvasContainer=t)}},Ye.map((function(t){var n="interface"===t;return I().createElement("canvas",{key:t,ref:function(i){i&&(e.canvas[t]=i,e.ctx[t]=i.getContext("2d"),n&&(e.coordSystem.canvas=i))},style:Oe({},We),onMouseDown:n?e.handleDrawStart:void 0,onMouseMove:n?e.handleDrawMove:void 0,onMouseUp:n?e.handleDrawEnd:void 0,onMouseOut:n?e.handleDrawEnd:void 0,onTouchStart:n?e.handleDrawStart:void 0,onTouchMove:n?e.handleDrawMove:void 0,onTouchEnd:n?e.handleDrawEnd:void 0,onTouchCancel:n?e.handleDrawEnd:void 0})})))},i}(C.PureComponent);ze(Fe,"defaultProps",{onChange:null,loadTimeOffset:5,lazyRadius:12,brushRadius:10,brushColor:"#444",catenaryColor:"#0a0302",gridColor:"rgba(150,150,150,0.17)",backgroundColor:"#FFF",hideGrid:!1,canvasWidth:400,canvasHeight:400,disabled:!1,imgSrc:"",saveData:"",immediateLoading:!1,hideInterface:!1,gridSizeX:25,gridSizeY:25,gridLineWidth:.5,hideGridX:!1,hideGridY:!1,enablePanAndZoom:!1,mouseZoomFactor:.01,zoomExtents:{min:.33,max:3},clampLinesToDocument:!1}),Fe.propTypes={};function Ve(e){const n=function(e){const[n,i]=(0,t.useState)({windowWidth:window.innerWidth,isDesiredWidth:window.innerWidth<e});return(0,t.useEffect)((()=>{const t=()=>{const t=window.innerWidth;i({windowWidth:t,isDesiredWidth:t<e})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[n.windowWidth]),n.isDesiredWidth}(600),[a,o]=(0,t.useState)(n?.6:1),[s,l]=(0,t.useState)(!1),[c,h]=(0,t.useState)(null),[d,m]=(0,t.useState)(null),[p,g]=(0,t.useState)(25),[y,v]=(0,t.useState)(e.prompt),[w,b]=(0,t.useState)(512*a),[_,E]=(0,t.useState)(512*a),[x,j]=(0,t.useState)(512),[M,S]=(0,t.useState)(512),[k,C]=(0,t.useState)(null);return(0,t.useEffect)((()=>{o(n?.6:1)}),[n]),(0,t.useEffect)((()=>{C(null==c?void 0:c.getSaveData()),"3:2"===e.queryRatio?(b(341*a),E(512*a),j(512),S(768)):"2:3"===e.queryRatio?(n?(b(768*a),E(512*a)):(b(512*a),E(341*a)),j(768),S(512)):(b(512*a),E(512*a)),g((e=>e*a)),null==c||c.clear()}),[a]),(0,t.useEffect)((()=>{null==c||c.loadSaveData(k,!0)}),[_]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>l(!0),icon:Y,label:(0,i.__)("Touchup (beta)","imajinn-ai")}),s&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:()=>l(!1),className:"imajinn-inpainting-modal",shouldCloseOnClickOutside:!0,title:(0,i.__)("Touchup Image Editor (beta)","imajinn-ai")}),(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,null,(0,t.createElement)(Fe,{style:{position:"relative"},ref:e=>h(e),imgSrc:e.src,brushRadius:p,lazyRadius:0,hideInterface:!0,brushColor:"rgba(180,0,0,0.75)",canvasWidth:_,canvasHeight:w})),(0,t.createElement)(r.CardFooter,null,(0,t.createElement)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-brush-size",label:(0,i.__)("Select the brush size","imajinn-ai"),defaultChecked:p,onChange:g,checked:p},(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Small","imajinn-ai"),className:"brush-sm",value:10*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Medium","imajinn-ai"),className:"brush-md",value:25*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("large","imajinn-ai"),className:"brush-lg",value:40*a},(0,t.createElement)(r.Icon,{icon:Y}))))),null),(0,t.createElement)(f,{isMobile:n}),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(r.Button,{icon:F,label:(0,i.__)("Reset","imajinn-ai"),onClick:()=>{c.eraseAll()}}),(0,t.createElement)(r.Button,{icon:V,label:(0,i.__)("Undo","imajinn-ai"),onClick:()=>{c.undo()}})))),(0,t.createElement)(r.TextareaControl,{rows:3,maxLength:450,value:y,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Modified prompt describing the entire image and the masked area:","imajinn-ai")),className:"text-prompt",onFocus:e=>e.target.select(),onChange:e=>v(e)}),(0,t.createElement)(r.Flex,{wrap:!1},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>l(!1)},(0,i.__)("Cancel","imajinn-ai"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"primary",onClick:()=>{const t=new Image;t.onload=()=>{const n=document.createElement("canvas");n.width=M,n.height=x;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height,0,0,M,x);let a=i.getImageData(0,0,n.width,n.height),r=0;for(r=0;r<a.data.length;r+=4){let e=0;a.data[r]+a.data[r+1]+a.data[r+2]>383&&(e=255),a.data[r]=e,a.data[r+1]=e,a.data[r+2]=e,a.data[r+3]=255}i.putImageData(a,0,0);const o=n.toDataURL("image/png");n.remove(),e.setRatio(e.queryRatio),e.startJob(e.src,o,e.queryRatio,y),e.setPrompt(y)},d.clear(),d.loadSaveData(c.getSaveData(),!0),t.src=d.getDataURL("png",!1,"#ffffff")}},(0,i.__)("Generate","imajinn-ai")))),(0,t.createElement)(Fe,{style:{visibility:"hidden",position:"absolute",top:"-99999px",left:"-99999px"},disabled:!0,hideGrid:!0,ref:e=>m(e),canvasWidth:M,canvasHeight:x})))}var Ge=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),He=e=>{let{generations:n,setGenerations:a,faceFixed:o,setFaceFixed:s,setError:l,...c}=e;const[u,h]=(0,C.useState)(!1),[d,m]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{o.some((e=>e.index===c.genindex))?(m(!0),h(!1)):(m(!1),h(!1))}),[o]),u?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Repairing","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:d,icon:Ge,label:(0,i.__)("Face Repair","imajinn-ai"),onClick:async()=>{h(!0),await(async e=>{let t=n[e].jpg;l(null);const r=await fetch(`${ajaxurl}?action=imajinn-face-repair`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,nonce:IMAJINN.nonce})}),o=await r.json();return o.success?(s((t=>[...t,{index:e}])),a((t=>(t[e]=o.data.image,[...t]))),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Face repair completed.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),o.data):(l(o.data[0].message),!1)})(c.genindex)||h(!1)}})},Ue=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"})),Je=e=>{let n=e.generations[e.genindex].jpg;return(0,t.createElement)(r.Button,{icon:Ue,label:(0,i.__)("Generate Variations","imajinn-ai"),onClick:()=>{e.setRatio(e.queryRatio),e.startJob(n,null,e.queryRatio)}})},qe=e=>{let{...n}=e;return(0,t.createElement)(r.CardFooter,null,(0,t.createElement)(r.ButtonGroup,{className:"imajinn-image-actions"},(0,t.createElement)(r.Button,{href:`${ajaxurl}?action=imajinn-tweet&image=${n.src}`,target:"_blank",icon:W,label:(0,i.__)("Share on Twitter","imajinn-ai")}),(0,t.createElement)(Je,n),(0,t.createElement)(He,n),(0,t.createElement)(Ve,u({},n,{src:n.generations[n.genindex].jpg}))),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(B,n),(0,t.createElement)(O,n)))},Ze=e=>{let{setSelectedImage:n,...i}=e;const[a,o]=(0,t.useState)("300px"),[s,l]=(0,t.useState)("300px");(0,t.useEffect)((()=>{"3:2"===i.queryRatio?(l("200px"),o("300px")):"2:3"===i.queryRatio?(l("450px"),o("300px")):(l("300px"),o("300px"))}),[i.generations,i.queryRatio]);const c=e=>{let{...i}=e;return(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,{className:"loop-show",style:{width:i.width,height:i.height,position:"relative",cursor:"pointer"}},(0,t.createElement)("div",{className:"loop-icon",onClick:()=>n(i.genindex)},(0,t.createElement)("div",null,(0,t.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBmaWxsLXJ1bGU9ImV2ZW5vZGQiCiAgICBjbGlwLXJ1bGU9ImV2ZW5vZGQiCiAgICBkPSJNMTguMzE5IDE0LjQzMjZDMjAuNzYyOCAxMS4yOTQxIDIwLjU0MiA2Ljc1MzQ3IDE3LjY1NjkgMy44NjgyOUMxNC41MzI3IDAuNzQ0MDk4IDkuNDY3MzQgMC43NDQwOTggNi4zNDMxNSAzLjg2ODI5QzMuMjE4OTUgNi45OTI0OSAzLjIxODk1IDEyLjA1NzggNi4zNDMxNSAxNS4xODJDOS4yMjgzMyAxOC4wNjcyIDEzLjc2OSAxOC4yODc5IDE2LjkwNzUgMTUuODQ0MkMxNi45MjEgMTUuODU5NSAxNi45MzUxIDE1Ljg3NDUgMTYuOTQ5NyAxNS44ODkxTDIxLjE5MjQgMjAuMTMxN0MyMS41ODI5IDIwLjUyMjMgMjIuMjE2MSAyMC41MjIzIDIyLjYwNjYgMjAuMTMxN0MyMi45OTcxIDE5Ljc0MTIgMjIuOTk3MSAxOS4xMDgxIDIyLjYwNjYgMTguNzE3NUwxOC4zNjQgMTQuNDc0OUMxOC4zNDkzIDE0LjQ2MDMgMTguMzM0MyAxNC40NDYyIDE4LjMxOSAxNC40MzI2Wk0xNi4yNDI2IDUuMjgyNTFDMTguNTg1OCA3LjYyNTY1IDE4LjU4NTggMTEuNDI0NiAxNi4yNDI2IDEzLjc2NzhDMTMuODk5NSAxNi4xMTA5IDEwLjEwMDUgMTYuMTEwOSA3Ljc1NzM2IDEzLjc2NzhDNS40MTQyMSAxMS40MjQ2IDUuNDE0MjEgNy42MjU2NSA3Ljc1NzM2IDUuMjgyNTFDMTAuMTAwNSAyLjkzOTM2IDEzLjg5OTUgMi45MzkzNiAxNi4yNDI2IDUuMjgyNTFaIgogICAgZmlsbD0id2hpdGUiCiAgLz4KPC9zdmc+"}))),(0,t.createElement)("img",{className:"generation-zoom",alt:i.alt||i.label,src:i.src,width:i.width,height:i.height})),(0,t.createElement)(qe,i))};return(0,t.createElement)("div",{className:"results-grid",style:{gridTemplateColumns:!IMAJINN.custom_editor&&"1fr 1fr"}},i.generations&&i.generations.map(((e,n)=>(0,t.createElement)("div",{style:{minWidth:a,flexGrow:1},key:n},(0,t.createElement)(c,u({src:e.preview,genindex:n,width:a,height:s,label:"Result "+(n+1).toString()},i))))))},Xe=e=>{let{status:n,progress:a,cancelJob:o}=e;const s="processing"===n?(0,i.sprintf)((0,i.__)("Generating %s%%","imajinn-ai"),a):(0,i.__)("Queued","imajinn-ai");return(0,t.createElement)("div",{className:"imajinn-loading"},(0,t.createElement)(c.ZZ,null),(0,t.createElement)("div",null,(0,t.createElement)(r.__experimentalText,null,s),(0,t.createElement)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>{o()}},(0,i.__)("Cancel"))))},Qe=e=>{let{deleteBlock:n}=e;return(0,t.createElement)("div",{className:"corner-controls"},(0,t.createElement)(p,null),(0,t.createElement)(r.Button,{className:"imajinn-close-button",icon:s,label:(0,i.__)("Close Imajinn Block","imajinn-ai"),onClick:()=>{n()}}))},$e=function(e){let{showWelcome:n,setShowWelcome:a,...o}=e;const[s,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{l(n)}),[n]),(0,t.createElement)(t.Fragment,null,s&&(0,t.createElement)(r.Modal,u({},o,{isDismissible:!1,style:{maxWidth:"900px"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("Getting Started","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Welcome to Imajinn! Here are some quick tips to get you started so you can create the best images possible.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Do:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Write a detailed and descriptive prompt in English.","imajinn-ai"),(0,t.createElement)(m,null)),(0,t.createElement)("li",null,(0,i.__)("Use Prompt Genie or our style dropdowns for the best results.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Only use 3:2 or 2:3 ratios to generate images with smaller or multiple details, not a single object.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Think like the AI not a human: What text would you find online associated with the image you want to create?","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Do Not:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Try to generate photo-realistic human faces or bodies, they will look deformed. Stick to artistic styles for images with people.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Expect to be able to create legible words, text, or logos. They will be gibberish.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Use 3:2 or 2:3 ratio for images with a single object or subject, as that tends to create strange duplications. It is best to use 1:1 for those types of images.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Write your prompts in a language other than English. Sorry, the model was trained on primarily English image descriptions (automatic translation coming soon).","imajinn-ai"))),(0,t.createElement)("div",{className:"imajinn-starting-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",onClick:async()=>{a(!1);const e=await fetch(`${ajaxurl}?action=imajinn-dismiss-welcome`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})});return!!(await e.json()).success&&(IMAJINN.show_welcome=!1,!0)}},(0,i.__)("Got it!","imajinn-ai")),(0,t.createElement)(p,null))))};(0,e.registerBlockType)(l,{edit:function(){const[e,n]=(0,t.useState)(IMAJINN.connected),[o,u]=(0,t.useState)(!1),[h,d]=(0,t.useState)(null),[p,f]=(0,t.useState)(null),[v,x]=(0,t.useState)([]),[j,S]=(0,t.useState)(IMAJINN.history),[C,I]=(0,t.useState)(null),[N,O]=(0,t.useState)(0),[R,z]=(0,t.useState)(""),[B,W]=(0,t.useState)(""),[Y,F]=(0,t.useState)("1:1"),[V,G]=(0,t.useState)(Y),[H,U]=(0,t.useState)(IMAJINN.remaining_credits),[J,q]=(0,t.useState)(!1),[Z,X]=(0,t.useState)(IMAJINN.show_welcome),[Q,$]=(0,t.useState)(""),[K,ee]=(0,t.useState)(""),[te,ne]=(0,t.useState)(""),[ie,ae]=(0,t.useState)(!1),[re,oe]=(0,t.useState)([]),[se,le]=(0,t.useState)([]),[ce,ue]=(0,t.useState)(null);(0,t.useEffect)((()=>()=>{ae(!1)}),[R,B,Y]),(0,t.useEffect)((()=>{IMAJINN.remaining_credits=H,H>0&&q(!1)}),[H]),(0,t.useEffect)((()=>{IMAJINN.history=j}),[j]),(0,t.useEffect)((()=>{W([Q,K,te].filter(Boolean).join(", "))}),[Q,K,te]);const he=(0,a.useBlockProps)(),de=(e,t,n,i,a)=>{if(H<=0&&pe(),H-1<0)return q(!0),!1;const r=e||null,o=t||null,s=n||Y,l=i||R,c=a||B;f(null),x([]),le([]),oe([]),G(s),u(!0),d(null),O(0),fetch(`${ajaxurl}?action=imajinn-start-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,prompt_style:c,ratio:s,num_variations:4,init_image:r,mask:o,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((e=>{e.success?(f(e.data.job_id),I(e.data.status),U(e.data.remaining_credits),O(e.data.progress),me(e.data.job_id)):(u(!1),f(null),I(null),d(e.data[0].message))})).catch((e=>{u(!1),f(null),I(null),d(e)}))},me=async e=>{if(!e)return u(!1),f(null),!1;setTimeout((async()=>{const t=await fetch(`${ajaxurl}?action=imajinn-check-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:e,nonce:IMAJINN.nonce})}),n=await t.json();n.success?(I(n.data.status),O(n.data.progress),U(n.data.remaining_credits),"succeeded"===n.data.status?(x(n.data.generations),S((e=>[n.data.history,...e])),ae(!0)):"failed"===n.data.status&&(d(n.data.error),I(null),u(!1),f(null),ae(!0)),"starting"===n.data.status||"processing"===n.data.status?me(e):(I(null),u(!1),f(null),ae(!0))):(I(null),u(!1),f(null),d(n.data[0].message),ae(!0))}),4e3)},pe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?U(t.data.remaining_credits):d(t.data[0].message)},fe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-account-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?window.open(t.data.account_url,"_blank"):d(t.data[0].message)},ge=v.length?"":l.description,ye=()=>{$(""),ee(""),ne(""),W("")};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(_,{image:ce,setImage:ue,generations:v}),(0,t.createElement)("figure",he,(0,t.createElement)(D,{refreshInfo:pe,isConnected:e,credits:H,visitAccount:fe}),e&&(0,t.createElement)(E,{history:j,setPrompt:z,setPromptStyle:W,setGenerations:x,setRatio:F,clearStyles:ye,setQueryRatio:G,setSaved:oe,setFaceFixed:le}),(0,t.createElement)(r.Placeholder,{icon:IMAJINN.custom_editor?null:c.mC,instructions:ge,label:IMAJINN.custom_editor?null:(0,i.__)("AI Text-to-Image Generator","imajinn-ai")},!e&&(0,t.createElement)(w,{setCredits:U,isConnected:e,setIsConnected:n}),e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(k,{showUpgrade:J,setShowUpgrade:q}),(0,t.createElement)($e,{showWelcome:Z,setShowWelcome:X}),h&&(0,t.createElement)(P,{hasError:h}),o&&(0,t.createElement)(Xe,{status:C,progress:N,cancelJob:async()=>{if(!p)return d("Error: No job id"),!1;const e=await fetch(`${ajaxurl}?action=imajinn-cancel-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:p,nonce:IMAJINN.nonce})}),t=await e.json();t.success?(I(null),u(!1),f(null),U(t.data.remaining_credits)):d(t.data[0].message)}}),(0,t.createElement)(Ze,{prompt:R,setPrompt:z,saved:re,queryRatio:V,setRatio:F,faceFixed:se,setFaceFixed:le,generations:v,setGenerations:x,startJob:de,saveImage:async e=>{let t=v[e].jpg;const n=await fetch(`${ajaxurl}?action=imajinn-save-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t,prompt:R,post_id:wp.data.select("core/editor").getCurrentPostId(),nonce:IMAJINN.nonce})}),a=await n.json();return!!a.success&&(oe((t=>[...t,{index:e,data:a.data}])),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Image saved to media library.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),a.data)},setSelectedImage:ue,setError:d}),(0,t.createElement)("div",{className:"prompt-form"},(0,t.createElement)(r.TextareaControl,{disabled:o,rows:2,maxLength:450,value:R,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Prompt - Enter a detailed English description of the image you would like to generate.","imajinn-ai"),(0,t.createElement)(m,null)),className:"text-prompt",onChange:e=>z(e),onFocus:e=>e.target.select()}),(0,t.createElement)(r.__experimentalText,{className:"prompt-style",numberOfLines:2,truncate:!0},B),(0,t.createElement)("div",{className:"styles-form"},(0,t.createElement)(g,{prompt:R,setPrompt:z,setPromptStyle:W,startJob:de,setError:d,clearStyles:ye,isLoading:o}),(0,t.createElement)(A,{setImageStyle:$,isLoading:o,imageStyle:Q,optionData:b}),(0,t.createElement)(T,{setImageArtist:ee,isLoading:o,imageArtist:K,optionData:b}),(0,t.createElement)(L,{setImageModifier:ne,isLoading:o,imageModifier:te,optionData:b}),(0,t.createElement)(r.Button,{icon:s,disabled:o,label:(0,i._x)("Clear styles","clear the image style selects","imajinn-ai"),onClick:ye}))),(0,t.createElement)(r.Flex,{align:"top",wrap:"true"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(M,{ratio:Y,setRatio:F,isLoading:o})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{isPrimary:!0,disabled:o,onClick:()=>de()},(0,i.__)(ie?"Generate More":"Generate","imajinn-ai"))))),!IMAJINN.custom_editor&&(0,t.createElement)(Qe,{deleteBlock:()=>{const{removeBlocks:e}=wp.data.dispatch("core/block-editor");e(wp.data.select("core/block-editor").getSelectedBlockClientIds())}})),(0,t.createElement)("div",{className:"imajinn-footer"},(0,t.createElement)(r.Button,{onClick:()=>{fe()}},(0,i.__)("Account","imajinn-ai")),(0,t.createElement)(y,null),(0,t.createElement)("a",{href:"https://infiniteuploads.com/support/",target:"_blank"},(0,i.__)("Support","imajinn-ai")),(0,t.createElement)("span",{className:"imajinn-credits"},(0,i._x)("Made with ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)(r.Dashicon,{icon:"heart","aria-label":(0,i._x)("love","Made with love by Infinite Uploads","imajinn-ai")}),(0,i._x)(" by ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)("a",{href:"https://infiniteuploads.com/",target:"_blank"},"Infinite Uploads")))))},save:function(){return null},icon:c.DT})}()}();1 !function(){"use strict";var e={352:function(e,t,n){n.d(t,{DT:function(){return a},ZZ:function(){return o},mC:function(){return r}});var i=n(307);function a(e){const t=e.iconSize||30;return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68.99 99",height:t,width:t},(0,i.createElement)("path",{d:"M65.19,60.78c3.9-3.9,6.19-17.59-.2-23.67-4.3-2.8-10.87,1.08-18.09,.8-.51-.02-1.02,.07-1.49,.26-.67,.28-1.44,.72-2.26,1.42-2.56,2.19-5.99,3.51-8.31,2.21-1.84-1.23-1.39-3.92-1.31-4.32-3.97,.8-4.55-.88-8.17,.24-6.84,2.12-18.72,17.38-9.96,22.27,3.89,1.73,11.79,.79,11.79,.79,0,0,6.33,8.55,.95,12.41-5.03,3.61-9.48-.45-15.51-.97-12.95-1.21-19.27,16.96-2.54,26.78-3.64-6.18-4.42-14.42,3.76-14.42,5.68,0,13.27,8.43,24.48,7.03,9.69-1.21,13.03-5.15,17.38-16.07,2.01-4.71,6.92-10.71,6.92-10.71-6.91,2.54-10.67-.61-14.5-1.96-3.83-1.34-8.87-2.09-8.87-2.09,6.29,0,11.48,2.43,15.72,3.05,4.07,.6,7.6-.43,10.22-3.05Z"}),(0,i.createElement)("path",{d:"M54.55,13.82c-2.78-2.37-5.77-6.73-8.76-7.16-4.03-.58-5.66,1.64-6.51,4.46,0-.19-.01-.38-.03-.57L38.55,.04c0-.05-.08-.05-.08,0l-.88,10.25c-.1,1.36,.04,2.72,.4,4.03l.58,1.15c-.02,.39-.01,.62-.01,.62-1.14,1.24-1.97,3.51-2.59,5.14l.53,1.44s.1,2.24-1.84,4.55c0,0-1.2,1.43-1.34,1.77-.17,.4-.16,.96,.47,1.01,.64,.05,2.02,.23,2.02,.23l-.03,2.06c0,.58,.27,2.39,.42,2.86,.58,1.79,.37,3.29-.15,3.43-1.56,.45-1.92-1.14-1.92-1.14,0,0-1.22,4.58,3.55,3.85,3.06-.47,4.72-4.09,7.57-5.19h0c.18-.07,.36-.1,.55-.11,4.53-.1,7.41-.84,7.93-3.92,4.84-.42,6.65-2.72,7.81-7.44,1.21-4.91-2.73-7.17-7.01-10.81Z"}))}function r(){return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55.435381255341",height:"60",viewBox:"0 0 1167.58 1263.72",version:"1.1"},(0,i.createElement)("defs",null,(0,i.createElement)("clipPath",{id:"clip1"},(0,i.createElement)("path",{d:"M 525 1006 L 595 1006 L 595 1263.71875 L 525 1263.71875 Z M 525 1006 "})),(0,i.createElement)("clipPath",{id:"clip2"},(0,i.createElement)("path",{d:"M 1018 1006 L 1167.578125 1006 L 1167.578125 1212 L 1018 1212 Z M 1018 1006 "}))),(0,i.createElement)("g",{id:"surface1"},(0,i.createElement)("path",{d:"M 883.503906 564.917969 C 919.703125 528.71875 941.007813 401.410156 881.6875 344.964844 C 841.726563 318.957031 780.652344 354.957031 713.5625 352.410156 C 708.824219 352.230469 704.105469 353.039063 699.722656 354.847656 C 693.507813 357.414063 686.355469 361.507813 678.730469 368.042969 C 654.972656 388.40625 623.070313 400.625 601.488281 388.585938 C 584.429688 377.132813 588.597656 352.140625 589.332031 348.394531 C 552.476563 355.824219 547.042969 340.191406 513.355469 350.644531 C 449.75 370.382813 339.335938 512.171875 420.820313 557.613281 C 456.992188 573.714844 530.402344 564.917969 530.402344 564.917969 C 530.402344 564.917969 589.253906 644.367188 539.238281 680.246094 C 492.445313 713.808594 451.089844 676.105469 395.078125 671.234375 C 274.757813 660.003906 216.007813 828.910156 371.429688 920.136719 C 337.640625 862.695313 330.320313 786.113281 406.339844 786.113281 C 459.125 786.113281 529.695313 864.453125 633.84375 851.433594 C 723.941406 840.171875 754.910156 803.570313 795.363281 702.039063 C 814.039063 658.285156 859.652344 602.535156 859.652344 602.535156 C 795.457031 626.1875 760.519531 596.839844 724.90625 584.359375 C 689.289063 571.878906 642.421875 564.917969 642.421875 564.917969 C 700.839844 564.917969 749.109375 587.472656 788.523438 593.257813 C 826.324219 598.800781 859.152344 589.269531 883.503906 564.917969 "}),(0,i.createElement)("path",{d:"M 784.621094 128.429688 C 758.757813 106.421875 730.980469 65.921875 703.167969 61.910156 C 665.6875 56.5 650.527344 77.128906 642.636719 103.398438 C 642.59375 101.628906 642.523438 99.859375 642.386719 98.089844 L 635.902344 0.351563 C 635.871094 -0.121094 635.1875 -0.121094 635.15625 0.351563 L 626.976563 95.570313 C 626.089844 108.179688 627.359375 120.851563 630.730469 133.03125 L 636.097656 143.699219 C 635.9375 147.328125 635.964844 149.46875 635.964844 149.46875 C 625.332031 161.011719 617.640625 182.050781 611.933594 197.261719 L 616.851563 210.640625 C 616.851563 210.640625 617.800781 231.441406 599.78125 252.960938 C 599.78125 252.960938 588.667969 266.253906 587.359375 269.429688 C 585.824219 273.152344 585.828125 278.3125 591.742188 278.785156 C 597.652344 279.257813 610.558594 280.914063 610.558594 280.914063 L 610.324219 300.066406 C 610.324219 305.457031 612.859375 322.316406 614.246094 326.636719 C 619.597656 343.292969 617.640625 357.179688 612.886719 358.539063 C 598.386719 362.683594 595.0625 347.902344 595.0625 347.902344 C 595.0625 347.902344 583.699219 390.441406 628.046875 383.652344 C 656.480469 379.300781 671.941406 345.640625 698.414063 335.460938 C 700.050781 334.828125 701.785156 334.496094 703.539063 334.457031 C 745.660156 333.558594 772.402344 326.636719 777.207031 298.027344 C 822.210938 294.09375 838.976563 272.722656 849.785156 228.890625 C 861.050781 183.21875 824.402344 162.28125 784.621094 128.429688 "}),(0,i.createElement)("path",{d:"M 0 1211.832031 L 0 1006.238281 L 14.34375 1006.238281 L 14.34375 1211.832031 L 0 1211.832031 "}),(0,i.createElement)("path",{d:"M 191.785156 1211.832031 L 115.144531 1021.988281 L 114.019531 1021.988281 C 114.769531 1033.609375 115.144531 1045.519531 115.144531 1057.710938 L 115.144531 1211.832031 L 101.363281 1211.832031 L 101.363281 1006.238281 L 123.582031 1006.238281 L 196.425781 1187.082031 L 197.269531 1187.082031 L 270.113281 1006.238281 L 291.769531 1006.238281 L 291.769531 1211.832031 L 277.285156 1211.832031 L 277.285156 1056.019531 C 277.285156 1045.140625 277.847656 1033.890625 278.972656 1022.269531 L 277.847656 1022.269531 L 200.925781 1211.832031 L 191.785156 1211.832031 "}),(0,i.createElement)("path",{d:"M 399.320313 1126.328125 L 472.867188 1126.328125 L 444.882813 1052.21875 C 442.535156 1046.410156 439.722656 1038.351563 436.445313 1028.03125 C 433.914063 1037.03125 431.144531 1045.191406 428.148438 1052.5 Z M 477.648438 1139.269531 L 394.117188 1139.269531 L 365.429688 1211.832031 L 349.539063 1211.832031 L 432.226563 1005.390625 L 441.367188 1005.390625 L 522.367188 1211.832031 L 506.195313 1211.832031 L 477.648438 1139.269531 "}),(0,i.createElement)("g",{clipPath:"url(#clip1)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 546.523438 1263.71875 C 537.902344 1263.71875 530.824219 1262.460938 525.289063 1259.921875 L 525.289063 1247.550781 C 532.601563 1249.421875 539.589844 1250.359375 546.242188 1250.359375 C 568.929688 1250.359375 580.273438 1237.988281 580.273438 1213.238281 L 580.273438 1006.238281 L 594.617188 1006.238281 L 594.617188 1211.832031 C 594.617188 1246.421875 578.585938 1263.71875 546.523438 1263.71875 "})),(0,i.createElement)("path",{d:"M 680.230469 1211.832031 L 680.230469 1006.238281 L 694.574219 1006.238281 L 694.574219 1211.832031 L 680.230469 1211.832031 "}),(0,i.createElement)("path",{d:"M 931.078125 1211.832031 L 916.59375 1211.832031 L 794.8125 1029.300781 L 793.6875 1029.300781 C 794.8125 1051.050781 795.375 1067.460938 795.375 1078.519531 L 795.375 1211.832031 L 781.59375 1211.832031 L 781.59375 1006.238281 L 795.9375 1006.238281 L 917.578125 1188.488281 L 918.421875 1188.488281 C 917.578125 1171.609375 917.15625 1155.578125 917.15625 1140.390625 L 917.15625 1006.238281 L 931.078125 1006.238281 L 931.078125 1211.832031 "}),(0,i.createElement)("g",{clipPath:"url(#clip2)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 1167.578125 1211.832031 L 1153.101563 1211.832031 L 1031.320313 1029.300781 L 1030.191406 1029.300781 C 1031.320313 1051.050781 1031.878906 1067.460938 1031.878906 1078.519531 L 1031.878906 1211.832031 L 1018.101563 1211.832031 L 1018.101563 1006.238281 L 1032.441406 1006.238281 L 1154.078125 1188.488281 L 1154.929688 1188.488281 C 1154.078125 1171.609375 1153.660156 1155.578125 1153.660156 1140.390625 L 1153.660156 1006.238281 L 1167.578125 1006.238281 L 1167.578125 1211.832031 "}))))}function o(){return(0,i.useEffect)((()=>{var t,i;t=this,i=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var a=Math.abs;function r(e){return e}function o(e,t,n){var i=1-n;return 3*n*i*(e*i+t*n)+n*n*n}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return e<0||e>1||n<0||n>1?null:a(e-t)<=1e-5&&a(n-i)<=1e-5?r:function(r){if(r<=0)return e>0?r*t/e:0===t&&n>0?r*i/n:0;if(r>=1)return n<1?1+(r-1)*(i-1)/(n-1):1===n&&e<1?1+(r-1)*(t-1)/(e-1):1;for(var s,l=0,c=1;l<c;){var u=o(e,n,s=(l+c)/2);if(a(r-u)<1e-5)break;u<r?l=s:c=s}return o(t,i,s)}}function l(){return 1}function c(e){return 1===e?1:0}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(1===e){if(0===t)return c;if(1===t)return l}var n=1/e;return function(e){return e>=1?1:(e+=t*n)-e%n}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(Number.isInteger(e))return e;var n=Math.pow(10,t);return Math.round(e*n)/n}var d=Math.PI/180;function m(e,t,n){return e>=.5?n:t}function p(e,t,n){return 0===e||t===n?t:e*(n-t)+t}function f(e,t,n){var i=p(e,t,n);return i<=0?0:i}function g(e,t,n){return 0===e?t:1===e?n:{x:p(e,t.x,n.x),y:p(e,t.y,n.y)}}function y(e,t,n){return 0===e?t:1===e?n:{x:f(e,t.x,n.x),y:f(e,t.y,n.y)}}function v(e,t,n){var i=function(e,t,n){return Math.round(p(e,t,n))}(e,t,n);return i<=0?0:i>=255?255:i}function w(e,t,n){return 0===e?t:1===e?n:{r:v(e,t.r,n.r),g:v(e,t.g,n.g),b:v(e,t.b,n.b),a:p(e,null==t.a?1:t.a,null==n.a?1:n.a)}}function b(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=[],r=0;r<i;r++)a.push(w(e,t[r],n[r]));return a}function _(e,t,n){var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=new Array(i),r=0;r<i;r++)a[r]=p(e,t[r],n[r]);return a}function E(e,t){for(var n=[],i=0;i<e;i++)n.push(t);return n}function x(e,t){if(--t<=0)return e;var n=(e=Object.assign([],e)).length;do{for(var i=0;i<n;i++)e.push(e[i])}while(--t>0);return e}var j=/\.0+$/g;function M(e){return Number.isInteger(e)?e+"":e.toFixed(6).replace(j,"")}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e&&e.length?e.map(M).join(t):""}function k(e){return M(e.x)+","+M(e.y)}function C(e){return e?null==e.a||e.a>=1?"rgb("+e.r+","+e.g+","+e.b+")":"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"transparent"}var I={f:null,i:y,u:function(e,t){return function(n){var i=t(n);e.setAttribute("rx",M(i.x)),e.setAttribute("ry",M(i.y))}}},D={f:null,i:function(e,t,n){return 0===e?t:1===e?n:{width:f(e,t.width,n.width),height:f(e,t.height,n.height)}},u:function(e,t){return function(n){var i=t(n);e.setAttribute("width",M(i.width)),e.setAttribute("height",M(i.height))}}},A=Math.sin,T=Math.cos,L=Math.acos,P=Math.asin,N=Math.tan,O=Math.atan2,R=Math.PI/180,z=180/Math.PI,B=Math.sqrt,W=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;t(this,e),this.m=[n,i,a,r,o,s],this.i=null,this.w=null,this.s=null}return i(e,[{key:"point",value:function(e,t){var n=this.m;return{x:n[0]*e+n[2]*t+n[4],y:n[1]*e+n[3]*t+n[5]}}},{key:"translateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e&&!t)return this;var n=this.m;return n[4]+=n[0]*e+n[2]*t,n[5]+=n[1]*e+n[3]*t,this.w=this.s=this.i=null,this}},{key:"rotateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e%=360){var t=A(e*=R),n=T(e),i=this.m,a=i[0],r=i[1];i[0]=a*n+i[2]*t,i[1]=r*n+i[3]*t,i[2]=i[2]*n-a*t,i[3]=i[3]*n-r*t,this.w=this.s=this.i=null}return this}},{key:"scaleSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==e||1!==t){var n=this.m;n[0]*=e,n[1]*=e,n[2]*=t,n[3]*=t,this.w=this.s=this.i=null}return this}},{key:"skewSelf",value:function(e,t){if(t%=360,(e%=360)||t){var n=this.m,i=n[0],a=n[1],r=n[2],o=n[3];e&&(e=N(e*R),n[2]+=i*e,n[3]+=a*e),t&&(t=N(t*R),n[0]+=r*t,n[1]+=o*t),this.w=this.s=this.i=null}return this}},{key:"resetSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.m;return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o[4]=a,o[5]=r,this.w=this.s=this.i=null,this}},{key:"recomposeSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return this.isIdentity||this.resetSelf(),e&&(e.x||e.y)&&this.translateSelf(e.x,e.y),t&&this.rotateSelf(t),n&&(n.x&&this.skewSelf(n.x,0),n.y&&this.skewSelf(0,n.y)),!i||1===i.x&&1===i.y||this.scaleSelf(i.x,i.y),a&&(a.x||a.y)&&this.translateSelf(a.x,a.y),this}},{key:"decompose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.m,i=n[0]*n[0]+n[1]*n[1],a=[[n[0],n[1]],[n[2],n[3]]],r=B(i);if(0===r)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:0,y:0},skew:{x:0,y:0},rotate:0};a[0][0]/=r,a[0][1]/=r;var o=n[0]*n[3]-n[1]*n[2]<0;o&&(r=-r);var s=a[0][0]*a[1][0]+a[0][1]*a[1][1];a[1][0]-=a[0][0]*s,a[1][1]-=a[0][1]*s;var l=B(a[1][0]*a[1][0]+a[1][1]*a[1][1]);if(0===l)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:0},skew:{x:0,y:0},rotate:0};a[1][0]/=l,a[1][1]/=l,s/=l;var c=0;return a[1][1]<0?(c=L(a[1][1])*z,a[0][1]<0&&(c=360-c)):c=P(a[0][1])*z,o&&(c=-c),s=O(s,B(a[0][0]*a[0][0]+a[0][1]*a[0][1]))*z,{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:l},skew:{x:s,y:0},rotate:c}}},{key:"toString",value:function(){return null===this.s&&(this.s="matrix("+this.m.map(F).join(" ")+")"),this.s}},{key:"determinant",get:function(){var e=this.m;return e[0]*e[3]-e[1]*e[2]}},{key:"isIdentity",get:function(){if(null===this.i){var e=this.m;this.i=1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}return this.i}}]),e}(),Y=/\.0+$/;function F(e){return Number.isInteger(e)?e:e.toFixed(14).replace(Y,"")}function V(e,t,n){return e+(t-e)*n}function G(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a={x:V(e.x,t.x,n),y:V(e.y,t.y,n)};return i&&(a.a=H(e,t)),a}function H(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function U(e,t,n,i){var a=1-i;return a*a*e+2*a*i*t+i*i*n}function J(e,t,n,i){return 2*(1-i)*(t-e)+2*i*(n-t)}function q(e,t,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={x:U(e.x,t.x,n.x,i),y:U(e.y,t.y,n.y,i)};return a&&(r.a=Z(e,t,n,i)),r}function Z(e,t,n,i){return Math.atan2(J(e.y,t.y,n.y,i),J(e.x,t.x,n.x,i))}function X(e,t,n,i,a){var r=a*a;return a*r*(i-e+3*(t-n))+3*r*(e+n-2*t)+3*a*(t-e)+e}function Q(e,t,n,i,a){var r=1-a;return 3*(r*r*(t-e)+2*r*a*(n-t)+a*a*(i-n))}function $(e,t,n,i,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o={x:X(e.x,t.x,n.x,i.x,a),y:X(e.y,t.y,n.y,i.y,a)};return r&&(o.a=K(e,t,n,i,a)),o}function K(e,t,n,i,a){return Math.atan2(Q(e.y,t.y,n.y,i.y,a),Q(e.x,t.x,n.x,i.x,a))}function ee(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(ne(t)){if(ie(n))return q(t,n.start,n,e,i)}else if(ne(n)){if(t.end)return q(t,t.end,n,e,i)}else{if(t.end)return n.start?$(t,t.end,n.start,n,e,i):q(t,t.end,n,e,i);if(n.start)return q(t,n.start,n,e,i)}return G(t,n,e,i)}function te(e,t,n){var i=ee(e,t,n,!0);return i.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?e+Math.PI:e}(i.a)/d,i}function ne(e){return!e.type||"corner"===e.type}function ie(e){return null!=e.start&&!ne(e)}Object.freeze({M:2,L:2,Z:0,H:1,V:1,C:6,Q:4,T:2,S:4,A:7});var ae=new W,re={f:function(e){return e?e.join(" "):""},i:function(t,n,i){if(0===t)return n;if(1===t)return i;var a=n.length;if(a!==i.length)return m(t,n,i);for(var r,o=new Array(a),s=0;s<a;s++){if((r=e(n[s]))!==e(i[s]))return m(t,n,i);if("number"===r)o[s]=p(t,n[s],i[s]);else{if(n[s]!==i[s])return m(t,n,i);o[s]=n[s]}}return o}},oe={f:null,i:_,u:function(e,t){return function(n){var i=t(n);e.setAttribute("x1",M(i[0])),e.setAttribute("y1",M(i[1])),e.setAttribute("x2",M(i[2])),e.setAttribute("y2",M(i[3]))}}},se={f:M,i:p},le={f:M,i:function(e,t,n){var i=p(e,t,n);return i<=0?0:i>=1?1:i}},ce={f:S,i:function(e,t,n){var i,a,r,o=t.length,s=n.length;if(o!==s)if(0===o)t=E(o=s,0);else if(0===s)s=o,n=E(o,0);else{var l=(r=(i=o)*(a=s)/function(e,t){for(var n;t;)n=t,t=e%t,e=n;return e||1}(i,a))<0?-r:r;t=x(t,Math.floor(l/o)),n=x(n,Math.floor(l/s)),o=s=l}for(var c=[],u=0;u<o;u++)c.push(h(f(e,t[u],n[u]),6));return c}};function ue(e,t,n,i,a,r,o,s){return t=function(e,t,n){for(var i,a,r,o=e.length-1,s={},l=0;l<=o;l++)(i=e[l]).e&&(i.e=t(i.e)),i.v&&"g"===(a=i.v).t&&a.r&&(r=n.getElementById(a.r))&&(s[a.r]=r.querySelectorAll("stop"));return s}(e,i,s),function(i){var a,r=n(i,e,he);return r?"c"===r.t?C(r.v):"g"===r.t?(t[r.r]&&function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].setAttribute("stop-color",C(t[n]))}(t[r.r],r.v),(a=r.r)?"url(#"+a+")":"none"):"none":"none"}}function he(e,t,n){if(0===e)return t;if(1===e)return n;if(t&&n){var i=t.t;if(i===n.t)switch(t.t){case"c":return{t:i,v:w(e,t.v,n.v)};case"g":if(t.r===n.r)return{t:i,v:b(e,t.v,n.v),r:t.r}}}return m(e,t,n)}var de={blur:y,brightness:f,contrast:f,"drop-shadow":function(e,t,n){return 0===e?t:1===e?n:{blur:y(e,t.blur,n.blur),offset:g(e,t.offset,n.offset),color:w(e,t.color,n.color)}},grayscale:f,"hue-rotate":p,invert:f,opacity:f,saturate:f,sepia:f};function me(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a,r=[],o=0;o<i;o++){if(t[o].type!==n[o].type)return t;if(!(a=de[t[o].type]))return m(e,t,n);r.push({type:t.type,value:a(e,t[o].value,n[o].value)})}return r}var pe={blur:function(e){return e?function(t){e.setAttribute("stdDeviation",k(t))}:null},brightness:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t),e.map((function(e){return e.setAttribute("slope",t)}))}:null},contrast:function(e,t,n){return(e=ge(n,t))?function(t){var n=M((1-t)/2);t=M(t),e.map((function(e){e.setAttribute("slope",t),e.setAttribute("intercept",n)}))}:null},"drop-shadow":function(e,t,n){var i=n.getElementById(t+"-blur");if(!i)return null;var a=n.getElementById(t+"-offset");if(!a)return null;var r=n.getElementById(t+"-flood");return r?function(e){i.setAttribute("stdDeviation",k(e.blur)),a.setAttribute("dx",M(e.offset.x)),a.setAttribute("dy",M(e.offset.y)),r.setAttribute("flood-color",C(e.color))}:null},grayscale:function(e){return e?function(t){e.setAttribute("values",S(function(e){return[.2126+.7874*(e=1-e),.7152-.7152*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152+.2848*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152-.7152*e,.0722+.9278*e,0,0,0,0,0,1,0]}(t)))}:null},"hue-rotate":function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},invert:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t)+" "+M(1-t),e.map((function(e){return e.setAttribute("tableValues",t)}))}:null},opacity:function(e,t,n){return(e=n.getElementById(t+"-A"))?function(t){return e.setAttribute("tableValues","0 "+M(t))}:null},saturate:function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},sepia:function(e){return e?function(t){return e.setAttribute("values",S(function(e){return[.393+.607*(e=1-e),.769-.769*e,.189-.189*e,0,0,.349-.349*e,.686+.314*e,.168-.168*e,0,0,.272-.272*e,.534-.534*e,.131+.869*e,0,0,0,0,0,1,0]}(t)))}:null}},fe=["R","G","B"];function ge(e,t){var n=fe.map((function(n){return e.getElementById(t+"-"+n)||null}));return-1!==n.indexOf(null)?null:n}var ye={fill:ue,"fill-opacity":le,stroke:ue,"stroke-opacity":le,strokeWidth:se,strokeDashoffset:{f:M,i:p},strokeDasharray:ce,opacity:le,transform:function(t,n,i,a){if(!(t=function(t,n){if(!t||"object"!==e(t))return null;var i=!1;for(var a in t)t.hasOwnProperty(a)&&(t[a]&&t[a].length?(t[a].forEach((function(e){e.e&&(e.e=n(e.e))})),i=!0):delete t[a]);return i?t:null}(t,a)))return null;var r=function(e,a,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t[e]?i(a,t[e],r):n&&n[e]?n[e]:o};return n&&n.a&&t.o?function(e){var n=i(e,t.o,te);return ae.recomposeSelf(n,r("r",e,p,0)+n.a,r("k",e,g),r("s",e,g),r("t",e,g)).toString()}:function(e){return ae.recomposeSelf(r("o",e,ee,null),r("r",e,p,0),r("k",e,g),r("s",e,g),r("t",e,g)).toString()}},"#filter":function(e,t,n,i,a,r,o,s){if(!t.items||!e||!e.length)return null;var l=function(e,t){var n=(e=e.map((function(e){return e&&pe[e[0]]?(t.getElementById(e[1]),pe[e[0]](t.getElementById(e[1]),e[1],t)):null}))).length;return function(t){for(var i=0;i<n;i++)e[i]&&e[i](t[i].value)}}(t.items,s);return l?(e=function(e,t){return e.map((function(e){return e.e=t(e.e),e}))}(e,i),function(t){l(n(t,e,me))}):null},"#line":oe,points:{f:S,i:_},d:re,r:se,"#size":D,"#radius":I,_:function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)this[e[n]]=t;else this[e]=t}},ve=function(){function e(n){t(this,e),this.list=n,this.length=n.length}return i(e,[{key:"setAttribute",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].setAttribute(e,t)}},{key:"removeAttribute",value:function(e){for(var t=this.list,n=0;n<this.length;n++)t[n].removeAttribute(e)}},{key:"style",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].style[e]=t}}]),e}(),we=/-./g,be=function(e,t){return t.toUpperCase()};function _e(e){return"function"==typeof e?e:m}function Ee(e){return e?"function"==typeof e?e:Array.isArray(e)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;if(!Array.isArray(e))return t;switch(e.length){case 1:return u(e[0])||t;case 2:return u(e[0],e[1])||t;case 4:return s(e[0],e[1],e[2],e[3])||t}return t}(e,null):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;switch(e){case"linear":return r;case"steps":return u(t.steps||1,t.jump||0)||n;case"bezier":case"cubic-bezier":return s(t.x1||0,t.y1||0,t.x2||0,t.y2||0)||n}return n}(e.type,e.value,null):null}function xe(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length-1;if(e<=t[0].t)return i?[0,0,t[0].v]:t[0].v;if(e>=t[a].t)return i?[a,1,t[a].v]:t[a].v;var r,o=t[0],s=null;for(r=1;r<=a;r++){if(!(e>t[r].t)){s=t[r];break}o=t[r]}return null==s?i?[a,1,t[a].v]:t[a].v:o.t===s.t?i?[r,1,s.v]:s.v:(e=(e-o.t)/(s.t-o.t),o.e&&(e=o.e(e)),i?[r,e,n(e,o.v,s.v)]:n(e,o.v,s.v))}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e&&e.length?"function"!=typeof t?null:("function"!=typeof n&&(n=null),function(i){var a=xe(i,e,t);return null!=a&&n&&(a=n(a)),a}):null}function Me(e,t){return e.t-t.t}function Se(t,n,i,a){if(!a||"object"!==e(a))return null;var r=null,o=null;return Array.isArray(a)?o=function(e){if(!e||!e.length)return null;for(var t=0;t<e.length;t++)e[t].e&&(e[t].e=Ee(e[t].e));return e.sort(Me)}(a):(o=a.keys,r=a.data||null),o?function(t,n,i,a,r){var o,s="@"===i[0],l="#"===i[0],c=ye[i],u=m;switch(s?(o=i.substr(1),i=o.replace(we,be)):l&&(i=i.substr(1)),e(c)){case"function":if(u=c(a,r,xe,Ee,i,s,n,t),l)return u;break;case"string":u=je(a,_e(c));break;case"object":if((u=je(a,_e(c.i),c.f))&&"function"==typeof c.u)return c.u(n,u,i,s,t)}return u?function(e,t,n){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3])return e instanceof ve?function(i){return e.style(t,n(i))}:function(i){return e.style[t]=n(i)};if(Array.isArray(t)){var i=t.length;return function(a){var r=n(a);if(null==r)for(var o=0;o<i;o++)e[o].removeAttribute(t);else for(var s=0;s<i;s++)e[s].setAttribute(t,r)}}return function(i){var a=n(i);null==a?e.removeAttribute(t):e.setAttribute(t,a)}}(n,i,u,s):null}(t,n,i,o,r):null}function ke(e,t,n){if(!n)return null;var i=[];for(var a in n)if(n.hasOwnProperty(a)){var r=Se(e,t,a,n[a]);r&&i.push(r)}return i.length?i:null}var Ce=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(this,e),this._id=0,this._running=!1,this._animations=n,this.direction=i.direction||1,this.speed=i.speed||1,this.fps=i.fps||100,this.offset=i.offset||0}return i(e,[{key:"_start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=-1/0,i=null,a={},r=function r(o){e._running=!0,null==i&&(i=o);var s=Math.round((o-i+t)*e.speed),l=e.fps?1e3/e.fps:0;if(s>n+l){e.offset=s,n=s;for(var c=e._animations,u=c.length,h=0,d=0;d<u;d++)a[d]?h++:(a[d]=c[d](s,e.direction),a[d]&&h++);if(h===u)return void e._stop()}e._id=window.requestAnimationFrame(r)};this._id=window.requestAnimationFrame(r)}},{key:"_stop",value:function(){this._id&&window.cancelAnimationFrame(this._id),this._running=!1}},{key:"play",value:function(){this._running||this._start(this.offset)}},{key:"stop",value:function(){this._stop(),this.offset=0;var e=this.direction,t=this._animations;requestAnimationFrame((function(){for(var n=0;n<t.length;n++)t[n](0,e)}))}},{key:"restart",value:function(){this._stop(),this.offset=0,this._start()}},{key:"pause",value:function(){this._stop()}},{key:"reverse",value:function(){this.direction=-this.direction}}],[{key:"build",value:function(t){if(!(t=function(e){if(!e||!e.root||!Array.isArray(e.animations))return null;var t=window.document.getElementById(e.root);if(!t)return null;var n=e.animations.map((function(e){return function(e,t){if(!t.duration||t.duration<0)return null;var n=function(e,t){if(!t)return null;var n=[];if(Array.isArray(t))for(var i=t.length,a=0;a<i;a++){var r=t[a];if(2===r.length){var o=null;if("string"==typeof r[0])o=e.getElementById(r[0]);else if(Array.isArray(r[0])){o=[];for(var s=0;s<r[0].length;s++)if("string"==typeof r[0][s]){var l=e.getElementById(r[0][s]);l&&o.push(l)}o=o.length?1===o.length?o[0]:new ve(o):null}if(o){var c=ke(e,o,r[1]);c&&(n=n.concat(c))}}}else for(var u in t)if(t.hasOwnProperty(u)){var h=e.getElementById(u);if(h){var d=ke(e,h,t[u]);d&&(n=n.concat(d))}}return n.length?n:null}(e,t.elements);return n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=e.length,s=i>0?t:0;a&&n%2==0&&(s=t-s);var l=null;return function(c,u){var h=c%t,d=1+(c-h)/t;u*=i,a&&d%2==0&&(u=-u);var m=!1;if(d>n)h=s,m=!0,-1===r&&(h=i>0?0:t);else if(u<0&&(h=t-h),h===l)return!1;l=h;for(var p=0;p<o;p++)e[p](h);return m}}(n,t.duration,t.iterations||1/0,t.direction||1,!!t.alternate,t.fill||1):null}(t,e)})).filter((function(e){return!!e}));return n.length?{element:t,animations:n,options:e.options||void 0}:null}(t)))return null;var n=t.element,i=t.options||{},a=new e(t.animations,t.options);return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if("click"!==n){if("hover"===n)return t.addEventListener("mouseenter",(function(){return e.play()})),void t.addEventListener("mouseleave","freeze"===i?function(){return e.pause()}:function(){return e.stop()});e.play()}else{var a=function n(){t.removeEventListener("click",n),e.play()};t.addEventListener("click",a)}}(a,n,i.start,i.hover),a}}]),e}();return function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var n=Date.now(),i=Math.max(0,16-(n-e)),a=window.setTimeout((function(){t(n+i)}),i);return e=n+i,a},window.cancelAnimationFrame=window.clearTimeout)}(),Ce},"object"==typeof exports?e.exports=i():"function"==typeof define&&n.amdO?define(i):(t=t||self).__SVGATOR_PLAYER__=i(),__SVGATOR_PLAYER__.build({root:"e29gnwghxaec1",animations:[{duration:3e3,direction:1,iterations:0,fill:1,alternate:!1,elements:{e29gnwghxaec4:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160,y:60.000000000000085,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.0000000000001,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:160.00000000000009,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:70.00000000000013,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000011,y:110.00000000000003,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec5:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:209.99999999999997,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70,y:109.99999999999996,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160,y:59.999999999999986,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.00000000000006,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000003,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000006,y:210,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec6:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70.00000000000003,y:210.00000000000003,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.0000000033166,y:110.00000000017586,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999559876,y:59.99999999808161,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250.00000000133716,y:109.99999999826927,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250.00000000074502,y:209.99999999748923,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:160.00000000328416,y:259.99999999938586,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec7:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:209.99999999827637,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160.00000000000003,y:259.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.00000000000003,y:209.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000003,y:109.99999999827641,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:159.99999999999997,y:59.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250,y:109.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250.00000000000003,y:209.99999999827642,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec8:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:250.00000000000009,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160.00000000000006,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000006,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:70.00000000000003,y:110.00000000000007,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000006,y:60.000000000000064,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250,y:110.00000000000006,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec9:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:60,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:249.99999999999997,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:249.99999999999994,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999999991,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:69.99999999999991,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:69.99999999999994,y:110.00000000000001,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:159.99999999999994,y:60.00000000000004,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}}}}],options:{start:"load",hover:"restart"}})}),[]),(0,i.createElement)("svg",{id:"e29gnwghxaec1",className:"imajinn-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 300",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision"},(0,i.createElement)("defs",null,(0,i.createElement)("filter",{id:"e29gnwghxaec4-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec4-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec5-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec5-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec6-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec6-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec7-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec7-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec8-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec8-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec9-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec9-filter-blur-0",stdDeviation:"0,0",result:"result"}))),(0,i.createElement)("circle",{id:"e29gnwghxaec2",r:"50",transform:"matrix(-1 0 -0 -1 149.99999999999997 50.00000000379265)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("circle",{id:"e29gnwghxaec3",r:"50",transform:"matrix(-1 0 -0 -1 49.99999999999997 150.00000000379259)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("path",{id:"e29gnwghxaec4",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 110.00000000344897)",filter:"url(#e29gnwghxaec4-filter)",fill:"rgb(239,237,39)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec5",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 210.00000000344886)",filter:"url(#e29gnwghxaec5-filter)",fill:"rgb(236,0,140)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec6",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 260.00000000344897)",filter:"url(#e29gnwghxaec6-filter)",fill:"rgb(238,124,30)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec7",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 210.00000000172525)",filter:"url(#e29gnwghxaec7-filter)",fill:"rgb(0,161,103)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec8",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 110.00000000344897)",filter:"url(#e29gnwghxaec8-filter)",fill:"rgb(192,53,226)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec9",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 60.00000000344890)",filter:"url(#e29gnwghxaec9-filter)",fill:"rgb(38,169,224)",stroke:"none",strokeWidth:"6"}))}n(609),e=n.hmd(e)},380:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(873))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.segments,i=void 0===n?50:n,a=t.iterationLimit,s=void 0===a?100:a;o(this,e),this.p1=new r.default,this.p2=new r.default,this.segments=i,this.iterationLimit=s}return a(e,[{key:"drawToCanvas",value:function(e,t,n,i){this.p1.update(t),this.p2.update(n);var a=this.p1.x>this.p2.x,r=a?this.p2:this.p1,o=a?this.p1:this.p2,s=[],l=!0;if(r.getDistanceTo(o)<i)if(o.x-r.x>.01){var c=o.x-r.x,u=o.y-r.y,h=-this.getCatenaryParameter(c,u,i,this.iterationLimit),d=.5*(h*Math.log((i+u)/(i-u))-c),m=h*Math.cosh(d/h),p=r.x-d,f=r.y-m;s=this.getCurve(h,r,o,p,f,this.segments),l=!1}else{var g=.5*(r.x+o.x),y=.5*(r.y+o.y+i);s=[[r.x,r.y],[g,y],[o.x,o.y]]}else s=[[r.x,r.y],[o.x,o.y]];return l?this.drawLine(s,e):this.drawCurve(s,e),s}},{key:"getCatenaryParameter",value:function(e,t,n,i){for(var a=Math.sqrt(n*n-t*t)/e,r=Math.acosh(a)+1,o=-1,s=0;Math.abs(r-o)>1e-6&&s<i;)o=r,r-=(Math.sinh(r)-a*r)/(Math.cosh(r)-a),s++;return e/(2*r)}},{key:"getCurve",value:function(e,t,n,i,a,r){for(var o=[t.x,e*Math.cosh((t.x-i)/e)+a],s=n.x-t.x,l=r-1,c=0;c<l;c++){var u=t.x+s*(c+.5)/l,h=e*Math.cosh((u-i)/e)+a;o.push(u,h)}return o.push(n.x,e*Math.cosh((n.x-i)/e)+a),o}},{key:"drawLine",value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:"drawCurve",value:function(e,t){var n=.5*e.length-1,i=e[2],a=e[3],r=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[2*o],l=e[2*o+1],c=.5*(s+i),u=.5*(l+a);r.push([i,a,c,u]),t.quadraticCurveTo(i,a,c,u),i=s,a=l}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),r}}]),e}();t.default=s},873:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return n(e,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"getDifferenceTo",value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}}]),e}();t.default=i},301:function(e,t,n){t.oT=void 0;var i=r(n(380)),a=r(n(873));function r(e){return e&&e.__esModule?e:{default:e}}t.oT=i.default,a.default},630:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(195))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.radius,i=void 0===n?30:n,a=t.enabled,s=void 0===a||a,l=t.initialPoint,c=void 0===l?{x:0,y:0}:l;o(this,e),this.radius=i,this._isEnabled=s,this.pointer=new r.default(c.x,c.y),this.brush=new r.default(c.x,c.y),this.angle=0,this.distance=0,this._hasMoved=!1}return a(e,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"isEnabled",value:function(){return this._isEnabled}},{key:"setRadius",value:function(e){this.radius=e}},{key:"getRadius",value:function(){return this.radius}},{key:"getBrushCoordinates",value:function(){return this.brush.toObject()}},{key:"getPointerCoordinates",value:function(){return this.pointer.toObject()}},{key:"getBrush",value:function(){return this.brush}},{key:"getPointer",value:function(){return this.pointer}},{key:"getAngle",value:function(){return this.angle}},{key:"getDistance",value:function(){return this.distance}},{key:"brushHasMoved",value:function(){return this._hasMoved}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.both,i=void 0!==n&&n;return this._hasMoved=!1,!(this.pointer.equalsTo(e)&&!i||(this.pointer.update(e),i?(this._hasMoved=!0,this.brush.update(e),0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),0)))}}]),e}();t.default=s},195:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(93))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"moveByAngle",value:function(e,t){var n=e+Math.PI/2;this.x=this.x+Math.sin(n)*t,this.y=this.y-Math.cos(n)*t}},{key:"equalsTo",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"getDifferenceTo",value:function(e){return new r.default(this.x-e.x,this.y-e.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}},{key:"getAngleTo",value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:"toObject",value:function(){return{x:this.x,y:this.y}}}]),t}(r.default);t.default=l},93:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}},227:function(e,t,n){t.xv=void 0;var i=o(n(630)),a=o(n(93)),r=o(n(195));function o(e){return e&&e.__esModule?e:{default:e}}t.xv=i.default,a.default,r.default},609:function(e){e.exports=window.wp.components},307:function(e){e.exports=window.wp.element}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i](r,r.exports,n),r.loaded=!0,r.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),function(){var e=window.wp.blocks,t=n(307),i=window.wp.i18n,a=window.wp.blockEditor,r=n(609),o=window.wp.primitives,s=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"infinite-uploads/imajinn-ai","version":"0.1.0","title":"Imajinn AI","category":"media","icon":"art","description":"Generate the perfect images from a text prompt in seconds with cutting-edge AI. Creates stunning images for any topic with just your imagination.","keywords":["img","image","photo","picture","ai","art","infinite"],"supports":{"html":false,"multiple":false,"customClassName":false,"reusable":false,"lock":false},"example":{"attributes":{"mode":"preview"}},"textdomain":"imajinn-ai","editorScript":"file:./block.js","editorStyle":"file:./block.css"}'),c=n(352);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)}var h=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),d=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function m(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{className:"imajinn-prompt-tips",onClick:()=>a(!0),icon:h,label:(0,i.__)("Prompt Tips","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Basics of Prompt Engineering","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)('"Prompt Engineering" is an important skill to create better generations with this text to image AI. After reading this document and applying these simple steps, you’ll be able to generate better images with the same amount of effort.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Note: Your prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. If you speak another language you can use a online translation tool, which should provide excellent results as it does not have to be perfect.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("1. Raw prompt","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Raw prompt is the simplest way of describing what you want to generate, for instance;","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Panda"),(0,t.createElement)("li",null,"A warrior with a sword"),(0,t.createElement)("li",null,"Skeleton")),(0,t.createElement)("p",null,(0,i.__)("This is the basic building block of any prompt. Most new people start by only using raw prompts, this is usually a mistake as the images you generate like this tend to get random and chaotic. It's best to include as much detail as possible in your prompt describing exactly what you want to see in the scene.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("2. Style","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Style is a crucial part of the prompt. The AI, when missing a specified style, usually chooses the one it has seen the most in related images, for example, if you generated landscape, it would probably generate realistic or oil painting looking images. Having a well chosen style + raw prompt is sometimes enough, as the style influences the image the most right after the raw prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most commonly used styles include:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Realistic"),(0,t.createElement)("li",null,"Oil painting"),(0,t.createElement)("li",null,"Pencil drawing"),(0,t.createElement)("li",null,"Concept art")),(0,t.createElement)("p",null,(0,i.__)("In the case of a realistic image, there are various ways of making it the style, most resulting in similar images. Here are some commonly used techniques of making the image realistic:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"a photo of + raw prompt"),(0,t.createElement)("li",null,"a photograph of + raw prompt"),(0,t.createElement)("li",null,"raw prompt, hyperrealistic"),(0,t.createElement)("li",null,"raw prompt, realistic")),(0,t.createElement)("p",null,(0,i.__)("You can of course combine these to get more and more realistic images.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To get oil painting you can just simply add “an oil painting of” to your prompt. This sometimes results in the image showing an oil painting in a frame, to fix this you can just re-run the prompt or use raw prompt + “oil painting”","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make a pencil drawing just simply add “a pencil drawing of” to your raw prompt or make your prompt raw prompt + “pencil drawing”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The same applies to landscape art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("3. Artist","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make your style more specific, or the image more coherent, you can use artists’ names in your prompt. For instance, if you want a very abstract image, you can add “made by Pablo Picasso” or just simply, “Picasso”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Below are lists of artists in different styles that you can use, but we encourage you to search for different artists as it is a cool way of discovering new art.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Portrait:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"John Singer Sargent"),(0,t.createElement)("li",null,"Edgar Degas"),(0,t.createElement)("li",null,"Paul Cézanne"),(0,t.createElement)("li",null,"Jan van Eyck")),(0,t.createElement)("p",null,(0,i.__)("Oil painting:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Leonardo DaVinci"),(0,t.createElement)("li",null,"Vincent Van Gogh"),(0,t.createElement)("li",null,"Johannes Vermeer"),(0,t.createElement)("li",null,"Rembrandt")),(0,t.createElement)("p",null,(0,i.__)("Pencil/Pen drawing:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Albrecht Dürer"),(0,t.createElement)("li",null,"Leonardo da Vinci"),(0,t.createElement)("li",null,"Michelangelo"),(0,t.createElement)("li",null,"Jean-Auguste-Dominique Ingres")),(0,t.createElement)("p",null,(0,i.__)("Landscape art:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Thomas Moran"),(0,t.createElement)("li",null,"Claude Monet"),(0,t.createElement)("li",null,"Alfred Bierstadt"),(0,t.createElement)("li",null,"Frederic Edwin Church")),(0,t.createElement)("p",null,(0,i.__)("Mixing the artists is highly encouraged, as it can lead to interesting-looking art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("4. Finishing touches","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("This is the part that some people take to extremes, leading to longer prompts than this article. Finishing touches are the final things that you add to your prompt to make it look like you want. For instance, if you want to make your image more artistic, add “trending on artstation”. If you want to add more realistic lighting add “Unreal Engine.” You can add anything you want, but here are some examples:","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Highly detailed, surrealism, trending on art station, triadic color scheme, smooth, sharp focus, matte, elegant, the most beautiful image ever seen, illustration, digital paint, dark, gloomy, octane render, 8k, 4k, washed colors, sharp, dramatic lighting, beautiful, post processing, picture of the day, ambient lighting, epic composition, bokeh, etc.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("5. Conclusion","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Prompt engineering allows you to have better control of what the image will look like. It (if done right) improves the image quality by a lot in every aspect. But if you want to keep it simple, just use our Prompt Genie or style presets.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function p(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.ToolbarButton,{onClick:()=>a(!0),icon:d,label:(0,i.__)("Help","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:d}),title:(0,i.__)("Usage Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI is a powerful tool that uses the latest technology in AI to generate images from text. It is a great tool for writers, artists, and anyone who needs to visualize their ideas.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The Imajinn AI interface is a block that you can add to your post or page. You can add it by clicking on the plus button in the top left corner of the editor and selecting Imajinn AI. You can also add it by clicking on the Imajinn AI icon in the block inserter. It does not output any content on your site on its own, but allows you to generate and insert images into the same location in the block editor. When finished you can just close the block.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Connecting","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Running an artificial intelligence neural network requires a lot of computing power. To make this possible, we run a cloud service to run the neural network. This means that you need to connect to our service before you can use the plugin. To connect to Imajinn AI, you need to have a user account. You can create one for free with just your valid email address and a password, or if you already have an account, you can log in with your Infinite Uploads/Imajinn AI email and password.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompts","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To generate images, you need to write a prompt. A prompt is a text that describes what you want the image to look like. The prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. The prompt can be as short as a a few words, or as long as a paragraph. The longer the prompt, the more detailed the image will be. Please see our prompt engineering guide for more information on how to write a good prompt.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt Genie","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Because writing prompts is hard, we have created a tool called Prompt Genie that can help you turn your simple prompts into amazing masterpieces. Prompt Genie uses a custom AI model to transform your prompt into ten different powerful options to generate an image in beautiful artistic styles. Simply enter your simple prompt like "a dog running on a beach", then click on the Prompt Genie button. After a few moments it will present you with ten different expanded prompts to choose from. You can then select the one you like best and click on the Generate button to generate a set of images. If you want to try a different prompt, just click on the Prompt Genie button again and choose a new option.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Summoning Prompt Genie does not use any of your credits, so you can summon it as many times as you like. However each time you generate a set of images from one of it's prompts you will use one credit like normal.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prefilled Styles","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To give you inspiration and make it easier to generate images in specific styles, we have added some dropdowns with prefilled styles that you can optionally select from. When optionally choosing options here it will append specific keywords to your prompt to achieve that style when sent to our servers.","imajinn-ai")),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Image Style","imajinn-ai")),"-",(0,i.__)("Choose from many common photographic or artistic styles and mediums.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Artist Style","imajinn-ai")),"-",(0,i.__)("Choose to generate your images based on the styles of some famous artists.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Modifier","imajinn-ai")),"-",(0,i.__)("Some fun and common styles to give the image output that special uniqueness.","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Image Ratio","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("You can control the output ratio of the generated images. Square images are the default, while rectangular images have more pixels and take longer to process.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The AI model was trained on square images, so depending on the prompt rectangular images may produce strange results such as duplication of the main subject. For example a rectangular image of a person may produce two of the same person, or multiple mouths on the same face. So it may require more prompt editing and generation attempts to get the desired result. Rectangular images are best used for landscapes, scenes, and other objects that do not have a singular main subject.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Saving Images","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI allows you to save images to your media library, and optionally insert them into your post/page. You can save images by clicking on the save button in the bottom right corner of each image generation. You can insert images into the editor in the same location as the Imajinn block by clicking on the insert button in the bottom right corner. Inserting an image also saves it to your media library, so you don't need to choose both.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you save or insert an image, it can take a few seconds because we send it to our servers to be upscaled using our advanced AI models so that you get a high resolution optimized image in your media library with no watermarks.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Image Actions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("For each image result for a generation, you can perform some actions on the image. You can share the image on social media, generate a set of variations, perform a face repair, or enter touchup mode.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've found an image you like, you can click the Generate Variations button to generate a set of images with similar styles and layout to give you more options to choose from. This will take into account any modifications you've made to the prompt, while still roughly following the original image. Creating variations uses one credit just like a normal generation.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've generated an image of a person and the face looks slightly deformed or unrealistic, you can click the Face Repair button to try and repair any issues with the face. This processes the image on our servers with AI-based facial restoration to restore facial details and enhance colors with a good balance of realness and fidelity. It can't fix every problem with a face, but it can help with some common issues. This tool is most effective for photographic or realistic art; if you try to use it on more abstract artistic faces results may be strange. Face repairs are not stored in your prompt history so that you can easily undo, and do not use any credits.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('The Touchup button (or "Inpainting") allows you to customize and make modifications to the image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, and duplicate objects. You can also use it to add new objects to the image, such as a new background or foreground. Using touchup can be a bit tricky, so be sure to read the tips popup inside of the image editor so you can make good use of your credits.',"imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt History","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn saves your prompt history to your site so that you can easily access previous prompts and their results later. Currently the editor will show the last 20 generated prompts and their image results. To jump back in time simply click the Load button next to an item. You can then edit, save, adjust the prompt, styles, or any other action you can normally do after generating a set of images.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Credits","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you first signup for Imajinn AI, you get a chunk of free credits. You can use these credits to generate images and get a feel for how the plugin functions and learn how to write effective prompts. If you run out, you can purchase more credits from the Imajinn AI website via our plans.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Each prompt generation uses one credit, and creates four images that you can choose to save and/or insert into your content. There is no limit to the number of images you can save.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Filters and Restrictions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To ensure that the images generated are appropriate for all audiences, we have a set of filters and restrictions that are applied to prompts and the image outputs. We block the use of specific words and phrases in prompts, and we scan all generations with an AI moderation filter to block images that appear to contain nudity, or other inappropriate content.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Depending on your prompt construction, it can be a fairly common occurrence for it to detect a potentially inappropriate image. If this happens, you will see a warning message. You can either change your prompt, or try generating again. We currently don't charge credits for images that are blocked by the filter, but may need to change this policy in the future. We monitor prompt violations and if we find that you are purposely using inappropriate prompts and attempting to bypass our restrictions, we may disable your account.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function f(e){let{isMobile:n,...a}=e;const[o,s]=(0,t.useState)(!1),l=()=>s(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>s(!0),icon:h,label:n&&(0,i.__)("Tips","imajinn-ai")},!n&&(0,i.__)("Tips","imajinn-ai")),o&&(0,t.createElement)(r.Modal,u({},a,{onRequestClose:l,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Touchup (Inpainting) Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("The Touchup feature allows you to customize and make modifications to an image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, or duplicates. Or you can also use it to add new objects to the image, such as a new object or background. Touchup allows you to create the exact image you want by choosing where each element in the image goes. You can create the complex image you have in mind, even if it is too specific to get right with one initial prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Touchup works by choosing an image as an input, masking an area with the brush that you want to modify, then adjusting your prompt to describe what you want in that area. However, this can be quite difficult to work with if you don’t use it right, because sometimes you select an area and put in the prompt, but the image doesn't change. So, here are some tips to help you get the best results from Touchup.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Best Practices","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Prompt Modification","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most important thing to keep in mind is whether you should describe the entire image you want or only what you want to add. For example, let’s say you want to change an image of an empty shoreline to add a boat floating on the water. You select an area where you want the boat to go, and your prompt in most cases shouldn’t be “a boat”. Instead it should be “Shoreline with a boat floating on the water”. This is because Imajinn needs to know what the context of the entire image should look like, and then it will fill in the area you selected with the boat. If you just say “a boat”, you are more likely to just get an erased area.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('There are some cases when you do want to describe only the thing you want to add instead of the final result. For example, if you are trying to simply erase parts of the image, it may work better to describe "a gray background", or whatever it should be replaced with. Also if you are building an image step-by-step and there are a lot of different subjects, focus your prompt on the section you are painting and generalize the rest of the image as detailed below.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When modifying the prompt, there is no need to get too poetic or descriptive because most of the image and its styles are already still there and taken into account, unless you paint out a very large portion of the image. Also if Prompt Genie or our style selectors were used initially, the styles will already be applied to your modified prompt. If you entered your own styles and modifiers to the prompt field, it is best to leave them there so they will be applied to the selected area. Be careful not to change or add styles in the modified prompt that will clash with the rest of the image.","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Step-by-Step Image Building","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('If you are trying to create a complex image with lots of subjects like people, animals, or objects, it can be impossible to do this with just one long prompt. Instead you can use Touchup to add new elements to the image one-by-one. For example, if you are building a landscape, you can use Touchup to add a new tree, mountain, or different characters one at a time. In this case as you add more objects, you should not describe the entire image in your modified prompt, but instead describe the new object you are adding, and summarize or skip the rest. For example, if you were adding a "girl with a dog", you would not put "girl with a dog, boy dancing, other boy with red shirt sitting" as then Imajinn would loose focus on what you want to put in the masked area. Instead summarize the existing objects like "a bunch of children including a girl with a dog".',"imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Other Tips","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you are making adjustments to part of an existing object, make sure you mask enough of that object so that Imajinn can make a smooth transition between old and new. For example to add a hat to a person, include the top of their head in the masked area. If you want a person next to a cat to be petting the cat, mask their entire arm and part of the cat where their hand would go before prompting “person petting a cat”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Be careful with shadows and reflections. Be sure to select not just the object but its shadow and reflection so that the replacement will look more realistic.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Size matters! Try to select larger areas to replace rather than smaller ones, because the smaller the area is, the less likely it is to actually do anything. Also, the contextual size of the new object to the rest of the image is important too. For example, if you try to replace a cat with an elephant, the size does not make sense to Imajinn, so either nothing will happen or you\'ll only get a piece of the elephant. Either stick with similar sized replacements, or make the prompt ask for a "tiny elephant".',"imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:l},(0,i.__)("Close","imajinn-ai"))))}function g(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(!1),[l,h]=(0,t.useState)([]),[d,m]=(0,t.useState)([]),[p,f]=(0,t.useState)(null),g=()=>a(!0),y=()=>a(!1),v=l.map(((n,a)=>(0,t.createElement)(r.PanelBody,{key:a.toString(),opened:!0},(0,t.createElement)(r.PanelRow,null,(0,t.createElement)("span",null,(0,t.createElement)("em",null,e.prompt)," ",n),(0,t.createElement)(r.Button,{variant:"primary",isSmall:!0,disabled:d.some((e=>e.index===a)),className:"genie-generate",onClick:()=>{if(e.clearStyles(),e.prompt)e.setPromptStyle(n),e.startJob(null,null,null,null,n);else{let t=n.split(",")[0];e.setPrompt(t);let i=n.split(",").slice(1).join();e.setPromptStyle(i),e.startJob(null,null,null,t,i)}m((e=>[...e,{index:a}])),y()}},(0,i.__)("Generate","imajinn-ai"))))));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.BaseControl,{label:(0,i.__)("Prompt Genie","imajinn-ai"),id:"imajinn-prompt-genie-button",className:"prompt-genie"},(0,t.createElement)("div",null,(0,t.createElement)((()=>o?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Generating prompt masterpieces...","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:e.isLoading,variant:"secondary",id:"imajinn-prompt-genie-button",label:(0,i.__)("Prompt Genie: AI generated prompt masterpiece","imajinn-ai"),onClick:()=>{e.setError(""),e.prompt===p?g():(async t=>{s(!0);const n=await fetch(`${ajaxurl}?action=imajinn-create-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,nonce:IMAJINN.nonce})}),i=await n.json();s(!1),i.success?(h(i.data.prompts),m([]),f(t),g()):(e.setError(i.data[0].message),y())})(e.prompt)},icon:(0,t.createElement)(c.DT,null)},(0,i.__)("Summon","imajinn-ai"))),null))),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:y,style:{maxWidth:"90%"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("AI Generated Prompt Ideas","imajinn-ai")}),(0,t.createElement)(r.Panel,null,v)))}function y(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>a(!0)},e.buttonLabel||(0,i.__)("License / Restrictions","imajinn-ai")),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:(0,t.createElement)(r.Icon,{icon:h})}),title:(0,i.__)("License / Usage Restrictions","imajinn-ai")}),(0,t.createElement)("p",null,"CreativeML Open RAIL-M dated August 22, 2022"),(0,t.createElement)("p",null,"Section I: PREAMBLE"),(0,t.createElement)("p",null,"Multimodal generative models are being widely adopted and used, and have the potential to transform the way artists, among other individuals, conceive and benefit from AI or ML technologies as a tool for content creation."),(0,t.createElement)("p",null,"Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations."),(0,t.createElement)("p",null,"In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the Model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for art and content generation."),(0,t.createElement)("p",null,"Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this License aims to strike a balance between both in order to enable responsible open-science in the field of AI."),(0,t.createElement)("p",null,"This License governs the use of the model (and its derivatives) and is informed by the model card associated with the model."),(0,t.createElement)("p",null,"NOW THEREFORE, You and Licensor agree as follows:"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,t.createElement)("p",null,"Definitions")),(0,t.createElement)("li",null,(0,t.createElement)("p",null,'"License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.')),(0,t.createElement)("li",null,'"Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.'),(0,t.createElement)("li",null,'"Output" means the results of operating a Model as embodied in informational content resulting therefrom.'),(0,t.createElement)("li",null,'"Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.'),(0,t.createElement)("li",null,'"Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.'),(0,t.createElement)("li",null,'"Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.'),(0,t.createElement)("li",null,'"Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.'),(0,t.createElement)("li",null,'"Licensor" means the copyright owner or entity authorized by the copyright owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.'),(0,t.createElement)("li",null,'"You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, image generator.'),(0,t.createElement)("li",null,'"Third Parties" means individuals or legal entities that are not under common control with Licensor or You.'),(0,t.createElement)("li",null,'"Contribution" means any work of authorship, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."'),(0,t.createElement)("li",null,'"Contributor" means Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.')),(0,t.createElement)("p",null,"Section II: INTELLECTUAL PROPERTY RIGHTS"),(0,t.createElement)("p",null,"Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in Section III."),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model."),(0,t.createElement)("li",null,"Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material or a Contribution incorporated within the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Work shall terminate as of the date such litigation is asserted or filed.")),(0,t.createElement)("p",null,"Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions: Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License; You must cause any modified files to carry prominent notices stating that You changed the files; You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. - for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License."),(0,t.createElement)("li",null,"Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5)."),(0,t.createElement)("li",null,"The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.")),(0,t.createElement)("p",null,"Section IV: OTHER PROVISIONS"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License, update the Model through electronic means, or modify the Output of the Model based on updates. You shall undertake reasonable efforts to use the latest version of the Model."),(0,t.createElement)("li",null,"Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors."),(0,t.createElement)("li",null,'Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model and the Complementary Material (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.'),(0,t.createElement)("li",null,"Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages."),(0,t.createElement)("li",null,"Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability."),(0,t.createElement)("li",null,"If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.")),(0,t.createElement)("p",null,"END OF TERMS AND CONDITIONS"),(0,t.createElement)("p",null,"Attachment A"),(0,t.createElement)("p",null,"Use Restrictions"),(0,t.createElement)("p",null,"You agree not to use the Model or Derivatives of the Model:"),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,"In any way that violates any applicable national, federal, state, local or international law or regulation;"),(0,t.createElement)("li",null,"For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;"),(0,t.createElement)("li",null,"To generate or disseminate verifiably false information and/or content with the purpose of harming others;"),(0,t.createElement)("li",null,"To generate or disseminate personal identifiable information that can be used to harm an individual;"),(0,t.createElement)("li",null,"To defame, disparage or otherwise harass others;"),(0,t.createElement)("li",null,"For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;"),(0,t.createElement)("li",null,"To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;"),(0,t.createElement)("li",null,"To provide medical advice and medical results interpretation;"),(0,t.createElement)("li",null,"To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}var v=n.p+"images/imajinn-demo.6ce7fccc.jpg";function w(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null),[l,c]=(0,t.useState)(null),[u,h]=(0,t.useState)(IMAJINN.email),[d,m]=(0,t.useState)(""),[p,f]=(0,t.useState)(!1),[g,w]=(0,t.useState)(!1);if(e.isConnected)return null;const b=e=>e.target.select();return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("img",{src:v,alt:(0,i.__)("Example images generated by Imajinn AI","imajinn-ai"),style:{width:"100%"}}),(0,t.createElement)("p",null,(0,i.__)("We hope you are excited to turn your imagination into creative media for your WordPress site. To get started please create a free account or login with your existing Infinite Uploads/Imajinn credentials and we'll connect your site to our cloud.","imajinn-ai")),(0,t.createElement)((()=>o?(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,o,"incorrect_password"===l&&(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/wp-login.php?action=lostpassword",target:"_blank"},(0,i.__)("Reset Password","imajinn-ai")))):null),null),(0,t.createElement)(r.__experimentalHeading,{as:"label"},(0,i.__)("Register / Login","imajinn-ai")),(0,t.createElement)(r.Flex,{align:"bottom",wrap:"true",className:"connect-wrapper"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.TextControl,{label:(0,i.__)("Email","imajinn-ai"),type:"email",value:u,onFocus:b,onChange:e=>h(e),help:(0,i.__)("You'll need a valid email to enable your credits.","imajinn-ai")}),(0,t.createElement)(r.TextControl,{label:(0,i.__)("Password","imajinn-ai"),type:"password",autoComplete:"off",value:d,onFocus:b,onChange:e=>m(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("I agree to the Terms of Service and Usage Restrictions:","imajinn-ai"),checked:g,value:"1",onChange:e=>w(e)}),(0,t.createElement)("div",{className:"license-links"},(0,t.createElement)(y,{buttonLabel:(0,i.__)("Usage Restrictions","imajinn-ai")}),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/terms-of-service/",target:"_blank"},(0,i.__)("Terms of Service","imajinn-ai")),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/privacy/",target:"_blank"},(0,i.__)("Privacy Policy","imajinn-ai"))),(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("Notify me about usage tips & new features (unsubscribe anytime)","imajinn-ai"),checked:p,value:"1",onChange:e=>f(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)((()=>n?(0,t.createElement)(r.Button,{className:"connect-button",disabled:!0},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{className:"connect-button",variant:"primary",disabled:n,onClick:()=>{a(!0),s(null),fetch(`${ajaxurl}?action=imajinn-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:d,signup_tos:g,signup_newsletter:p,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((t=>{console.log(t),t.success?(e.setIsConnected(!0),IMAJINN.connected=!0,e.setCredits(t.data.remaining_credits)):(a(!1),c(t.data[0].code),s(t.data[0].message))})).catch((e=>{a(!1),s(e)}))}},(0,i.__)("Connect","imajinn-ai"))),null))))}var b={styles:[{id:"painting, digital art, trending on artstation",name:(0,i.__)("Painting","imajinn-ai"),children:[{id:"digital art, trending on artstation, hd",name:(0,i.__)("Digital Art","imajinn-ai")},{id:"oil painting, award winning",name:(0,i.__)("Oil Painting","imajinn-ai")},{id:"watercolor painting",name:(0,i.__)("Watercolor","imajinn-ai")},{id:"acrylic painting, award winning art, trending",name:(0,i.__)("Acrylic","imajinn-ai")},{id:"airbrush art",name:(0,i.__)("Airbrushed","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")}]},{id:"artistic drawing, trending on artstation",name:(0,i.__)("Drawing","imajinn-ai"),children:[{id:"illustration, trending on artstation",name:(0,i.__)("Illustration","imajinn-ai")},{id:"cyberpunk, trending on artstation",name:(0,i.__)("Cyberpunk","imajinn-ai")},{id:"pencil sketch, drawing, trending on artstation",name:(0,i.__)("Pencil","imajinn-ai")},{id:"drawn in blue biro pen, artistic drawing, trending on artstation",name:(0,i.__)("Pen","imajinn-ai")},{id:"Ink dripping drawing, trending on artstation",name:(0,i.__)("Ink","imajinn-ai")},{id:"caligraphy",name:(0,i.__)("Caligraphy","imajinn-ai")},{id:"charcoal shaded, artistic drawing, trending on artstation",name:(0,i.__)("Charcoal","imajinn-ai")},{id:"cartoon",name:(0,i.__)("Cartoon","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"technical sketch",name:(0,i.__)("Technical Sketch","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")},{id:"line art",name:(0,i.__)("Line Art","imajinn-ai")},{id:"crayon drawing",name:(0,i.__)("Crayon","imajinn-ai")},{id:"pastel drawing, artistic",name:(0,i.__)("Pastel","imajinn-ai")},{id:"chalkboard drawing",name:(0,i.__)("Chalkboard","imajinn-ai")}]},{id:"animation",name:(0,i.__)("Animation","imajinn-ai"),children:[{id:"vintage disney animation",name:(0,i.__)("Vintage Disney","imajinn-ai")},{id:"Rendered by octane, disney animation studios",name:(0,i.__)("Disney Animation","imajinn-ai")},{id:"simpsons style animation",name:(0,i.__)("Simpsons","imajinn-ai")},{id:"anime style, Studio Ghibli, manga, trending on artstation",name:(0,i.__)("Anime","imajinn-ai")},{id:"disney pixar style animation, octane render",name:(0,i.__)("Pixar","imajinn-ai")}]},{id:"unreal engine, 3d render, Rendered by octane",name:(0,i.__)("Screen","imajinn-ai"),children:[{id:"Unreal Engine, Cinema 4D",name:(0,i.__)("Video Game HD","imajinn-ai")},{id:"animal crossing, mario, nintendo, pokemon",name:(0,i.__)("Nintendo","imajinn-ai")},{id:"3D render, composite",name:(0,i.__)("3D Render","imajinn-ai")},{id:"8bit graphics",name:(0,i.__)("8bit","imajinn-ai")},{id:"emoji",name:(0,i.__)("Emoji","imajinn-ai")},{id:"low poly ps1 graphics",name:(0,i.__)("Low Poly","imajinn-ai")},{id:"pixel art",name:(0,i.__)("Pixel Art","imajinn-ai")},{id:"ASCII art",name:(0,i.__)("ASCII","imajinn-ai")}]},{id:"photograph of, photo, 50mm portrait photograph",name:(0,i.__)("Photography (avoid people)","imajinn-ai"),children:[{id:"realistic photo of, award winning photograph, 50mm",name:(0,i.__)("Realistic","imajinn-ai")},{id:"Portrait photograph, symmetrical, award winning, bokeh, dof, Annie Leibovitz",name:(0,i.__)("Portrait","imajinn-ai")},{id:"polaroid photograph, polaroid frame",name:(0,i.__)("Polaroid","imajinn-ai")},{id:"war photograph, WWI photograph, WWII photograph",name:(0,i.__)("War","imajinn-ai")},{id:"Wildlife Photograph, national geographic photo, zoom, telephoto",name:(0,i.__)("Wildlife","imajinn-ai")},{id:"Photojournalism, award winning, photo of, magazine photograph",name:(0,i.__)("Photojournalism","imajinn-ai")},{id:"macro photograph, close up, zoom, depth of field",name:(0,i.__)("Macro","imajinn-ai")},{id:"long exposure, photograph, realistic",name:(0,i.__)("Long Exposure","imajinn-ai")},{id:"photograph, fish eye lense, wide-angle",name:(0,i.__)("Fish Eye","imajinn-ai")}]},{id:"realistic",name:(0,i.__)("Real Life Materials","imajinn-ai"),children:[{children:[{id:"marble statue",name:(0,i.__)("Marble","imajinn-ai")},{id:"stone statue",name:(0,i.__)("stone","imajinn-ai")},{id:"statue carved from wax",name:(0,i.__)("Wax","imajinn-ai")}],id:"statue",name:(0,i.__)("Statue","imajinn-ai")},{id:"origami paper folding",name:(0,i.__)("Origami","imajinn-ai")},{id:"paper mache art",name:(0,i.__)("Paper Mache","imajinn-ai")},{id:"paper cutout art",name:(0,i.__)("Paper Cutout","imajinn-ai")},{id:"graffiti street art",name:(0,i.__)("Graffiti","imajinn-ai")},{id:"halftone print",name:(0,i.__)("Halftone","imajinn-ai")},{id:"cross stitch art",name:(0,i.__)("Cross Stitch","imajinn-ai")},{id:"stained glass",name:(0,i.__)("Stained Glass","imajinn-ai")},{id:"made of crystals",name:(0,i.__)("Crystal","imajinn-ai")},{id:"made of flowers",name:(0,i.__)("Flowery","imajinn-ai")}]}],artists:[{value:"",label:""},{value:"by Albert Bierstadt",label:(0,i.__)("Albert Bierstadt","imajinn-ai")},{value:"by Andy Warhol",label:(0,i.__)("Andy Warhol","imajinn-ai")},{value:"by Asaf Hanuka",label:(0,i.__)("Asaf Hanuka","imajinn-ai")},{value:"by Aubrey Beardsley",label:(0,i.__)("Aubrey Beardsley","imajinn-ai")},{value:"by Claude Monet",label:(0,i.__)("Claude Monet","imajinn-ai")},{value:"by Diego Rivera",label:(0,i.__)("Diego Rivera","imajinn-ai")},{value:"by Frida Kahlo",label:(0,i.__)("Frida Kahlo","imajinn-ai")},{value:"by Greg Rutkowski",label:(0,i.__)("Greg Rutkowski","imajinn-ai")},{value:"by Hayao Miyazaki",label:(0,i.__)("Hayao Miyazaki","imajinn-ai")},{value:"by Hieronymus Bosch",label:(0,i.__)("Hieronymus Bosch","imajinn-ai")},{value:"by Jackson Pollock",label:(0,i.__)("Jackson Pollock","imajinn-ai")},{value:"by Leonardo da Vinci",label:(0,i.__)("Leonardo da Vinci","imajinn-ai")},{value:"by Michelangelo",label:(0,i.__)("Michelangelo","imajinn-ai")},{value:"by Pablo Picasso",label:(0,i.__)("Pablo Picasso","imajinn-ai")},{value:"by Salvador Dali",label:(0,i.__)("Salvador Dali","imajinn-ai")},{value:"by artgerm, art germ",label:(0,i.__)("Stanley Artgerm","imajinn-ai")},{value:"by Thomas Kinkade",label:(0,i.__)("Thomas Kinkade","imajinn-ai")},{value:"by Vincent van Gogh",label:(0,i.__)("Vincent van Gogh","imajinn-ai")}],modifiers:[{value:"",label:""},{value:"in the style of steampunk",label:(0,i.__)("Steampunk","imajinn-ai")},{value:"synthwave",label:(0,i.__)("Synthwave","imajinn-ai")},{value:"in the style of cyberpunk",label:(0,i.__)("Cyberpunk","imajinn-ai")},{value:"insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Detailed & Intricate","imajinn-ai")},{value:"in a symbolic and meaningful style, insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Symbolic & Meaningful","imajinn-ai")},{value:"Cinematic Lighting",label:(0,i.__)("Cinematic Lighting","imajinn-ai")},{value:"Contre-Jour",label:(0,i.__)("Contre-Jour","imajinn-ai")},{value:"futuristic",label:(0,i.__)("Futuristic","imajinn-ai")},{value:"black and white",label:(0,i.__)("Black & White","imajinn-ai")},{value:"technicolor",label:(0,i.__)("Technicolor","imajinn-ai")},{value:"warm color palette",label:(0,i.__)("Warm","imajinn-ai")},{value:"neon",label:(0,i.__)("Neon","imajinn-ai")},{value:"colorful",label:(0,i.__)("Colorful","imajinn-ai")}]},_=e=>{let{image:n,setImage:i,generations:a}=e;return(0,t.createElement)(t.Fragment,null,null!==n&&(0,t.createElement)(r.Modal,{__experimentalHideHeader:!0,onRequestClose:()=>i(null),className:"imajinn-preview-modal",onKeyDown:e=>{const t=a.length-1;"ArrowRight"===e.key?i(n<t?n+1:0):"ArrowLeft"===e.key&&i(n>0?n-1:t)}},(0,t.createElement)("img",{style:{width:"100%"},src:a[n].preview,onClick:()=>i(null)})))},E=e=>{let{history:n,setPrompt:o,setPromptStyle:s,setGenerations:l,setRatio:c,clearStyles:u,setQueryRatio:h,setSaved:d,setFaceFixed:m}=e;return n.length<=0?null:(0,t.createElement)(a.InspectorControls,{key:"setting"},(0,t.createElement)(r.Panel,{header:(0,i.__)("Generation History","imajinn-ai"),className:"imajinn-history"},n.map(((e,n)=>(0,t.createElement)(r.PanelBody,{key:n},(0,t.createElement)("h2",{className:"components-panel__body-title"},e.generations.map(((e,n)=>(0,t.createElement)("img",{key:n,src:e.thumbnail,alt:sprintf((0,i.__)("Result %d","imajinn-ai"),(n+1).toString())}))),(0,t.createElement)(r.Button,{variant:"secondary",label:(0,i.__)("Load prompt results","imajinn-ai"),onClick:()=>{u(),o(e.prompt),s(e.prompt_style),l(e.generations),c(e.ratio),h(e.ratio),d([]),m([])}},(0,i.__)("Load","imajinn-ai"))),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.__experimentalText,{numberOfLines:2,truncate:!0},e.prompt)))))))},x=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),j=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})),M=e=>{let{ratio:n,isLoading:a,setRatio:o}=e;const s={"1:1":(0,i.__)("Square","imajinn-ai"),"3:2":(0,i.__)("Wide","imajinn-ai"),"2:3":(0,i.__)("Tall","imajinn-ai")}[n]+" images"+("1:1"!==n?" - "+(0,i.__)("slower to generate","imajinn-ai"):"");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-ratio",label:(0,i.__)("Select an image ratio to generate.","imajinn-ai"),defaultChecked:"1:1",disabled:a,onChange:o,checked:n},(0,t.createElement)(r.__experimentalRadio,{value:"1:1",icon:x},"1:1"),(0,t.createElement)(r.__experimentalRadio,{value:"3:2",icon:j},"3:2"),(0,t.createElement)(r.__experimentalRadio,{className:"ratio-3-2",value:"2:3",icon:j},"2:3")),(0,t.createElement)("br",null),(0,t.createElement)(r.__experimentalText,null,s))},S=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})),k=function(e){const[n,a]=(0,t.useState)(e.showUpgrade),o=()=>{a(!1),e.setShowUpgrade(!1)};return(0,t.useEffect)((()=>{a(e.showUpgrade)}),[a,e]),(0,t.createElement)(t.Fragment,null,n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"400px"},icon:S,title:(0,i.__)("Upgrade Plan","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Sorry, you are out of available image generation credits. You can get more credits by upgrading your account to one of our premium plans.","imajinn-ai")),(0,t.createElement)("div",{className:"imajinn-upgrade-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",href:IMAJINN.checkout_url,target:"_blank"},(0,i.__)("Get More Credits","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i._x)("Cancel","Don't upgrade now","imajinn-ai")))))},C=window.React,I=n.n(C),D=e=>{let{isConnected:n,credits:o,refreshInfo:s,visitAccount:l}=e;const[c,u]=(0,C.useState)(!1),[h,d]=(0,C.useState)("refreshing-button");return(0,C.useEffect)((()=>{d(c?"refreshing-button is-refreshing":"refreshing-button")}),[c]),(0,t.createElement)(a.BlockControls,null,(0,t.createElement)(r.Toolbar,{label:(0,i.__)("Imajinn AI","imajinn-ai"),className:"imajinn-toolbar"},(0,t.createElement)(r.ToolbarGroup,null,n&&!1!==o&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"credit-label"},(0,i.__)("Credits:","imajinn-ai")),(0,t.createElement)("div",{className:"credits"},o),(0,t.createElement)(r.ToolbarButton,{className:h,disabled:c,icon:(0,t.createElement)(r.Dashicon,{icon:"update"}),label:(0,i.__)("Refresh count","imajinn-ai"),onClick:async()=>{u(!0),await s(),u(!1)}})),(0,t.createElement)(r.ToolbarButton,{onClick:l,icon:(0,t.createElement)(r.Dashicon,{icon:"admin-users"}),label:(0,i.__)("Account / Upgrade","imajinn-ai")}),(0,t.createElement)(p,null))))};const A=e=>{let{setImageStyle:n,isLoading:a,imageStyle:o,optionData:s}=e;return(0,t.createElement)(r.TreeSelect,{disabled:a,label:(0,i.__)("Select an image style","imajinn-ai"),noOptionLabel:" ",selectedId:o,onChange:e=>{n(e)},__next36pxDefaultSize:!0,tree:s.styles})},T=e=>{let{setImageArtist:n,isLoading:a,imageArtist:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select an Artist style","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.artists})},L=e=>{let{setImageModifier:n,isLoading:a,imageModifier:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select a style modifier","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.modifiers})};var P=e=>{let{hasError:n}=e;return(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,n))},N=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),O=e=>{let{saved:n,saveImage:a,...o}=e;const[s,l]=(0,C.useState)(!1);return IMAJINN.custom_editor?null:s?(0,t.createElement)(r.Button,{disabled:!0,className:"imajinn-image-insert",label:(0,i.__)("Inserting","imajinn-ai")},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{variant:"primary",className:"imajinn-image-insert",disabled:s,icon:N,onClick:async()=>{l(!0),await(async e=>{let t=!1;if(t=n.some((t=>t.index===e))?n.find((t=>t.index===e)).data:await a(e),t){const e=wp.data.select("core/block-editor").getBlocks().map((function(e){return"infinite-uploads/imajinn-ai"===e.name})).indexOf(!0),n=wp.blocks.createBlock("core/image",{id:t.attachment_id,url:t.url,width:t.width,height:t.height,sizeSlug:t.size,alt:o.prompt+" "+o.promptStyle,title:o.prompt,caption:o.prompt});return wp.data.dispatch("core/block-editor").insertBlocks(n,e),!0}return!1})(o.genindex)||l(!1)}},(0,i.__)("Insert","imajinn-ai"))},R=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),z=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),B=e=>{const[n,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{e.saved.some((t=>t.index===e.genindex))?(s(!0),a(!1)):(s(!1),a(!1))}),[e.saved]),o?(0,t.createElement)(r.Button,{disabled:!0,icon:R,label:(0,i.__)("Saved","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saved","imajinn-ai"):""):n?(0,t.createElement)(r.Button,{disabled:!0,style:IMAJINN.custom_editor?{}:{maxWidth:"36px"},icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Saving","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saving","imajinn-ai"):""):(0,t.createElement)(r.Button,{variant:IMAJINN.custom_editor?"primary":"secondary",disabled:n,icon:z,label:(0,i.__)("Save to Media Library","imajinn-ai"),onClick:async()=>{a(!0),await e.saveImage(e.genindex)||a(!1)}},IMAJINN.custom_editor?(0,i.__)("Save","imajinn-ai"):"")},W=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Y=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),F=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),V=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),G=n(227),H=n(301),U=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var a=i[n];e.call(t,a[1],a[0])}},t}()}(),J="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,q=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Z="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(q):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},X=["top","right","bottom","left","width","height","size","weight"],Q="undefined"!=typeof MutationObserver,$=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,a=0;function r(){n&&(n=!1,e()),i&&s()}function o(){Z(r)}function s(){var e=Date.now();if(n){if(e-a<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){J&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Q?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){J&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;X.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),K=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var a=i[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ee=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||q},te=oe(0,0,0,0);function ne(e){return parseFloat(e)||0}function ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ne(e["border-"+n+"-width"])}),0)}var ae="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof ee(e).SVGGraphicsElement}:function(e){return e instanceof ee(e).SVGElement&&"function"==typeof e.getBBox};function re(e){return J?ae(e)?function(e){var t=e.getBBox();return oe(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return te;var i=ee(e).getComputedStyle(e),a=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var a=i[n],r=e["padding-"+a];t[a]=ne(r)}return t}(i),r=a.left+a.right,o=a.top+a.bottom,s=ne(i.width),l=ne(i.height);if("border-box"===i.boxSizing&&(Math.round(s+r)!==t&&(s-=ie(i,"left","right")+r),Math.round(l+o)!==n&&(l-=ie(i,"top","bottom")+o)),!function(e){return e===ee(e).document.documentElement}(e)){var c=Math.round(s+r)-t,u=Math.round(l+o)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return oe(a.left,a.top,s,l)}(e):te}function oe(e,t,n,i){return{x:e,y:t,width:n,height:i}}var se=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=re(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),le=function(e,t){var n,i,a,r,o,s,l,c=(i=(n=t).x,a=n.y,r=n.width,o=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),K(l,{x:i,y:a,width:r,height:o,top:a,right:i+r,bottom:o+a,left:i}),l);K(this,{target:e,contentRect:c})},ce=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new U,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new se(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new le(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ue="undefined"!=typeof WeakMap?new WeakMap:new U,he=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=$.getInstance(),i=new ce(t,n,this);ue.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){he.prototype[e]=function(){var t;return(t=ue.get(this))[e].apply(t,arguments)}}));var de=void 0!==q.ResizeObserver?q.ResizeObserver:he;function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},me.apply(this,arguments)}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),ye=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:ge,viewMax:ge}),ve=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),we=function(){function e(e){var t=this,n=e.scaleExtents,i=e.documentSize;fe(this,"_scaleExtents",void 0),fe(this,"_documentSize",void 0),fe(this,"_canvas",null),fe(this,"_view",{scale:1,x:0,y:0}),fe(this,"_viewChangeListeners",new Set),fe(this,"setScale",(function(e){t.setView({scale:e})})),fe(this,"clampView",(function(e){var n=e.scale,i=e.x,a=e.y,r=t.scaleExtents,o=r.min,s=r.max,l=t.documentSize,c=l.width,u=l.height,h=t.canvasRect||ye,d=h.left,m=h.top,p=h.right-d,f=h.bottom-m,g=p/2,y=-(c*t._view.scale-p/2),v=f/2,w=-(u*t._view.scale-f/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(i,y),g),y:Math.min(Math.max(a,w),v)}})),fe(this,"resetView",(function(){t.setView({scale:1,x:0,y:0})})),fe(this,"setView",(function(e){var n=t.clampView(me({},t._view,e||{})),i=t._view,a=i.scale,r=i.x,o=i.y;return n.scale===a&&n.x===r&&n.y===o||(t._view=n,t._viewChangeListeners.forEach((function(e){return e&&e(n)}))),me({},t._view)})),fe(this,"scaleAtClientPoint",(function(e,n){var i=t.clientPointToViewPoint(n),a=t.clampView(me({},t._view,{scale:t._view.scale+e})),r=t.viewPointToClientPoint(i,a);return a.x=t._view.x-(r.clientX-n.clientX),a.y=t._view.y-(r.clientY-n.clientY),t.setView(a)})),fe(this,"clientPointToViewPoint",(function(e,n){var i=e.clientX,a=e.clientY;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=i-r.left,s=a-r.top;return{x:(o-n.x)/n.scale,y:(s-n.y)/n.scale,relativeClientX:o,relativeClientY:s}})),fe(this,"viewPointToClientPoint",(function(e,n){var i=e.x,a=e.y;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=r.left,s=r.top,l=i*n.scale+n.x,c=a*n.scale+n.y,u=l+o,h=c+s;return{clientX:u,clientY:h,relativeX:l,relativeY:c,x:u,y:h}})),fe(this,"attachViewChangeListener",(function(e){t._viewChangeListeners.add(e)})),this._scaleExtents=n,this._documentSize=i}var t,n;return t=e,(n=[{key:"canvas",get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:"scale",get:function(){return this._view.scale}},{key:"x",get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:"y",get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:"view",get:function(){return me({},this._view)}},{key:"scaleExtents",get:function(){return me({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:"documentSize",get:function(){return me({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:"transformMatrix",get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:"canvasBounds",get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,i=e.right,a=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:i,clientY:a}),left:t,top:n,right:i,bottom:a,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}}},{key:"canvasRect",get:function(){return this.canvas?this.canvas.getBoundingClientRect():void 0}}])&&pe(t.prototype,n),e}();function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=function(e){e.preventDefault()},Ee=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){var i=n.props,a=i.disabled,r=i.enablePanAndZoom,o=i.mouseZoomFactor;return a?new xe:(r&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Ae(t))),e)})),be(this,"handleDrawStart",(function(e,t){return t.props.disabled?new xe:e.ctrlKey&&t.props.enablePanAndZoom?(new je).handleDrawStart(e,t):(new Me).handleDrawStart(e,t)})),be(this,"handleDrawMove",(function(t,n){if(n.props.disabled)return new xe;var i=Te(n.coordSystem,t),a=i.x,r=i.y;return n.lazy.update({x:a,y:r}),e})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?new xe:e}))},xe=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){return n.props.disabled?e:(new Ee).handleMouseWheel(t,n)})),be(this,"handleDrawStart",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawMove(t,n)})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawEnd(t,n)}))},je=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),e.dragStart=Ae(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Ae(t),a=i.clientX,r=i.clientY,o=a-e.dragStart.clientX,s=r-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e})),be(this,"handleDrawEnd",(function(){return new Ee}))},Me=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){var i=n.props.enablePanAndZoom;return t.preventDefault(),t.touches&&t.touches.length&&i?i&&t.touches&&t.touches.length>=2?(new Se).handleDrawStart(t,n):e.handleDrawMove(t,n):(new Ie).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return(new Se).handleDrawStart(t,n);var i=Ae(t);return e.deferredPoints.push(i),(new Date).valueOf()-e.startTimestamp<250&&(null===e.startClientPoint&&(e.startClientPoint=i),Math.abs(i.clientX-e.startClientPoint.clientX)+Math.abs(i.clientY-e.startClientPoint.clientY)<10)?e:e.issueDeferredPoints(n)})),be(this,"handleDrawEnd",(function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)})),be(this,"issueDeferredPoints",(function(t){for(var n=new Ie,i=0;i<e.deferredPoints.length;i++){var a=e.deferredPoints[i],r=new De(a);n=(0===i?n.handleDrawStart:n.handleDrawMove)(r,t)}return n})),this.startClientPoint=null,this.startTimestamp=(new Date).valueOf(),this.deferredPoints=[]},Se=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Ee:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Ee;var i=e.recentMetrics=e.getTouchMetrics(t),a=i.centroid,r=i.distance;if(Math.abs(r-e.start.distance)>=10)return new Ce(e).handleDrawMove(t,n);var o=a.clientX-e.start.centroid.clientX,s=a.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=10?new ke(e).handleDrawMove(t,n):e})),be(this,"handleDrawEnd",(function(){return new Ee})),be(this,"getTouchMetrics",(function(e){var t=Ae(e.touches[0]),n=t.clientX,i=t.clientY,a=Ae(e.touches[1]),r=a.clientX,o=a.clientY,s=r-n,l=o-i;return{t1:{clientX:n,clientY:i},t2:{clientX:r,clientY:o},distance:Math.sqrt(s*s+l*l),centroid:{clientX:(n+r)/2,clientY:(i+o)/2}}}))},ke=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=(a.distance,r.clientX-i.start.centroid.clientX),s=r.clientY-i.start.centroid.clientY;return n.setView({x:i.panStart.x+o,y:i.panStart.y+s}),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ce=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=a.distance,s=i.scaleStart*(o/i.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,r),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ie=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r},{both:!0})}return e.handleDrawMove(t,n)})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r});var o=!n.lazy.isEnabled();return e.isDrawing&&!o||(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e})),be(this,"handleDrawEnd",(function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Ee})),this.isDrawing=!1},De=function(e){var t=e.clientX,n=e.clientY;be(this,"preventDefault",(function(){})),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Ae(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Te(e,t){return e.clientPointToViewPoint(Ae(t))}var Le=!1;try{var Pe={get passive(){return Le=!0,!1}};window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(e){Le=!1}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Oe.apply(this,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var We={display:"block",position:"absolute"},Ye=["grid","drawing","temp","interface"],Fe=function(e){var t,n;function i(t){var n;return ze(Re(n=e.call(this,t)||this),"undo",(function(){var e=[];n.lines.length?e=n.lines.slice(0,-1):n.erasedLines.length&&(e=n.erasedLines.pop()),n.clearExceptErasedLines(),n.simulateDrawingLines({lines:e,immediate:!0}),n.triggerOnChange()})),ze(Re(n),"eraseAll",(function(){n.erasedLines.push([].concat(n.lines)),n.clearExceptErasedLines(),n.triggerOnChange()})),ze(Re(n),"clear",(function(){n.erasedLines=[],n.clearExceptErasedLines(),n.resetView()})),ze(Re(n),"resetView",(function(){return n.coordSystem.resetView()})),ze(Re(n),"setView",(function(e){return n.coordSystem.setView(e)})),ze(Re(n),"getSaveData",(function(){return JSON.stringify({lines:n.lines,width:n.props.canvasWidth,height:n.props.canvasHeight})})),ze(Re(n),"getDataURL",(function(e,t,i){var a=n.canvas.drawing,r=a.getContext("2d"),o=a.width,s=a.height,l=r.getImageData(0,0,o,s),c=r.globalCompositeOperation;if(r.globalCompositeOperation="destination-over",t){if(!n.props.imgSrc)return"Background image source not set";n.drawImage()}else null!=i&&(r.fillStyle=i,r.fillRect(0,0,o,s));e||(e="png");var u=a.toDataURL("image/"+e);return r.clearRect(0,0,o,s),r.putImageData(l,0,0),r.globalCompositeOperation=c,u})),ze(Re(n),"loadSaveData",(function(e,t){if(void 0===t&&(t=n.props.immediateLoading),"string"!=typeof e)throw new Error("saveData needs to be of type string!");var i=JSON.parse(e),a=i.lines,r=i.width,o=i.height;if(!a||"function"!=typeof a.push)throw new Error("saveData.lines needs to be an array!");if(n.clear(),r===n.props.canvasWidth&&o===n.props.canvasHeight)n.simulateDrawingLines({lines:a,immediate:t});else{var s=n.props.canvasWidth/r,l=n.props.canvasHeight/o,c=(s+l)/2;n.simulateDrawingLines({lines:a.map((function(e){return Oe({},e,{points:e.points.map((function(e){return{x:e.x*s,y:e.y*l}})),brushRadius:e.brushRadius*c})})),immediate:t})}})),ze(Re(n),"componentWillUnmount",(function(){n.canvasObserver.unobserve(n.canvasContainer),n.canvas.interface&&n.canvas.interface.removeEventListener("wheel",n.handleWheel)})),ze(Re(n),"handleWheel",(function(e){n.interactionSM=n.interactionSM.handleMouseWheel(e,Re(n))})),ze(Re(n),"handleDrawStart",(function(e){n.interactionSM=n.interactionSM.handleDrawStart(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawMove",(function(e){n.interactionSM=n.interactionSM.handleDrawMove(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawEnd",(function(e){n.interactionSM=n.interactionSM.handleDrawEnd(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"applyView",(function(){if(n.ctx.drawing&&(Ye.map((function(e){return n.ctx[e]})).forEach((function(e){n.clearWindow(e);var t=n.coordSystem.transformMatrix;e.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)})),!n.deferRedrawOnViewChange)){n.drawGrid(n.ctx.grid),n.redrawImage(),n.loop({once:!0});var e=n.lines;n.lines=[],n.simulateDrawingLines({lines:e,immediate:!0})}})),ze(Re(n),"handleCanvasResize",(function(e){var t=n.getSaveData();n.deferRedrawOnViewChange=!0;try{for(var i,a=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(i=a()).done;){var r=i.value.contentRect,o=r.width,s=r.height;n.setCanvasSize(n.canvas.interface,o,s),n.setCanvasSize(n.canvas.drawing,o,s),n.setCanvasSize(n.canvas.temp,o,s),n.setCanvasSize(n.canvas.grid,o,s),n.coordSystem.documentSize={width:o,height:s},n.drawGrid(n.ctx.grid),n.drawImage(),n.loop({once:!0})}n.loadSaveData(t,!0)}finally{n.deferRedrawOnViewChange=!1}})),ze(Re(n),"clampPointToDocument",(function(e){return n.props.clampLinesToDocument?{x:Math.max(Math.min(e.x,n.props.canvasWidth),0),y:Math.max(Math.min(e.y,n.props.canvasHeight),0)}:e})),ze(Re(n),"redrawImage",(function(){n.image&&n.image.complete&&function(e){var t=void 0===e?{}:e,n=t.ctx,i=t.img,a=t.x,r=t.y,o=t.w,s=t.h,l=t.offsetX,c=t.offsetY;"number"!=typeof a&&(a=0),"number"!=typeof r&&(r=0),"number"!=typeof o&&(o=n.canvas.width),"number"!=typeof s&&(s=n.canvas.height),"number"!=typeof l&&(l=.5),"number"!=typeof c&&(c=.5),l<0&&(l=0),c<0&&(c=0),l>1&&(l=1),c>1&&(c=1);var u,h,d,m,p=i.width,f=i.height,g=Math.min(o/p,s/f),y=p*g,v=f*g,w=1;y<o&&(w=o/y),Math.abs(w-1)<1e-14&&v<s&&(w=s/v),(u=(p-(d=p/((y*=w)/o)))*l)<0&&(u=0),(h=(f-(m=f/((v*=w)/s)))*c)<0&&(h=0),d>p&&(d=p),m>f&&(m=f),n.drawImage(i,u,h,d,m,a,r,o,s)}({ctx:n.ctx.grid,img:n.image})})),ze(Re(n),"simulateDrawingLines",(function(e){var t=e.lines,i=e.immediate,a=0,r=i?0:n.props.loadTimeOffset;t.forEach((function(e){var t=e.points,o=e.brushColor,s=e.brushRadius;if(i)return n.drawPoints({points:t,brushColor:o,brushRadius:s}),n.points=t,void n.saveLine({brushColor:o,brushRadius:s});for(var l=function(e){a+=r,window.setTimeout((function(){n.drawPoints({points:t.slice(0,e+1),brushColor:o,brushRadius:s})}),a)},c=1;c<t.length;c++)l(c);a+=r,window.setTimeout((function(){n.points=t,n.saveLine({brushColor:o,brushRadius:s})}),a)}))})),ze(Re(n),"setCanvasSize",(function(e,t,n){e.width=t,e.height=n,e.style.width=t,e.style.height=n})),ze(Re(n),"drawPoints",(function(e){var t=e.points,i=e.brushColor,a=e.brushRadius;n.ctx.temp.lineJoin="round",n.ctx.temp.lineCap="round",n.ctx.temp.strokeStyle=i,n.clearWindow(n.ctx.temp),n.ctx.temp.lineWidth=2*a;var r=t[0],o=t[1];n.ctx.temp.moveTo(o.x,o.y),n.ctx.temp.beginPath();for(var s=1,l=t.length;s<l;s++){var c=Be(r,o);n.ctx.temp.quadraticCurveTo(r.x,r.y,c.x,c.y),r=t[s],o=t[s+1]}n.ctx.temp.lineTo(r.x,r.y),n.ctx.temp.stroke()})),ze(Re(n),"saveLine",(function(e){var t=void 0===e?{}:e,i=t.brushColor,a=t.brushRadius;n.points.length<2||(n.lines.push({points:[].concat(n.points),brushColor:i||n.props.brushColor,brushRadius:a||n.props.brushRadius}),n.points.length=0,n.inClientSpace([n.ctx.drawing,n.ctx.temp],(function(){n.ctx.drawing.drawImage(n.canvas.temp,0,0,n.canvas.drawing.width,n.canvas.drawing.height)})),n.clearWindow(n.ctx.temp),n.triggerOnChange())})),ze(Re(n),"triggerOnChange",(function(){n.props.onChange&&n.props.onChange(Re(n))})),ze(Re(n),"clearWindow",(function(e){n.inClientSpace([e],(function(){return e.clearRect(0,0,e.canvas.width,e.canvas.height)}))})),ze(Re(n),"clearExceptErasedLines",(function(){n.lines=[],n.valuesChanged=!0,n.clearWindow(n.ctx.drawing),n.clearWindow(n.ctx.temp)})),ze(Re(n),"loop",(function(e){var t=(void 0===e?{}:e).once,i=void 0!==t&&t;if(n.lazy&&(n.mouseHasMoved||n.valuesChanged)){var a=n.lazy.getPointerCoordinates(),r=n.lazy.getBrushCoordinates();n.drawInterface(n.ctx.interface,a,r),n.mouseHasMoved=!1,n.valuesChanged=!1}i||window.requestAnimationFrame((function(){n.loop()}))})),ze(Re(n),"inClientSpace",(function(e,t){e.forEach((function(e){e.save(),e.setTransform(ve.a,ve.b,ve.c,ve.d,ve.e,ve.f)}));try{t()}finally{e.forEach((function(e){return e.restore()}))}})),ze(Re(n),"drawImage",(function(){n.props.imgSrc&&(n.image=new Image,n.image.crossOrigin="anonymous",n.image.onload=n.redrawImage,n.image.src=n.props.imgSrc)})),ze(Re(n),"drawGrid",(function(e){if(!n.props.hideGrid){n.clearWindow(e);var t=25,i=n.coordSystem.canvasBounds,a=i.viewMin,r=i.viewMax,o=Math.floor(a.x/t-1)*t,s=Math.floor(a.y/t-1)*t,l=r.x+t,c=r.y+t;if(e.beginPath(),e.setLineDash([5,1]),e.setLineDash([]),e.strokeStyle=n.props.gridColor,e.lineWidth=n.props.gridLineWidth,!n.props.hideGridX){for(var u=o,h=n.props.gridSizeX;u<l;)u+=h,e.moveTo(u,s),e.lineTo(u,c);e.stroke()}if(!n.props.hideGridY){for(var d=s,m=n.props.gridSizeY;d<c;)d+=m,e.moveTo(o,d),e.lineTo(l,d);e.stroke()}}})),ze(Re(n),"drawInterface",(function(e,t,i){n.props.hideInterface||(n.clearWindow(e),e.beginPath(),e.fillStyle=n.props.brushColor,e.arc(i.x,i.y,n.props.brushRadius,0,2*Math.PI,!0),e.fill(),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(t.x,t.y,4,0,2*Math.PI,!0),e.fill(),n.lazy.isEnabled()&&(e.beginPath(),e.lineWidth=2,e.lineCap="round",e.setLineDash([2,4]),e.strokeStyle=n.props.catenaryColor,n.catenary.drawToCanvas(n.ctx.interface,i,t,n.chainLength),e.stroke()),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(i.x,i.y,2,0,2*Math.PI,!0),e.fill())})),n.canvas={},n.ctx={},n.catenary=new H.oT,n.points=[],n.lines=[],n.erasedLines=[],n.mouseHasMoved=!0,n.valuesChanged=!0,n.isDrawing=!1,n.isPressing=!1,n.deferRedrawOnViewChange=!1,n.interactionSM=new Ee,n.coordSystem=new we({scaleExtents:t.zoomExtents,documentSize:{width:t.canvasWidth,height:t.canvasHeight}}),n.coordSystem.attachViewChangeListener(n.applyView.bind(Re(n))),n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.componentDidMount=function(){var e,t=this;this.lazy=new G.xv({radius:this.props.lazyRadius*window.devicePixelRatio,enabled:!0,initialPoint:{x:window.innerWidth/2,y:window.innerHeight/2}}),this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.canvasObserver=new de((function(e,n){return t.handleCanvasResize(e,n)})),this.canvasObserver.observe(this.canvasContainer),this.drawImage(),this.loop(),window.setTimeout((function(){var e=window.innerWidth/2,n=window.innerHeight/2;t.lazy.update({x:e-t.chainLength/4,y:n},{both:!0}),t.lazy.update({x:e+t.chainLength/4,y:n},{both:!1}),t.mouseHasMoved=!0,t.valuesChanged=!0,t.clearExceptErasedLines(),t.props.saveData&&t.loadSaveData(t.props.saveData)}),100),this.canvas.interface&&this.canvas.interface.addEventListener("wheel",this.handleWheel,Le?{passive:e}:e)},a.componentDidUpdate=function(e){e.lazyRadius!==this.props.lazyRadius&&(this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.lazy.setRadius(this.props.lazyRadius*window.devicePixelRatio)),e.saveData!==this.props.saveData&&this.loadSaveData(this.props.saveData),JSON.stringify(e)!==JSON.stringify(this.props)&&(this.valuesChanged=!0),this.coordSystem.scaleExtents=this.props.zoomExtents,this.props.enablePanAndZoom||this.coordSystem.resetView(),e.imgSrc!==this.props.imgSrc&&this.drawImage()},a.render=function(){var e=this;return I().createElement("div",{className:this.props.className,style:Oe({display:"block",background:this.props.backgroundColor,touchAction:"none",width:this.props.canvasWidth,height:this.props.canvasHeight},this.props.style),ref:function(t){t&&(e.canvasContainer=t)}},Ye.map((function(t){var n="interface"===t;return I().createElement("canvas",{key:t,ref:function(i){i&&(e.canvas[t]=i,e.ctx[t]=i.getContext("2d"),n&&(e.coordSystem.canvas=i))},style:Oe({},We),onMouseDown:n?e.handleDrawStart:void 0,onMouseMove:n?e.handleDrawMove:void 0,onMouseUp:n?e.handleDrawEnd:void 0,onMouseOut:n?e.handleDrawEnd:void 0,onTouchStart:n?e.handleDrawStart:void 0,onTouchMove:n?e.handleDrawMove:void 0,onTouchEnd:n?e.handleDrawEnd:void 0,onTouchCancel:n?e.handleDrawEnd:void 0})})))},i}(C.PureComponent);ze(Fe,"defaultProps",{onChange:null,loadTimeOffset:5,lazyRadius:12,brushRadius:10,brushColor:"#444",catenaryColor:"#0a0302",gridColor:"rgba(150,150,150,0.17)",backgroundColor:"#FFF",hideGrid:!1,canvasWidth:400,canvasHeight:400,disabled:!1,imgSrc:"",saveData:"",immediateLoading:!1,hideInterface:!1,gridSizeX:25,gridSizeY:25,gridLineWidth:.5,hideGridX:!1,hideGridY:!1,enablePanAndZoom:!1,mouseZoomFactor:.01,zoomExtents:{min:.33,max:3},clampLinesToDocument:!1}),Fe.propTypes={};function Ve(e){const n=function(e){const[n,i]=(0,t.useState)({windowWidth:window.innerWidth,isDesiredWidth:window.innerWidth<e});return(0,t.useEffect)((()=>{const t=()=>{const t=window.innerWidth;i({windowWidth:t,isDesiredWidth:t<e})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[n.windowWidth]),n.isDesiredWidth}(600),[a,o]=(0,t.useState)(n?.6:1),[s,l]=(0,t.useState)(!1),[c,h]=(0,t.useState)(null),[d,m]=(0,t.useState)(null),[p,g]=(0,t.useState)(25),[y,v]=(0,t.useState)(e.prompt),[w,b]=(0,t.useState)(512*a),[_,E]=(0,t.useState)(512*a),[x,j]=(0,t.useState)(512),[M,S]=(0,t.useState)(512),[k,C]=(0,t.useState)(null);return(0,t.useEffect)((()=>{o(n?.6:1)}),[n]),(0,t.useEffect)((()=>{C(null==c?void 0:c.getSaveData()),"3:2"===e.queryRatio?(b(341*a),E(512*a),j(512),S(768)):"2:3"===e.queryRatio?(n?(b(768*a),E(512*a)):(b(512*a),E(341*a)),j(768),S(512)):(b(512*a),E(512*a)),g((e=>e*a)),null==c||c.clear()}),[a]),(0,t.useEffect)((()=>{null==c||c.loadSaveData(k,!0)}),[_]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>l(!0),icon:Y,label:(0,i.__)("Touchup (beta)","imajinn-ai")}),s&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:()=>l(!1),className:"imajinn-inpainting-modal",shouldCloseOnClickOutside:!0,title:(0,i.__)("Touchup Image Editor (beta)","imajinn-ai")}),(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,null,(0,t.createElement)(Fe,{style:{position:"relative"},ref:e=>h(e),imgSrc:e.src,brushRadius:p,lazyRadius:0,hideInterface:!0,brushColor:"rgba(180,0,0,0.75)",canvasWidth:_,canvasHeight:w})),(0,t.createElement)(r.CardFooter,null,(0,t.createElement)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-brush-size",label:(0,i.__)("Select the brush size","imajinn-ai"),defaultChecked:p,onChange:g,checked:p},(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Small","imajinn-ai"),className:"brush-sm",value:10*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Medium","imajinn-ai"),className:"brush-md",value:25*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("large","imajinn-ai"),className:"brush-lg",value:40*a},(0,t.createElement)(r.Icon,{icon:Y}))))),null),(0,t.createElement)(f,{isMobile:n}),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(r.Button,{icon:F,label:(0,i.__)("Reset","imajinn-ai"),onClick:()=>{c.eraseAll()}}),(0,t.createElement)(r.Button,{icon:V,label:(0,i.__)("Undo","imajinn-ai"),onClick:()=>{c.undo()}})))),(0,t.createElement)(r.TextareaControl,{rows:3,maxLength:450,value:y,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Modified prompt describing the entire image and the masked area:","imajinn-ai")),className:"text-prompt",onFocus:e=>e.target.select(),onChange:e=>v(e)}),(0,t.createElement)(r.Flex,{wrap:!1},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>l(!1)},(0,i.__)("Cancel","imajinn-ai"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"primary",onClick:()=>{const t=new Image;t.onload=()=>{const n=document.createElement("canvas");n.width=M,n.height=x;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height,0,0,M,x);let a=i.getImageData(0,0,n.width,n.height),r=0;for(r=0;r<a.data.length;r+=4){let e=255;a.data[r]+a.data[r+1]+a.data[r+2]>383&&(e=0),a.data[r]=e,a.data[r+1]=e,a.data[r+2]=e,a.data[r+3]=255}i.putImageData(a,0,0);const o=n.toDataURL("image/png");n.remove(),e.setRatio(e.queryRatio),e.startJob(e.src,o,e.queryRatio,y),e.setPrompt(y)},d.clear(),d.loadSaveData(c.getSaveData(),!0),t.src=d.getDataURL("png",!1,"#ffffff")}},(0,i.__)("Generate","imajinn-ai")))),(0,t.createElement)(Fe,{style:{visibility:"hidden",position:"absolute",top:"-99999px",left:"-99999px"},disabled:!0,hideGrid:!0,ref:e=>m(e),canvasWidth:M,canvasHeight:x})))}var Ge=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),He=e=>{let{generations:n,setGenerations:a,faceFixed:o,setFaceFixed:s,setError:l,...c}=e;const[u,h]=(0,C.useState)(!1),[d,m]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{o.some((e=>e.index===c.genindex))?(m(!0),h(!1)):(m(!1),h(!1))}),[o]),u?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Repairing","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:d,icon:Ge,label:(0,i.__)("Face Repair","imajinn-ai"),onClick:async()=>{h(!0),await(async e=>{let t=n[e].jpg;l(null);const r=await fetch(`${ajaxurl}?action=imajinn-face-repair`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,nonce:IMAJINN.nonce})}),o=await r.json();return o.success?(s((t=>[...t,{index:e}])),a((t=>(t[e]=o.data.image,[...t]))),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Face repair completed.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),o.data):(l(o.data[0].message),!1)})(c.genindex)||h(!1)}})},Ue=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"})),Je=e=>{let n=e.generations[e.genindex].jpg;return(0,t.createElement)(r.Button,{icon:Ue,label:(0,i.__)("Generate Variations","imajinn-ai"),onClick:()=>{e.setRatio(e.queryRatio),e.startJob(n,null,e.queryRatio)}})},qe=e=>{let{...n}=e;return(0,t.createElement)(r.CardFooter,null,(0,t.createElement)(r.ButtonGroup,{className:"imajinn-image-actions"},(0,t.createElement)(r.Button,{href:`${ajaxurl}?action=imajinn-tweet&image=${n.src}`,target:"_blank",icon:W,label:(0,i.__)("Share on Twitter","imajinn-ai")}),(0,t.createElement)(Je,n),(0,t.createElement)(He,n),(0,t.createElement)(Ve,u({},n,{src:n.generations[n.genindex].jpg}))),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(B,n),(0,t.createElement)(O,n)))},Ze=e=>{let{setSelectedImage:n,...i}=e;const[a,o]=(0,t.useState)("300px"),[s,l]=(0,t.useState)("300px");(0,t.useEffect)((()=>{"3:2"===i.queryRatio?(l("200px"),o("300px")):"2:3"===i.queryRatio?(l("450px"),o("300px")):(l("300px"),o("300px"))}),[i.generations,i.queryRatio]);const c=e=>{let{...i}=e;return(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,{className:"loop-show",style:{width:i.width,height:i.height,position:"relative",cursor:"pointer"}},(0,t.createElement)("div",{className:"loop-icon",onClick:()=>n(i.genindex)},(0,t.createElement)("div",null,(0,t.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBmaWxsLXJ1bGU9ImV2ZW5vZGQiCiAgICBjbGlwLXJ1bGU9ImV2ZW5vZGQiCiAgICBkPSJNMTguMzE5IDE0LjQzMjZDMjAuNzYyOCAxMS4yOTQxIDIwLjU0MiA2Ljc1MzQ3IDE3LjY1NjkgMy44NjgyOUMxNC41MzI3IDAuNzQ0MDk4IDkuNDY3MzQgMC43NDQwOTggNi4zNDMxNSAzLjg2ODI5QzMuMjE4OTUgNi45OTI0OSAzLjIxODk1IDEyLjA1NzggNi4zNDMxNSAxNS4xODJDOS4yMjgzMyAxOC4wNjcyIDEzLjc2OSAxOC4yODc5IDE2LjkwNzUgMTUuODQ0MkMxNi45MjEgMTUuODU5NSAxNi45MzUxIDE1Ljg3NDUgMTYuOTQ5NyAxNS44ODkxTDIxLjE5MjQgMjAuMTMxN0MyMS41ODI5IDIwLjUyMjMgMjIuMjE2MSAyMC41MjIzIDIyLjYwNjYgMjAuMTMxN0MyMi45OTcxIDE5Ljc0MTIgMjIuOTk3MSAxOS4xMDgxIDIyLjYwNjYgMTguNzE3NUwxOC4zNjQgMTQuNDc0OUMxOC4zNDkzIDE0LjQ2MDMgMTguMzM0MyAxNC40NDYyIDE4LjMxOSAxNC40MzI2Wk0xNi4yNDI2IDUuMjgyNTFDMTguNTg1OCA3LjYyNTY1IDE4LjU4NTggMTEuNDI0NiAxNi4yNDI2IDEzLjc2NzhDMTMuODk5NSAxNi4xMTA5IDEwLjEwMDUgMTYuMTEwOSA3Ljc1NzM2IDEzLjc2NzhDNS40MTQyMSAxMS40MjQ2IDUuNDE0MjEgNy42MjU2NSA3Ljc1NzM2IDUuMjgyNTFDMTAuMTAwNSAyLjkzOTM2IDEzLjg5OTUgMi45MzkzNiAxNi4yNDI2IDUuMjgyNTFaIgogICAgZmlsbD0id2hpdGUiCiAgLz4KPC9zdmc+"}))),(0,t.createElement)("img",{className:"generation-zoom",alt:i.alt||i.label,src:i.src,width:i.width,height:i.height})),(0,t.createElement)(qe,i))};return(0,t.createElement)("div",{className:"results-grid",style:{gridTemplateColumns:!IMAJINN.custom_editor&&"1fr 1fr"}},i.generations&&i.generations.map(((e,n)=>(0,t.createElement)("div",{style:{minWidth:a,flexGrow:1},key:n},(0,t.createElement)(c,u({src:e.preview,genindex:n,width:a,height:s,label:"Result "+(n+1).toString()},i))))))},Xe=e=>{let{status:n,progress:a,cancelJob:o}=e;const s="processing"===n?(0,i.sprintf)((0,i.__)("Generating %s%%","imajinn-ai"),a):(0,i.__)("Queued","imajinn-ai");return(0,t.createElement)("div",{className:"imajinn-loading"},(0,t.createElement)(c.ZZ,null),(0,t.createElement)("div",null,(0,t.createElement)(r.__experimentalText,null,s),(0,t.createElement)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>{o()}},(0,i.__)("Cancel"))))},Qe=e=>{let{deleteBlock:n}=e;return(0,t.createElement)("div",{className:"corner-controls"},(0,t.createElement)(p,null),(0,t.createElement)(r.Button,{className:"imajinn-close-button",icon:s,label:(0,i.__)("Close Imajinn Block","imajinn-ai"),onClick:()=>{n()}}))},$e=function(e){let{showWelcome:n,setShowWelcome:a,...o}=e;const[s,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{l(n)}),[n]),(0,t.createElement)(t.Fragment,null,s&&(0,t.createElement)(r.Modal,u({},o,{isDismissible:!1,style:{maxWidth:"900px"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("Getting Started","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Welcome to Imajinn! Here are some quick tips to get you started so you can create the best images possible.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Do:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Write a detailed and descriptive prompt in English.","imajinn-ai"),(0,t.createElement)(m,null)),(0,t.createElement)("li",null,(0,i.__)("Use Prompt Genie or our style dropdowns for the best results.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Only use 3:2 or 2:3 ratios to generate images with smaller or multiple details, not a single object.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Think like the AI not a human: What text would you find online associated with the image you want to create?","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Do Not:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Try to generate photo-realistic human faces or bodies, they will look deformed. Stick to artistic styles for images with people.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Expect to be able to create legible words, text, or logos. They will be gibberish.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Use 3:2 or 2:3 ratio for images with a single object or subject, as that tends to create strange duplications. It is best to use 1:1 for those types of images.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Write your prompts in a language other than English. Sorry, the model was trained on primarily English image descriptions (automatic translation coming soon).","imajinn-ai"))),(0,t.createElement)("div",{className:"imajinn-starting-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",onClick:async()=>{a(!1);const e=await fetch(`${ajaxurl}?action=imajinn-dismiss-welcome`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})});return!!(await e.json()).success&&(IMAJINN.show_welcome=!1,!0)}},(0,i.__)("Got it!","imajinn-ai")),(0,t.createElement)(p,null))))};(0,e.registerBlockType)(l,{edit:function(){const[e,n]=(0,t.useState)(IMAJINN.connected),[o,u]=(0,t.useState)(!1),[h,d]=(0,t.useState)(null),[p,f]=(0,t.useState)(null),[v,x]=(0,t.useState)([]),[j,S]=(0,t.useState)(IMAJINN.history),[C,I]=(0,t.useState)(null),[N,O]=(0,t.useState)(0),[R,z]=(0,t.useState)(""),[B,W]=(0,t.useState)(""),[Y,F]=(0,t.useState)("1:1"),[V,G]=(0,t.useState)(Y),[H,U]=(0,t.useState)(IMAJINN.remaining_credits),[J,q]=(0,t.useState)(!1),[Z,X]=(0,t.useState)(IMAJINN.show_welcome),[Q,$]=(0,t.useState)(""),[K,ee]=(0,t.useState)(""),[te,ne]=(0,t.useState)(""),[ie,ae]=(0,t.useState)(!1),[re,oe]=(0,t.useState)([]),[se,le]=(0,t.useState)([]),[ce,ue]=(0,t.useState)(null);(0,t.useEffect)((()=>()=>{ae(!1)}),[R,B,Y]),(0,t.useEffect)((()=>{IMAJINN.remaining_credits=H,H>0&&q(!1)}),[H]),(0,t.useEffect)((()=>{IMAJINN.history=j}),[j]),(0,t.useEffect)((()=>{W([Q,K,te].filter(Boolean).join(", "))}),[Q,K,te]);const he=(0,a.useBlockProps)(),de=(e,t,n,i,a)=>{if(H<=0&&pe(),H-1<0)return q(!0),!1;const r=e||null,o=t||null,s=n||Y,l=i||R,c=a||B;f(null),x([]),le([]),oe([]),G(s),u(!0),d(null),O(0),fetch(`${ajaxurl}?action=imajinn-start-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,prompt_style:c,ratio:s,num_variations:4,init_image:r,mask:o,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((e=>{e.success?(f(e.data.job_id),I(e.data.status),U(e.data.remaining_credits),O(e.data.progress),me(e.data.job_id)):(u(!1),f(null),I(null),d(e.data[0].message))})).catch((e=>{u(!1),f(null),I(null),d(e)}))},me=async e=>{if(!e)return u(!1),f(null),!1;setTimeout((async()=>{const t=await fetch(`${ajaxurl}?action=imajinn-check-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:e,nonce:IMAJINN.nonce})}),n=await t.json();n.success?(I(n.data.status),O(n.data.progress),U(n.data.remaining_credits),"succeeded"===n.data.status?(x(n.data.generations),S((e=>[n.data.history,...e])),ae(!0)):"failed"===n.data.status&&(d(n.data.error),I(null),u(!1),f(null),ae(!0)),"starting"===n.data.status||"processing"===n.data.status?me(e):(I(null),u(!1),f(null),ae(!0))):(I(null),u(!1),f(null),d(n.data[0].message),ae(!0))}),4e3)},pe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?U(t.data.remaining_credits):d(t.data[0].message)},fe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-account-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?window.open(t.data.account_url,"_blank"):d(t.data[0].message)},ge=v.length?"":l.description,ye=()=>{$(""),ee(""),ne(""),W("")};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(_,{image:ce,setImage:ue,generations:v}),(0,t.createElement)("figure",he,(0,t.createElement)(D,{refreshInfo:pe,isConnected:e,credits:H,visitAccount:fe}),e&&(0,t.createElement)(E,{history:j,setPrompt:z,setPromptStyle:W,setGenerations:x,setRatio:F,clearStyles:ye,setQueryRatio:G,setSaved:oe,setFaceFixed:le}),(0,t.createElement)(r.Placeholder,{icon:IMAJINN.custom_editor?null:c.mC,instructions:ge,label:IMAJINN.custom_editor?null:(0,i.__)("AI Text-to-Image Generator","imajinn-ai")},!e&&(0,t.createElement)(w,{setCredits:U,isConnected:e,setIsConnected:n}),e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(k,{showUpgrade:J,setShowUpgrade:q}),(0,t.createElement)($e,{showWelcome:Z,setShowWelcome:X}),h&&(0,t.createElement)(P,{hasError:h}),o&&(0,t.createElement)(Xe,{status:C,progress:N,cancelJob:async()=>{if(!p)return d("Error: No job id"),!1;const e=await fetch(`${ajaxurl}?action=imajinn-cancel-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:p,nonce:IMAJINN.nonce})}),t=await e.json();t.success?(I(null),u(!1),f(null),U(t.data.remaining_credits)):d(t.data[0].message)}}),(0,t.createElement)(Ze,{prompt:R,setPrompt:z,promptStyle:B,saved:re,queryRatio:V,setRatio:F,faceFixed:se,setFaceFixed:le,generations:v,setGenerations:x,startJob:de,saveImage:async e=>{let t=v[e].jpg;const n=await fetch(`${ajaxurl}?action=imajinn-save-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t,prompt:R,prompt_style:B,post_id:wp.data.select("core/editor").getCurrentPostId(),nonce:IMAJINN.nonce})}),a=await n.json();return!!a.success&&(oe((t=>[...t,{index:e,data:a.data}])),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Image saved to media library.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),a.data)},setSelectedImage:ue,setError:d}),(0,t.createElement)("div",{className:"prompt-form"},(0,t.createElement)(r.TextareaControl,{disabled:o,rows:2,maxLength:450,value:R,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Prompt - Enter a detailed English description of the image you would like to generate.","imajinn-ai"),(0,t.createElement)(m,null)),className:"text-prompt",onChange:e=>z(e),onFocus:e=>e.target.select()}),(0,t.createElement)(r.__experimentalText,{className:"prompt-style",numberOfLines:2,truncate:!0},B),(0,t.createElement)("div",{className:"styles-form"},(0,t.createElement)(g,{prompt:R,setPrompt:z,setPromptStyle:W,startJob:de,setError:d,clearStyles:ye,isLoading:o}),(0,t.createElement)(A,{setImageStyle:$,isLoading:o,imageStyle:Q,optionData:b}),(0,t.createElement)(T,{setImageArtist:ee,isLoading:o,imageArtist:K,optionData:b}),(0,t.createElement)(L,{setImageModifier:ne,isLoading:o,imageModifier:te,optionData:b}),(0,t.createElement)(r.Button,{icon:s,disabled:o,label:(0,i._x)("Clear styles","clear the image style selects","imajinn-ai"),onClick:ye}))),(0,t.createElement)(r.Flex,{align:"top",wrap:"true"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(M,{ratio:Y,setRatio:F,isLoading:o})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{isPrimary:!0,disabled:o,onClick:()=>de()},(0,i.__)(ie?"Generate More":"Generate","imajinn-ai"))))),!IMAJINN.custom_editor&&(0,t.createElement)(Qe,{deleteBlock:()=>{const{removeBlocks:e}=wp.data.dispatch("core/block-editor");e(wp.data.select("core/block-editor").getSelectedBlockClientIds())}})),(0,t.createElement)("div",{className:"imajinn-footer"},(0,t.createElement)(r.Button,{onClick:()=>{fe()}},(0,i.__)("Account","imajinn-ai")),(0,t.createElement)(y,null),(0,t.createElement)("a",{href:"https://infiniteuploads.com/support/",target:"_blank"},(0,i.__)("Support","imajinn-ai")),(0,t.createElement)("span",{className:"imajinn-credits"},(0,i._x)("Made with ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)(r.Dashicon,{icon:"heart","aria-label":(0,i._x)("love","Made with love by Infinite Uploads","imajinn-ai")}),(0,i._x)(" by ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)("a",{href:"https://infiniteuploads.com/",target:"_blank"},"Infinite Uploads")))))},save:function(){return null},icon:c.DT})}()}(); -
imajinn-ai/tags/1.5/build/editor.asset.php
r2796851 r2833326 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-format-library', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-media-utils', 'wp-preferences'), 'version' => ' 7ef1d8407853a4dd1875');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-format-library', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-media-utils', 'wp-preferences'), 'version' => 'c75fee77c2519bd50317'); -
imajinn-ai/tags/1.5/build/editor.css
r2796851 r2833326 1 .imajinn-header{align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;display:flex;height:80px;justify-content:flex-start;left:-20px;padding-left:20px;position:relative;width:calc(100% + 20px)}.imajinn-header__title{font-size:16px;padding:0 20px}.imajinn-sidebar{background:#fff;border-left:1px solid #e0e0e0;bottom:0;color:#1e1e1e; height:100vh;overflow:hidden;position:fixed;right:0;top:0;width:280px;z-index:z-index(".edit-site-sidebar")}@media(min-width:600px){.imajinn-sidebar{-webkit-overflow-scrolling:touch;height:auto;overflow:auto;top:126px}}@media(min-width:782px){.imajinn-sidebar{top:112px}}@media(min-width:600px){.imajinn-sidebar{display:block}}.imajinn-sidebar>.components-panel{border-left:0;border-right:0;margin-bottom:-1px;margin-top:-1px}.imajinn-sidebar>.components-panel>.components-panel__header{background:#e0e0e0}.imajinn-sidebar .block-editor-block-inspector h2,.imajinn-sidebar .block-editor-block-inspector h3,.imajinn-sidebar .block-editor-block-inspector__card{margin:0}.imajinn-block-editor__block-list{margin-left:auto;margin-right:20px;margin-top:140px!important;padding-bottom:0;padding-top:0}.imajinn-block-editor__block-list .block-editor-block-list__block{margin-left:auto;margin-right:auto}body.block-editor-page,html.wp-toolbar{background:#fff}body.block-editor-page #wpcontent{padding-left:0}body.block-editor-page #wpbody-content{padding-bottom:0}body.block-editor-page #wpbody-content>div:not(.block-editor):not(#screen-meta),body.block-editor-page #wpfooter{display:none}body.block-editor-page .a11y-speak-region{left:-1px;top:-1px}body.block-editor-page ul#adminmenu a.wp-has-current-submenu:after,body.block-editor-page ul#adminmenu>li.current>a.current:after{border-right-color:#fff}body.block-editor-page .media-frame select.attachment-filters:last-of-type{max-width:100%;width:auto}.imajinn-block-editor{min-height:calc(100vh - 32px)}.imajinn-block-editor .block-list-appender,.imajinn-block-editor .components-toolbar-group:has(.block-editor-block-settings-menu){display:none}.imajinn-block-editor .components-snackbar-list{bottom:40px;left:160px;padding-left:16px;padding-right:16px;position:fixed;right:0}.editor-styles-wrapper{color:#1e1e1e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:1.8;width:100%}@media(min-width:600px){.editor-styles-wrapper{width:calc(100% - 280px)}}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__no-avatar:before{content:"";font:normal 20px/1 dashicons;margin-right:5px;vertical-align:middle}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-avatar{flex-grow:0;flex-shrink:0;height:24px;margin-right:8px;max-width:none;width:24px}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-name{flex-grow:1;flex-shrink:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-slug{color:#757575;flex-grow:0;flex-shrink:0;margin-left:8px;max-width:100px;overflow:none;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user:hover .editor-autocompleters__user-slug{color:var(--wp-admin-theme-color)}.editor-styles-wrapper .document-outline{margin:20px 0}.editor-styles-wrapper .document-outline ul{margin:0;padding:0}.editor-styles-wrapper .document-outline__item{display:flex;margin:4px 0}.editor-styles-wrapper .document-outline__item a{text-decoration:none}.editor-styles-wrapper .document-outline__item .document-outline__emdash:before{color:#ddd;margin-right:4px}.editor-styles-wrapper .document-outline__item.is-h2 .document-outline__emdash:before{content:"—"}.editor-styles-wrapper .document-outline__item.is-h3 .document-outline__emdash:before{content:"——"}.editor-styles-wrapper .document-outline__item.is-h4 .document-outline__emdash:before{content:"———"}.editor-styles-wrapper .document-outline__item.is-h5 .document-outline__emdash:before{content:"————"}.editor-styles-wrapper .document-outline__item.is-h6 .document-outline__emdash:before{content:"—————"}.editor-styles-wrapper .document-outline__button{align-items:flex-start;background:none;border:none;border-radius:2px;color:#1e1e1e;cursor:pointer;display:flex;margin:0 0 0 -1px;padding:2px 5px 2px 1px;text-align:left}.editor-styles-wrapper .document-outline__button:disabled{cursor:default}.editor-styles-wrapper .document-outline__button:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .document-outline__level{background:#ddd;border-radius:3px;color:#1e1e1e;font-size:13px;margin-right:4px;padding:1px 6px}.is-invalid .editor-styles-wrapper .document-outline__level{background:#f0b849}.editor-styles-wrapper .document-outline__item-content{padding:1px 0}.editor-styles-wrapper .components-editor-notices__dismissible,.editor-styles-wrapper .components-editor-notices__pinned{color:#1e1e1e;left:0;position:relative;right:0;top:0}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice,.editor-styles-wrapper .components-editor-notices__pinned .components-notice{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;margin:0;min-height:60px;padding:0 12px}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice .components-notice__dismiss,.editor-styles-wrapper .components-editor-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}.editor-styles-wrapper .entities-saved-states__panel{background:#fff;bottom:0;box-sizing:border-box;left:0;overflow:auto;position:fixed;right:0;top:46px;z-index:z-index(".entities-saved-states__panel")}.editor-styles-wrapper .entities-saved-states__panel *,.editor-styles-wrapper .entities-saved-states__panel :after,.editor-styles-wrapper .entities-saved-states__panel :before{box-sizing:inherit}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:none}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:block}@media(min-width:782px){.editor-styles-wrapper .entities-saved-states__panel{border-left:1px solid #ddd;left:auto;top:32px;width:280px}body.is-fullscreen-mode .editor-styles-wrapper .entities-saved-states__panel{top:0}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:block}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:none}}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__panel-header{background:#fff;border-bottom:1px solid #ddd;height:61px;padding-left:8px;padding-right:8px}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__text-prompt{padding:16px 16px 4px}.editor-styles-wrapper .editor-error-boundary{box-shadow:0 10px 10px rgba(0,0,0,.25);margin:60px auto auto;max-width:780px;padding:20px}.editor-styles-wrapper .editor-page-attributes__order{width:100%}.editor-styles-wrapper .editor-page-attributes__order .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-page-attributes__order input{width:66px}.editor-styles-wrapper .editor-post-excerpt__textarea{margin-bottom:10px;width:100%}.editor-styles-wrapper .editor-post-featured-image{padding:0}.editor-styles-wrapper .editor-post-featured-image__container{margin-bottom:1em;position:relative}.editor-styles-wrapper .editor-post-featured-image .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.editor-styles-wrapper .editor-post-featured-image .components-button+.components-button{display:block;margin-top:1em}.editor-styles-wrapper .editor-post-featured-image .components-responsive-wrapper__content{max-width:100%;width:auto}.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{box-shadow:0 0 0 0 var(--wp-admin-theme-color);display:block;padding:0;transition:all .1s ease-out;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-featured-image__preview{height:auto}.editor-styles-wrapper .editor-post-featured-image__preview:not(:disabled):not([aria-disabled=true]):focus{box-shadow:0 0 0 4px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-featured-image__toggle{background-color:#f0f0f0;border-radius:2px;line-height:20px;min-height:90px;padding:8px 0;text-align:center}.editor-styles-wrapper .editor-post-featured-image__toggle:hover{background:#ddd;color:#1e1e1e}.editor-styles-wrapper [class].editor-post-format__suggestion{margin:4px 0 0}.editor-styles-wrapper .editor-post-last-revision__title{font-weight:600;width:100%}.editor-styles-wrapper .editor-post-last-revision__title .dashicon{margin-right:5px}.editor-styles-wrapper .components-button.editor-post-last-revision__title{height:100%}.editor-styles-wrapper .components-button.editor-post-last-revision__title:active,.editor-styles-wrapper .components-button.editor-post-last-revision__title:hover{background:#f0f0f0}.editor-styles-wrapper .components-button.editor-post-last-revision__title:focus{border-radius:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}@media(min-width:600px){.editor-styles-wrapper .editor-post-locked-modal{max-width:480px}}.editor-styles-wrapper .editor-post-locked-modal .components-modal__content{display:flex}.editor-styles-wrapper .editor-post-locked-modal__buttons{margin-top:24px}.editor-styles-wrapper .editor-post-locked-modal__avatar{border-radius:2px;margin-right:24px;margin-top:16px}.editor-styles-wrapper .editor-post-publish-button__button.has-changes-dot:before{background:currentcolor;border-radius:4px;content:"";height:8px;margin:auto 5px auto -3px;width:8px}.editor-styles-wrapper .editor-post-publish-panel{background:#fff}.editor-styles-wrapper .editor-post-publish-panel__content{min-height:calc(100% - 144px)}.editor-styles-wrapper .editor-post-publish-panel__content .components-spinner{display:block;margin:100px auto 0}.editor-styles-wrapper .editor-post-publish-panel__header{align-content:space-between;align-items:center;background:#fff;border-bottom:1px solid #ddd;display:flex;height:61px;padding-left:16px;padding-right:16px}.editor-styles-wrapper .editor-post-publish-panel__header .components-button{justify-content:center;width:100%}.editor-styles-wrapper .editor-post-publish-panel__header .has-icon{margin-left:auto;width:auto}.editor-styles-wrapper .components-site-card{align-items:center;display:flex;margin:16px 0}.editor-styles-wrapper .components-site-icon{border:none;border-radius:2px;height:36px;margin-right:12px;width:36px}.editor-styles-wrapper .components-site-name{display:block;font-size:14px}.editor-styles-wrapper .components-site-home{color:#757575;display:block;font-size:12px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{flex-grow:1}@media(min-width:480px){.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{max-width:160px}}.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{padding-right:4px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button{padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__header-published{flex-grow:1}.editor-styles-wrapper .editor-post-publish-panel__footer{padding:16px}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary{align-items:center;display:inline-flex}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary.is-busy .dashicon{display:none}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary .dashicon{margin-right:-4px}.editor-styles-wrapper .editor-post-publish-panel__link{font-weight:400;padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__prepublish{padding:16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish strong{color:#1e1e1e}.editor-styles-wrapper .editor-post-publish-panel__prepublish .components-panel__body{background:#fff;margin-left:-16px;margin-right:-16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish .editor-post-visibility__dialog-legend{display:none}.editor-styles-wrapper .post-publish-panel__postpublish .components-panel__body{border-bottom:1px solid #e0e0e0;border-top:none}.editor-styles-wrapper .post-publish-panel__postpublish-buttons{align-content:space-between;display:flex;flex-wrap:wrap;margin:-5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons>*{flex-grow:1;margin:5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-button{flex:1;height:auto;justify-content:center;line-height:1.6;padding:3px 10px 4px;text-align:center;white-space:normal}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-clipboard-button{width:100%}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container{align-items:flex-end;display:flex;margin-bottom:16px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .components-base-control__field{margin-bottom:0}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .post-publish-panel__postpublish-post-address{flex:1}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container input[readonly]{background:#ddd;overflow:hidden;padding:10px;text-overflow:ellipsis}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap{flex-shrink:0;margin-left:8px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap .components-button{height:38px}.editor-styles-wrapper .post-publish-panel__postpublish-header{font-weight:500}.editor-styles-wrapper .post-publish-panel__postpublish-subheader{margin:0 0 8px}.editor-styles-wrapper .post-publish-panel__tip{color:#f0b849}@media screen and (max-width:782px){.editor-styles-wrapper .post-publish-panel__postpublish-post-address__button-wrap .components-button{height:40px}}.editor-styles-wrapper .editor-post-saved-state{align-items:center;color:#757575;display:flex;overflow:hidden;padding:12px 4px;white-space:nowrap;width:28px}.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true]:hover,.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true]:hover{background:transparent;color:#757575}.editor-styles-wrapper .editor-post-saved-state svg{fill:currentColor;display:inline-block;flex:0 0 auto;margin-right:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-saved-state{padding:8px 12px;text-indent:inherit;width:auto}.editor-styles-wrapper .editor-post-saved-state svg{margin-right:0}}.editor-styles-wrapper .editor-post-save-draft.has-text.has-icon svg{margin-right:0}.editor-styles-wrapper :root[dir=rtl] .editor-post-saved-state.has-text.has-icon{justify-content:right}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-list{margin-left:-6px;margin-top:-6px;max-height:14em;overflow:auto;padding-left:6px;padding-top:6px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-choice{margin-bottom:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-subchoices{margin-left:16px;margin-top:8px}.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-add,.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-submit{margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-label{display:inline-block;margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-input{margin-top:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-filter{margin-bottom:8px;width:100%}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used .editor-post-taxonomies__flat-term-most-used-label{font-weight:400;margin-bottom:12px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list{margin:0}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list li{display:inline-block;margin-right:8px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list .components-button{font-size:12px}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{border:1px solid #949494;border-radius:0;box-shadow:none;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:16px!important;line-height:2.4;margin:0;min-height:200px;overflow:hidden;padding:16px;resize:none;transition:border .1s ease-out,box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{font-size:15px!important;padding:24px}}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);position:relative}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-url__link-label{font-size:13px;font-weight:400;margin:0}.editor-styles-wrapper .editor-post-url__link{direction:ltr;word-break:break-word}.editor-styles-wrapper .editor-post-url__link-slug{font-weight:600}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{border:1px solid #1e1e1e;border-radius:2px;border-radius:50%;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:24px;line-height:normal;margin-right:12px;margin-top:2px;padding:6px 8px;transition:box-shadow .1s linear;transition:none;width:24px}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:-ms-input-placeholder{color:rgba(30,30,30,.62)}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{height:20px;width:20px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:8px;margin:0;transform:translate(7px,7px);width:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{transform:translate(5px,5px)}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{color:#757575;margin-left:36px;margin-top:.5em}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{margin-left:32px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__choice:last-child .editor-post-visibility__info{margin-bottom:0}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-left:32px;padding:6px 8px;transition:box-shadow .1s linear;width:calc(100% - 32px)}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-title{position:relative}.editor-styles-wrapper .editor-post-title.is-focus-mode{opacity:.2;transition:opacity .1s linear}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-title.is-focus-mode{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-title.is-focus-mode:focus{opacity:1}.editor-styles-wrapper .editor-post-trash.components-button{display:flex;justify-content:center;margin-top:4px;width:100%}.editor-styles-wrapper .table-of-contents__popover.components-popover .components-popover__content{min-width:380px}.editor-styles-wrapper .components-popover.table-of-contents__popover{z-index:z-index(".components-popover.table-of-contents__popover")}.editor-styles-wrapper .table-of-contents__popover .components-popover__content{padding:16px}@media(min-width:600px){.editor-styles-wrapper .table-of-contents__popover .components-popover__content{max-height:calc(100vh - 120px);overflow-y:auto}}.editor-styles-wrapper .table-of-contents__popover hr{margin:10px -16px 0}.editor-styles-wrapper .table-of-contents__wrapper:focus:before{bottom:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}.editor-styles-wrapper .table-of-contents__counts{display:flex;flex-wrap:wrap;margin:-8px 0 0}.editor-styles-wrapper .table-of-contents__count{color:#1e1e1e;display:flex;flex-basis:33%;flex-direction:column;font-size:13px;margin-bottom:0;margin-top:8px;padding-right:8px}.editor-styles-wrapper .table-of-contents__count:nth-child(4n){padding-right:0}.editor-styles-wrapper .table-of-contents__number,.editor-styles-wrapper .table-of-contents__popover .word-count{color:#1e1e1e;font-size:21px;font-weight:400;line-height:30px}.editor-styles-wrapper .table-of-contents__title{display:block;font-size:15px;font-weight:600;margin-top:20px}.editor-styles-wrapper .editor-template-validation-notice{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-template-validation-notice .components-button{margin-left:5px}.components-modal__frame,.imajinn-block-editor{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before,.imajinn-block-editor *,.imajinn-block-editor :after,.imajinn-block-editor :before{box-sizing:inherit}1 .imajinn-header{align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;display:flex;height:80px;justify-content:flex-start;left:-20px;padding-left:20px;position:relative;width:calc(100% + 20px)}.imajinn-header__title{font-size:16px;padding:0 20px}.imajinn-sidebar{background:#fff;border-left:1px solid #e0e0e0;bottom:0;color:#1e1e1e;display:none;height:100vh;overflow:hidden;position:fixed;right:0;top:0;width:280px;z-index:z-index(".edit-site-sidebar")}@media(min-width:600px){.imajinn-sidebar{-webkit-overflow-scrolling:touch;height:auto;overflow:auto;top:126px}}@media(min-width:782px){.imajinn-sidebar{top:112px}}@media(min-width:600px){.imajinn-sidebar{display:block}}.imajinn-sidebar>.components-panel{border-left:0;border-right:0;margin-bottom:-1px;margin-top:-1px}.imajinn-sidebar>.components-panel>.components-panel__header{background:#e0e0e0}.imajinn-sidebar .block-editor-block-inspector h2,.imajinn-sidebar .block-editor-block-inspector h3,.imajinn-sidebar .block-editor-block-inspector__card{margin:0}.imajinn-block-editor__block-list{margin-left:auto;margin-right:20px;margin-top:140px!important;padding-bottom:0;padding-top:0}.imajinn-block-editor__block-list .block-editor-block-list__block{margin-left:auto;margin-right:auto}body.block-editor-page,html.wp-toolbar{background:#fff}body.block-editor-page #wpcontent{padding-left:0}body.block-editor-page #wpbody-content{padding-bottom:0}body.block-editor-page #wpbody-content>div:not(.block-editor):not(#screen-meta),body.block-editor-page #wpfooter{display:none}body.block-editor-page .a11y-speak-region{left:-1px;top:-1px}body.block-editor-page ul#adminmenu a.wp-has-current-submenu:after,body.block-editor-page ul#adminmenu>li.current>a.current:after{border-right-color:#fff}body.block-editor-page .media-frame select.attachment-filters:last-of-type{max-width:100%;width:auto}.imajinn-block-editor{min-height:calc(100vh - 32px)}.imajinn-block-editor .block-list-appender,.imajinn-block-editor .components-toolbar-group:has(.block-editor-block-settings-menu){display:none}.imajinn-block-editor .components-snackbar-list{bottom:40px;left:160px;padding-left:16px;padding-right:16px;position:fixed;right:0}.editor-styles-wrapper{color:#1e1e1e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:1.8;width:100%}@media(min-width:600px){.editor-styles-wrapper{width:calc(100% - 280px)}}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__no-avatar:before{content:"";font:normal 20px/1 dashicons;margin-right:5px;vertical-align:middle}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-avatar{flex-grow:0;flex-shrink:0;height:24px;margin-right:8px;max-width:none;width:24px}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-name{flex-grow:1;flex-shrink:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-slug{color:#757575;flex-grow:0;flex-shrink:0;margin-left:8px;max-width:100px;overflow:none;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user:hover .editor-autocompleters__user-slug{color:var(--wp-admin-theme-color)}.editor-styles-wrapper .document-outline{margin:20px 0}.editor-styles-wrapper .document-outline ul{margin:0;padding:0}.editor-styles-wrapper .document-outline__item{display:flex;margin:4px 0}.editor-styles-wrapper .document-outline__item a{text-decoration:none}.editor-styles-wrapper .document-outline__item .document-outline__emdash:before{color:#ddd;margin-right:4px}.editor-styles-wrapper .document-outline__item.is-h2 .document-outline__emdash:before{content:"—"}.editor-styles-wrapper .document-outline__item.is-h3 .document-outline__emdash:before{content:"——"}.editor-styles-wrapper .document-outline__item.is-h4 .document-outline__emdash:before{content:"———"}.editor-styles-wrapper .document-outline__item.is-h5 .document-outline__emdash:before{content:"————"}.editor-styles-wrapper .document-outline__item.is-h6 .document-outline__emdash:before{content:"—————"}.editor-styles-wrapper .document-outline__button{align-items:flex-start;background:none;border:none;border-radius:2px;color:#1e1e1e;cursor:pointer;display:flex;margin:0 0 0 -1px;padding:2px 5px 2px 1px;text-align:left}.editor-styles-wrapper .document-outline__button:disabled{cursor:default}.editor-styles-wrapper .document-outline__button:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .document-outline__level{background:#ddd;border-radius:3px;color:#1e1e1e;font-size:13px;margin-right:4px;padding:1px 6px}.is-invalid .editor-styles-wrapper .document-outline__level{background:#f0b849}.editor-styles-wrapper .document-outline__item-content{padding:1px 0}.editor-styles-wrapper .components-editor-notices__dismissible,.editor-styles-wrapper .components-editor-notices__pinned{color:#1e1e1e;left:0;position:relative;right:0;top:0}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice,.editor-styles-wrapper .components-editor-notices__pinned .components-notice{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;margin:0;min-height:60px;padding:0 12px}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice .components-notice__dismiss,.editor-styles-wrapper .components-editor-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}.editor-styles-wrapper .entities-saved-states__panel{background:#fff;bottom:0;box-sizing:border-box;left:0;overflow:auto;position:fixed;right:0;top:46px;z-index:z-index(".entities-saved-states__panel")}.editor-styles-wrapper .entities-saved-states__panel *,.editor-styles-wrapper .entities-saved-states__panel :after,.editor-styles-wrapper .entities-saved-states__panel :before{box-sizing:inherit}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:none}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:block}@media(min-width:782px){.editor-styles-wrapper .entities-saved-states__panel{border-left:1px solid #ddd;left:auto;top:32px;width:280px}body.is-fullscreen-mode .editor-styles-wrapper .entities-saved-states__panel{top:0}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:block}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:none}}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__panel-header{background:#fff;border-bottom:1px solid #ddd;height:61px;padding-left:8px;padding-right:8px}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__text-prompt{padding:16px 16px 4px}.editor-styles-wrapper .editor-error-boundary{box-shadow:0 10px 10px rgba(0,0,0,.25);margin:60px auto auto;max-width:780px;padding:20px}.editor-styles-wrapper .editor-page-attributes__order{width:100%}.editor-styles-wrapper .editor-page-attributes__order .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-page-attributes__order input{width:66px}.editor-styles-wrapper .editor-post-excerpt__textarea{margin-bottom:10px;width:100%}.editor-styles-wrapper .editor-post-featured-image{padding:0}.editor-styles-wrapper .editor-post-featured-image__container{margin-bottom:1em;position:relative}.editor-styles-wrapper .editor-post-featured-image .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.editor-styles-wrapper .editor-post-featured-image .components-button+.components-button{display:block;margin-top:1em}.editor-styles-wrapper .editor-post-featured-image .components-responsive-wrapper__content{max-width:100%;width:auto}.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{box-shadow:0 0 0 0 var(--wp-admin-theme-color);display:block;padding:0;transition:all .1s ease-out;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-featured-image__preview{height:auto}.editor-styles-wrapper .editor-post-featured-image__preview:not(:disabled):not([aria-disabled=true]):focus{box-shadow:0 0 0 4px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-featured-image__toggle{background-color:#f0f0f0;border-radius:2px;line-height:20px;min-height:90px;padding:8px 0;text-align:center}.editor-styles-wrapper .editor-post-featured-image__toggle:hover{background:#ddd;color:#1e1e1e}.editor-styles-wrapper [class].editor-post-format__suggestion{margin:4px 0 0}.editor-styles-wrapper .editor-post-last-revision__title{font-weight:600;width:100%}.editor-styles-wrapper .editor-post-last-revision__title .dashicon{margin-right:5px}.editor-styles-wrapper .components-button.editor-post-last-revision__title{height:100%}.editor-styles-wrapper .components-button.editor-post-last-revision__title:active,.editor-styles-wrapper .components-button.editor-post-last-revision__title:hover{background:#f0f0f0}.editor-styles-wrapper .components-button.editor-post-last-revision__title:focus{border-radius:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}@media(min-width:600px){.editor-styles-wrapper .editor-post-locked-modal{max-width:480px}}.editor-styles-wrapper .editor-post-locked-modal .components-modal__content{display:flex}.editor-styles-wrapper .editor-post-locked-modal__buttons{margin-top:24px}.editor-styles-wrapper .editor-post-locked-modal__avatar{border-radius:2px;margin-right:24px;margin-top:16px}.editor-styles-wrapper .editor-post-publish-button__button.has-changes-dot:before{background:currentcolor;border-radius:4px;content:"";height:8px;margin:auto 5px auto -3px;width:8px}.editor-styles-wrapper .editor-post-publish-panel{background:#fff}.editor-styles-wrapper .editor-post-publish-panel__content{min-height:calc(100% - 144px)}.editor-styles-wrapper .editor-post-publish-panel__content .components-spinner{display:block;margin:100px auto 0}.editor-styles-wrapper .editor-post-publish-panel__header{align-content:space-between;align-items:center;background:#fff;border-bottom:1px solid #ddd;display:flex;height:61px;padding-left:16px;padding-right:16px}.editor-styles-wrapper .editor-post-publish-panel__header .components-button{justify-content:center;width:100%}.editor-styles-wrapper .editor-post-publish-panel__header .has-icon{margin-left:auto;width:auto}.editor-styles-wrapper .components-site-card{align-items:center;display:flex;margin:16px 0}.editor-styles-wrapper .components-site-icon{border:none;border-radius:2px;height:36px;margin-right:12px;width:36px}.editor-styles-wrapper .components-site-name{display:block;font-size:14px}.editor-styles-wrapper .components-site-home{color:#757575;display:block;font-size:12px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{flex-grow:1}@media(min-width:480px){.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{max-width:160px}}.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{padding-right:4px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button{padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__header-published{flex-grow:1}.editor-styles-wrapper .editor-post-publish-panel__footer{padding:16px}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary{align-items:center;display:inline-flex}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary.is-busy .dashicon{display:none}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary .dashicon{margin-right:-4px}.editor-styles-wrapper .editor-post-publish-panel__link{font-weight:400;padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__prepublish{padding:16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish strong{color:#1e1e1e}.editor-styles-wrapper .editor-post-publish-panel__prepublish .components-panel__body{background:#fff;margin-left:-16px;margin-right:-16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish .editor-post-visibility__dialog-legend{display:none}.editor-styles-wrapper .post-publish-panel__postpublish .components-panel__body{border-bottom:1px solid #e0e0e0;border-top:none}.editor-styles-wrapper .post-publish-panel__postpublish-buttons{align-content:space-between;display:flex;flex-wrap:wrap;margin:-5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons>*{flex-grow:1;margin:5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-button{flex:1;height:auto;justify-content:center;line-height:1.6;padding:3px 10px 4px;text-align:center;white-space:normal}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-clipboard-button{width:100%}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container{align-items:flex-end;display:flex;margin-bottom:16px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .components-base-control__field{margin-bottom:0}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .post-publish-panel__postpublish-post-address{flex:1}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container input[readonly]{background:#ddd;overflow:hidden;padding:10px;text-overflow:ellipsis}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap{flex-shrink:0;margin-left:8px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap .components-button{height:38px}.editor-styles-wrapper .post-publish-panel__postpublish-header{font-weight:500}.editor-styles-wrapper .post-publish-panel__postpublish-subheader{margin:0 0 8px}.editor-styles-wrapper .post-publish-panel__tip{color:#f0b849}@media screen and (max-width:782px){.editor-styles-wrapper .post-publish-panel__postpublish-post-address__button-wrap .components-button{height:40px}}.editor-styles-wrapper .editor-post-saved-state{align-items:center;color:#757575;display:flex;overflow:hidden;padding:12px 4px;white-space:nowrap;width:28px}.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true]:hover,.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true]:hover{background:transparent;color:#757575}.editor-styles-wrapper .editor-post-saved-state svg{fill:currentColor;display:inline-block;flex:0 0 auto;margin-right:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-saved-state{padding:8px 12px;text-indent:inherit;width:auto}.editor-styles-wrapper .editor-post-saved-state svg{margin-right:0}}.editor-styles-wrapper .editor-post-save-draft.has-text.has-icon svg{margin-right:0}.editor-styles-wrapper :root[dir=rtl] .editor-post-saved-state.has-text.has-icon{justify-content:right}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-list{margin-left:-6px;margin-top:-6px;max-height:14em;overflow:auto;padding-left:6px;padding-top:6px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-choice{margin-bottom:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-subchoices{margin-left:16px;margin-top:8px}.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-add,.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-submit{margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-label{display:inline-block;margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-input{margin-top:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-filter{margin-bottom:8px;width:100%}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used .editor-post-taxonomies__flat-term-most-used-label{font-weight:400;margin-bottom:12px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list{margin:0}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list li{display:inline-block;margin-right:8px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list .components-button{font-size:12px}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{border:1px solid #949494;border-radius:0;box-shadow:none;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:16px!important;line-height:2.4;margin:0;min-height:200px;overflow:hidden;padding:16px;resize:none;transition:border .1s ease-out,box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{font-size:15px!important;padding:24px}}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);position:relative}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-url__link-label{font-size:13px;font-weight:400;margin:0}.editor-styles-wrapper .editor-post-url__link{direction:ltr;word-break:break-word}.editor-styles-wrapper .editor-post-url__link-slug{font-weight:600}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{border:1px solid #1e1e1e;border-radius:2px;border-radius:50%;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:24px;line-height:normal;margin-right:12px;margin-top:2px;padding:6px 8px;transition:box-shadow .1s linear;transition:none;width:24px}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:-ms-input-placeholder{color:rgba(30,30,30,.62)}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{height:20px;width:20px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:8px;margin:0;transform:translate(7px,7px);width:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{transform:translate(5px,5px)}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{color:#757575;margin-left:36px;margin-top:.5em}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{margin-left:32px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__choice:last-child .editor-post-visibility__info{margin-bottom:0}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-left:32px;padding:6px 8px;transition:box-shadow .1s linear;width:calc(100% - 32px)}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-title{position:relative}.editor-styles-wrapper .editor-post-title.is-focus-mode{opacity:.2;transition:opacity .1s linear}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-title.is-focus-mode{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-title.is-focus-mode:focus{opacity:1}.editor-styles-wrapper .editor-post-trash.components-button{display:flex;justify-content:center;margin-top:4px;width:100%}.editor-styles-wrapper .table-of-contents__popover.components-popover .components-popover__content{min-width:380px}.editor-styles-wrapper .components-popover.table-of-contents__popover{z-index:z-index(".components-popover.table-of-contents__popover")}.editor-styles-wrapper .table-of-contents__popover .components-popover__content{padding:16px}@media(min-width:600px){.editor-styles-wrapper .table-of-contents__popover .components-popover__content{max-height:calc(100vh - 120px);overflow-y:auto}}.editor-styles-wrapper .table-of-contents__popover hr{margin:10px -16px 0}.editor-styles-wrapper .table-of-contents__wrapper:focus:before{bottom:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}.editor-styles-wrapper .table-of-contents__counts{display:flex;flex-wrap:wrap;margin:-8px 0 0}.editor-styles-wrapper .table-of-contents__count{color:#1e1e1e;display:flex;flex-basis:33%;flex-direction:column;font-size:13px;margin-bottom:0;margin-top:8px;padding-right:8px}.editor-styles-wrapper .table-of-contents__count:nth-child(4n){padding-right:0}.editor-styles-wrapper .table-of-contents__number,.editor-styles-wrapper .table-of-contents__popover .word-count{color:#1e1e1e;font-size:21px;font-weight:400;line-height:30px}.editor-styles-wrapper .table-of-contents__title{display:block;font-size:15px;font-weight:600;margin-top:20px}.editor-styles-wrapper .editor-template-validation-notice{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-template-validation-notice .components-button{margin-left:5px}.components-modal__frame,.imajinn-block-editor{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before,.imajinn-block-editor *,.imajinn-block-editor :after,.imajinn-block-editor :before{box-sizing:inherit} -
imajinn-ai/tags/1.5/imajinn-ai.php
r2796851 r2833326 5 5 * Requires at least: 6.0 6 6 * Requires PHP: 7.0 7 * Version: 1. 47 * Version: 1.5 8 8 * Author: Infinite Uploads 9 9 * Author URI: https://infiniteuploads.com … … 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 13 * Text Domain: imajinn-ai 14 14 15 * 15 16 * @package imajinn-ai … … 20 21 */ 21 22 22 define( 'IMAJINN_AI_VERSION', '1. 4' );23 define( 'IMAJINN_AI_VERSION', '1.5' ); 23 24 24 25 class Imajinn_AI { … … 135 136 //get history from post type 136 137 $history = []; 137 $posts = get_posts( [138 'post_type' => 'imajinn_prompt',139 'post_status' => 'publish',140 'posts_per_page' => 20,141 'orderby' => 'date',142 'order' => 'DESC',138 $posts = get_posts( [ 139 'post_type' => 'imajinn_prompt', 140 'post_status' => 'publish', 141 'posts_per_page' => 20, 142 'orderby' => 'date', 143 'order' => 'DESC', 143 144 ] ); 144 145 foreach ( $posts as $post ) { … … 203 204 ?> 204 205 <div 205 id="imajinn-block-editor"206 class="imajinn-block-editor"206 id="imajinn-block-editor" 207 class="imajinn-block-editor" 207 208 > 208 209 <?php esc_html_e( 'Loading Editor...', 'imajinn-ai' ); ?> … … 331 332 //rename vars for saving 332 333 $full_prompt = $prompt; 333 $prompt = $orig_prompt;334 $prompt = $orig_prompt; 334 335 335 336 //save to history post type … … 407 408 408 409 // check caps 409 $params = $this->check_ajax(); 410 $image = esc_url_raw( $params['url'] ); 411 $prompt = sanitize_text_field( $params['prompt'] ); 412 $post_id = absint( $params['post_id'] ); 410 $params = $this->check_ajax(); 411 $image = esc_url_raw( $params['url'] ); 412 $orig_prompt = sanitize_text_field( $params['prompt'] ); 413 $post_id = absint( $params['post_id'] ); 414 415 $prompt_style = trim( sanitize_text_field( $params['prompt_style'] ), " \t\n\r\0\x0B,/." ); 416 $prompt = $orig_prompt . ' ' . $prompt_style; 413 417 414 418 $size = 'full'; 415 419 //make api call to upscale the image 416 $upscaled_result = $this->api_request( sprintf( 'site/%s/upscale', $this->get_site_id() ), compact( 'image' ) );420 $upscaled_result = $this->api_request( sprintf( 'site/%s/upscale', $this->get_site_id() ), compact( 'image', 'prompt' ) ); 417 421 if ( ! is_wp_error( $upscaled_result ) && ! empty( $upscaled_result->image ) ) { 418 422 $image = $upscaled_result->image; … … 420 424 } 421 425 422 $attachment_id = media_sideload_image( $image, $post_id, $ prompt, 'id' );426 $attachment_id = media_sideload_image( $image, $post_id, $orig_prompt, 'id' ); 423 427 if ( is_wp_error( $attachment_id ) ) { 424 428 wp_send_json_error( $attachment_id ); 425 429 } 426 430 431 //add alt text to attachment 432 $alt = wp_strip_all_tags( $prompt, true ); 433 update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $alt ) ); 434 427 435 list( $url, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $size ); 428 436 wp_send_json_success( compact( 'attachment_id', 'url', 'width', 'height', 'size' ) ); … … 434 442 $params = $this->check_ajax(); 435 443 436 $prompt 444 $prompt = sanitize_text_field( $params['prompt'] ); 437 445 438 446 //make api call to fix the image … … 454 462 $params = $this->check_ajax(); 455 463 456 $image 464 $image = esc_url_raw( $params['image'] ); 457 465 458 466 //make api call to fix the image … … 511 519 512 520 $headers = array( 513 'Accept' => 'application/json', 514 'Content-Type' => 'application/json', 521 'Accept' => 'application/json', 522 'Content-Type' => 'application/json', 523 'x-plugin-version' => IMAJINN_AI_VERSION, 515 524 ); 516 525 -
imajinn-ai/trunk/build/block.asset.php
r2796851 r2833326 1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 16c8312a94c47e1d8fa7');1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'dd32228479f2ada5e837'); -
imajinn-ai/trunk/build/block.css
r2796851 r2833326 1 1 .wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-base-control__field{margin-bottom:7px}.wp-block-infinite-uploads-imajinn-ai .prompt-genie label{line-height:1.2}.wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-button.has-icon{height:30px;margin-bottom:0!important;min-width:90px;padding:0 8px 0 0}.wp-block-infinite-uploads-imajinn-ai .prompt-genie .components-button.has-icon svg{height:18px;margin-right:0}button.genie-generate{margin-left:10px} 2 2 .wp-block-infinite-uploads-imajinn-ai .connect-wrapper{align-content:space-between;align-items:end;margin-top:10px}.wp-block-infinite-uploads-imajinn-ai .connect-wrapper .components-base-control__help{font-size:80%}.wp-block-infinite-uploads-imajinn-ai .components-placeholder__fieldset .components-button.connect-button{margin-bottom:8px} 3 .imajinn-preview-modal{height:80%}.imajinn-preview-modal .components-modal__content.hide-header{overflow:hidden;padding:0}.imajinn-preview-modal img{height:100% }3 .imajinn-preview-modal{height:80%}.imajinn-preview-modal .components-modal__content.hide-header{overflow:hidden;padding:0}.imajinn-preview-modal img{height:100%!important;-o-object-fit:contain!important;object-fit:contain!important;width:100%!important} 4 4 .imajinn-history .components-panel__body-title{height:50px}.imajinn-history .components-panel__body-title .components-button{float:right;margin-right:10px;margin-top:7px}.imajinn-history .components-panel__body-title img{float:left;height:50px;width:50px}.imajinn-history .components-panel__row{clear:both} 5 5 .imajinn-upgrade-modal-buttons{text-align:right}.imajinn-upgrade-modal-buttons a,.imajinn-upgrade-modal-buttons button{float:right;margin-left:10px} -
imajinn-ai/trunk/build/block.js
r2796851 r2833326 1 !function(){"use strict";var e={352:function(e,t,n){n.d(t,{DT:function(){return a},ZZ:function(){return o},mC:function(){return r}});var i=n(307);function a(e){const t=e.iconSize||30;return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68.99 99",height:t,width:t},(0,i.createElement)("path",{d:"M65.19,60.78c3.9-3.9,6.19-17.59-.2-23.67-4.3-2.8-10.87,1.08-18.09,.8-.51-.02-1.02,.07-1.49,.26-.67,.28-1.44,.72-2.26,1.42-2.56,2.19-5.99,3.51-8.31,2.21-1.84-1.23-1.39-3.92-1.31-4.32-3.97,.8-4.55-.88-8.17,.24-6.84,2.12-18.72,17.38-9.96,22.27,3.89,1.73,11.79,.79,11.79,.79,0,0,6.33,8.55,.95,12.41-5.03,3.61-9.48-.45-15.51-.97-12.95-1.21-19.27,16.96-2.54,26.78-3.64-6.18-4.42-14.42,3.76-14.42,5.68,0,13.27,8.43,24.48,7.03,9.69-1.21,13.03-5.15,17.38-16.07,2.01-4.71,6.92-10.71,6.92-10.71-6.91,2.54-10.67-.61-14.5-1.96-3.83-1.34-8.87-2.09-8.87-2.09,6.29,0,11.48,2.43,15.72,3.05,4.07,.6,7.6-.43,10.22-3.05Z"}),(0,i.createElement)("path",{d:"M54.55,13.82c-2.78-2.37-5.77-6.73-8.76-7.16-4.03-.58-5.66,1.64-6.51,4.46,0-.19-.01-.38-.03-.57L38.55,.04c0-.05-.08-.05-.08,0l-.88,10.25c-.1,1.36,.04,2.72,.4,4.03l.58,1.15c-.02,.39-.01,.62-.01,.62-1.14,1.24-1.97,3.51-2.59,5.14l.53,1.44s.1,2.24-1.84,4.55c0,0-1.2,1.43-1.34,1.77-.17,.4-.16,.96,.47,1.01,.64,.05,2.02,.23,2.02,.23l-.03,2.06c0,.58,.27,2.39,.42,2.86,.58,1.79,.37,3.29-.15,3.43-1.56,.45-1.92-1.14-1.92-1.14,0,0-1.22,4.58,3.55,3.85,3.06-.47,4.72-4.09,7.57-5.19h0c.18-.07,.36-.1,.55-.11,4.53-.1,7.41-.84,7.93-3.92,4.84-.42,6.65-2.72,7.81-7.44,1.21-4.91-2.73-7.17-7.01-10.81Z"}))}function r(){return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55.435381255341",height:"60",viewBox:"0 0 1167.58 1263.72",version:"1.1"},(0,i.createElement)("defs",null,(0,i.createElement)("clipPath",{id:"clip1"},(0,i.createElement)("path",{d:"M 525 1006 L 595 1006 L 595 1263.71875 L 525 1263.71875 Z M 525 1006 "})),(0,i.createElement)("clipPath",{id:"clip2"},(0,i.createElement)("path",{d:"M 1018 1006 L 1167.578125 1006 L 1167.578125 1212 L 1018 1212 Z M 1018 1006 "}))),(0,i.createElement)("g",{id:"surface1"},(0,i.createElement)("path",{d:"M 883.503906 564.917969 C 919.703125 528.71875 941.007813 401.410156 881.6875 344.964844 C 841.726563 318.957031 780.652344 354.957031 713.5625 352.410156 C 708.824219 352.230469 704.105469 353.039063 699.722656 354.847656 C 693.507813 357.414063 686.355469 361.507813 678.730469 368.042969 C 654.972656 388.40625 623.070313 400.625 601.488281 388.585938 C 584.429688 377.132813 588.597656 352.140625 589.332031 348.394531 C 552.476563 355.824219 547.042969 340.191406 513.355469 350.644531 C 449.75 370.382813 339.335938 512.171875 420.820313 557.613281 C 456.992188 573.714844 530.402344 564.917969 530.402344 564.917969 C 530.402344 564.917969 589.253906 644.367188 539.238281 680.246094 C 492.445313 713.808594 451.089844 676.105469 395.078125 671.234375 C 274.757813 660.003906 216.007813 828.910156 371.429688 920.136719 C 337.640625 862.695313 330.320313 786.113281 406.339844 786.113281 C 459.125 786.113281 529.695313 864.453125 633.84375 851.433594 C 723.941406 840.171875 754.910156 803.570313 795.363281 702.039063 C 814.039063 658.285156 859.652344 602.535156 859.652344 602.535156 C 795.457031 626.1875 760.519531 596.839844 724.90625 584.359375 C 689.289063 571.878906 642.421875 564.917969 642.421875 564.917969 C 700.839844 564.917969 749.109375 587.472656 788.523438 593.257813 C 826.324219 598.800781 859.152344 589.269531 883.503906 564.917969 "}),(0,i.createElement)("path",{d:"M 784.621094 128.429688 C 758.757813 106.421875 730.980469 65.921875 703.167969 61.910156 C 665.6875 56.5 650.527344 77.128906 642.636719 103.398438 C 642.59375 101.628906 642.523438 99.859375 642.386719 98.089844 L 635.902344 0.351563 C 635.871094 -0.121094 635.1875 -0.121094 635.15625 0.351563 L 626.976563 95.570313 C 626.089844 108.179688 627.359375 120.851563 630.730469 133.03125 L 636.097656 143.699219 C 635.9375 147.328125 635.964844 149.46875 635.964844 149.46875 C 625.332031 161.011719 617.640625 182.050781 611.933594 197.261719 L 616.851563 210.640625 C 616.851563 210.640625 617.800781 231.441406 599.78125 252.960938 C 599.78125 252.960938 588.667969 266.253906 587.359375 269.429688 C 585.824219 273.152344 585.828125 278.3125 591.742188 278.785156 C 597.652344 279.257813 610.558594 280.914063 610.558594 280.914063 L 610.324219 300.066406 C 610.324219 305.457031 612.859375 322.316406 614.246094 326.636719 C 619.597656 343.292969 617.640625 357.179688 612.886719 358.539063 C 598.386719 362.683594 595.0625 347.902344 595.0625 347.902344 C 595.0625 347.902344 583.699219 390.441406 628.046875 383.652344 C 656.480469 379.300781 671.941406 345.640625 698.414063 335.460938 C 700.050781 334.828125 701.785156 334.496094 703.539063 334.457031 C 745.660156 333.558594 772.402344 326.636719 777.207031 298.027344 C 822.210938 294.09375 838.976563 272.722656 849.785156 228.890625 C 861.050781 183.21875 824.402344 162.28125 784.621094 128.429688 "}),(0,i.createElement)("path",{d:"M 0 1211.832031 L 0 1006.238281 L 14.34375 1006.238281 L 14.34375 1211.832031 L 0 1211.832031 "}),(0,i.createElement)("path",{d:"M 191.785156 1211.832031 L 115.144531 1021.988281 L 114.019531 1021.988281 C 114.769531 1033.609375 115.144531 1045.519531 115.144531 1057.710938 L 115.144531 1211.832031 L 101.363281 1211.832031 L 101.363281 1006.238281 L 123.582031 1006.238281 L 196.425781 1187.082031 L 197.269531 1187.082031 L 270.113281 1006.238281 L 291.769531 1006.238281 L 291.769531 1211.832031 L 277.285156 1211.832031 L 277.285156 1056.019531 C 277.285156 1045.140625 277.847656 1033.890625 278.972656 1022.269531 L 277.847656 1022.269531 L 200.925781 1211.832031 L 191.785156 1211.832031 "}),(0,i.createElement)("path",{d:"M 399.320313 1126.328125 L 472.867188 1126.328125 L 444.882813 1052.21875 C 442.535156 1046.410156 439.722656 1038.351563 436.445313 1028.03125 C 433.914063 1037.03125 431.144531 1045.191406 428.148438 1052.5 Z M 477.648438 1139.269531 L 394.117188 1139.269531 L 365.429688 1211.832031 L 349.539063 1211.832031 L 432.226563 1005.390625 L 441.367188 1005.390625 L 522.367188 1211.832031 L 506.195313 1211.832031 L 477.648438 1139.269531 "}),(0,i.createElement)("g",{clipPath:"url(#clip1)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 546.523438 1263.71875 C 537.902344 1263.71875 530.824219 1262.460938 525.289063 1259.921875 L 525.289063 1247.550781 C 532.601563 1249.421875 539.589844 1250.359375 546.242188 1250.359375 C 568.929688 1250.359375 580.273438 1237.988281 580.273438 1213.238281 L 580.273438 1006.238281 L 594.617188 1006.238281 L 594.617188 1211.832031 C 594.617188 1246.421875 578.585938 1263.71875 546.523438 1263.71875 "})),(0,i.createElement)("path",{d:"M 680.230469 1211.832031 L 680.230469 1006.238281 L 694.574219 1006.238281 L 694.574219 1211.832031 L 680.230469 1211.832031 "}),(0,i.createElement)("path",{d:"M 931.078125 1211.832031 L 916.59375 1211.832031 L 794.8125 1029.300781 L 793.6875 1029.300781 C 794.8125 1051.050781 795.375 1067.460938 795.375 1078.519531 L 795.375 1211.832031 L 781.59375 1211.832031 L 781.59375 1006.238281 L 795.9375 1006.238281 L 917.578125 1188.488281 L 918.421875 1188.488281 C 917.578125 1171.609375 917.15625 1155.578125 917.15625 1140.390625 L 917.15625 1006.238281 L 931.078125 1006.238281 L 931.078125 1211.832031 "}),(0,i.createElement)("g",{clipPath:"url(#clip2)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 1167.578125 1211.832031 L 1153.101563 1211.832031 L 1031.320313 1029.300781 L 1030.191406 1029.300781 C 1031.320313 1051.050781 1031.878906 1067.460938 1031.878906 1078.519531 L 1031.878906 1211.832031 L 1018.101563 1211.832031 L 1018.101563 1006.238281 L 1032.441406 1006.238281 L 1154.078125 1188.488281 L 1154.929688 1188.488281 C 1154.078125 1171.609375 1153.660156 1155.578125 1153.660156 1140.390625 L 1153.660156 1006.238281 L 1167.578125 1006.238281 L 1167.578125 1211.832031 "}))))}function o(){return(0,i.useEffect)((()=>{var t,i;t=this,i=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var a=Math.abs;function r(e){return e}function o(e,t,n){var i=1-n;return 3*n*i*(e*i+t*n)+n*n*n}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return e<0||e>1||n<0||n>1?null:a(e-t)<=1e-5&&a(n-i)<=1e-5?r:function(r){if(r<=0)return e>0?r*t/e:0===t&&n>0?r*i/n:0;if(r>=1)return n<1?1+(r-1)*(i-1)/(n-1):1===n&&e<1?1+(r-1)*(t-1)/(e-1):1;for(var s,l=0,c=1;l<c;){var u=o(e,n,s=(l+c)/2);if(a(r-u)<1e-5)break;u<r?l=s:c=s}return o(t,i,s)}}function l(){return 1}function c(e){return 1===e?1:0}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(1===e){if(0===t)return c;if(1===t)return l}var n=1/e;return function(e){return e>=1?1:(e+=t*n)-e%n}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(Number.isInteger(e))return e;var n=Math.pow(10,t);return Math.round(e*n)/n}var d=Math.PI/180;function m(e,t,n){return e>=.5?n:t}function p(e,t,n){return 0===e||t===n?t:e*(n-t)+t}function f(e,t,n){var i=p(e,t,n);return i<=0?0:i}function g(e,t,n){return 0===e?t:1===e?n:{x:p(e,t.x,n.x),y:p(e,t.y,n.y)}}function y(e,t,n){return 0===e?t:1===e?n:{x:f(e,t.x,n.x),y:f(e,t.y,n.y)}}function v(e,t,n){var i=function(e,t,n){return Math.round(p(e,t,n))}(e,t,n);return i<=0?0:i>=255?255:i}function w(e,t,n){return 0===e?t:1===e?n:{r:v(e,t.r,n.r),g:v(e,t.g,n.g),b:v(e,t.b,n.b),a:p(e,null==t.a?1:t.a,null==n.a?1:n.a)}}function b(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=[],r=0;r<i;r++)a.push(w(e,t[r],n[r]));return a}function _(e,t,n){var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=new Array(i),r=0;r<i;r++)a[r]=p(e,t[r],n[r]);return a}function E(e,t){for(var n=[],i=0;i<e;i++)n.push(t);return n}function x(e,t){if(--t<=0)return e;var n=(e=Object.assign([],e)).length;do{for(var i=0;i<n;i++)e.push(e[i])}while(--t>0);return e}var j=/\.0+$/g;function M(e){return Number.isInteger(e)?e+"":e.toFixed(6).replace(j,"")}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e&&e.length?e.map(M).join(t):""}function k(e){return M(e.x)+","+M(e.y)}function C(e){return e?null==e.a||e.a>=1?"rgb("+e.r+","+e.g+","+e.b+")":"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"transparent"}var I={f:null,i:y,u:function(e,t){return function(n){var i=t(n);e.setAttribute("rx",M(i.x)),e.setAttribute("ry",M(i.y))}}},D={f:null,i:function(e,t,n){return 0===e?t:1===e?n:{width:f(e,t.width,n.width),height:f(e,t.height,n.height)}},u:function(e,t){return function(n){var i=t(n);e.setAttribute("width",M(i.width)),e.setAttribute("height",M(i.height))}}},A=Math.sin,T=Math.cos,L=Math.acos,P=Math.asin,N=Math.tan,O=Math.atan2,R=Math.PI/180,z=180/Math.PI,B=Math.sqrt,W=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;t(this,e),this.m=[n,i,a,r,o,s],this.i=null,this.w=null,this.s=null}return i(e,[{key:"point",value:function(e,t){var n=this.m;return{x:n[0]*e+n[2]*t+n[4],y:n[1]*e+n[3]*t+n[5]}}},{key:"translateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e&&!t)return this;var n=this.m;return n[4]+=n[0]*e+n[2]*t,n[5]+=n[1]*e+n[3]*t,this.w=this.s=this.i=null,this}},{key:"rotateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e%=360){var t=A(e*=R),n=T(e),i=this.m,a=i[0],r=i[1];i[0]=a*n+i[2]*t,i[1]=r*n+i[3]*t,i[2]=i[2]*n-a*t,i[3]=i[3]*n-r*t,this.w=this.s=this.i=null}return this}},{key:"scaleSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==e||1!==t){var n=this.m;n[0]*=e,n[1]*=e,n[2]*=t,n[3]*=t,this.w=this.s=this.i=null}return this}},{key:"skewSelf",value:function(e,t){if(t%=360,(e%=360)||t){var n=this.m,i=n[0],a=n[1],r=n[2],o=n[3];e&&(e=N(e*R),n[2]+=i*e,n[3]+=a*e),t&&(t=N(t*R),n[0]+=r*t,n[1]+=o*t),this.w=this.s=this.i=null}return this}},{key:"resetSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.m;return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o[4]=a,o[5]=r,this.w=this.s=this.i=null,this}},{key:"recomposeSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return this.isIdentity||this.resetSelf(),e&&(e.x||e.y)&&this.translateSelf(e.x,e.y),t&&this.rotateSelf(t),n&&(n.x&&this.skewSelf(n.x,0),n.y&&this.skewSelf(0,n.y)),!i||1===i.x&&1===i.y||this.scaleSelf(i.x,i.y),a&&(a.x||a.y)&&this.translateSelf(a.x,a.y),this}},{key:"decompose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.m,i=n[0]*n[0]+n[1]*n[1],a=[[n[0],n[1]],[n[2],n[3]]],r=B(i);if(0===r)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:0,y:0},skew:{x:0,y:0},rotate:0};a[0][0]/=r,a[0][1]/=r;var o=n[0]*n[3]-n[1]*n[2]<0;o&&(r=-r);var s=a[0][0]*a[1][0]+a[0][1]*a[1][1];a[1][0]-=a[0][0]*s,a[1][1]-=a[0][1]*s;var l=B(a[1][0]*a[1][0]+a[1][1]*a[1][1]);if(0===l)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:0},skew:{x:0,y:0},rotate:0};a[1][0]/=l,a[1][1]/=l,s/=l;var c=0;return a[1][1]<0?(c=L(a[1][1])*z,a[0][1]<0&&(c=360-c)):c=P(a[0][1])*z,o&&(c=-c),s=O(s,B(a[0][0]*a[0][0]+a[0][1]*a[0][1]))*z,{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:l},skew:{x:s,y:0},rotate:c}}},{key:"toString",value:function(){return null===this.s&&(this.s="matrix("+this.m.map(F).join(" ")+")"),this.s}},{key:"determinant",get:function(){var e=this.m;return e[0]*e[3]-e[1]*e[2]}},{key:"isIdentity",get:function(){if(null===this.i){var e=this.m;this.i=1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}return this.i}}]),e}(),Y=/\.0+$/;function F(e){return Number.isInteger(e)?e:e.toFixed(14).replace(Y,"")}function V(e,t,n){return e+(t-e)*n}function G(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a={x:V(e.x,t.x,n),y:V(e.y,t.y,n)};return i&&(a.a=H(e,t)),a}function H(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function U(e,t,n,i){var a=1-i;return a*a*e+2*a*i*t+i*i*n}function J(e,t,n,i){return 2*(1-i)*(t-e)+2*i*(n-t)}function q(e,t,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={x:U(e.x,t.x,n.x,i),y:U(e.y,t.y,n.y,i)};return a&&(r.a=Z(e,t,n,i)),r}function Z(e,t,n,i){return Math.atan2(J(e.y,t.y,n.y,i),J(e.x,t.x,n.x,i))}function X(e,t,n,i,a){var r=a*a;return a*r*(i-e+3*(t-n))+3*r*(e+n-2*t)+3*a*(t-e)+e}function Q(e,t,n,i,a){var r=1-a;return 3*(r*r*(t-e)+2*r*a*(n-t)+a*a*(i-n))}function $(e,t,n,i,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o={x:X(e.x,t.x,n.x,i.x,a),y:X(e.y,t.y,n.y,i.y,a)};return r&&(o.a=K(e,t,n,i,a)),o}function K(e,t,n,i,a){return Math.atan2(Q(e.y,t.y,n.y,i.y,a),Q(e.x,t.x,n.x,i.x,a))}function ee(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(ne(t)){if(ie(n))return q(t,n.start,n,e,i)}else if(ne(n)){if(t.end)return q(t,t.end,n,e,i)}else{if(t.end)return n.start?$(t,t.end,n.start,n,e,i):q(t,t.end,n,e,i);if(n.start)return q(t,n.start,n,e,i)}return G(t,n,e,i)}function te(e,t,n){var i=ee(e,t,n,!0);return i.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?e+Math.PI:e}(i.a)/d,i}function ne(e){return!e.type||"corner"===e.type}function ie(e){return null!=e.start&&!ne(e)}Object.freeze({M:2,L:2,Z:0,H:1,V:1,C:6,Q:4,T:2,S:4,A:7});var ae=new W,re={f:function(e){return e?e.join(" "):""},i:function(t,n,i){if(0===t)return n;if(1===t)return i;var a=n.length;if(a!==i.length)return m(t,n,i);for(var r,o=new Array(a),s=0;s<a;s++){if((r=e(n[s]))!==e(i[s]))return m(t,n,i);if("number"===r)o[s]=p(t,n[s],i[s]);else{if(n[s]!==i[s])return m(t,n,i);o[s]=n[s]}}return o}},oe={f:null,i:_,u:function(e,t){return function(n){var i=t(n);e.setAttribute("x1",M(i[0])),e.setAttribute("y1",M(i[1])),e.setAttribute("x2",M(i[2])),e.setAttribute("y2",M(i[3]))}}},se={f:M,i:p},le={f:M,i:function(e,t,n){var i=p(e,t,n);return i<=0?0:i>=1?1:i}},ce={f:S,i:function(e,t,n){var i,a,r,o=t.length,s=n.length;if(o!==s)if(0===o)t=E(o=s,0);else if(0===s)s=o,n=E(o,0);else{var l=(r=(i=o)*(a=s)/function(e,t){for(var n;t;)n=t,t=e%t,e=n;return e||1}(i,a))<0?-r:r;t=x(t,Math.floor(l/o)),n=x(n,Math.floor(l/s)),o=s=l}for(var c=[],u=0;u<o;u++)c.push(h(f(e,t[u],n[u]),6));return c}};function ue(e,t,n,i,a,r,o,s){return t=function(e,t,n){for(var i,a,r,o=e.length-1,s={},l=0;l<=o;l++)(i=e[l]).e&&(i.e=t(i.e)),i.v&&"g"===(a=i.v).t&&a.r&&(r=n.getElementById(a.r))&&(s[a.r]=r.querySelectorAll("stop"));return s}(e,i,s),function(i){var a,r=n(i,e,he);return r?"c"===r.t?C(r.v):"g"===r.t?(t[r.r]&&function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].setAttribute("stop-color",C(t[n]))}(t[r.r],r.v),(a=r.r)?"url(#"+a+")":"none"):"none":"none"}}function he(e,t,n){if(0===e)return t;if(1===e)return n;if(t&&n){var i=t.t;if(i===n.t)switch(t.t){case"c":return{t:i,v:w(e,t.v,n.v)};case"g":if(t.r===n.r)return{t:i,v:b(e,t.v,n.v),r:t.r}}}return m(e,t,n)}var de={blur:y,brightness:f,contrast:f,"drop-shadow":function(e,t,n){return 0===e?t:1===e?n:{blur:y(e,t.blur,n.blur),offset:g(e,t.offset,n.offset),color:w(e,t.color,n.color)}},grayscale:f,"hue-rotate":p,invert:f,opacity:f,saturate:f,sepia:f};function me(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a,r=[],o=0;o<i;o++){if(t[o].type!==n[o].type)return t;if(!(a=de[t[o].type]))return m(e,t,n);r.push({type:t.type,value:a(e,t[o].value,n[o].value)})}return r}var pe={blur:function(e){return e?function(t){e.setAttribute("stdDeviation",k(t))}:null},brightness:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t),e.map((function(e){return e.setAttribute("slope",t)}))}:null},contrast:function(e,t,n){return(e=ge(n,t))?function(t){var n=M((1-t)/2);t=M(t),e.map((function(e){e.setAttribute("slope",t),e.setAttribute("intercept",n)}))}:null},"drop-shadow":function(e,t,n){var i=n.getElementById(t+"-blur");if(!i)return null;var a=n.getElementById(t+"-offset");if(!a)return null;var r=n.getElementById(t+"-flood");return r?function(e){i.setAttribute("stdDeviation",k(e.blur)),a.setAttribute("dx",M(e.offset.x)),a.setAttribute("dy",M(e.offset.y)),r.setAttribute("flood-color",C(e.color))}:null},grayscale:function(e){return e?function(t){e.setAttribute("values",S(function(e){return[.2126+.7874*(e=1-e),.7152-.7152*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152+.2848*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152-.7152*e,.0722+.9278*e,0,0,0,0,0,1,0]}(t)))}:null},"hue-rotate":function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},invert:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t)+" "+M(1-t),e.map((function(e){return e.setAttribute("tableValues",t)}))}:null},opacity:function(e,t,n){return(e=n.getElementById(t+"-A"))?function(t){return e.setAttribute("tableValues","0 "+M(t))}:null},saturate:function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},sepia:function(e){return e?function(t){return e.setAttribute("values",S(function(e){return[.393+.607*(e=1-e),.769-.769*e,.189-.189*e,0,0,.349-.349*e,.686+.314*e,.168-.168*e,0,0,.272-.272*e,.534-.534*e,.131+.869*e,0,0,0,0,0,1,0]}(t)))}:null}},fe=["R","G","B"];function ge(e,t){var n=fe.map((function(n){return e.getElementById(t+"-"+n)||null}));return-1!==n.indexOf(null)?null:n}var ye={fill:ue,"fill-opacity":le,stroke:ue,"stroke-opacity":le,strokeWidth:se,strokeDashoffset:{f:M,i:p},strokeDasharray:ce,opacity:le,transform:function(t,n,i,a){if(!(t=function(t,n){if(!t||"object"!==e(t))return null;var i=!1;for(var a in t)t.hasOwnProperty(a)&&(t[a]&&t[a].length?(t[a].forEach((function(e){e.e&&(e.e=n(e.e))})),i=!0):delete t[a]);return i?t:null}(t,a)))return null;var r=function(e,a,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t[e]?i(a,t[e],r):n&&n[e]?n[e]:o};return n&&n.a&&t.o?function(e){var n=i(e,t.o,te);return ae.recomposeSelf(n,r("r",e,p,0)+n.a,r("k",e,g),r("s",e,g),r("t",e,g)).toString()}:function(e){return ae.recomposeSelf(r("o",e,ee,null),r("r",e,p,0),r("k",e,g),r("s",e,g),r("t",e,g)).toString()}},"#filter":function(e,t,n,i,a,r,o,s){if(!t.items||!e||!e.length)return null;var l=function(e,t){var n=(e=e.map((function(e){return e&&pe[e[0]]?(t.getElementById(e[1]),pe[e[0]](t.getElementById(e[1]),e[1],t)):null}))).length;return function(t){for(var i=0;i<n;i++)e[i]&&e[i](t[i].value)}}(t.items,s);return l?(e=function(e,t){return e.map((function(e){return e.e=t(e.e),e}))}(e,i),function(t){l(n(t,e,me))}):null},"#line":oe,points:{f:S,i:_},d:re,r:se,"#size":D,"#radius":I,_:function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)this[e[n]]=t;else this[e]=t}},ve=function(){function e(n){t(this,e),this.list=n,this.length=n.length}return i(e,[{key:"setAttribute",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].setAttribute(e,t)}},{key:"removeAttribute",value:function(e){for(var t=this.list,n=0;n<this.length;n++)t[n].removeAttribute(e)}},{key:"style",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].style[e]=t}}]),e}(),we=/-./g,be=function(e,t){return t.toUpperCase()};function _e(e){return"function"==typeof e?e:m}function Ee(e){return e?"function"==typeof e?e:Array.isArray(e)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;if(!Array.isArray(e))return t;switch(e.length){case 1:return u(e[0])||t;case 2:return u(e[0],e[1])||t;case 4:return s(e[0],e[1],e[2],e[3])||t}return t}(e,null):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;switch(e){case"linear":return r;case"steps":return u(t.steps||1,t.jump||0)||n;case"bezier":case"cubic-bezier":return s(t.x1||0,t.y1||0,t.x2||0,t.y2||0)||n}return n}(e.type,e.value,null):null}function xe(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length-1;if(e<=t[0].t)return i?[0,0,t[0].v]:t[0].v;if(e>=t[a].t)return i?[a,1,t[a].v]:t[a].v;var r,o=t[0],s=null;for(r=1;r<=a;r++){if(!(e>t[r].t)){s=t[r];break}o=t[r]}return null==s?i?[a,1,t[a].v]:t[a].v:o.t===s.t?i?[r,1,s.v]:s.v:(e=(e-o.t)/(s.t-o.t),o.e&&(e=o.e(e)),i?[r,e,n(e,o.v,s.v)]:n(e,o.v,s.v))}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e&&e.length?"function"!=typeof t?null:("function"!=typeof n&&(n=null),function(i){var a=xe(i,e,t);return null!=a&&n&&(a=n(a)),a}):null}function Me(e,t){return e.t-t.t}function Se(t,n,i,a){if(!a||"object"!==e(a))return null;var r=null,o=null;return Array.isArray(a)?o=function(e){if(!e||!e.length)return null;for(var t=0;t<e.length;t++)e[t].e&&(e[t].e=Ee(e[t].e));return e.sort(Me)}(a):(o=a.keys,r=a.data||null),o?function(t,n,i,a,r){var o,s="@"===i[0],l="#"===i[0],c=ye[i],u=m;switch(s?(o=i.substr(1),i=o.replace(we,be)):l&&(i=i.substr(1)),e(c)){case"function":if(u=c(a,r,xe,Ee,i,s,n,t),l)return u;break;case"string":u=je(a,_e(c));break;case"object":if((u=je(a,_e(c.i),c.f))&&"function"==typeof c.u)return c.u(n,u,i,s,t)}return u?function(e,t,n){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3])return e instanceof ve?function(i){return e.style(t,n(i))}:function(i){return e.style[t]=n(i)};if(Array.isArray(t)){var i=t.length;return function(a){var r=n(a);if(null==r)for(var o=0;o<i;o++)e[o].removeAttribute(t);else for(var s=0;s<i;s++)e[s].setAttribute(t,r)}}return function(i){var a=n(i);null==a?e.removeAttribute(t):e.setAttribute(t,a)}}(n,i,u,s):null}(t,n,i,o,r):null}function ke(e,t,n){if(!n)return null;var i=[];for(var a in n)if(n.hasOwnProperty(a)){var r=Se(e,t,a,n[a]);r&&i.push(r)}return i.length?i:null}var Ce=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(this,e),this._id=0,this._running=!1,this._animations=n,this.direction=i.direction||1,this.speed=i.speed||1,this.fps=i.fps||100,this.offset=i.offset||0}return i(e,[{key:"_start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=-1/0,i=null,a={},r=function r(o){e._running=!0,null==i&&(i=o);var s=Math.round((o-i+t)*e.speed),l=e.fps?1e3/e.fps:0;if(s>n+l){e.offset=s,n=s;for(var c=e._animations,u=c.length,h=0,d=0;d<u;d++)a[d]?h++:(a[d]=c[d](s,e.direction),a[d]&&h++);if(h===u)return void e._stop()}e._id=window.requestAnimationFrame(r)};this._id=window.requestAnimationFrame(r)}},{key:"_stop",value:function(){this._id&&window.cancelAnimationFrame(this._id),this._running=!1}},{key:"play",value:function(){this._running||this._start(this.offset)}},{key:"stop",value:function(){this._stop(),this.offset=0;var e=this.direction,t=this._animations;requestAnimationFrame((function(){for(var n=0;n<t.length;n++)t[n](0,e)}))}},{key:"restart",value:function(){this._stop(),this.offset=0,this._start()}},{key:"pause",value:function(){this._stop()}},{key:"reverse",value:function(){this.direction=-this.direction}}],[{key:"build",value:function(t){if(!(t=function(e){if(!e||!e.root||!Array.isArray(e.animations))return null;var t=window.document.getElementById(e.root);if(!t)return null;var n=e.animations.map((function(e){return function(e,t){if(!t.duration||t.duration<0)return null;var n=function(e,t){if(!t)return null;var n=[];if(Array.isArray(t))for(var i=t.length,a=0;a<i;a++){var r=t[a];if(2===r.length){var o=null;if("string"==typeof r[0])o=e.getElementById(r[0]);else if(Array.isArray(r[0])){o=[];for(var s=0;s<r[0].length;s++)if("string"==typeof r[0][s]){var l=e.getElementById(r[0][s]);l&&o.push(l)}o=o.length?1===o.length?o[0]:new ve(o):null}if(o){var c=ke(e,o,r[1]);c&&(n=n.concat(c))}}}else for(var u in t)if(t.hasOwnProperty(u)){var h=e.getElementById(u);if(h){var d=ke(e,h,t[u]);d&&(n=n.concat(d))}}return n.length?n:null}(e,t.elements);return n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=e.length,s=i>0?t:0;a&&n%2==0&&(s=t-s);var l=null;return function(c,u){var h=c%t,d=1+(c-h)/t;u*=i,a&&d%2==0&&(u=-u);var m=!1;if(d>n)h=s,m=!0,-1===r&&(h=i>0?0:t);else if(u<0&&(h=t-h),h===l)return!1;l=h;for(var p=0;p<o;p++)e[p](h);return m}}(n,t.duration,t.iterations||1/0,t.direction||1,!!t.alternate,t.fill||1):null}(t,e)})).filter((function(e){return!!e}));return n.length?{element:t,animations:n,options:e.options||void 0}:null}(t)))return null;var n=t.element,i=t.options||{},a=new e(t.animations,t.options);return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if("click"!==n){if("hover"===n)return t.addEventListener("mouseenter",(function(){return e.play()})),void t.addEventListener("mouseleave","freeze"===i?function(){return e.pause()}:function(){return e.stop()});e.play()}else{var a=function n(){t.removeEventListener("click",n),e.play()};t.addEventListener("click",a)}}(a,n,i.start,i.hover),a}}]),e}();return function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var n=Date.now(),i=Math.max(0,16-(n-e)),a=window.setTimeout((function(){t(n+i)}),i);return e=n+i,a},window.cancelAnimationFrame=window.clearTimeout)}(),Ce},"object"==typeof exports?e.exports=i():"function"==typeof define&&n.amdO?define(i):(t=t||self).__SVGATOR_PLAYER__=i(),__SVGATOR_PLAYER__.build({root:"e29gnwghxaec1",animations:[{duration:3e3,direction:1,iterations:0,fill:1,alternate:!1,elements:{e29gnwghxaec4:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160,y:60.000000000000085,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.0000000000001,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:160.00000000000009,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:70.00000000000013,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000011,y:110.00000000000003,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec5:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:209.99999999999997,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70,y:109.99999999999996,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160,y:59.999999999999986,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.00000000000006,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000003,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000006,y:210,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec6:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70.00000000000003,y:210.00000000000003,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.0000000033166,y:110.00000000017586,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999559876,y:59.99999999808161,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250.00000000133716,y:109.99999999826927,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250.00000000074502,y:209.99999999748923,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:160.00000000328416,y:259.99999999938586,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec7:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:209.99999999827637,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160.00000000000003,y:259.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.00000000000003,y:209.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000003,y:109.99999999827641,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:159.99999999999997,y:59.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250,y:109.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250.00000000000003,y:209.99999999827642,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec8:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:250.00000000000009,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160.00000000000006,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000006,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:70.00000000000003,y:110.00000000000007,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000006,y:60.000000000000064,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250,y:110.00000000000006,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec9:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:60,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:249.99999999999997,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:249.99999999999994,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999999991,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:69.99999999999991,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:69.99999999999994,y:110.00000000000001,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:159.99999999999994,y:60.00000000000004,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}}}}],options:{start:"load",hover:"restart"}})}),[]),(0,i.createElement)("svg",{id:"e29gnwghxaec1",className:"imajinn-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 300",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision"},(0,i.createElement)("defs",null,(0,i.createElement)("filter",{id:"e29gnwghxaec4-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec4-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec5-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec5-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec6-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec6-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec7-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec7-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec8-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec8-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec9-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec9-filter-blur-0",stdDeviation:"0,0",result:"result"}))),(0,i.createElement)("circle",{id:"e29gnwghxaec2",r:"50",transform:"matrix(-1 0 -0 -1 149.99999999999997 50.00000000379265)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("circle",{id:"e29gnwghxaec3",r:"50",transform:"matrix(-1 0 -0 -1 49.99999999999997 150.00000000379259)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("path",{id:"e29gnwghxaec4",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 110.00000000344897)",filter:"url(#e29gnwghxaec4-filter)",fill:"rgb(239,237,39)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec5",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 210.00000000344886)",filter:"url(#e29gnwghxaec5-filter)",fill:"rgb(236,0,140)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec6",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 260.00000000344897)",filter:"url(#e29gnwghxaec6-filter)",fill:"rgb(238,124,30)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec7",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 210.00000000172525)",filter:"url(#e29gnwghxaec7-filter)",fill:"rgb(0,161,103)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec8",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 110.00000000344897)",filter:"url(#e29gnwghxaec8-filter)",fill:"rgb(192,53,226)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec9",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 60.00000000344890)",filter:"url(#e29gnwghxaec9-filter)",fill:"rgb(38,169,224)",stroke:"none",strokeWidth:"6"}))}n(609),e=n.hmd(e)},380:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(873))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.segments,i=void 0===n?50:n,a=t.iterationLimit,s=void 0===a?100:a;o(this,e),this.p1=new r.default,this.p2=new r.default,this.segments=i,this.iterationLimit=s}return a(e,[{key:"drawToCanvas",value:function(e,t,n,i){this.p1.update(t),this.p2.update(n);var a=this.p1.x>this.p2.x,r=a?this.p2:this.p1,o=a?this.p1:this.p2,s=[],l=!0;if(r.getDistanceTo(o)<i)if(o.x-r.x>.01){var c=o.x-r.x,u=o.y-r.y,h=-this.getCatenaryParameter(c,u,i,this.iterationLimit),d=.5*(h*Math.log((i+u)/(i-u))-c),m=h*Math.cosh(d/h),p=r.x-d,f=r.y-m;s=this.getCurve(h,r,o,p,f,this.segments),l=!1}else{var g=.5*(r.x+o.x),y=.5*(r.y+o.y+i);s=[[r.x,r.y],[g,y],[o.x,o.y]]}else s=[[r.x,r.y],[o.x,o.y]];return l?this.drawLine(s,e):this.drawCurve(s,e),s}},{key:"getCatenaryParameter",value:function(e,t,n,i){for(var a=Math.sqrt(n*n-t*t)/e,r=Math.acosh(a)+1,o=-1,s=0;Math.abs(r-o)>1e-6&&s<i;)o=r,r-=(Math.sinh(r)-a*r)/(Math.cosh(r)-a),s++;return e/(2*r)}},{key:"getCurve",value:function(e,t,n,i,a,r){for(var o=[t.x,e*Math.cosh((t.x-i)/e)+a],s=n.x-t.x,l=r-1,c=0;c<l;c++){var u=t.x+s*(c+.5)/l,h=e*Math.cosh((u-i)/e)+a;o.push(u,h)}return o.push(n.x,e*Math.cosh((n.x-i)/e)+a),o}},{key:"drawLine",value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:"drawCurve",value:function(e,t){var n=.5*e.length-1,i=e[2],a=e[3],r=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[2*o],l=e[2*o+1],c=.5*(s+i),u=.5*(l+a);r.push([i,a,c,u]),t.quadraticCurveTo(i,a,c,u),i=s,a=l}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),r}}]),e}();t.default=s},873:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return n(e,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"getDifferenceTo",value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}}]),e}();t.default=i},301:function(e,t,n){t.oT=void 0;var i=r(n(380)),a=r(n(873));function r(e){return e&&e.__esModule?e:{default:e}}t.oT=i.default,a.default},630:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(195))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.radius,i=void 0===n?30:n,a=t.enabled,s=void 0===a||a,l=t.initialPoint,c=void 0===l?{x:0,y:0}:l;o(this,e),this.radius=i,this._isEnabled=s,this.pointer=new r.default(c.x,c.y),this.brush=new r.default(c.x,c.y),this.angle=0,this.distance=0,this._hasMoved=!1}return a(e,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"isEnabled",value:function(){return this._isEnabled}},{key:"setRadius",value:function(e){this.radius=e}},{key:"getRadius",value:function(){return this.radius}},{key:"getBrushCoordinates",value:function(){return this.brush.toObject()}},{key:"getPointerCoordinates",value:function(){return this.pointer.toObject()}},{key:"getBrush",value:function(){return this.brush}},{key:"getPointer",value:function(){return this.pointer}},{key:"getAngle",value:function(){return this.angle}},{key:"getDistance",value:function(){return this.distance}},{key:"brushHasMoved",value:function(){return this._hasMoved}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.both,i=void 0!==n&&n;return this._hasMoved=!1,!(this.pointer.equalsTo(e)&&!i||(this.pointer.update(e),i?(this._hasMoved=!0,this.brush.update(e),0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),0)))}}]),e}();t.default=s},195:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(93))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"moveByAngle",value:function(e,t){var n=e+Math.PI/2;this.x=this.x+Math.sin(n)*t,this.y=this.y-Math.cos(n)*t}},{key:"equalsTo",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"getDifferenceTo",value:function(e){return new r.default(this.x-e.x,this.y-e.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}},{key:"getAngleTo",value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:"toObject",value:function(){return{x:this.x,y:this.y}}}]),t}(r.default);t.default=l},93:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}},227:function(e,t,n){t.xv=void 0;var i=o(n(630)),a=o(n(93)),r=o(n(195));function o(e){return e&&e.__esModule?e:{default:e}}t.xv=i.default,a.default,r.default},609:function(e){e.exports=window.wp.components},307:function(e){e.exports=window.wp.element}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i](r,r.exports,n),r.loaded=!0,r.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),function(){var e=window.wp.blocks,t=n(307),i=window.wp.i18n,a=window.wp.blockEditor,r=n(609),o=window.wp.primitives,s=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"infinite-uploads/imajinn-ai","version":"0.1.0","title":"Imajinn AI","category":"media","icon":"art","description":"Generate the perfect images from a text prompt in seconds with cutting-edge AI. Creates stunning images for any topic with just your imagination.","keywords":["img","image","photo","picture","ai","art","infinite"],"supports":{"html":false,"multiple":false,"customClassName":false,"reusable":false,"lock":false},"example":{"attributes":{"mode":"preview"}},"textdomain":"imajinn-ai","editorScript":"file:./block.js","editorStyle":"file:./block.css"}'),c=n(352);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)}var h=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),d=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function m(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{className:"imajinn-prompt-tips",onClick:()=>a(!0),icon:h,label:(0,i.__)("Prompt Tips","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Basics of Prompt Engineering","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)('"Prompt Engineering" is an important skill to create better generations with this text to image AI. After reading this document and applying these simple steps, you’ll be able to generate better images with the same amount of effort.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Note: Your prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. If you speak another language you can use a online translation tool, which should provide excellent results as it does not have to be perfect.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("1. Raw prompt","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Raw prompt is the simplest way of describing what you want to generate, for instance;","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Panda"),(0,t.createElement)("li",null,"A warrior with a sword"),(0,t.createElement)("li",null,"Skeleton")),(0,t.createElement)("p",null,(0,i.__)("This is the basic building block of any prompt. Most new people start by only using raw prompts, this is usually a mistake as the images you generate like this tend to get random and chaotic. It's best to include as much detail as possible in your prompt describing exactly what you want to see in the scene.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("2. Style","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Style is a crucial part of the prompt. The AI, when missing a specified style, usually chooses the one it has seen the most in related images, for example, if you generated landscape, it would probably generate realistic or oil painting looking images. Having a well chosen style + raw prompt is sometimes enough, as the style influences the image the most right after the raw prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most commonly used styles include:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Realistic"),(0,t.createElement)("li",null,"Oil painting"),(0,t.createElement)("li",null,"Pencil drawing"),(0,t.createElement)("li",null,"Concept art")),(0,t.createElement)("p",null,(0,i.__)("In the case of a realistic image, there are various ways of making it the style, most resulting in similar images. Here are some commonly used techniques of making the image realistic:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"a photo of + raw prompt"),(0,t.createElement)("li",null,"a photograph of + raw prompt"),(0,t.createElement)("li",null,"raw prompt, hyperrealistic"),(0,t.createElement)("li",null,"raw prompt, realistic")),(0,t.createElement)("p",null,(0,i.__)("You can of course combine these to get more and more realistic images.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To get oil painting you can just simply add “an oil painting of” to your prompt. This sometimes results in the image showing an oil painting in a frame, to fix this you can just re-run the prompt or use raw prompt + “oil painting”","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make a pencil drawing just simply add “a pencil drawing of” to your raw prompt or make your prompt raw prompt + “pencil drawing”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The same applies to landscape art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("3. Artist","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make your style more specific, or the image more coherent, you can use artists’ names in your prompt. For instance, if you want a very abstract image, you can add “made by Pablo Picasso” or just simply, “Picasso”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Below are lists of artists in different styles that you can use, but we encourage you to search for different artists as it is a cool way of discovering new art.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Portrait:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"John Singer Sargent"),(0,t.createElement)("li",null,"Edgar Degas"),(0,t.createElement)("li",null,"Paul Cézanne"),(0,t.createElement)("li",null,"Jan van Eyck")),(0,t.createElement)("p",null,(0,i.__)("Oil painting:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Leonardo DaVinci"),(0,t.createElement)("li",null,"Vincent Van Gogh"),(0,t.createElement)("li",null,"Johannes Vermeer"),(0,t.createElement)("li",null,"Rembrandt")),(0,t.createElement)("p",null,(0,i.__)("Pencil/Pen drawing:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Albrecht Dürer"),(0,t.createElement)("li",null,"Leonardo da Vinci"),(0,t.createElement)("li",null,"Michelangelo"),(0,t.createElement)("li",null,"Jean-Auguste-Dominique Ingres")),(0,t.createElement)("p",null,(0,i.__)("Landscape art:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Thomas Moran"),(0,t.createElement)("li",null,"Claude Monet"),(0,t.createElement)("li",null,"Alfred Bierstadt"),(0,t.createElement)("li",null,"Frederic Edwin Church")),(0,t.createElement)("p",null,(0,i.__)("Mixing the artists is highly encouraged, as it can lead to interesting-looking art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("4. Finishing touches","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("This is the part that some people take to extremes, leading to longer prompts than this article. Finishing touches are the final things that you add to your prompt to make it look like you want. For instance, if you want to make your image more artistic, add “trending on artstation”. If you want to add more realistic lighting add “Unreal Engine.” You can add anything you want, but here are some examples:","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Highly detailed, surrealism, trending on art station, triadic color scheme, smooth, sharp focus, matte, elegant, the most beautiful image ever seen, illustration, digital paint, dark, gloomy, octane render, 8k, 4k, washed colors, sharp, dramatic lighting, beautiful, post processing, picture of the day, ambient lighting, epic composition, bokeh, etc.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("5. Conclusion","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Prompt engineering allows you to have better control of what the image will look like. It (if done right) improves the image quality by a lot in every aspect. But if you want to keep it simple, just use our Prompt Genie or style presets.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function p(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.ToolbarButton,{onClick:()=>a(!0),icon:d,label:(0,i.__)("Help","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:d}),title:(0,i.__)("Usage Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI is a powerful tool that uses the latest technology in AI to generate images from text. It is a great tool for writers, artists, and anyone who needs to visualize their ideas.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The Imajinn AI interface is a block that you can add to your post or page. You can add it by clicking on the plus button in the top left corner of the editor and selecting Imajinn AI. You can also add it by clicking on the Imajinn AI icon in the block inserter. It does not output any content on your site on its own, but allows you to generate and insert images into the same location in the block editor. When finished you can just close the block.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Connecting","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Running an artificial intelligence neural network requires a lot of computing power. To make this possible, we run a cloud service to run the neural network. This means that you need to connect to our service before you can use the plugin. To connect to Imajinn AI, you need to have a user account. You can create one for free with just your valid email address and a password, or if you already have an account, you can log in with your Infinite Uploads/Imajinn AI email and password.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompts","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To generate images, you need to write a prompt. A prompt is a text that describes what you want the image to look like. The prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. The prompt can be as short as a a few words, or as long as a paragraph. The longer the prompt, the more detailed the image will be. Please see our prompt engineering guide for more information on how to write a good prompt.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt Genie","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Because writing prompts is hard, we have created a tool called Prompt Genie that can help you turn your simple prompts into amazing masterpieces. Prompt Genie uses a custom AI model to transform your prompt into ten different powerful options to generate an image in beautiful artistic styles. Simply enter your simple prompt like "a dog running on a beach", then click on the Prompt Genie button. After a few moments it will present you with ten different expanded prompts to choose from. You can then select the one you like best and click on the Generate button to generate a set of images. If you want to try a different prompt, just click on the Prompt Genie button again and choose a new option.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Summoning Prompt Genie does not use any of your credits, so you can summon it as many times as you like. However each time you generate a set of images from one of it's prompts you will use one credit like normal.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prefilled Styles","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To give you inspiration and make it easier to generate images in specific styles, we have added some dropdowns with prefilled styles that you can optionally select from. When optionally choosing options here it will append specific keywords to your prompt to achieve that style when sent to our servers.","imajinn-ai")),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Image Style","imajinn-ai")),"-",(0,i.__)("Choose from many common photographic or artistic styles and mediums.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Artist Style","imajinn-ai")),"-",(0,i.__)("Choose to generate your images based on the styles of some famous artists.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Modifier","imajinn-ai")),"-",(0,i.__)("Some fun and common styles to give the image output that special uniqueness.","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Image Ratio","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("You can control the output ratio of the generated images. Square images are the default, while rectangular images have more pixels and take longer to process.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The AI model was trained on square images, so depending on the prompt rectangular images may produce strange results such as duplication of the main subject. For example a rectangular image of a person may produce two of the same person, or multiple mouths on the same face. So it may require more prompt editing and generation attempts to get the desired result. Rectangular images are best used for landscapes, scenes, and other objects that do not have a singular main subject.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Saving Images","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI allows you to save images to your media library, and optionally insert them into your post/page. You can save images by clicking on the save button in the bottom right corner of each image generation. You can insert images into the editor in the same location as the Imajinn block by clicking on the insert button in the bottom right corner. Inserting an image also saves it to your media library, so you don't need to choose both.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you save or insert an image, it can take a few seconds because we send it to our servers to be upscaled using our advanced AI models so that you get a high resolution optimized image in your media library with no watermarks.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Image Actions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("For each image result for a generation, you can perform some actions on the image. You can share the image on social media, generate a set of variations, perform a face repair, or enter touchup mode.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've found an image you like, you can click the Generate Variations button to generate a set of images with similar styles and layout to give you more options to choose from. This will take into account any modifications you've made to the prompt, while still roughly following the original image. Creating variations uses one credit just like a normal generation.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've generated an image of a person and the face looks slightly deformed or unrealistic, you can click the Face Repair button to try and repair any issues with the face. This processes the image on our servers with AI-based facial restoration to restore facial details and enhance colors with a good balance of realness and fidelity. It can't fix every problem with a face, but it can help with some common issues. This tool is most effective for photographic or realistic art; if you try to use it on more abstract artistic faces results may be strange. Face repairs are not stored in your prompt history so that you can easily undo, and do not use any credits.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('The Touchup button (or "Inpainting") allows you to customize and make modifications to the image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, and duplicate objects. You can also use it to add new objects to the image, such as a new background or foreground. Using touchup can be a bit tricky, so be sure to read the tips popup inside of the image editor so you can make good use of your credits.',"imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt History","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn saves your prompt history to your site so that you can easily access previous prompts and their results later. Currently the editor will show the last 20 generated prompts and their image results. To jump back in time simply click the Load button next to an item. You can then edit, save, adjust the prompt, styles, or any other action you can normally do after generating a set of images.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Credits","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you first signup for Imajinn AI, you get a chunk of free credits. You can use these credits to generate images and get a feel for how the plugin functions and learn how to write effective prompts. If you run out, you can purchase more credits from the Imajinn AI website via our plans.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Each prompt generation uses one credit, and creates four images that you can choose to save and/or insert into your content. There is no limit to the number of images you can save.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Filters and Restrictions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To ensure that the images generated are appropriate for all audiences, we have a set of filters and restrictions that are applied to prompts and the image outputs. We block the use of specific words and phrases in prompts, and we scan all generations with an AI moderation filter to block images that appear to contain nudity, or other inappropriate content.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Depending on your prompt construction, it can be a fairly common occurrence for it to detect a potentially inappropriate image. If this happens, you will see a warning message. You can either change your prompt, or try generating again. We currently don't charge credits for images that are blocked by the filter, but may need to change this policy in the future. We monitor prompt violations and if we find that you are purposely using inappropriate prompts and attempting to bypass our restrictions, we may disable your account.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function f(e){let{isMobile:n,...a}=e;const[o,s]=(0,t.useState)(!1),l=()=>s(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>s(!0),icon:h,label:n&&(0,i.__)("Tips","imajinn-ai")},!n&&(0,i.__)("Tips","imajinn-ai")),o&&(0,t.createElement)(r.Modal,u({},a,{onRequestClose:l,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Touchup (Inpainting) Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("The Touchup feature allows you to customize and make modifications to an image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, or duplicates. Or you can also use it to add new objects to the image, such as a new object or background. Touchup allows you to create the exact image you want by choosing where each element in the image goes. You can create the complex image you have in mind, even if it is too specific to get right with one initial prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Touchup works by choosing an image as an input, masking an area with the brush that you want to modify, then adjusting your prompt to describe what you want in that area. However, this can be quite difficult to work with if you don’t use it right, because sometimes you select an area and put in the prompt, but the image doesn't change. So, here are some tips to help you get the best results from Touchup.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Best Practices","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Prompt Modification","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most important thing to keep in mind is whether you should describe the entire image you want or only what you want to add. For example, let’s say you want to change an image of an empty shoreline to add a boat floating on the water. You select an area where you want the boat to go, and your prompt in most cases shouldn’t be “a boat”. Instead it should be “Shoreline with a boat floating on the water”. This is because Imajinn needs to know what the context of the entire image should look like, and then it will fill in the area you selected with the boat. If you just say “a boat”, you are more likely to just get an erased area.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('There are some cases when you do want to describe only the thing you want to add instead of the final result. For example, if you are trying to simply erase parts of the image, it may work better to describe "a gray background", or whatever it should be replaced with. Also if you are building an image step-by-step and there are a lot of different subjects, focus your prompt on the section you are painting and generalize the rest of the image as detailed below.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When modifying the prompt, there is no need to get too poetic or descriptive because most of the image and its styles are already still there and taken into account, unless you paint out a very large portion of the image. Also if Prompt Genie or our style selectors were used initially, the styles will already be applied to your modified prompt. If you entered your own styles and modifiers to the prompt field, it is best to leave them there so they will be applied to the selected area. Be careful not to change or add styles in the modified prompt that will clash with the rest of the image.","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Step-by-Step Image Building","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('If you are trying to create a complex image with lots of subjects like people, animals, or objects, it can be impossible to do this with just one long prompt. Instead you can use Touchup to add new elements to the image one-by-one. For example, if you are building a landscape, you can use Touchup to add a new tree, mountain, or different characters one at a time. In this case as you add more objects, you should not describe the entire image in your modified prompt, but instead describe the new object you are adding, and summarize or skip the rest. For example, if you were adding a "girl with a dog", you would not put "girl with a dog, boy dancing, other boy with red shirt sitting" as then Imajinn would loose focus on what you want to put in the masked area. Instead summarize the existing objects like "a bunch of children including a girl with a dog".',"imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Other Tips","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you are making adjustments to part of an existing object, make sure you mask enough of that object so that Imajinn can make a smooth transition between old and new. For example to add a hat to a person, include the top of their head in the masked area. If you want a person next to a cat to be petting the cat, mask their entire arm and part of the cat where their hand would go before prompting “person petting a cat”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Be careful with shadows and reflections. Be sure to select not just the object but its shadow and reflection so that the replacement will look more realistic.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Size matters! Try to select larger areas to replace rather than smaller ones, because the smaller the area is, the less likely it is to actually do anything. Also, the contextual size of the new object to the rest of the image is important too. For example, if you try to replace a cat with an elephant, the size does not make sense to Imajinn, so either nothing will happen or you\'ll only get a piece of the elephant. Either stick with similar sized replacements, or make the prompt ask for a "tiny elephant".',"imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:l},(0,i.__)("Close","imajinn-ai"))))}function g(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(!1),[l,h]=(0,t.useState)([]),[d,m]=(0,t.useState)([]),[p,f]=(0,t.useState)(null),g=()=>a(!0),y=()=>a(!1),v=l.map(((n,a)=>(0,t.createElement)(r.PanelBody,{key:a.toString(),opened:!0},(0,t.createElement)(r.PanelRow,null,(0,t.createElement)("span",null,(0,t.createElement)("em",null,e.prompt)," ",n),(0,t.createElement)(r.Button,{variant:"primary",isSmall:!0,disabled:d.some((e=>e.index===a)),className:"genie-generate",onClick:()=>{if(e.clearStyles(),e.prompt)e.setPromptStyle(n),e.startJob(null,null,null,null,n);else{let t=n.split(",")[0];e.setPrompt(t);let i=n.split(",").slice(1).join();e.setPromptStyle(i),e.startJob(null,null,null,t,i)}m((e=>[...e,{index:a}])),y()}},(0,i.__)("Generate","imajinn-ai"))))));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.BaseControl,{label:(0,i.__)("Prompt Genie","imajinn-ai"),id:"imajinn-prompt-genie-button",className:"prompt-genie"},(0,t.createElement)("div",null,(0,t.createElement)((()=>o?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Generating prompt masterpieces...","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:e.isLoading,variant:"secondary",id:"imajinn-prompt-genie-button",label:(0,i.__)("Prompt Genie: AI generated prompt masterpiece","imajinn-ai"),onClick:()=>{e.setError(""),e.prompt===p?g():(async t=>{s(!0);const n=await fetch(`${ajaxurl}?action=imajinn-create-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,nonce:IMAJINN.nonce})}),i=await n.json();s(!1),i.success?(h(i.data.prompts),m([]),f(t),g()):(e.setError(i.data[0].message),y())})(e.prompt)},icon:(0,t.createElement)(c.DT,null)},(0,i.__)("Summon","imajinn-ai"))),null))),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:y,style:{maxWidth:"90%"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("AI Generated Prompt Ideas","imajinn-ai")}),(0,t.createElement)(r.Panel,null,v)))}function y(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>a(!0)},e.buttonLabel||(0,i.__)("License / Restrictions","imajinn-ai")),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:(0,t.createElement)(r.Icon,{icon:h})}),title:(0,i.__)("License / Usage Restrictions","imajinn-ai")}),(0,t.createElement)("p",null,"CreativeML Open RAIL-M dated August 22, 2022"),(0,t.createElement)("p",null,"Section I: PREAMBLE"),(0,t.createElement)("p",null,"Multimodal generative models are being widely adopted and used, and have the potential to transform the way artists, among other individuals, conceive and benefit from AI or ML technologies as a tool for content creation."),(0,t.createElement)("p",null,"Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations."),(0,t.createElement)("p",null,"In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the Model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for art and content generation."),(0,t.createElement)("p",null,"Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this License aims to strike a balance between both in order to enable responsible open-science in the field of AI."),(0,t.createElement)("p",null,"This License governs the use of the model (and its derivatives) and is informed by the model card associated with the model."),(0,t.createElement)("p",null,"NOW THEREFORE, You and Licensor agree as follows:"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,t.createElement)("p",null,"Definitions")),(0,t.createElement)("li",null,(0,t.createElement)("p",null,'"License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.')),(0,t.createElement)("li",null,'"Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.'),(0,t.createElement)("li",null,'"Output" means the results of operating a Model as embodied in informational content resulting therefrom.'),(0,t.createElement)("li",null,'"Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.'),(0,t.createElement)("li",null,'"Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.'),(0,t.createElement)("li",null,'"Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.'),(0,t.createElement)("li",null,'"Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.'),(0,t.createElement)("li",null,'"Licensor" means the copyright owner or entity authorized by the copyright owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.'),(0,t.createElement)("li",null,'"You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, image generator.'),(0,t.createElement)("li",null,'"Third Parties" means individuals or legal entities that are not under common control with Licensor or You.'),(0,t.createElement)("li",null,'"Contribution" means any work of authorship, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."'),(0,t.createElement)("li",null,'"Contributor" means Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.')),(0,t.createElement)("p",null,"Section II: INTELLECTUAL PROPERTY RIGHTS"),(0,t.createElement)("p",null,"Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in Section III."),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model."),(0,t.createElement)("li",null,"Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material or a Contribution incorporated within the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Work shall terminate as of the date such litigation is asserted or filed.")),(0,t.createElement)("p",null,"Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions: Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License; You must cause any modified files to carry prominent notices stating that You changed the files; You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. - for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License."),(0,t.createElement)("li",null,"Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5)."),(0,t.createElement)("li",null,"The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.")),(0,t.createElement)("p",null,"Section IV: OTHER PROVISIONS"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License, update the Model through electronic means, or modify the Output of the Model based on updates. You shall undertake reasonable efforts to use the latest version of the Model."),(0,t.createElement)("li",null,"Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors."),(0,t.createElement)("li",null,'Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model and the Complementary Material (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.'),(0,t.createElement)("li",null,"Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages."),(0,t.createElement)("li",null,"Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability."),(0,t.createElement)("li",null,"If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.")),(0,t.createElement)("p",null,"END OF TERMS AND CONDITIONS"),(0,t.createElement)("p",null,"Attachment A"),(0,t.createElement)("p",null,"Use Restrictions"),(0,t.createElement)("p",null,"You agree not to use the Model or Derivatives of the Model:"),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,"In any way that violates any applicable national, federal, state, local or international law or regulation;"),(0,t.createElement)("li",null,"For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;"),(0,t.createElement)("li",null,"To generate or disseminate verifiably false information and/or content with the purpose of harming others;"),(0,t.createElement)("li",null,"To generate or disseminate personal identifiable information that can be used to harm an individual;"),(0,t.createElement)("li",null,"To defame, disparage or otherwise harass others;"),(0,t.createElement)("li",null,"For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;"),(0,t.createElement)("li",null,"To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;"),(0,t.createElement)("li",null,"To provide medical advice and medical results interpretation;"),(0,t.createElement)("li",null,"To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}var v=n.p+"images/imajinn-demo.6ce7fccc.jpg";function w(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null),[l,c]=(0,t.useState)(null),[u,h]=(0,t.useState)(IMAJINN.email),[d,m]=(0,t.useState)(""),[p,f]=(0,t.useState)(!1),[g,w]=(0,t.useState)(!1);if(e.isConnected)return null;const b=e=>e.target.select();return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("img",{src:v,alt:(0,i.__)("Example images generated by Imajinn AI","imajinn-ai"),style:{width:"100%"}}),(0,t.createElement)("p",null,(0,i.__)("We hope you are excited to turn your imagination into creative media for your WordPress site. To get started please create a free account or login with your existing Infinite Uploads/Imajinn credentials and we'll connect your site to our cloud.","imajinn-ai")),(0,t.createElement)((()=>o?(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,o,"incorrect_password"===l&&(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/wp-login.php?action=lostpassword",target:"_blank"},(0,i.__)("Reset Password","imajinn-ai")))):null),null),(0,t.createElement)(r.__experimentalHeading,{as:"label"},(0,i.__)("Register / Login","imajinn-ai")),(0,t.createElement)(r.Flex,{align:"bottom",wrap:"true",className:"connect-wrapper"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.TextControl,{label:(0,i.__)("Email","imajinn-ai"),type:"email",value:u,onFocus:b,onChange:e=>h(e),help:(0,i.__)("You'll need a valid email to enable your credits.","imajinn-ai")}),(0,t.createElement)(r.TextControl,{label:(0,i.__)("Password","imajinn-ai"),type:"password",autoComplete:"off",value:d,onFocus:b,onChange:e=>m(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("I agree to the Terms of Service and Usage Restrictions:","imajinn-ai"),checked:g,value:"1",onChange:e=>w(e)}),(0,t.createElement)("div",{className:"license-links"},(0,t.createElement)(y,{buttonLabel:(0,i.__)("Usage Restrictions","imajinn-ai")}),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/terms-of-service/",target:"_blank"},(0,i.__)("Terms of Service","imajinn-ai")),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/privacy/",target:"_blank"},(0,i.__)("Privacy Policy","imajinn-ai"))),(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("Notify me about usage tips & new features (unsubscribe anytime)","imajinn-ai"),checked:p,value:"1",onChange:e=>f(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)((()=>n?(0,t.createElement)(r.Button,{className:"connect-button",disabled:!0},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{className:"connect-button",variant:"primary",disabled:n,onClick:()=>{a(!0),s(null),fetch(`${ajaxurl}?action=imajinn-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:d,signup_tos:g,signup_newsletter:p,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((t=>{console.log(t),t.success?(e.setIsConnected(!0),IMAJINN.connected=!0,e.setCredits(t.data.remaining_credits)):(a(!1),c(t.data[0].code),s(t.data[0].message))})).catch((e=>{a(!1),s(e)}))}},(0,i.__)("Connect","imajinn-ai"))),null))))}var b={styles:[{id:"painting, digital art, trending on artstation",name:(0,i.__)("Painting","imajinn-ai"),children:[{id:"digital art, trending on artstation, hd",name:(0,i.__)("Digital Art","imajinn-ai")},{id:"oil painting, award winning",name:(0,i.__)("Oil Painting","imajinn-ai")},{id:"watercolor painting",name:(0,i.__)("Watercolor","imajinn-ai")},{id:"acrylic painting, award winning art, trending",name:(0,i.__)("Acrylic","imajinn-ai")},{id:"airbrush art",name:(0,i.__)("Airbrushed","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")}]},{id:"artistic drawing, trending on artstation",name:(0,i.__)("Drawing","imajinn-ai"),children:[{id:"illustration, trending on artstation",name:(0,i.__)("Illustration","imajinn-ai")},{id:"cyberpunk, trending on artstation",name:(0,i.__)("Cyberpunk","imajinn-ai")},{id:"pencil sketch, drawing, trending on artstation",name:(0,i.__)("Pencil","imajinn-ai")},{id:"drawn in blue biro pen, artistic drawing, trending on artstation",name:(0,i.__)("Pen","imajinn-ai")},{id:"Ink dripping drawing, trending on artstation",name:(0,i.__)("Ink","imajinn-ai")},{id:"caligraphy",name:(0,i.__)("Caligraphy","imajinn-ai")},{id:"charcoal shaded, artistic drawing, trending on artstation",name:(0,i.__)("Charcoal","imajinn-ai")},{id:"cartoon",name:(0,i.__)("Cartoon","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"technical sketch",name:(0,i.__)("Technical Sketch","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")},{id:"line art",name:(0,i.__)("Line Art","imajinn-ai")},{id:"crayon drawing",name:(0,i.__)("Crayon","imajinn-ai")},{id:"pastel drawing, artistic",name:(0,i.__)("Pastel","imajinn-ai")},{id:"chalkboard drawing",name:(0,i.__)("Chalkboard","imajinn-ai")}]},{id:"animation",name:(0,i.__)("Animation","imajinn-ai"),children:[{id:"vintage disney animation",name:(0,i.__)("Vintage Disney","imajinn-ai")},{id:"Rendered by octane, disney animation studios",name:(0,i.__)("Disney Animation","imajinn-ai")},{id:"simpsons style animation",name:(0,i.__)("Simpsons","imajinn-ai")},{id:"anime style, Studio Ghibli, manga, trending on artstation",name:(0,i.__)("Anime","imajinn-ai")},{id:"disney pixar style animation, octane render",name:(0,i.__)("Pixar","imajinn-ai")}]},{id:"unreal engine, 3d render, Rendered by octane",name:(0,i.__)("Screen","imajinn-ai"),children:[{id:"Unreal Engine, Cinema 4D",name:(0,i.__)("Video Game HD","imajinn-ai")},{id:"animal crossing, mario, nintendo, pokemon",name:(0,i.__)("Nintendo","imajinn-ai")},{id:"3D render, composite",name:(0,i.__)("3D Render","imajinn-ai")},{id:"8bit graphics",name:(0,i.__)("8bit","imajinn-ai")},{id:"emoji",name:(0,i.__)("Emoji","imajinn-ai")},{id:"low poly ps1 graphics",name:(0,i.__)("Low Poly","imajinn-ai")},{id:"pixel art",name:(0,i.__)("Pixel Art","imajinn-ai")},{id:"ASCII art",name:(0,i.__)("ASCII","imajinn-ai")}]},{id:"photograph of, photo, 50mm portrait photograph",name:(0,i.__)("Photography (avoid people)","imajinn-ai"),children:[{id:"realistic photo of, award winning photograph, 50mm",name:(0,i.__)("Realistic","imajinn-ai")},{id:"Portrait photograph, symmetrical, award winning, bokeh, dof, Annie Leibovitz",name:(0,i.__)("Portrait","imajinn-ai")},{id:"polaroid photograph, polaroid frame",name:(0,i.__)("Polaroid","imajinn-ai")},{id:"war photograph, WWI photograph, WWII photograph",name:(0,i.__)("War","imajinn-ai")},{id:"Wildlife Photograph, national geographic photo, zoom, telephoto",name:(0,i.__)("Wildlife","imajinn-ai")},{id:"Photojournalism, award winning, photo of, magazine photograph",name:(0,i.__)("Photojournalism","imajinn-ai")},{id:"macro photograph, close up, zoom, depth of field",name:(0,i.__)("Macro","imajinn-ai")},{id:"long exposure, photograph, realistic",name:(0,i.__)("Long Exposure","imajinn-ai")},{id:"photograph, fish eye lense, wide-angle",name:(0,i.__)("Fish Eye","imajinn-ai")}]},{id:"realistic",name:(0,i.__)("Real Life Materials","imajinn-ai"),children:[{children:[{id:"marble statue",name:(0,i.__)("Marble","imajinn-ai")},{id:"stone statue",name:(0,i.__)("stone","imajinn-ai")},{id:"statue carved from wax",name:(0,i.__)("Wax","imajinn-ai")}],id:"statue",name:(0,i.__)("Statue","imajinn-ai")},{id:"origami paper folding",name:(0,i.__)("Origami","imajinn-ai")},{id:"paper mache art",name:(0,i.__)("Paper Mache","imajinn-ai")},{id:"paper cutout art",name:(0,i.__)("Paper Cutout","imajinn-ai")},{id:"graffiti street art",name:(0,i.__)("Graffiti","imajinn-ai")},{id:"halftone print",name:(0,i.__)("Halftone","imajinn-ai")},{id:"cross stitch art",name:(0,i.__)("Cross Stitch","imajinn-ai")},{id:"stained glass",name:(0,i.__)("Stained Glass","imajinn-ai")},{id:"made of crystals",name:(0,i.__)("Crystal","imajinn-ai")},{id:"made of flowers",name:(0,i.__)("Flowery","imajinn-ai")}]}],artists:[{value:"",label:""},{value:"by Albert Bierstadt",label:(0,i.__)("Albert Bierstadt","imajinn-ai")},{value:"by Andy Warhol",label:(0,i.__)("Andy Warhol","imajinn-ai")},{value:"by Asaf Hanuka",label:(0,i.__)("Asaf Hanuka","imajinn-ai")},{value:"by Aubrey Beardsley",label:(0,i.__)("Aubrey Beardsley","imajinn-ai")},{value:"by Claude Monet",label:(0,i.__)("Claude Monet","imajinn-ai")},{value:"by Diego Rivera",label:(0,i.__)("Diego Rivera","imajinn-ai")},{value:"by Frida Kahlo",label:(0,i.__)("Frida Kahlo","imajinn-ai")},{value:"by Greg Rutkowski",label:(0,i.__)("Greg Rutkowski","imajinn-ai")},{value:"by Hayao Miyazaki",label:(0,i.__)("Hayao Miyazaki","imajinn-ai")},{value:"by Hieronymus Bosch",label:(0,i.__)("Hieronymus Bosch","imajinn-ai")},{value:"by Jackson Pollock",label:(0,i.__)("Jackson Pollock","imajinn-ai")},{value:"by Leonardo da Vinci",label:(0,i.__)("Leonardo da Vinci","imajinn-ai")},{value:"by Michelangelo",label:(0,i.__)("Michelangelo","imajinn-ai")},{value:"by Pablo Picasso",label:(0,i.__)("Pablo Picasso","imajinn-ai")},{value:"by Salvador Dali",label:(0,i.__)("Salvador Dali","imajinn-ai")},{value:"by artgerm, art germ",label:(0,i.__)("Stanley Artgerm","imajinn-ai")},{value:"by Thomas Kinkade",label:(0,i.__)("Thomas Kinkade","imajinn-ai")},{value:"by Vincent van Gogh",label:(0,i.__)("Vincent van Gogh","imajinn-ai")}],modifiers:[{value:"",label:""},{value:"in the style of steampunk",label:(0,i.__)("Steampunk","imajinn-ai")},{value:"synthwave",label:(0,i.__)("Synthwave","imajinn-ai")},{value:"in the style of cyberpunk",label:(0,i.__)("Cyberpunk","imajinn-ai")},{value:"insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Detailed & Intricate","imajinn-ai")},{value:"in a symbolic and meaningful style, insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Symbolic & Meaningful","imajinn-ai")},{value:"Cinematic Lighting",label:(0,i.__)("Cinematic Lighting","imajinn-ai")},{value:"Contre-Jour",label:(0,i.__)("Contre-Jour","imajinn-ai")},{value:"futuristic",label:(0,i.__)("Futuristic","imajinn-ai")},{value:"black and white",label:(0,i.__)("Black & White","imajinn-ai")},{value:"technicolor",label:(0,i.__)("Technicolor","imajinn-ai")},{value:"warm color palette",label:(0,i.__)("Warm","imajinn-ai")},{value:"neon",label:(0,i.__)("Neon","imajinn-ai")},{value:"colorful",label:(0,i.__)("Colorful","imajinn-ai")}]},_=e=>{let{image:n,setImage:i,generations:a}=e;return(0,t.createElement)(t.Fragment,null,null!==n&&(0,t.createElement)(r.Modal,{__experimentalHideHeader:!0,onRequestClose:()=>i(null),className:"imajinn-preview-modal",onKeyDown:e=>{const t=a.length-1;"ArrowRight"===e.key?i(n<t?n+1:0):"ArrowLeft"===e.key&&i(n>0?n-1:t)}},(0,t.createElement)("img",{s rc:a[n].preview,onClick:()=>i(null)})))},E=e=>{let{history:n,setPrompt:o,setPromptStyle:s,setGenerations:l,setRatio:c,clearStyles:u,setQueryRatio:h,setSaved:d,setFaceFixed:m}=e;return n.length<=0?null:(0,t.createElement)(a.InspectorControls,{key:"setting"},(0,t.createElement)(r.Panel,{header:(0,i.__)("Generation History","imajinn-ai"),className:"imajinn-history"},n.map(((e,n)=>(0,t.createElement)(r.PanelBody,{key:n},(0,t.createElement)("h2",{className:"components-panel__body-title"},e.generations.map(((e,n)=>(0,t.createElement)("img",{key:n,src:e.thumbnail,alt:sprintf((0,i.__)("Result %d","imajinn-ai"),(n+1).toString())}))),(0,t.createElement)(r.Button,{variant:"secondary",label:(0,i.__)("Load prompt results","imajinn-ai"),onClick:()=>{u(),o(e.prompt),s(e.prompt_style),l(e.generations),c(e.ratio),h(e.ratio),d([]),m([])}},(0,i.__)("Load","imajinn-ai"))),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.__experimentalText,{numberOfLines:2,truncate:!0},e.prompt)))))))},x=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),j=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})),M=e=>{let{ratio:n,isLoading:a,setRatio:o}=e;const s={"1:1":(0,i.__)("Square","imajinn-ai"),"3:2":(0,i.__)("Wide","imajinn-ai"),"2:3":(0,i.__)("Tall","imajinn-ai")}[n]+" images"+("1:1"!==n?" - "+(0,i.__)("slower to generate","imajinn-ai"):"");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-ratio",label:(0,i.__)("Select an image ratio to generate.","imajinn-ai"),defaultChecked:"1:1",disabled:a,onChange:o,checked:n},(0,t.createElement)(r.__experimentalRadio,{value:"1:1",icon:x},"1:1"),(0,t.createElement)(r.__experimentalRadio,{value:"3:2",icon:j},"3:2"),(0,t.createElement)(r.__experimentalRadio,{className:"ratio-3-2",value:"2:3",icon:j},"2:3")),(0,t.createElement)("br",null),(0,t.createElement)(r.__experimentalText,null,s))},S=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})),k=function(e){const[n,a]=(0,t.useState)(e.showUpgrade),o=()=>{a(!1),e.setShowUpgrade(!1)};return(0,t.useEffect)((()=>{a(e.showUpgrade)}),[a,e]),(0,t.createElement)(t.Fragment,null,n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"400px"},icon:S,title:(0,i.__)("Upgrade Plan","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Sorry, you are out of available image generation credits. You can get more credits by upgrading your account to one of our premium plans.","imajinn-ai")),(0,t.createElement)("div",{className:"imajinn-upgrade-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",href:IMAJINN.checkout_url,target:"_blank"},(0,i.__)("Get More Credits","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i._x)("Cancel","Don't upgrade now","imajinn-ai")))))},C=window.React,I=n.n(C),D=e=>{let{isConnected:n,credits:o,refreshInfo:s,visitAccount:l}=e;const[c,u]=(0,C.useState)(!1),[h,d]=(0,C.useState)("refreshing-button");return(0,C.useEffect)((()=>{d(c?"refreshing-button is-refreshing":"refreshing-button")}),[c]),(0,t.createElement)(a.BlockControls,null,(0,t.createElement)(r.Toolbar,{label:(0,i.__)("Imajinn AI","imajinn-ai"),className:"imajinn-toolbar"},(0,t.createElement)(r.ToolbarGroup,null,n&&!1!==o&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"credit-label"},(0,i.__)("Credits:","imajinn-ai")),(0,t.createElement)("div",{className:"credits"},o),(0,t.createElement)(r.ToolbarButton,{className:h,disabled:c,icon:(0,t.createElement)(r.Dashicon,{icon:"update"}),label:(0,i.__)("Refresh count","imajinn-ai"),onClick:async()=>{u(!0),await s(),u(!1)}})),(0,t.createElement)(r.ToolbarButton,{onClick:l,icon:(0,t.createElement)(r.Dashicon,{icon:"admin-users"}),label:(0,i.__)("Account / Upgrade","imajinn-ai")}),(0,t.createElement)(p,null))))};const A=e=>{let{setImageStyle:n,isLoading:a,imageStyle:o,optionData:s}=e;return(0,t.createElement)(r.TreeSelect,{disabled:a,label:(0,i.__)("Select an image style","imajinn-ai"),noOptionLabel:" ",selectedId:o,onChange:e=>{n(e)},__next36pxDefaultSize:!0,tree:s.styles})},T=e=>{let{setImageArtist:n,isLoading:a,imageArtist:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select an Artist style","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.artists})},L=e=>{let{setImageModifier:n,isLoading:a,imageModifier:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select a style modifier","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.modifiers})};var P=e=>{let{hasError:n}=e;return(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,n))},N=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),O=e=>{let{saved:n,saveImage:a,...o}=e;const[s,l]=(0,C.useState)(!1);return IMAJINN.custom_editor?null:s?(0,t.createElement)(r.Button,{disabled:!0,className:"imajinn-image-insert",label:(0,i.__)("Inserting","imajinn-ai")},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{variant:"primary",className:"imajinn-image-insert",disabled:s,icon:N,onClick:async()=>{l(!0),await(async e=>{let t=!1;if(t=n.some((t=>t.index===e))?n.find((t=>t.index===e)).data:await a(e),t){const e=wp.data.select("core/block-editor").getBlocks().map((function(e){return"infinite-uploads/imajinn-ai"===e.name})).indexOf(!0),n=wp.blocks.createBlock("core/image",{id:t.attachment_id,url:t.url,width:t.width,height:t.height,sizeSlug:t.size,alt:o.prompt,title:o.prompt});return wp.data.dispatch("core/block-editor").insertBlocks(n,e),!0}return!1})(o.genindex)||l(!1)}},(0,i.__)("Insert","imajinn-ai"))},R=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),z=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),B=e=>{const[n,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{e.saved.some((t=>t.index===e.genindex))?(s(!0),a(!1)):(s(!1),a(!1))}),[e.saved]),o?(0,t.createElement)(r.Button,{disabled:!0,icon:R,label:(0,i.__)("Saved","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saved","imajinn-ai"):""):n?(0,t.createElement)(r.Button,{disabled:!0,style:IMAJINN.custom_editor?{}:{maxWidth:"36px"},icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Saving","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saving","imajinn-ai"):""):(0,t.createElement)(r.Button,{variant:IMAJINN.custom_editor?"primary":"secondary",disabled:n,icon:z,label:(0,i.__)("Save to Media Library","imajinn-ai"),onClick:async()=>{a(!0),await e.saveImage(e.genindex)||a(!1)}},IMAJINN.custom_editor?(0,i.__)("Save","imajinn-ai"):"")},W=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Y=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),F=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),V=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),G=n(227),H=n(301),U=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var a=i[n];e.call(t,a[1],a[0])}},t}()}(),J="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,q=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Z="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(q):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},X=["top","right","bottom","left","width","height","size","weight"],Q="undefined"!=typeof MutationObserver,$=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,a=0;function r(){n&&(n=!1,e()),i&&s()}function o(){Z(r)}function s(){var e=Date.now();if(n){if(e-a<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){J&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Q?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){J&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;X.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),K=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var a=i[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ee=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||q},te=oe(0,0,0,0);function ne(e){return parseFloat(e)||0}function ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ne(e["border-"+n+"-width"])}),0)}var ae="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof ee(e).SVGGraphicsElement}:function(e){return e instanceof ee(e).SVGElement&&"function"==typeof e.getBBox};function re(e){return J?ae(e)?function(e){var t=e.getBBox();return oe(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return te;var i=ee(e).getComputedStyle(e),a=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var a=i[n],r=e["padding-"+a];t[a]=ne(r)}return t}(i),r=a.left+a.right,o=a.top+a.bottom,s=ne(i.width),l=ne(i.height);if("border-box"===i.boxSizing&&(Math.round(s+r)!==t&&(s-=ie(i,"left","right")+r),Math.round(l+o)!==n&&(l-=ie(i,"top","bottom")+o)),!function(e){return e===ee(e).document.documentElement}(e)){var c=Math.round(s+r)-t,u=Math.round(l+o)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return oe(a.left,a.top,s,l)}(e):te}function oe(e,t,n,i){return{x:e,y:t,width:n,height:i}}var se=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=re(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),le=function(e,t){var n,i,a,r,o,s,l,c=(i=(n=t).x,a=n.y,r=n.width,o=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),K(l,{x:i,y:a,width:r,height:o,top:a,right:i+r,bottom:o+a,left:i}),l);K(this,{target:e,contentRect:c})},ce=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new U,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new se(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new le(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ue="undefined"!=typeof WeakMap?new WeakMap:new U,he=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=$.getInstance(),i=new ce(t,n,this);ue.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){he.prototype[e]=function(){var t;return(t=ue.get(this))[e].apply(t,arguments)}}));var de=void 0!==q.ResizeObserver?q.ResizeObserver:he;function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},me.apply(this,arguments)}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),ye=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:ge,viewMax:ge}),ve=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),we=function(){function e(e){var t=this,n=e.scaleExtents,i=e.documentSize;fe(this,"_scaleExtents",void 0),fe(this,"_documentSize",void 0),fe(this,"_canvas",null),fe(this,"_view",{scale:1,x:0,y:0}),fe(this,"_viewChangeListeners",new Set),fe(this,"setScale",(function(e){t.setView({scale:e})})),fe(this,"clampView",(function(e){var n=e.scale,i=e.x,a=e.y,r=t.scaleExtents,o=r.min,s=r.max,l=t.documentSize,c=l.width,u=l.height,h=t.canvasRect||ye,d=h.left,m=h.top,p=h.right-d,f=h.bottom-m,g=p/2,y=-(c*t._view.scale-p/2),v=f/2,w=-(u*t._view.scale-f/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(i,y),g),y:Math.min(Math.max(a,w),v)}})),fe(this,"resetView",(function(){t.setView({scale:1,x:0,y:0})})),fe(this,"setView",(function(e){var n=t.clampView(me({},t._view,e||{})),i=t._view,a=i.scale,r=i.x,o=i.y;return n.scale===a&&n.x===r&&n.y===o||(t._view=n,t._viewChangeListeners.forEach((function(e){return e&&e(n)}))),me({},t._view)})),fe(this,"scaleAtClientPoint",(function(e,n){var i=t.clientPointToViewPoint(n),a=t.clampView(me({},t._view,{scale:t._view.scale+e})),r=t.viewPointToClientPoint(i,a);return a.x=t._view.x-(r.clientX-n.clientX),a.y=t._view.y-(r.clientY-n.clientY),t.setView(a)})),fe(this,"clientPointToViewPoint",(function(e,n){var i=e.clientX,a=e.clientY;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=i-r.left,s=a-r.top;return{x:(o-n.x)/n.scale,y:(s-n.y)/n.scale,relativeClientX:o,relativeClientY:s}})),fe(this,"viewPointToClientPoint",(function(e,n){var i=e.x,a=e.y;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=r.left,s=r.top,l=i*n.scale+n.x,c=a*n.scale+n.y,u=l+o,h=c+s;return{clientX:u,clientY:h,relativeX:l,relativeY:c,x:u,y:h}})),fe(this,"attachViewChangeListener",(function(e){t._viewChangeListeners.add(e)})),this._scaleExtents=n,this._documentSize=i}var t,n;return t=e,(n=[{key:"canvas",get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:"scale",get:function(){return this._view.scale}},{key:"x",get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:"y",get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:"view",get:function(){return me({},this._view)}},{key:"scaleExtents",get:function(){return me({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:"documentSize",get:function(){return me({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:"transformMatrix",get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:"canvasBounds",get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,i=e.right,a=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:i,clientY:a}),left:t,top:n,right:i,bottom:a,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}}},{key:"canvasRect",get:function(){return this.canvas?this.canvas.getBoundingClientRect():void 0}}])&&pe(t.prototype,n),e}();function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=function(e){e.preventDefault()},Ee=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){var i=n.props,a=i.disabled,r=i.enablePanAndZoom,o=i.mouseZoomFactor;return a?new xe:(r&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Ae(t))),e)})),be(this,"handleDrawStart",(function(e,t){return t.props.disabled?new xe:e.ctrlKey&&t.props.enablePanAndZoom?(new je).handleDrawStart(e,t):(new Me).handleDrawStart(e,t)})),be(this,"handleDrawMove",(function(t,n){if(n.props.disabled)return new xe;var i=Te(n.coordSystem,t),a=i.x,r=i.y;return n.lazy.update({x:a,y:r}),e})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?new xe:e}))},xe=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){return n.props.disabled?e:(new Ee).handleMouseWheel(t,n)})),be(this,"handleDrawStart",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawMove(t,n)})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawEnd(t,n)}))},je=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),e.dragStart=Ae(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Ae(t),a=i.clientX,r=i.clientY,o=a-e.dragStart.clientX,s=r-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e})),be(this,"handleDrawEnd",(function(){return new Ee}))},Me=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){var i=n.props.enablePanAndZoom;return t.preventDefault(),t.touches&&t.touches.length&&i?i&&t.touches&&t.touches.length>=2?(new Se).handleDrawStart(t,n):e.handleDrawMove(t,n):(new Ie).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return(new Se).handleDrawStart(t,n);var i=Ae(t);return e.deferredPoints.push(i),(new Date).valueOf()-e.startTimestamp<250&&(null===e.startClientPoint&&(e.startClientPoint=i),Math.abs(i.clientX-e.startClientPoint.clientX)+Math.abs(i.clientY-e.startClientPoint.clientY)<10)?e:e.issueDeferredPoints(n)})),be(this,"handleDrawEnd",(function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)})),be(this,"issueDeferredPoints",(function(t){for(var n=new Ie,i=0;i<e.deferredPoints.length;i++){var a=e.deferredPoints[i],r=new De(a);n=(0===i?n.handleDrawStart:n.handleDrawMove)(r,t)}return n})),this.startClientPoint=null,this.startTimestamp=(new Date).valueOf(),this.deferredPoints=[]},Se=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Ee:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Ee;var i=e.recentMetrics=e.getTouchMetrics(t),a=i.centroid,r=i.distance;if(Math.abs(r-e.start.distance)>=10)return new Ce(e).handleDrawMove(t,n);var o=a.clientX-e.start.centroid.clientX,s=a.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=10?new ke(e).handleDrawMove(t,n):e})),be(this,"handleDrawEnd",(function(){return new Ee})),be(this,"getTouchMetrics",(function(e){var t=Ae(e.touches[0]),n=t.clientX,i=t.clientY,a=Ae(e.touches[1]),r=a.clientX,o=a.clientY,s=r-n,l=o-i;return{t1:{clientX:n,clientY:i},t2:{clientX:r,clientY:o},distance:Math.sqrt(s*s+l*l),centroid:{clientX:(n+r)/2,clientY:(i+o)/2}}}))},ke=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=(a.distance,r.clientX-i.start.centroid.clientX),s=r.clientY-i.start.centroid.clientY;return n.setView({x:i.panStart.x+o,y:i.panStart.y+s}),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ce=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=a.distance,s=i.scaleStart*(o/i.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,r),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ie=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r},{both:!0})}return e.handleDrawMove(t,n)})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r});var o=!n.lazy.isEnabled();return e.isDrawing&&!o||(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e})),be(this,"handleDrawEnd",(function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Ee})),this.isDrawing=!1},De=function(e){var t=e.clientX,n=e.clientY;be(this,"preventDefault",(function(){})),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Ae(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Te(e,t){return e.clientPointToViewPoint(Ae(t))}var Le=!1;try{var Pe={get passive(){return Le=!0,!1}};window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(e){Le=!1}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Oe.apply(this,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var We={display:"block",position:"absolute"},Ye=["grid","drawing","temp","interface"],Fe=function(e){var t,n;function i(t){var n;return ze(Re(n=e.call(this,t)||this),"undo",(function(){var e=[];n.lines.length?e=n.lines.slice(0,-1):n.erasedLines.length&&(e=n.erasedLines.pop()),n.clearExceptErasedLines(),n.simulateDrawingLines({lines:e,immediate:!0}),n.triggerOnChange()})),ze(Re(n),"eraseAll",(function(){n.erasedLines.push([].concat(n.lines)),n.clearExceptErasedLines(),n.triggerOnChange()})),ze(Re(n),"clear",(function(){n.erasedLines=[],n.clearExceptErasedLines(),n.resetView()})),ze(Re(n),"resetView",(function(){return n.coordSystem.resetView()})),ze(Re(n),"setView",(function(e){return n.coordSystem.setView(e)})),ze(Re(n),"getSaveData",(function(){return JSON.stringify({lines:n.lines,width:n.props.canvasWidth,height:n.props.canvasHeight})})),ze(Re(n),"getDataURL",(function(e,t,i){var a=n.canvas.drawing,r=a.getContext("2d"),o=a.width,s=a.height,l=r.getImageData(0,0,o,s),c=r.globalCompositeOperation;if(r.globalCompositeOperation="destination-over",t){if(!n.props.imgSrc)return"Background image source not set";n.drawImage()}else null!=i&&(r.fillStyle=i,r.fillRect(0,0,o,s));e||(e="png");var u=a.toDataURL("image/"+e);return r.clearRect(0,0,o,s),r.putImageData(l,0,0),r.globalCompositeOperation=c,u})),ze(Re(n),"loadSaveData",(function(e,t){if(void 0===t&&(t=n.props.immediateLoading),"string"!=typeof e)throw new Error("saveData needs to be of type string!");var i=JSON.parse(e),a=i.lines,r=i.width,o=i.height;if(!a||"function"!=typeof a.push)throw new Error("saveData.lines needs to be an array!");if(n.clear(),r===n.props.canvasWidth&&o===n.props.canvasHeight)n.simulateDrawingLines({lines:a,immediate:t});else{var s=n.props.canvasWidth/r,l=n.props.canvasHeight/o,c=(s+l)/2;n.simulateDrawingLines({lines:a.map((function(e){return Oe({},e,{points:e.points.map((function(e){return{x:e.x*s,y:e.y*l}})),brushRadius:e.brushRadius*c})})),immediate:t})}})),ze(Re(n),"componentWillUnmount",(function(){n.canvasObserver.unobserve(n.canvasContainer),n.canvas.interface&&n.canvas.interface.removeEventListener("wheel",n.handleWheel)})),ze(Re(n),"handleWheel",(function(e){n.interactionSM=n.interactionSM.handleMouseWheel(e,Re(n))})),ze(Re(n),"handleDrawStart",(function(e){n.interactionSM=n.interactionSM.handleDrawStart(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawMove",(function(e){n.interactionSM=n.interactionSM.handleDrawMove(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawEnd",(function(e){n.interactionSM=n.interactionSM.handleDrawEnd(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"applyView",(function(){if(n.ctx.drawing&&(Ye.map((function(e){return n.ctx[e]})).forEach((function(e){n.clearWindow(e);var t=n.coordSystem.transformMatrix;e.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)})),!n.deferRedrawOnViewChange)){n.drawGrid(n.ctx.grid),n.redrawImage(),n.loop({once:!0});var e=n.lines;n.lines=[],n.simulateDrawingLines({lines:e,immediate:!0})}})),ze(Re(n),"handleCanvasResize",(function(e){var t=n.getSaveData();n.deferRedrawOnViewChange=!0;try{for(var i,a=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(i=a()).done;){var r=i.value.contentRect,o=r.width,s=r.height;n.setCanvasSize(n.canvas.interface,o,s),n.setCanvasSize(n.canvas.drawing,o,s),n.setCanvasSize(n.canvas.temp,o,s),n.setCanvasSize(n.canvas.grid,o,s),n.coordSystem.documentSize={width:o,height:s},n.drawGrid(n.ctx.grid),n.drawImage(),n.loop({once:!0})}n.loadSaveData(t,!0)}finally{n.deferRedrawOnViewChange=!1}})),ze(Re(n),"clampPointToDocument",(function(e){return n.props.clampLinesToDocument?{x:Math.max(Math.min(e.x,n.props.canvasWidth),0),y:Math.max(Math.min(e.y,n.props.canvasHeight),0)}:e})),ze(Re(n),"redrawImage",(function(){n.image&&n.image.complete&&function(e){var t=void 0===e?{}:e,n=t.ctx,i=t.img,a=t.x,r=t.y,o=t.w,s=t.h,l=t.offsetX,c=t.offsetY;"number"!=typeof a&&(a=0),"number"!=typeof r&&(r=0),"number"!=typeof o&&(o=n.canvas.width),"number"!=typeof s&&(s=n.canvas.height),"number"!=typeof l&&(l=.5),"number"!=typeof c&&(c=.5),l<0&&(l=0),c<0&&(c=0),l>1&&(l=1),c>1&&(c=1);var u,h,d,m,p=i.width,f=i.height,g=Math.min(o/p,s/f),y=p*g,v=f*g,w=1;y<o&&(w=o/y),Math.abs(w-1)<1e-14&&v<s&&(w=s/v),(u=(p-(d=p/((y*=w)/o)))*l)<0&&(u=0),(h=(f-(m=f/((v*=w)/s)))*c)<0&&(h=0),d>p&&(d=p),m>f&&(m=f),n.drawImage(i,u,h,d,m,a,r,o,s)}({ctx:n.ctx.grid,img:n.image})})),ze(Re(n),"simulateDrawingLines",(function(e){var t=e.lines,i=e.immediate,a=0,r=i?0:n.props.loadTimeOffset;t.forEach((function(e){var t=e.points,o=e.brushColor,s=e.brushRadius;if(i)return n.drawPoints({points:t,brushColor:o,brushRadius:s}),n.points=t,void n.saveLine({brushColor:o,brushRadius:s});for(var l=function(e){a+=r,window.setTimeout((function(){n.drawPoints({points:t.slice(0,e+1),brushColor:o,brushRadius:s})}),a)},c=1;c<t.length;c++)l(c);a+=r,window.setTimeout((function(){n.points=t,n.saveLine({brushColor:o,brushRadius:s})}),a)}))})),ze(Re(n),"setCanvasSize",(function(e,t,n){e.width=t,e.height=n,e.style.width=t,e.style.height=n})),ze(Re(n),"drawPoints",(function(e){var t=e.points,i=e.brushColor,a=e.brushRadius;n.ctx.temp.lineJoin="round",n.ctx.temp.lineCap="round",n.ctx.temp.strokeStyle=i,n.clearWindow(n.ctx.temp),n.ctx.temp.lineWidth=2*a;var r=t[0],o=t[1];n.ctx.temp.moveTo(o.x,o.y),n.ctx.temp.beginPath();for(var s=1,l=t.length;s<l;s++){var c=Be(r,o);n.ctx.temp.quadraticCurveTo(r.x,r.y,c.x,c.y),r=t[s],o=t[s+1]}n.ctx.temp.lineTo(r.x,r.y),n.ctx.temp.stroke()})),ze(Re(n),"saveLine",(function(e){var t=void 0===e?{}:e,i=t.brushColor,a=t.brushRadius;n.points.length<2||(n.lines.push({points:[].concat(n.points),brushColor:i||n.props.brushColor,brushRadius:a||n.props.brushRadius}),n.points.length=0,n.inClientSpace([n.ctx.drawing,n.ctx.temp],(function(){n.ctx.drawing.drawImage(n.canvas.temp,0,0,n.canvas.drawing.width,n.canvas.drawing.height)})),n.clearWindow(n.ctx.temp),n.triggerOnChange())})),ze(Re(n),"triggerOnChange",(function(){n.props.onChange&&n.props.onChange(Re(n))})),ze(Re(n),"clearWindow",(function(e){n.inClientSpace([e],(function(){return e.clearRect(0,0,e.canvas.width,e.canvas.height)}))})),ze(Re(n),"clearExceptErasedLines",(function(){n.lines=[],n.valuesChanged=!0,n.clearWindow(n.ctx.drawing),n.clearWindow(n.ctx.temp)})),ze(Re(n),"loop",(function(e){var t=(void 0===e?{}:e).once,i=void 0!==t&&t;if(n.lazy&&(n.mouseHasMoved||n.valuesChanged)){var a=n.lazy.getPointerCoordinates(),r=n.lazy.getBrushCoordinates();n.drawInterface(n.ctx.interface,a,r),n.mouseHasMoved=!1,n.valuesChanged=!1}i||window.requestAnimationFrame((function(){n.loop()}))})),ze(Re(n),"inClientSpace",(function(e,t){e.forEach((function(e){e.save(),e.setTransform(ve.a,ve.b,ve.c,ve.d,ve.e,ve.f)}));try{t()}finally{e.forEach((function(e){return e.restore()}))}})),ze(Re(n),"drawImage",(function(){n.props.imgSrc&&(n.image=new Image,n.image.crossOrigin="anonymous",n.image.onload=n.redrawImage,n.image.src=n.props.imgSrc)})),ze(Re(n),"drawGrid",(function(e){if(!n.props.hideGrid){n.clearWindow(e);var t=25,i=n.coordSystem.canvasBounds,a=i.viewMin,r=i.viewMax,o=Math.floor(a.x/t-1)*t,s=Math.floor(a.y/t-1)*t,l=r.x+t,c=r.y+t;if(e.beginPath(),e.setLineDash([5,1]),e.setLineDash([]),e.strokeStyle=n.props.gridColor,e.lineWidth=n.props.gridLineWidth,!n.props.hideGridX){for(var u=o,h=n.props.gridSizeX;u<l;)u+=h,e.moveTo(u,s),e.lineTo(u,c);e.stroke()}if(!n.props.hideGridY){for(var d=s,m=n.props.gridSizeY;d<c;)d+=m,e.moveTo(o,d),e.lineTo(l,d);e.stroke()}}})),ze(Re(n),"drawInterface",(function(e,t,i){n.props.hideInterface||(n.clearWindow(e),e.beginPath(),e.fillStyle=n.props.brushColor,e.arc(i.x,i.y,n.props.brushRadius,0,2*Math.PI,!0),e.fill(),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(t.x,t.y,4,0,2*Math.PI,!0),e.fill(),n.lazy.isEnabled()&&(e.beginPath(),e.lineWidth=2,e.lineCap="round",e.setLineDash([2,4]),e.strokeStyle=n.props.catenaryColor,n.catenary.drawToCanvas(n.ctx.interface,i,t,n.chainLength),e.stroke()),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(i.x,i.y,2,0,2*Math.PI,!0),e.fill())})),n.canvas={},n.ctx={},n.catenary=new H.oT,n.points=[],n.lines=[],n.erasedLines=[],n.mouseHasMoved=!0,n.valuesChanged=!0,n.isDrawing=!1,n.isPressing=!1,n.deferRedrawOnViewChange=!1,n.interactionSM=new Ee,n.coordSystem=new we({scaleExtents:t.zoomExtents,documentSize:{width:t.canvasWidth,height:t.canvasHeight}}),n.coordSystem.attachViewChangeListener(n.applyView.bind(Re(n))),n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.componentDidMount=function(){var e,t=this;this.lazy=new G.xv({radius:this.props.lazyRadius*window.devicePixelRatio,enabled:!0,initialPoint:{x:window.innerWidth/2,y:window.innerHeight/2}}),this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.canvasObserver=new de((function(e,n){return t.handleCanvasResize(e,n)})),this.canvasObserver.observe(this.canvasContainer),this.drawImage(),this.loop(),window.setTimeout((function(){var e=window.innerWidth/2,n=window.innerHeight/2;t.lazy.update({x:e-t.chainLength/4,y:n},{both:!0}),t.lazy.update({x:e+t.chainLength/4,y:n},{both:!1}),t.mouseHasMoved=!0,t.valuesChanged=!0,t.clearExceptErasedLines(),t.props.saveData&&t.loadSaveData(t.props.saveData)}),100),this.canvas.interface&&this.canvas.interface.addEventListener("wheel",this.handleWheel,Le?{passive:e}:e)},a.componentDidUpdate=function(e){e.lazyRadius!==this.props.lazyRadius&&(this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.lazy.setRadius(this.props.lazyRadius*window.devicePixelRatio)),e.saveData!==this.props.saveData&&this.loadSaveData(this.props.saveData),JSON.stringify(e)!==JSON.stringify(this.props)&&(this.valuesChanged=!0),this.coordSystem.scaleExtents=this.props.zoomExtents,this.props.enablePanAndZoom||this.coordSystem.resetView(),e.imgSrc!==this.props.imgSrc&&this.drawImage()},a.render=function(){var e=this;return I().createElement("div",{className:this.props.className,style:Oe({display:"block",background:this.props.backgroundColor,touchAction:"none",width:this.props.canvasWidth,height:this.props.canvasHeight},this.props.style),ref:function(t){t&&(e.canvasContainer=t)}},Ye.map((function(t){var n="interface"===t;return I().createElement("canvas",{key:t,ref:function(i){i&&(e.canvas[t]=i,e.ctx[t]=i.getContext("2d"),n&&(e.coordSystem.canvas=i))},style:Oe({},We),onMouseDown:n?e.handleDrawStart:void 0,onMouseMove:n?e.handleDrawMove:void 0,onMouseUp:n?e.handleDrawEnd:void 0,onMouseOut:n?e.handleDrawEnd:void 0,onTouchStart:n?e.handleDrawStart:void 0,onTouchMove:n?e.handleDrawMove:void 0,onTouchEnd:n?e.handleDrawEnd:void 0,onTouchCancel:n?e.handleDrawEnd:void 0})})))},i}(C.PureComponent);ze(Fe,"defaultProps",{onChange:null,loadTimeOffset:5,lazyRadius:12,brushRadius:10,brushColor:"#444",catenaryColor:"#0a0302",gridColor:"rgba(150,150,150,0.17)",backgroundColor:"#FFF",hideGrid:!1,canvasWidth:400,canvasHeight:400,disabled:!1,imgSrc:"",saveData:"",immediateLoading:!1,hideInterface:!1,gridSizeX:25,gridSizeY:25,gridLineWidth:.5,hideGridX:!1,hideGridY:!1,enablePanAndZoom:!1,mouseZoomFactor:.01,zoomExtents:{min:.33,max:3},clampLinesToDocument:!1}),Fe.propTypes={};function Ve(e){const n=function(e){const[n,i]=(0,t.useState)({windowWidth:window.innerWidth,isDesiredWidth:window.innerWidth<e});return(0,t.useEffect)((()=>{const t=()=>{const t=window.innerWidth;i({windowWidth:t,isDesiredWidth:t<e})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[n.windowWidth]),n.isDesiredWidth}(600),[a,o]=(0,t.useState)(n?.6:1),[s,l]=(0,t.useState)(!1),[c,h]=(0,t.useState)(null),[d,m]=(0,t.useState)(null),[p,g]=(0,t.useState)(25),[y,v]=(0,t.useState)(e.prompt),[w,b]=(0,t.useState)(512*a),[_,E]=(0,t.useState)(512*a),[x,j]=(0,t.useState)(512),[M,S]=(0,t.useState)(512),[k,C]=(0,t.useState)(null);return(0,t.useEffect)((()=>{o(n?.6:1)}),[n]),(0,t.useEffect)((()=>{C(null==c?void 0:c.getSaveData()),"3:2"===e.queryRatio?(b(341*a),E(512*a),j(512),S(768)):"2:3"===e.queryRatio?(n?(b(768*a),E(512*a)):(b(512*a),E(341*a)),j(768),S(512)):(b(512*a),E(512*a)),g((e=>e*a)),null==c||c.clear()}),[a]),(0,t.useEffect)((()=>{null==c||c.loadSaveData(k,!0)}),[_]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>l(!0),icon:Y,label:(0,i.__)("Touchup (beta)","imajinn-ai")}),s&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:()=>l(!1),className:"imajinn-inpainting-modal",shouldCloseOnClickOutside:!0,title:(0,i.__)("Touchup Image Editor (beta)","imajinn-ai")}),(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,null,(0,t.createElement)(Fe,{style:{position:"relative"},ref:e=>h(e),imgSrc:e.src,brushRadius:p,lazyRadius:0,hideInterface:!0,brushColor:"rgba(180,0,0,0.75)",canvasWidth:_,canvasHeight:w})),(0,t.createElement)(r.CardFooter,null,(0,t.createElement)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-brush-size",label:(0,i.__)("Select the brush size","imajinn-ai"),defaultChecked:p,onChange:g,checked:p},(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Small","imajinn-ai"),className:"brush-sm",value:10*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Medium","imajinn-ai"),className:"brush-md",value:25*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("large","imajinn-ai"),className:"brush-lg",value:40*a},(0,t.createElement)(r.Icon,{icon:Y}))))),null),(0,t.createElement)(f,{isMobile:n}),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(r.Button,{icon:F,label:(0,i.__)("Reset","imajinn-ai"),onClick:()=>{c.eraseAll()}}),(0,t.createElement)(r.Button,{icon:V,label:(0,i.__)("Undo","imajinn-ai"),onClick:()=>{c.undo()}})))),(0,t.createElement)(r.TextareaControl,{rows:3,maxLength:450,value:y,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Modified prompt describing the entire image and the masked area:","imajinn-ai")),className:"text-prompt",onFocus:e=>e.target.select(),onChange:e=>v(e)}),(0,t.createElement)(r.Flex,{wrap:!1},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>l(!1)},(0,i.__)("Cancel","imajinn-ai"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"primary",onClick:()=>{const t=new Image;t.onload=()=>{const n=document.createElement("canvas");n.width=M,n.height=x;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height,0,0,M,x);let a=i.getImageData(0,0,n.width,n.height),r=0;for(r=0;r<a.data.length;r+=4){let e=0;a.data[r]+a.data[r+1]+a.data[r+2]>383&&(e=255),a.data[r]=e,a.data[r+1]=e,a.data[r+2]=e,a.data[r+3]=255}i.putImageData(a,0,0);const o=n.toDataURL("image/png");n.remove(),e.setRatio(e.queryRatio),e.startJob(e.src,o,e.queryRatio,y),e.setPrompt(y)},d.clear(),d.loadSaveData(c.getSaveData(),!0),t.src=d.getDataURL("png",!1,"#ffffff")}},(0,i.__)("Generate","imajinn-ai")))),(0,t.createElement)(Fe,{style:{visibility:"hidden",position:"absolute",top:"-99999px",left:"-99999px"},disabled:!0,hideGrid:!0,ref:e=>m(e),canvasWidth:M,canvasHeight:x})))}var Ge=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),He=e=>{let{generations:n,setGenerations:a,faceFixed:o,setFaceFixed:s,setError:l,...c}=e;const[u,h]=(0,C.useState)(!1),[d,m]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{o.some((e=>e.index===c.genindex))?(m(!0),h(!1)):(m(!1),h(!1))}),[o]),u?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Repairing","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:d,icon:Ge,label:(0,i.__)("Face Repair","imajinn-ai"),onClick:async()=>{h(!0),await(async e=>{let t=n[e].jpg;l(null);const r=await fetch(`${ajaxurl}?action=imajinn-face-repair`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,nonce:IMAJINN.nonce})}),o=await r.json();return o.success?(s((t=>[...t,{index:e}])),a((t=>(t[e]=o.data.image,[...t]))),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Face repair completed.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),o.data):(l(o.data[0].message),!1)})(c.genindex)||h(!1)}})},Ue=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"})),Je=e=>{let n=e.generations[e.genindex].jpg;return(0,t.createElement)(r.Button,{icon:Ue,label:(0,i.__)("Generate Variations","imajinn-ai"),onClick:()=>{e.setRatio(e.queryRatio),e.startJob(n,null,e.queryRatio)}})},qe=e=>{let{...n}=e;return(0,t.createElement)(r.CardFooter,null,(0,t.createElement)(r.ButtonGroup,{className:"imajinn-image-actions"},(0,t.createElement)(r.Button,{href:`${ajaxurl}?action=imajinn-tweet&image=${n.src}`,target:"_blank",icon:W,label:(0,i.__)("Share on Twitter","imajinn-ai")}),(0,t.createElement)(Je,n),(0,t.createElement)(He,n),(0,t.createElement)(Ve,u({},n,{src:n.generations[n.genindex].jpg}))),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(B,n),(0,t.createElement)(O,n)))},Ze=e=>{let{setSelectedImage:n,...i}=e;const[a,o]=(0,t.useState)("300px"),[s,l]=(0,t.useState)("300px");(0,t.useEffect)((()=>{"3:2"===i.queryRatio?(l("200px"),o("300px")):"2:3"===i.queryRatio?(l("450px"),o("300px")):(l("300px"),o("300px"))}),[i.generations,i.queryRatio]);const c=e=>{let{...i}=e;return(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,{className:"loop-show",style:{width:i.width,height:i.height,position:"relative",cursor:"pointer"}},(0,t.createElement)("div",{className:"loop-icon",onClick:()=>n(i.genindex)},(0,t.createElement)("div",null,(0,t.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBmaWxsLXJ1bGU9ImV2ZW5vZGQiCiAgICBjbGlwLXJ1bGU9ImV2ZW5vZGQiCiAgICBkPSJNMTguMzE5IDE0LjQzMjZDMjAuNzYyOCAxMS4yOTQxIDIwLjU0MiA2Ljc1MzQ3IDE3LjY1NjkgMy44NjgyOUMxNC41MzI3IDAuNzQ0MDk4IDkuNDY3MzQgMC43NDQwOTggNi4zNDMxNSAzLjg2ODI5QzMuMjE4OTUgNi45OTI0OSAzLjIxODk1IDEyLjA1NzggNi4zNDMxNSAxNS4xODJDOS4yMjgzMyAxOC4wNjcyIDEzLjc2OSAxOC4yODc5IDE2LjkwNzUgMTUuODQ0MkMxNi45MjEgMTUuODU5NSAxNi45MzUxIDE1Ljg3NDUgMTYuOTQ5NyAxNS44ODkxTDIxLjE5MjQgMjAuMTMxN0MyMS41ODI5IDIwLjUyMjMgMjIuMjE2MSAyMC41MjIzIDIyLjYwNjYgMjAuMTMxN0MyMi45OTcxIDE5Ljc0MTIgMjIuOTk3MSAxOS4xMDgxIDIyLjYwNjYgMTguNzE3NUwxOC4zNjQgMTQuNDc0OUMxOC4zNDkzIDE0LjQ2MDMgMTguMzM0MyAxNC40NDYyIDE4LjMxOSAxNC40MzI2Wk0xNi4yNDI2IDUuMjgyNTFDMTguNTg1OCA3LjYyNTY1IDE4LjU4NTggMTEuNDI0NiAxNi4yNDI2IDEzLjc2NzhDMTMuODk5NSAxNi4xMTA5IDEwLjEwMDUgMTYuMTEwOSA3Ljc1NzM2IDEzLjc2NzhDNS40MTQyMSAxMS40MjQ2IDUuNDE0MjEgNy42MjU2NSA3Ljc1NzM2IDUuMjgyNTFDMTAuMTAwNSAyLjkzOTM2IDEzLjg5OTUgMi45MzkzNiAxNi4yNDI2IDUuMjgyNTFaIgogICAgZmlsbD0id2hpdGUiCiAgLz4KPC9zdmc+"}))),(0,t.createElement)("img",{className:"generation-zoom",alt:i.alt||i.label,src:i.src,width:i.width,height:i.height})),(0,t.createElement)(qe,i))};return(0,t.createElement)("div",{className:"results-grid",style:{gridTemplateColumns:!IMAJINN.custom_editor&&"1fr 1fr"}},i.generations&&i.generations.map(((e,n)=>(0,t.createElement)("div",{style:{minWidth:a,flexGrow:1},key:n},(0,t.createElement)(c,u({src:e.preview,genindex:n,width:a,height:s,label:"Result "+(n+1).toString()},i))))))},Xe=e=>{let{status:n,progress:a,cancelJob:o}=e;const s="processing"===n?(0,i.sprintf)((0,i.__)("Generating %s%%","imajinn-ai"),a):(0,i.__)("Queued","imajinn-ai");return(0,t.createElement)("div",{className:"imajinn-loading"},(0,t.createElement)(c.ZZ,null),(0,t.createElement)("div",null,(0,t.createElement)(r.__experimentalText,null,s),(0,t.createElement)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>{o()}},(0,i.__)("Cancel"))))},Qe=e=>{let{deleteBlock:n}=e;return(0,t.createElement)("div",{className:"corner-controls"},(0,t.createElement)(p,null),(0,t.createElement)(r.Button,{className:"imajinn-close-button",icon:s,label:(0,i.__)("Close Imajinn Block","imajinn-ai"),onClick:()=>{n()}}))},$e=function(e){let{showWelcome:n,setShowWelcome:a,...o}=e;const[s,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{l(n)}),[n]),(0,t.createElement)(t.Fragment,null,s&&(0,t.createElement)(r.Modal,u({},o,{isDismissible:!1,style:{maxWidth:"900px"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("Getting Started","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Welcome to Imajinn! Here are some quick tips to get you started so you can create the best images possible.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Do:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Write a detailed and descriptive prompt in English.","imajinn-ai"),(0,t.createElement)(m,null)),(0,t.createElement)("li",null,(0,i.__)("Use Prompt Genie or our style dropdowns for the best results.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Only use 3:2 or 2:3 ratios to generate images with smaller or multiple details, not a single object.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Think like the AI not a human: What text would you find online associated with the image you want to create?","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Do Not:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Try to generate photo-realistic human faces or bodies, they will look deformed. Stick to artistic styles for images with people.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Expect to be able to create legible words, text, or logos. They will be gibberish.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Use 3:2 or 2:3 ratio for images with a single object or subject, as that tends to create strange duplications. It is best to use 1:1 for those types of images.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Write your prompts in a language other than English. Sorry, the model was trained on primarily English image descriptions (automatic translation coming soon).","imajinn-ai"))),(0,t.createElement)("div",{className:"imajinn-starting-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",onClick:async()=>{a(!1);const e=await fetch(`${ajaxurl}?action=imajinn-dismiss-welcome`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})});return!!(await e.json()).success&&(IMAJINN.show_welcome=!1,!0)}},(0,i.__)("Got it!","imajinn-ai")),(0,t.createElement)(p,null))))};(0,e.registerBlockType)(l,{edit:function(){const[e,n]=(0,t.useState)(IMAJINN.connected),[o,u]=(0,t.useState)(!1),[h,d]=(0,t.useState)(null),[p,f]=(0,t.useState)(null),[v,x]=(0,t.useState)([]),[j,S]=(0,t.useState)(IMAJINN.history),[C,I]=(0,t.useState)(null),[N,O]=(0,t.useState)(0),[R,z]=(0,t.useState)(""),[B,W]=(0,t.useState)(""),[Y,F]=(0,t.useState)("1:1"),[V,G]=(0,t.useState)(Y),[H,U]=(0,t.useState)(IMAJINN.remaining_credits),[J,q]=(0,t.useState)(!1),[Z,X]=(0,t.useState)(IMAJINN.show_welcome),[Q,$]=(0,t.useState)(""),[K,ee]=(0,t.useState)(""),[te,ne]=(0,t.useState)(""),[ie,ae]=(0,t.useState)(!1),[re,oe]=(0,t.useState)([]),[se,le]=(0,t.useState)([]),[ce,ue]=(0,t.useState)(null);(0,t.useEffect)((()=>()=>{ae(!1)}),[R,B,Y]),(0,t.useEffect)((()=>{IMAJINN.remaining_credits=H,H>0&&q(!1)}),[H]),(0,t.useEffect)((()=>{IMAJINN.history=j}),[j]),(0,t.useEffect)((()=>{W([Q,K,te].filter(Boolean).join(", "))}),[Q,K,te]);const he=(0,a.useBlockProps)(),de=(e,t,n,i,a)=>{if(H<=0&&pe(),H-1<0)return q(!0),!1;const r=e||null,o=t||null,s=n||Y,l=i||R,c=a||B;f(null),x([]),le([]),oe([]),G(s),u(!0),d(null),O(0),fetch(`${ajaxurl}?action=imajinn-start-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,prompt_style:c,ratio:s,num_variations:4,init_image:r,mask:o,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((e=>{e.success?(f(e.data.job_id),I(e.data.status),U(e.data.remaining_credits),O(e.data.progress),me(e.data.job_id)):(u(!1),f(null),I(null),d(e.data[0].message))})).catch((e=>{u(!1),f(null),I(null),d(e)}))},me=async e=>{if(!e)return u(!1),f(null),!1;setTimeout((async()=>{const t=await fetch(`${ajaxurl}?action=imajinn-check-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:e,nonce:IMAJINN.nonce})}),n=await t.json();n.success?(I(n.data.status),O(n.data.progress),U(n.data.remaining_credits),"succeeded"===n.data.status?(x(n.data.generations),S((e=>[n.data.history,...e])),ae(!0)):"failed"===n.data.status&&(d(n.data.error),I(null),u(!1),f(null),ae(!0)),"starting"===n.data.status||"processing"===n.data.status?me(e):(I(null),u(!1),f(null),ae(!0))):(I(null),u(!1),f(null),d(n.data[0].message),ae(!0))}),4e3)},pe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?U(t.data.remaining_credits):d(t.data[0].message)},fe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-account-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?window.open(t.data.account_url,"_blank"):d(t.data[0].message)},ge=v.length?"":l.description,ye=()=>{$(""),ee(""),ne(""),W("")};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(_,{image:ce,setImage:ue,generations:v}),(0,t.createElement)("figure",he,(0,t.createElement)(D,{refreshInfo:pe,isConnected:e,credits:H,visitAccount:fe}),e&&(0,t.createElement)(E,{history:j,setPrompt:z,setPromptStyle:W,setGenerations:x,setRatio:F,clearStyles:ye,setQueryRatio:G,setSaved:oe,setFaceFixed:le}),(0,t.createElement)(r.Placeholder,{icon:IMAJINN.custom_editor?null:c.mC,instructions:ge,label:IMAJINN.custom_editor?null:(0,i.__)("AI Text-to-Image Generator","imajinn-ai")},!e&&(0,t.createElement)(w,{setCredits:U,isConnected:e,setIsConnected:n}),e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(k,{showUpgrade:J,setShowUpgrade:q}),(0,t.createElement)($e,{showWelcome:Z,setShowWelcome:X}),h&&(0,t.createElement)(P,{hasError:h}),o&&(0,t.createElement)(Xe,{status:C,progress:N,cancelJob:async()=>{if(!p)return d("Error: No job id"),!1;const e=await fetch(`${ajaxurl}?action=imajinn-cancel-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:p,nonce:IMAJINN.nonce})}),t=await e.json();t.success?(I(null),u(!1),f(null),U(t.data.remaining_credits)):d(t.data[0].message)}}),(0,t.createElement)(Ze,{prompt:R,setPrompt:z,saved:re,queryRatio:V,setRatio:F,faceFixed:se,setFaceFixed:le,generations:v,setGenerations:x,startJob:de,saveImage:async e=>{let t=v[e].jpg;const n=await fetch(`${ajaxurl}?action=imajinn-save-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t,prompt:R,post_id:wp.data.select("core/editor").getCurrentPostId(),nonce:IMAJINN.nonce})}),a=await n.json();return!!a.success&&(oe((t=>[...t,{index:e,data:a.data}])),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Image saved to media library.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),a.data)},setSelectedImage:ue,setError:d}),(0,t.createElement)("div",{className:"prompt-form"},(0,t.createElement)(r.TextareaControl,{disabled:o,rows:2,maxLength:450,value:R,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Prompt - Enter a detailed English description of the image you would like to generate.","imajinn-ai"),(0,t.createElement)(m,null)),className:"text-prompt",onChange:e=>z(e),onFocus:e=>e.target.select()}),(0,t.createElement)(r.__experimentalText,{className:"prompt-style",numberOfLines:2,truncate:!0},B),(0,t.createElement)("div",{className:"styles-form"},(0,t.createElement)(g,{prompt:R,setPrompt:z,setPromptStyle:W,startJob:de,setError:d,clearStyles:ye,isLoading:o}),(0,t.createElement)(A,{setImageStyle:$,isLoading:o,imageStyle:Q,optionData:b}),(0,t.createElement)(T,{setImageArtist:ee,isLoading:o,imageArtist:K,optionData:b}),(0,t.createElement)(L,{setImageModifier:ne,isLoading:o,imageModifier:te,optionData:b}),(0,t.createElement)(r.Button,{icon:s,disabled:o,label:(0,i._x)("Clear styles","clear the image style selects","imajinn-ai"),onClick:ye}))),(0,t.createElement)(r.Flex,{align:"top",wrap:"true"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(M,{ratio:Y,setRatio:F,isLoading:o})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{isPrimary:!0,disabled:o,onClick:()=>de()},(0,i.__)(ie?"Generate More":"Generate","imajinn-ai"))))),!IMAJINN.custom_editor&&(0,t.createElement)(Qe,{deleteBlock:()=>{const{removeBlocks:e}=wp.data.dispatch("core/block-editor");e(wp.data.select("core/block-editor").getSelectedBlockClientIds())}})),(0,t.createElement)("div",{className:"imajinn-footer"},(0,t.createElement)(r.Button,{onClick:()=>{fe()}},(0,i.__)("Account","imajinn-ai")),(0,t.createElement)(y,null),(0,t.createElement)("a",{href:"https://infiniteuploads.com/support/",target:"_blank"},(0,i.__)("Support","imajinn-ai")),(0,t.createElement)("span",{className:"imajinn-credits"},(0,i._x)("Made with ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)(r.Dashicon,{icon:"heart","aria-label":(0,i._x)("love","Made with love by Infinite Uploads","imajinn-ai")}),(0,i._x)(" by ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)("a",{href:"https://infiniteuploads.com/",target:"_blank"},"Infinite Uploads")))))},save:function(){return null},icon:c.DT})}()}();1 !function(){"use strict";var e={352:function(e,t,n){n.d(t,{DT:function(){return a},ZZ:function(){return o},mC:function(){return r}});var i=n(307);function a(e){const t=e.iconSize||30;return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68.99 99",height:t,width:t},(0,i.createElement)("path",{d:"M65.19,60.78c3.9-3.9,6.19-17.59-.2-23.67-4.3-2.8-10.87,1.08-18.09,.8-.51-.02-1.02,.07-1.49,.26-.67,.28-1.44,.72-2.26,1.42-2.56,2.19-5.99,3.51-8.31,2.21-1.84-1.23-1.39-3.92-1.31-4.32-3.97,.8-4.55-.88-8.17,.24-6.84,2.12-18.72,17.38-9.96,22.27,3.89,1.73,11.79,.79,11.79,.79,0,0,6.33,8.55,.95,12.41-5.03,3.61-9.48-.45-15.51-.97-12.95-1.21-19.27,16.96-2.54,26.78-3.64-6.18-4.42-14.42,3.76-14.42,5.68,0,13.27,8.43,24.48,7.03,9.69-1.21,13.03-5.15,17.38-16.07,2.01-4.71,6.92-10.71,6.92-10.71-6.91,2.54-10.67-.61-14.5-1.96-3.83-1.34-8.87-2.09-8.87-2.09,6.29,0,11.48,2.43,15.72,3.05,4.07,.6,7.6-.43,10.22-3.05Z"}),(0,i.createElement)("path",{d:"M54.55,13.82c-2.78-2.37-5.77-6.73-8.76-7.16-4.03-.58-5.66,1.64-6.51,4.46,0-.19-.01-.38-.03-.57L38.55,.04c0-.05-.08-.05-.08,0l-.88,10.25c-.1,1.36,.04,2.72,.4,4.03l.58,1.15c-.02,.39-.01,.62-.01,.62-1.14,1.24-1.97,3.51-2.59,5.14l.53,1.44s.1,2.24-1.84,4.55c0,0-1.2,1.43-1.34,1.77-.17,.4-.16,.96,.47,1.01,.64,.05,2.02,.23,2.02,.23l-.03,2.06c0,.58,.27,2.39,.42,2.86,.58,1.79,.37,3.29-.15,3.43-1.56,.45-1.92-1.14-1.92-1.14,0,0-1.22,4.58,3.55,3.85,3.06-.47,4.72-4.09,7.57-5.19h0c.18-.07,.36-.1,.55-.11,4.53-.1,7.41-.84,7.93-3.92,4.84-.42,6.65-2.72,7.81-7.44,1.21-4.91-2.73-7.17-7.01-10.81Z"}))}function r(){return(0,i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"55.435381255341",height:"60",viewBox:"0 0 1167.58 1263.72",version:"1.1"},(0,i.createElement)("defs",null,(0,i.createElement)("clipPath",{id:"clip1"},(0,i.createElement)("path",{d:"M 525 1006 L 595 1006 L 595 1263.71875 L 525 1263.71875 Z M 525 1006 "})),(0,i.createElement)("clipPath",{id:"clip2"},(0,i.createElement)("path",{d:"M 1018 1006 L 1167.578125 1006 L 1167.578125 1212 L 1018 1212 Z M 1018 1006 "}))),(0,i.createElement)("g",{id:"surface1"},(0,i.createElement)("path",{d:"M 883.503906 564.917969 C 919.703125 528.71875 941.007813 401.410156 881.6875 344.964844 C 841.726563 318.957031 780.652344 354.957031 713.5625 352.410156 C 708.824219 352.230469 704.105469 353.039063 699.722656 354.847656 C 693.507813 357.414063 686.355469 361.507813 678.730469 368.042969 C 654.972656 388.40625 623.070313 400.625 601.488281 388.585938 C 584.429688 377.132813 588.597656 352.140625 589.332031 348.394531 C 552.476563 355.824219 547.042969 340.191406 513.355469 350.644531 C 449.75 370.382813 339.335938 512.171875 420.820313 557.613281 C 456.992188 573.714844 530.402344 564.917969 530.402344 564.917969 C 530.402344 564.917969 589.253906 644.367188 539.238281 680.246094 C 492.445313 713.808594 451.089844 676.105469 395.078125 671.234375 C 274.757813 660.003906 216.007813 828.910156 371.429688 920.136719 C 337.640625 862.695313 330.320313 786.113281 406.339844 786.113281 C 459.125 786.113281 529.695313 864.453125 633.84375 851.433594 C 723.941406 840.171875 754.910156 803.570313 795.363281 702.039063 C 814.039063 658.285156 859.652344 602.535156 859.652344 602.535156 C 795.457031 626.1875 760.519531 596.839844 724.90625 584.359375 C 689.289063 571.878906 642.421875 564.917969 642.421875 564.917969 C 700.839844 564.917969 749.109375 587.472656 788.523438 593.257813 C 826.324219 598.800781 859.152344 589.269531 883.503906 564.917969 "}),(0,i.createElement)("path",{d:"M 784.621094 128.429688 C 758.757813 106.421875 730.980469 65.921875 703.167969 61.910156 C 665.6875 56.5 650.527344 77.128906 642.636719 103.398438 C 642.59375 101.628906 642.523438 99.859375 642.386719 98.089844 L 635.902344 0.351563 C 635.871094 -0.121094 635.1875 -0.121094 635.15625 0.351563 L 626.976563 95.570313 C 626.089844 108.179688 627.359375 120.851563 630.730469 133.03125 L 636.097656 143.699219 C 635.9375 147.328125 635.964844 149.46875 635.964844 149.46875 C 625.332031 161.011719 617.640625 182.050781 611.933594 197.261719 L 616.851563 210.640625 C 616.851563 210.640625 617.800781 231.441406 599.78125 252.960938 C 599.78125 252.960938 588.667969 266.253906 587.359375 269.429688 C 585.824219 273.152344 585.828125 278.3125 591.742188 278.785156 C 597.652344 279.257813 610.558594 280.914063 610.558594 280.914063 L 610.324219 300.066406 C 610.324219 305.457031 612.859375 322.316406 614.246094 326.636719 C 619.597656 343.292969 617.640625 357.179688 612.886719 358.539063 C 598.386719 362.683594 595.0625 347.902344 595.0625 347.902344 C 595.0625 347.902344 583.699219 390.441406 628.046875 383.652344 C 656.480469 379.300781 671.941406 345.640625 698.414063 335.460938 C 700.050781 334.828125 701.785156 334.496094 703.539063 334.457031 C 745.660156 333.558594 772.402344 326.636719 777.207031 298.027344 C 822.210938 294.09375 838.976563 272.722656 849.785156 228.890625 C 861.050781 183.21875 824.402344 162.28125 784.621094 128.429688 "}),(0,i.createElement)("path",{d:"M 0 1211.832031 L 0 1006.238281 L 14.34375 1006.238281 L 14.34375 1211.832031 L 0 1211.832031 "}),(0,i.createElement)("path",{d:"M 191.785156 1211.832031 L 115.144531 1021.988281 L 114.019531 1021.988281 C 114.769531 1033.609375 115.144531 1045.519531 115.144531 1057.710938 L 115.144531 1211.832031 L 101.363281 1211.832031 L 101.363281 1006.238281 L 123.582031 1006.238281 L 196.425781 1187.082031 L 197.269531 1187.082031 L 270.113281 1006.238281 L 291.769531 1006.238281 L 291.769531 1211.832031 L 277.285156 1211.832031 L 277.285156 1056.019531 C 277.285156 1045.140625 277.847656 1033.890625 278.972656 1022.269531 L 277.847656 1022.269531 L 200.925781 1211.832031 L 191.785156 1211.832031 "}),(0,i.createElement)("path",{d:"M 399.320313 1126.328125 L 472.867188 1126.328125 L 444.882813 1052.21875 C 442.535156 1046.410156 439.722656 1038.351563 436.445313 1028.03125 C 433.914063 1037.03125 431.144531 1045.191406 428.148438 1052.5 Z M 477.648438 1139.269531 L 394.117188 1139.269531 L 365.429688 1211.832031 L 349.539063 1211.832031 L 432.226563 1005.390625 L 441.367188 1005.390625 L 522.367188 1211.832031 L 506.195313 1211.832031 L 477.648438 1139.269531 "}),(0,i.createElement)("g",{clipPath:"url(#clip1)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 546.523438 1263.71875 C 537.902344 1263.71875 530.824219 1262.460938 525.289063 1259.921875 L 525.289063 1247.550781 C 532.601563 1249.421875 539.589844 1250.359375 546.242188 1250.359375 C 568.929688 1250.359375 580.273438 1237.988281 580.273438 1213.238281 L 580.273438 1006.238281 L 594.617188 1006.238281 L 594.617188 1211.832031 C 594.617188 1246.421875 578.585938 1263.71875 546.523438 1263.71875 "})),(0,i.createElement)("path",{d:"M 680.230469 1211.832031 L 680.230469 1006.238281 L 694.574219 1006.238281 L 694.574219 1211.832031 L 680.230469 1211.832031 "}),(0,i.createElement)("path",{d:"M 931.078125 1211.832031 L 916.59375 1211.832031 L 794.8125 1029.300781 L 793.6875 1029.300781 C 794.8125 1051.050781 795.375 1067.460938 795.375 1078.519531 L 795.375 1211.832031 L 781.59375 1211.832031 L 781.59375 1006.238281 L 795.9375 1006.238281 L 917.578125 1188.488281 L 918.421875 1188.488281 C 917.578125 1171.609375 917.15625 1155.578125 917.15625 1140.390625 L 917.15625 1006.238281 L 931.078125 1006.238281 L 931.078125 1211.832031 "}),(0,i.createElement)("g",{clipPath:"url(#clip2)",clipRule:"nonzero"},(0,i.createElement)("path",{d:"M 1167.578125 1211.832031 L 1153.101563 1211.832031 L 1031.320313 1029.300781 L 1030.191406 1029.300781 C 1031.320313 1051.050781 1031.878906 1067.460938 1031.878906 1078.519531 L 1031.878906 1211.832031 L 1018.101563 1211.832031 L 1018.101563 1006.238281 L 1032.441406 1006.238281 L 1154.078125 1188.488281 L 1154.929688 1188.488281 C 1154.078125 1171.609375 1153.660156 1155.578125 1153.660156 1140.390625 L 1153.660156 1006.238281 L 1167.578125 1006.238281 L 1167.578125 1211.832031 "}))))}function o(){return(0,i.useEffect)((()=>{var t,i;t=this,i=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var a=Math.abs;function r(e){return e}function o(e,t,n){var i=1-n;return 3*n*i*(e*i+t*n)+n*n*n}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return e<0||e>1||n<0||n>1?null:a(e-t)<=1e-5&&a(n-i)<=1e-5?r:function(r){if(r<=0)return e>0?r*t/e:0===t&&n>0?r*i/n:0;if(r>=1)return n<1?1+(r-1)*(i-1)/(n-1):1===n&&e<1?1+(r-1)*(t-1)/(e-1):1;for(var s,l=0,c=1;l<c;){var u=o(e,n,s=(l+c)/2);if(a(r-u)<1e-5)break;u<r?l=s:c=s}return o(t,i,s)}}function l(){return 1}function c(e){return 1===e?1:0}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(1===e){if(0===t)return c;if(1===t)return l}var n=1/e;return function(e){return e>=1?1:(e+=t*n)-e%n}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(Number.isInteger(e))return e;var n=Math.pow(10,t);return Math.round(e*n)/n}var d=Math.PI/180;function m(e,t,n){return e>=.5?n:t}function p(e,t,n){return 0===e||t===n?t:e*(n-t)+t}function f(e,t,n){var i=p(e,t,n);return i<=0?0:i}function g(e,t,n){return 0===e?t:1===e?n:{x:p(e,t.x,n.x),y:p(e,t.y,n.y)}}function y(e,t,n){return 0===e?t:1===e?n:{x:f(e,t.x,n.x),y:f(e,t.y,n.y)}}function v(e,t,n){var i=function(e,t,n){return Math.round(p(e,t,n))}(e,t,n);return i<=0?0:i>=255?255:i}function w(e,t,n){return 0===e?t:1===e?n:{r:v(e,t.r,n.r),g:v(e,t.g,n.g),b:v(e,t.b,n.b),a:p(e,null==t.a?1:t.a,null==n.a?1:n.a)}}function b(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=[],r=0;r<i;r++)a.push(w(e,t[r],n[r]));return a}function _(e,t,n){var i=t.length;if(i!==n.length)return m(e,t,n);for(var a=new Array(i),r=0;r<i;r++)a[r]=p(e,t[r],n[r]);return a}function E(e,t){for(var n=[],i=0;i<e;i++)n.push(t);return n}function x(e,t){if(--t<=0)return e;var n=(e=Object.assign([],e)).length;do{for(var i=0;i<n;i++)e.push(e[i])}while(--t>0);return e}var j=/\.0+$/g;function M(e){return Number.isInteger(e)?e+"":e.toFixed(6).replace(j,"")}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e&&e.length?e.map(M).join(t):""}function k(e){return M(e.x)+","+M(e.y)}function C(e){return e?null==e.a||e.a>=1?"rgb("+e.r+","+e.g+","+e.b+")":"rgba("+e.r+","+e.g+","+e.b+","+e.a+")":"transparent"}var I={f:null,i:y,u:function(e,t){return function(n){var i=t(n);e.setAttribute("rx",M(i.x)),e.setAttribute("ry",M(i.y))}}},D={f:null,i:function(e,t,n){return 0===e?t:1===e?n:{width:f(e,t.width,n.width),height:f(e,t.height,n.height)}},u:function(e,t){return function(n){var i=t(n);e.setAttribute("width",M(i.width)),e.setAttribute("height",M(i.height))}}},A=Math.sin,T=Math.cos,L=Math.acos,P=Math.asin,N=Math.tan,O=Math.atan2,R=Math.PI/180,z=180/Math.PI,B=Math.sqrt,W=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;t(this,e),this.m=[n,i,a,r,o,s],this.i=null,this.w=null,this.s=null}return i(e,[{key:"point",value:function(e,t){var n=this.m;return{x:n[0]*e+n[2]*t+n[4],y:n[1]*e+n[3]*t+n[5]}}},{key:"translateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e&&!t)return this;var n=this.m;return n[4]+=n[0]*e+n[2]*t,n[5]+=n[1]*e+n[3]*t,this.w=this.s=this.i=null,this}},{key:"rotateSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(e%=360){var t=A(e*=R),n=T(e),i=this.m,a=i[0],r=i[1];i[0]=a*n+i[2]*t,i[1]=r*n+i[3]*t,i[2]=i[2]*n-a*t,i[3]=i[3]*n-r*t,this.w=this.s=this.i=null}return this}},{key:"scaleSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(1!==e||1!==t){var n=this.m;n[0]*=e,n[1]*=e,n[2]*=t,n[3]*=t,this.w=this.s=this.i=null}return this}},{key:"skewSelf",value:function(e,t){if(t%=360,(e%=360)||t){var n=this.m,i=n[0],a=n[1],r=n[2],o=n[3];e&&(e=N(e*R),n[2]+=i*e,n[3]+=a*e),t&&(t=N(t*R),n[0]+=r*t,n[1]+=o*t),this.w=this.s=this.i=null}return this}},{key:"resetSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.m;return o[0]=e,o[1]=t,o[2]=n,o[3]=i,o[4]=a,o[5]=r,this.w=this.s=this.i=null,this}},{key:"recomposeSelf",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return this.isIdentity||this.resetSelf(),e&&(e.x||e.y)&&this.translateSelf(e.x,e.y),t&&this.rotateSelf(t),n&&(n.x&&this.skewSelf(n.x,0),n.y&&this.skewSelf(0,n.y)),!i||1===i.x&&1===i.y||this.scaleSelf(i.x,i.y),a&&(a.x||a.y)&&this.translateSelf(a.x,a.y),this}},{key:"decompose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.m,i=n[0]*n[0]+n[1]*n[1],a=[[n[0],n[1]],[n[2],n[3]]],r=B(i);if(0===r)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:0,y:0},skew:{x:0,y:0},rotate:0};a[0][0]/=r,a[0][1]/=r;var o=n[0]*n[3]-n[1]*n[2]<0;o&&(r=-r);var s=a[0][0]*a[1][0]+a[0][1]*a[1][1];a[1][0]-=a[0][0]*s,a[1][1]-=a[0][1]*s;var l=B(a[1][0]*a[1][0]+a[1][1]*a[1][1]);if(0===l)return{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:0},skew:{x:0,y:0},rotate:0};a[1][0]/=l,a[1][1]/=l,s/=l;var c=0;return a[1][1]<0?(c=L(a[1][1])*z,a[0][1]<0&&(c=360-c)):c=P(a[0][1])*z,o&&(c=-c),s=O(s,B(a[0][0]*a[0][0]+a[0][1]*a[0][1]))*z,{origin:{x:n[4],y:n[5]},translate:{x:e,y:t},scale:{x:r,y:l},skew:{x:s,y:0},rotate:c}}},{key:"toString",value:function(){return null===this.s&&(this.s="matrix("+this.m.map(F).join(" ")+")"),this.s}},{key:"determinant",get:function(){var e=this.m;return e[0]*e[3]-e[1]*e[2]}},{key:"isIdentity",get:function(){if(null===this.i){var e=this.m;this.i=1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}return this.i}}]),e}(),Y=/\.0+$/;function F(e){return Number.isInteger(e)?e:e.toFixed(14).replace(Y,"")}function V(e,t,n){return e+(t-e)*n}function G(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a={x:V(e.x,t.x,n),y:V(e.y,t.y,n)};return i&&(a.a=H(e,t)),a}function H(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function U(e,t,n,i){var a=1-i;return a*a*e+2*a*i*t+i*i*n}function J(e,t,n,i){return 2*(1-i)*(t-e)+2*i*(n-t)}function q(e,t,n,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={x:U(e.x,t.x,n.x,i),y:U(e.y,t.y,n.y,i)};return a&&(r.a=Z(e,t,n,i)),r}function Z(e,t,n,i){return Math.atan2(J(e.y,t.y,n.y,i),J(e.x,t.x,n.x,i))}function X(e,t,n,i,a){var r=a*a;return a*r*(i-e+3*(t-n))+3*r*(e+n-2*t)+3*a*(t-e)+e}function Q(e,t,n,i,a){var r=1-a;return 3*(r*r*(t-e)+2*r*a*(n-t)+a*a*(i-n))}function $(e,t,n,i,a){var r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o={x:X(e.x,t.x,n.x,i.x,a),y:X(e.y,t.y,n.y,i.y,a)};return r&&(o.a=K(e,t,n,i,a)),o}function K(e,t,n,i,a){return Math.atan2(Q(e.y,t.y,n.y,i.y,a),Q(e.x,t.x,n.x,i.x,a))}function ee(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(ne(t)){if(ie(n))return q(t,n.start,n,e,i)}else if(ne(n)){if(t.end)return q(t,t.end,n,e,i)}else{if(t.end)return n.start?$(t,t.end,n.start,n,e,i):q(t,t.end,n,e,i);if(n.start)return q(t,n.start,n,e,i)}return G(t,n,e,i)}function te(e,t,n){var i=ee(e,t,n,!0);return i.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?e+Math.PI:e}(i.a)/d,i}function ne(e){return!e.type||"corner"===e.type}function ie(e){return null!=e.start&&!ne(e)}Object.freeze({M:2,L:2,Z:0,H:1,V:1,C:6,Q:4,T:2,S:4,A:7});var ae=new W,re={f:function(e){return e?e.join(" "):""},i:function(t,n,i){if(0===t)return n;if(1===t)return i;var a=n.length;if(a!==i.length)return m(t,n,i);for(var r,o=new Array(a),s=0;s<a;s++){if((r=e(n[s]))!==e(i[s]))return m(t,n,i);if("number"===r)o[s]=p(t,n[s],i[s]);else{if(n[s]!==i[s])return m(t,n,i);o[s]=n[s]}}return o}},oe={f:null,i:_,u:function(e,t){return function(n){var i=t(n);e.setAttribute("x1",M(i[0])),e.setAttribute("y1",M(i[1])),e.setAttribute("x2",M(i[2])),e.setAttribute("y2",M(i[3]))}}},se={f:M,i:p},le={f:M,i:function(e,t,n){var i=p(e,t,n);return i<=0?0:i>=1?1:i}},ce={f:S,i:function(e,t,n){var i,a,r,o=t.length,s=n.length;if(o!==s)if(0===o)t=E(o=s,0);else if(0===s)s=o,n=E(o,0);else{var l=(r=(i=o)*(a=s)/function(e,t){for(var n;t;)n=t,t=e%t,e=n;return e||1}(i,a))<0?-r:r;t=x(t,Math.floor(l/o)),n=x(n,Math.floor(l/s)),o=s=l}for(var c=[],u=0;u<o;u++)c.push(h(f(e,t[u],n[u]),6));return c}};function ue(e,t,n,i,a,r,o,s){return t=function(e,t,n){for(var i,a,r,o=e.length-1,s={},l=0;l<=o;l++)(i=e[l]).e&&(i.e=t(i.e)),i.v&&"g"===(a=i.v).t&&a.r&&(r=n.getElementById(a.r))&&(s[a.r]=r.querySelectorAll("stop"));return s}(e,i,s),function(i){var a,r=n(i,e,he);return r?"c"===r.t?C(r.v):"g"===r.t?(t[r.r]&&function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].setAttribute("stop-color",C(t[n]))}(t[r.r],r.v),(a=r.r)?"url(#"+a+")":"none"):"none":"none"}}function he(e,t,n){if(0===e)return t;if(1===e)return n;if(t&&n){var i=t.t;if(i===n.t)switch(t.t){case"c":return{t:i,v:w(e,t.v,n.v)};case"g":if(t.r===n.r)return{t:i,v:b(e,t.v,n.v),r:t.r}}}return m(e,t,n)}var de={blur:y,brightness:f,contrast:f,"drop-shadow":function(e,t,n){return 0===e?t:1===e?n:{blur:y(e,t.blur,n.blur),offset:g(e,t.offset,n.offset),color:w(e,t.color,n.color)}},grayscale:f,"hue-rotate":p,invert:f,opacity:f,saturate:f,sepia:f};function me(e,t,n){if(0===e)return t;if(1===e)return n;var i=t.length;if(i!==n.length)return m(e,t,n);for(var a,r=[],o=0;o<i;o++){if(t[o].type!==n[o].type)return t;if(!(a=de[t[o].type]))return m(e,t,n);r.push({type:t.type,value:a(e,t[o].value,n[o].value)})}return r}var pe={blur:function(e){return e?function(t){e.setAttribute("stdDeviation",k(t))}:null},brightness:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t),e.map((function(e){return e.setAttribute("slope",t)}))}:null},contrast:function(e,t,n){return(e=ge(n,t))?function(t){var n=M((1-t)/2);t=M(t),e.map((function(e){e.setAttribute("slope",t),e.setAttribute("intercept",n)}))}:null},"drop-shadow":function(e,t,n){var i=n.getElementById(t+"-blur");if(!i)return null;var a=n.getElementById(t+"-offset");if(!a)return null;var r=n.getElementById(t+"-flood");return r?function(e){i.setAttribute("stdDeviation",k(e.blur)),a.setAttribute("dx",M(e.offset.x)),a.setAttribute("dy",M(e.offset.y)),r.setAttribute("flood-color",C(e.color))}:null},grayscale:function(e){return e?function(t){e.setAttribute("values",S(function(e){return[.2126+.7874*(e=1-e),.7152-.7152*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152+.2848*e,.0722-.0722*e,0,0,.2126-.2126*e,.7152-.7152*e,.0722+.9278*e,0,0,0,0,0,1,0]}(t)))}:null},"hue-rotate":function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},invert:function(e,t,n){return(e=ge(n,t))?function(t){t=M(t)+" "+M(1-t),e.map((function(e){return e.setAttribute("tableValues",t)}))}:null},opacity:function(e,t,n){return(e=n.getElementById(t+"-A"))?function(t){return e.setAttribute("tableValues","0 "+M(t))}:null},saturate:function(e){return e?function(t){return e.setAttribute("values",M(t))}:null},sepia:function(e){return e?function(t){return e.setAttribute("values",S(function(e){return[.393+.607*(e=1-e),.769-.769*e,.189-.189*e,0,0,.349-.349*e,.686+.314*e,.168-.168*e,0,0,.272-.272*e,.534-.534*e,.131+.869*e,0,0,0,0,0,1,0]}(t)))}:null}},fe=["R","G","B"];function ge(e,t){var n=fe.map((function(n){return e.getElementById(t+"-"+n)||null}));return-1!==n.indexOf(null)?null:n}var ye={fill:ue,"fill-opacity":le,stroke:ue,"stroke-opacity":le,strokeWidth:se,strokeDashoffset:{f:M,i:p},strokeDasharray:ce,opacity:le,transform:function(t,n,i,a){if(!(t=function(t,n){if(!t||"object"!==e(t))return null;var i=!1;for(var a in t)t.hasOwnProperty(a)&&(t[a]&&t[a].length?(t[a].forEach((function(e){e.e&&(e.e=n(e.e))})),i=!0):delete t[a]);return i?t:null}(t,a)))return null;var r=function(e,a,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t[e]?i(a,t[e],r):n&&n[e]?n[e]:o};return n&&n.a&&t.o?function(e){var n=i(e,t.o,te);return ae.recomposeSelf(n,r("r",e,p,0)+n.a,r("k",e,g),r("s",e,g),r("t",e,g)).toString()}:function(e){return ae.recomposeSelf(r("o",e,ee,null),r("r",e,p,0),r("k",e,g),r("s",e,g),r("t",e,g)).toString()}},"#filter":function(e,t,n,i,a,r,o,s){if(!t.items||!e||!e.length)return null;var l=function(e,t){var n=(e=e.map((function(e){return e&&pe[e[0]]?(t.getElementById(e[1]),pe[e[0]](t.getElementById(e[1]),e[1],t)):null}))).length;return function(t){for(var i=0;i<n;i++)e[i]&&e[i](t[i].value)}}(t.items,s);return l?(e=function(e,t){return e.map((function(e){return e.e=t(e.e),e}))}(e,i),function(t){l(n(t,e,me))}):null},"#line":oe,points:{f:S,i:_},d:re,r:se,"#size":D,"#radius":I,_:function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)this[e[n]]=t;else this[e]=t}},ve=function(){function e(n){t(this,e),this.list=n,this.length=n.length}return i(e,[{key:"setAttribute",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].setAttribute(e,t)}},{key:"removeAttribute",value:function(e){for(var t=this.list,n=0;n<this.length;n++)t[n].removeAttribute(e)}},{key:"style",value:function(e,t){for(var n=this.list,i=0;i<this.length;i++)n[i].style[e]=t}}]),e}(),we=/-./g,be=function(e,t){return t.toUpperCase()};function _e(e){return"function"==typeof e?e:m}function Ee(e){return e?"function"==typeof e?e:Array.isArray(e)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;if(!Array.isArray(e))return t;switch(e.length){case 1:return u(e[0])||t;case 2:return u(e[0],e[1])||t;case 4:return s(e[0],e[1],e[2],e[3])||t}return t}(e,null):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;switch(e){case"linear":return r;case"steps":return u(t.steps||1,t.jump||0)||n;case"bezier":case"cubic-bezier":return s(t.x1||0,t.y1||0,t.x2||0,t.y2||0)||n}return n}(e.type,e.value,null):null}function xe(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length-1;if(e<=t[0].t)return i?[0,0,t[0].v]:t[0].v;if(e>=t[a].t)return i?[a,1,t[a].v]:t[a].v;var r,o=t[0],s=null;for(r=1;r<=a;r++){if(!(e>t[r].t)){s=t[r];break}o=t[r]}return null==s?i?[a,1,t[a].v]:t[a].v:o.t===s.t?i?[r,1,s.v]:s.v:(e=(e-o.t)/(s.t-o.t),o.e&&(e=o.e(e)),i?[r,e,n(e,o.v,s.v)]:n(e,o.v,s.v))}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e&&e.length?"function"!=typeof t?null:("function"!=typeof n&&(n=null),function(i){var a=xe(i,e,t);return null!=a&&n&&(a=n(a)),a}):null}function Me(e,t){return e.t-t.t}function Se(t,n,i,a){if(!a||"object"!==e(a))return null;var r=null,o=null;return Array.isArray(a)?o=function(e){if(!e||!e.length)return null;for(var t=0;t<e.length;t++)e[t].e&&(e[t].e=Ee(e[t].e));return e.sort(Me)}(a):(o=a.keys,r=a.data||null),o?function(t,n,i,a,r){var o,s="@"===i[0],l="#"===i[0],c=ye[i],u=m;switch(s?(o=i.substr(1),i=o.replace(we,be)):l&&(i=i.substr(1)),e(c)){case"function":if(u=c(a,r,xe,Ee,i,s,n,t),l)return u;break;case"string":u=je(a,_e(c));break;case"object":if((u=je(a,_e(c.i),c.f))&&"function"==typeof c.u)return c.u(n,u,i,s,t)}return u?function(e,t,n){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3])return e instanceof ve?function(i){return e.style(t,n(i))}:function(i){return e.style[t]=n(i)};if(Array.isArray(t)){var i=t.length;return function(a){var r=n(a);if(null==r)for(var o=0;o<i;o++)e[o].removeAttribute(t);else for(var s=0;s<i;s++)e[s].setAttribute(t,r)}}return function(i){var a=n(i);null==a?e.removeAttribute(t):e.setAttribute(t,a)}}(n,i,u,s):null}(t,n,i,o,r):null}function ke(e,t,n){if(!n)return null;var i=[];for(var a in n)if(n.hasOwnProperty(a)){var r=Se(e,t,a,n[a]);r&&i.push(r)}return i.length?i:null}var Ce=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(this,e),this._id=0,this._running=!1,this._animations=n,this.direction=i.direction||1,this.speed=i.speed||1,this.fps=i.fps||100,this.offset=i.offset||0}return i(e,[{key:"_start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=-1/0,i=null,a={},r=function r(o){e._running=!0,null==i&&(i=o);var s=Math.round((o-i+t)*e.speed),l=e.fps?1e3/e.fps:0;if(s>n+l){e.offset=s,n=s;for(var c=e._animations,u=c.length,h=0,d=0;d<u;d++)a[d]?h++:(a[d]=c[d](s,e.direction),a[d]&&h++);if(h===u)return void e._stop()}e._id=window.requestAnimationFrame(r)};this._id=window.requestAnimationFrame(r)}},{key:"_stop",value:function(){this._id&&window.cancelAnimationFrame(this._id),this._running=!1}},{key:"play",value:function(){this._running||this._start(this.offset)}},{key:"stop",value:function(){this._stop(),this.offset=0;var e=this.direction,t=this._animations;requestAnimationFrame((function(){for(var n=0;n<t.length;n++)t[n](0,e)}))}},{key:"restart",value:function(){this._stop(),this.offset=0,this._start()}},{key:"pause",value:function(){this._stop()}},{key:"reverse",value:function(){this.direction=-this.direction}}],[{key:"build",value:function(t){if(!(t=function(e){if(!e||!e.root||!Array.isArray(e.animations))return null;var t=window.document.getElementById(e.root);if(!t)return null;var n=e.animations.map((function(e){return function(e,t){if(!t.duration||t.duration<0)return null;var n=function(e,t){if(!t)return null;var n=[];if(Array.isArray(t))for(var i=t.length,a=0;a<i;a++){var r=t[a];if(2===r.length){var o=null;if("string"==typeof r[0])o=e.getElementById(r[0]);else if(Array.isArray(r[0])){o=[];for(var s=0;s<r[0].length;s++)if("string"==typeof r[0][s]){var l=e.getElementById(r[0][s]);l&&o.push(l)}o=o.length?1===o.length?o[0]:new ve(o):null}if(o){var c=ke(e,o,r[1]);c&&(n=n.concat(c))}}}else for(var u in t)if(t.hasOwnProperty(u)){var h=e.getElementById(u);if(h){var d=ke(e,h,t[u]);d&&(n=n.concat(d))}}return n.length?n:null}(e,t.elements);return n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=e.length,s=i>0?t:0;a&&n%2==0&&(s=t-s);var l=null;return function(c,u){var h=c%t,d=1+(c-h)/t;u*=i,a&&d%2==0&&(u=-u);var m=!1;if(d>n)h=s,m=!0,-1===r&&(h=i>0?0:t);else if(u<0&&(h=t-h),h===l)return!1;l=h;for(var p=0;p<o;p++)e[p](h);return m}}(n,t.duration,t.iterations||1/0,t.direction||1,!!t.alternate,t.fill||1):null}(t,e)})).filter((function(e){return!!e}));return n.length?{element:t,animations:n,options:e.options||void 0}:null}(t)))return null;var n=t.element,i=t.options||{},a=new e(t.animations,t.options);return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if("click"!==n){if("hover"===n)return t.addEventListener("mouseenter",(function(){return e.play()})),void t.addEventListener("mouseleave","freeze"===i?function(){return e.pause()}:function(){return e.stop()});e.play()}else{var a=function n(){t.removeEventListener("click",n),e.play()};t.addEventListener("click",a)}}(a,n,i.start,i.hover),a}}]),e}();return function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var n=Date.now(),i=Math.max(0,16-(n-e)),a=window.setTimeout((function(){t(n+i)}),i);return e=n+i,a},window.cancelAnimationFrame=window.clearTimeout)}(),Ce},"object"==typeof exports?e.exports=i():"function"==typeof define&&n.amdO?define(i):(t=t||self).__SVGATOR_PLAYER__=i(),__SVGATOR_PLAYER__.build({root:"e29gnwghxaec1",animations:[{duration:3e3,direction:1,iterations:0,fill:1,alternate:!1,elements:{e29gnwghxaec4:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160,y:60.000000000000085,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.0000000000001,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:160.00000000000009,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:70.00000000000013,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000011,y:110.00000000000003,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec5:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:70,y:209.99999999999997,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70,y:109.99999999999996,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160,y:59.999999999999986,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:250.00000000000006,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000003,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:70.00000000000006,y:210,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec6:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:70.00000000000003,y:210.00000000000003,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.0000000033166,y:110.00000000017586,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999559876,y:59.99999999808161,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:250.00000000133716,y:109.99999999826927,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250.00000000074502,y:209.99999999748923,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:160.00000000328416,y:259.99999999938586,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec7:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:209.99999999827637,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:160.00000000000003,y:259.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:70.00000000000003,y:209.9999999982764,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000003,y:109.99999999827641,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:159.99999999999997,y:59.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:250,y:109.99999999827642,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250.00000000000003,y:209.99999999827642,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec8:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:250.00000000000006,y:110.00000000000009,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:250.00000000000009,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:160.00000000000006,y:260.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:70.00000000000006,y:210.00000000000006,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:70.00000000000003,y:110.00000000000007,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:160.00000000000006,y:60.000000000000064,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:250,y:110.00000000000006,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}},e29gnwghxaec9:{transform:{data:{t:{x:-14.999999999999972,y:2.8740790488276007e-9}},keys:{o:[{t:0,v:{x:160,y:60,type:"corner"},e:[.545,.025,.48,.935]},{t:500,v:{x:249.99999999999997,y:110,type:"corner"},e:[.545,.025,.48,.935]},{t:1e3,v:{x:249.99999999999994,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:1500,v:{x:159.99999999999991,y:260,type:"corner"},e:[.545,.025,.48,.935]},{t:2e3,v:{x:69.99999999999991,y:210,type:"corner"},e:[.545,.025,.48,.935]},{t:2500,v:{x:69.99999999999994,y:110.00000000000001,type:"corner"},e:[.545,.025,.48,.935]},{t:3e3,v:{x:159.99999999999994,y:60.00000000000004,type:"corner"},e:[.545,.025,.48,.935]}],s:[{t:0,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:1500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:1750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2250,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:2500,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]},{t:2750,v:{x:.75,y:.75},e:[.545,.025,.48,.935]},{t:3e3,v:{x:1.2,y:1.2},e:[.545,.025,.48,.935]}]}}}}}],options:{start:"load",hover:"restart"}})}),[]),(0,i.createElement)("svg",{id:"e29gnwghxaec1",className:"imajinn-spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 300",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision"},(0,i.createElement)("defs",null,(0,i.createElement)("filter",{id:"e29gnwghxaec4-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec4-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec5-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec5-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec6-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec6-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec7-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec7-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec8-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec8-filter-blur-0",stdDeviation:"0,0",result:"result"})),(0,i.createElement)("filter",{id:"e29gnwghxaec9-filter",x:"-400%",width:"600%",y:"-400%",height:"600%"},(0,i.createElement)("feGaussianBlur",{id:"e29gnwghxaec9-filter-blur-0",stdDeviation:"0,0",result:"result"}))),(0,i.createElement)("circle",{id:"e29gnwghxaec2",r:"50",transform:"matrix(-1 0 -0 -1 149.99999999999997 50.00000000379265)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("circle",{id:"e29gnwghxaec3",r:"50",transform:"matrix(-1 0 -0 -1 49.99999999999997 150.00000000379259)",fill:"none",stroke:"rgb(255,122,122)",strokeWidth:"6",strokeDashoffset:"314.160000",strokeDasharray:"314.160000"}),(0,i.createElement)("path",{id:"e29gnwghxaec4",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 110.00000000344897)",filter:"url(#e29gnwghxaec4-filter)",fill:"rgb(239,237,39)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec5",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 52.00000000000004 210.00000000344886)",filter:"url(#e29gnwghxaec5-filter)",fill:"rgb(236,0,140)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec6",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 260.00000000344897)",filter:"url(#e29gnwghxaec6-filter)",fill:"rgb(238,124,30)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec7",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 210.00000000172525)",filter:"url(#e29gnwghxaec7-filter)",fill:"rgb(0,161,103)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec8",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 232.00000000000009 110.00000000344897)",filter:"url(#e29gnwghxaec8-filter)",fill:"rgb(192,53,226)",stroke:"none",strokeWidth:"6"}),(0,i.createElement)("path",{id:"e29gnwghxaec9",d:"M-10,-8.333333C-10,-17.538079,-2.538079,-25,6.666667,-25C15.871412,-25,23.333333,-17.538079,23.333333,-8.333333C23.333333,0.871412,15.871412,8.333333,6.666667,8.333333C-2.538079,8.333333,-10,0.871412,-10,-8.333333Z",transform:"matrix(1.20000000000000 0 0 1.20000000000000 142.00000000000003 60.00000000344890)",filter:"url(#e29gnwghxaec9-filter)",fill:"rgb(38,169,224)",stroke:"none",strokeWidth:"6"}))}n(609),e=n.hmd(e)},380:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(873))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.segments,i=void 0===n?50:n,a=t.iterationLimit,s=void 0===a?100:a;o(this,e),this.p1=new r.default,this.p2=new r.default,this.segments=i,this.iterationLimit=s}return a(e,[{key:"drawToCanvas",value:function(e,t,n,i){this.p1.update(t),this.p2.update(n);var a=this.p1.x>this.p2.x,r=a?this.p2:this.p1,o=a?this.p1:this.p2,s=[],l=!0;if(r.getDistanceTo(o)<i)if(o.x-r.x>.01){var c=o.x-r.x,u=o.y-r.y,h=-this.getCatenaryParameter(c,u,i,this.iterationLimit),d=.5*(h*Math.log((i+u)/(i-u))-c),m=h*Math.cosh(d/h),p=r.x-d,f=r.y-m;s=this.getCurve(h,r,o,p,f,this.segments),l=!1}else{var g=.5*(r.x+o.x),y=.5*(r.y+o.y+i);s=[[r.x,r.y],[g,y],[o.x,o.y]]}else s=[[r.x,r.y],[o.x,o.y]];return l?this.drawLine(s,e):this.drawCurve(s,e),s}},{key:"getCatenaryParameter",value:function(e,t,n,i){for(var a=Math.sqrt(n*n-t*t)/e,r=Math.acosh(a)+1,o=-1,s=0;Math.abs(r-o)>1e-6&&s<i;)o=r,r-=(Math.sinh(r)-a*r)/(Math.cosh(r)-a),s++;return e/(2*r)}},{key:"getCurve",value:function(e,t,n,i,a,r){for(var o=[t.x,e*Math.cosh((t.x-i)/e)+a],s=n.x-t.x,l=r-1,c=0;c<l;c++){var u=t.x+s*(c+.5)/l,h=e*Math.cosh((u-i)/e)+a;o.push(u,h)}return o.push(n.x,e*Math.cosh((n.x-i)/e)+a),o}},{key:"drawLine",value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:"drawCurve",value:function(e,t){var n=.5*e.length-1,i=e[2],a=e[3],r=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[2*o],l=e[2*o+1],c=.5*(s+i),u=.5*(l+a);r.push([i,a,c,u]),t.quadraticCurveTo(i,a,c,u),i=s,a=l}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),r}}]),e}();t.default=s},873:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return n(e,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"getDifferenceTo",value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}}]),e}();t.default=i},301:function(e,t,n){t.oT=void 0;var i=r(n(380)),a=r(n(873));function r(e){return e&&e.__esModule?e:{default:e}}t.oT=i.default,a.default},630:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(195))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.radius,i=void 0===n?30:n,a=t.enabled,s=void 0===a||a,l=t.initialPoint,c=void 0===l?{x:0,y:0}:l;o(this,e),this.radius=i,this._isEnabled=s,this.pointer=new r.default(c.x,c.y),this.brush=new r.default(c.x,c.y),this.angle=0,this.distance=0,this._hasMoved=!1}return a(e,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"isEnabled",value:function(){return this._isEnabled}},{key:"setRadius",value:function(e){this.radius=e}},{key:"getRadius",value:function(){return this.radius}},{key:"getBrushCoordinates",value:function(){return this.brush.toObject()}},{key:"getPointerCoordinates",value:function(){return this.pointer.toObject()}},{key:"getBrush",value:function(){return this.brush}},{key:"getPointer",value:function(){return this.pointer}},{key:"getAngle",value:function(){return this.angle}},{key:"getDistance",value:function(){return this.distance}},{key:"brushHasMoved",value:function(){return this._hasMoved}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.both,i=void 0!==n&&n;return this._hasMoved=!1,!(this.pointer.equalsTo(e)&&!i||(this.pointer.update(e),i?(this._hasMoved=!0,this.brush.update(e),0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),0)))}}]),e}();t.default=s},195:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(93))&&i.__esModule?i:{default:i};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=function(e){function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"update",value:function(e){this.x=e.x,this.y=e.y}},{key:"moveByAngle",value:function(e,t){var n=e+Math.PI/2;this.x=this.x+Math.sin(n)*t,this.y=this.y-Math.cos(n)*t}},{key:"equalsTo",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"getDifferenceTo",value:function(e){return new r.default(this.x-e.x,this.y-e.y)}},{key:"getDistanceTo",value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}},{key:"getAngleTo",value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:"toObject",value:function(){return{x:this.x,y:this.y}}}]),t}(r.default);t.default=l},93:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}},227:function(e,t,n){t.xv=void 0;var i=o(n(630)),a=o(n(93)),r=o(n(195));function o(e){return e&&e.__esModule?e:{default:e}}t.xv=i.default,a.default,r.default},609:function(e){e.exports=window.wp.components},307:function(e){e.exports=window.wp.element}},t={};function n(i){var a=t[i];if(void 0!==a)return a.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i](r,r.exports,n),r.loaded=!0,r.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),function(){var e=window.wp.blocks,t=n(307),i=window.wp.i18n,a=window.wp.blockEditor,r=n(609),o=window.wp.primitives,s=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"infinite-uploads/imajinn-ai","version":"0.1.0","title":"Imajinn AI","category":"media","icon":"art","description":"Generate the perfect images from a text prompt in seconds with cutting-edge AI. Creates stunning images for any topic with just your imagination.","keywords":["img","image","photo","picture","ai","art","infinite"],"supports":{"html":false,"multiple":false,"customClassName":false,"reusable":false,"lock":false},"example":{"attributes":{"mode":"preview"}},"textdomain":"imajinn-ai","editorScript":"file:./block.js","editorStyle":"file:./block.css"}'),c=n(352);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)}var h=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),d=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function m(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{className:"imajinn-prompt-tips",onClick:()=>a(!0),icon:h,label:(0,i.__)("Prompt Tips","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Basics of Prompt Engineering","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)('"Prompt Engineering" is an important skill to create better generations with this text to image AI. After reading this document and applying these simple steps, you’ll be able to generate better images with the same amount of effort.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Note: Your prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. If you speak another language you can use a online translation tool, which should provide excellent results as it does not have to be perfect.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("1. Raw prompt","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Raw prompt is the simplest way of describing what you want to generate, for instance;","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Panda"),(0,t.createElement)("li",null,"A warrior with a sword"),(0,t.createElement)("li",null,"Skeleton")),(0,t.createElement)("p",null,(0,i.__)("This is the basic building block of any prompt. Most new people start by only using raw prompts, this is usually a mistake as the images you generate like this tend to get random and chaotic. It's best to include as much detail as possible in your prompt describing exactly what you want to see in the scene.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("2. Style","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Style is a crucial part of the prompt. The AI, when missing a specified style, usually chooses the one it has seen the most in related images, for example, if you generated landscape, it would probably generate realistic or oil painting looking images. Having a well chosen style + raw prompt is sometimes enough, as the style influences the image the most right after the raw prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most commonly used styles include:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Realistic"),(0,t.createElement)("li",null,"Oil painting"),(0,t.createElement)("li",null,"Pencil drawing"),(0,t.createElement)("li",null,"Concept art")),(0,t.createElement)("p",null,(0,i.__)("In the case of a realistic image, there are various ways of making it the style, most resulting in similar images. Here are some commonly used techniques of making the image realistic:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"a photo of + raw prompt"),(0,t.createElement)("li",null,"a photograph of + raw prompt"),(0,t.createElement)("li",null,"raw prompt, hyperrealistic"),(0,t.createElement)("li",null,"raw prompt, realistic")),(0,t.createElement)("p",null,(0,i.__)("You can of course combine these to get more and more realistic images.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To get oil painting you can just simply add “an oil painting of” to your prompt. This sometimes results in the image showing an oil painting in a frame, to fix this you can just re-run the prompt or use raw prompt + “oil painting”","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make a pencil drawing just simply add “a pencil drawing of” to your raw prompt or make your prompt raw prompt + “pencil drawing”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The same applies to landscape art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("3. Artist","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To make your style more specific, or the image more coherent, you can use artists’ names in your prompt. For instance, if you want a very abstract image, you can add “made by Pablo Picasso” or just simply, “Picasso”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Below are lists of artists in different styles that you can use, but we encourage you to search for different artists as it is a cool way of discovering new art.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Portrait:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"John Singer Sargent"),(0,t.createElement)("li",null,"Edgar Degas"),(0,t.createElement)("li",null,"Paul Cézanne"),(0,t.createElement)("li",null,"Jan van Eyck")),(0,t.createElement)("p",null,(0,i.__)("Oil painting:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Leonardo DaVinci"),(0,t.createElement)("li",null,"Vincent Van Gogh"),(0,t.createElement)("li",null,"Johannes Vermeer"),(0,t.createElement)("li",null,"Rembrandt")),(0,t.createElement)("p",null,(0,i.__)("Pencil/Pen drawing:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Albrecht Dürer"),(0,t.createElement)("li",null,"Leonardo da Vinci"),(0,t.createElement)("li",null,"Michelangelo"),(0,t.createElement)("li",null,"Jean-Auguste-Dominique Ingres")),(0,t.createElement)("p",null,(0,i.__)("Landscape art:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Thomas Moran"),(0,t.createElement)("li",null,"Claude Monet"),(0,t.createElement)("li",null,"Alfred Bierstadt"),(0,t.createElement)("li",null,"Frederic Edwin Church")),(0,t.createElement)("p",null,(0,i.__)("Mixing the artists is highly encouraged, as it can lead to interesting-looking art.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("4. Finishing touches","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("This is the part that some people take to extremes, leading to longer prompts than this article. Finishing touches are the final things that you add to your prompt to make it look like you want. For instance, if you want to make your image more artistic, add “trending on artstation”. If you want to add more realistic lighting add “Unreal Engine.” You can add anything you want, but here are some examples:","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Highly detailed, surrealism, trending on art station, triadic color scheme, smooth, sharp focus, matte, elegant, the most beautiful image ever seen, illustration, digital paint, dark, gloomy, octane render, 8k, 4k, washed colors, sharp, dramatic lighting, beautiful, post processing, picture of the day, ambient lighting, epic composition, bokeh, etc.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("5. Conclusion","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Prompt engineering allows you to have better control of what the image will look like. It (if done right) improves the image quality by a lot in every aspect. But if you want to keep it simple, just use our Prompt Genie or style presets.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function p(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.ToolbarButton,{onClick:()=>a(!0),icon:d,label:(0,i.__)("Help","imajinn-ai")}),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:d}),title:(0,i.__)("Usage Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI is a powerful tool that uses the latest technology in AI to generate images from text. It is a great tool for writers, artists, and anyone who needs to visualize their ideas.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The Imajinn AI interface is a block that you can add to your post or page. You can add it by clicking on the plus button in the top left corner of the editor and selecting Imajinn AI. You can also add it by clicking on the Imajinn AI icon in the block inserter. It does not output any content on your site on its own, but allows you to generate and insert images into the same location in the block editor. When finished you can just close the block.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Connecting","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Running an artificial intelligence neural network requires a lot of computing power. To make this possible, we run a cloud service to run the neural network. This means that you need to connect to our service before you can use the plugin. To connect to Imajinn AI, you need to have a user account. You can create one for free with just your valid email address and a password, or if you already have an account, you can log in with your Infinite Uploads/Imajinn AI email and password.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompts","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To generate images, you need to write a prompt. A prompt is a text that describes what you want the image to look like. The prompt should be in English as the AI model was only trained with English labels, and will function poorly with other languages. The prompt can be as short as a a few words, or as long as a paragraph. The longer the prompt, the more detailed the image will be. Please see our prompt engineering guide for more information on how to write a good prompt.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt Genie","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Because writing prompts is hard, we have created a tool called Prompt Genie that can help you turn your simple prompts into amazing masterpieces. Prompt Genie uses a custom AI model to transform your prompt into ten different powerful options to generate an image in beautiful artistic styles. Simply enter your simple prompt like "a dog running on a beach", then click on the Prompt Genie button. After a few moments it will present you with ten different expanded prompts to choose from. You can then select the one you like best and click on the Generate button to generate a set of images. If you want to try a different prompt, just click on the Prompt Genie button again and choose a new option.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Summoning Prompt Genie does not use any of your credits, so you can summon it as many times as you like. However each time you generate a set of images from one of it's prompts you will use one credit like normal.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prefilled Styles","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To give you inspiration and make it easier to generate images in specific styles, we have added some dropdowns with prefilled styles that you can optionally select from. When optionally choosing options here it will append specific keywords to your prompt to achieve that style when sent to our servers.","imajinn-ai")),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Image Style","imajinn-ai")),"-",(0,i.__)("Choose from many common photographic or artistic styles and mediums.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Artist Style","imajinn-ai")),"-",(0,i.__)("Choose to generate your images based on the styles of some famous artists.","imajinn-ai")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,(0,i.__)("Modifier","imajinn-ai")),"-",(0,i.__)("Some fun and common styles to give the image output that special uniqueness.","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Image Ratio","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("You can control the output ratio of the generated images. Square images are the default, while rectangular images have more pixels and take longer to process.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The AI model was trained on square images, so depending on the prompt rectangular images may produce strange results such as duplication of the main subject. For example a rectangular image of a person may produce two of the same person, or multiple mouths on the same face. So it may require more prompt editing and generation attempts to get the desired result. Rectangular images are best used for landscapes, scenes, and other objects that do not have a singular main subject.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Saving Images","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn AI allows you to save images to your media library, and optionally insert them into your post/page. You can save images by clicking on the save button in the bottom right corner of each image generation. You can insert images into the editor in the same location as the Imajinn block by clicking on the insert button in the bottom right corner. Inserting an image also saves it to your media library, so you don't need to choose both.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you save or insert an image, it can take a few seconds because we send it to our servers to be upscaled using our advanced AI models so that you get a high resolution optimized image in your media library with no watermarks.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Image Actions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("For each image result for a generation, you can perform some actions on the image. You can share the image on social media, generate a set of variations, perform a face repair, or enter touchup mode.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've found an image you like, you can click the Generate Variations button to generate a set of images with similar styles and layout to give you more options to choose from. This will take into account any modifications you've made to the prompt, while still roughly following the original image. Creating variations uses one credit just like a normal generation.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("If you've generated an image of a person and the face looks slightly deformed or unrealistic, you can click the Face Repair button to try and repair any issues with the face. This processes the image on our servers with AI-based facial restoration to restore facial details and enhance colors with a good balance of realness and fidelity. It can't fix every problem with a face, but it can help with some common issues. This tool is most effective for photographic or realistic art; if you try to use it on more abstract artistic faces results may be strange. Face repairs are not stored in your prompt history so that you can easily undo, and do not use any credits.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('The Touchup button (or "Inpainting") allows you to customize and make modifications to the image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, and duplicate objects. You can also use it to add new objects to the image, such as a new background or foreground. Using touchup can be a bit tricky, so be sure to read the tips popup inside of the image editor so you can make good use of your credits.',"imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Prompt History","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Imajinn saves your prompt history to your site so that you can easily access previous prompts and their results later. Currently the editor will show the last 20 generated prompts and their image results. To jump back in time simply click the Load button next to an item. You can then edit, save, adjust the prompt, styles, or any other action you can normally do after generating a set of images.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Credits","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you first signup for Imajinn AI, you get a chunk of free credits. You can use these credits to generate images and get a feel for how the plugin functions and learn how to write effective prompts. If you run out, you can purchase more credits from the Imajinn AI website via our plans.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Each prompt generation uses one credit, and creates four images that you can choose to save and/or insert into your content. There is no limit to the number of images you can save.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Filters and Restrictions","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("To ensure that the images generated are appropriate for all audiences, we have a set of filters and restrictions that are applied to prompts and the image outputs. We block the use of specific words and phrases in prompts, and we scan all generations with an AI moderation filter to block images that appear to contain nudity, or other inappropriate content.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Depending on your prompt construction, it can be a fairly common occurrence for it to detect a potentially inappropriate image. If this happens, you will see a warning message. You can either change your prompt, or try generating again. We currently don't charge credits for images that are blocked by the filter, but may need to change this policy in the future. We monitor prompt violations and if we find that you are purposely using inappropriate prompts and attempting to bypass our restrictions, we may disable your account.","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}function f(e){let{isMobile:n,...a}=e;const[o,s]=(0,t.useState)(!1),l=()=>s(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>s(!0),icon:h,label:n&&(0,i.__)("Tips","imajinn-ai")},!n&&(0,i.__)("Tips","imajinn-ai")),o&&(0,t.createElement)(r.Modal,u({},a,{onRequestClose:l,style:{maxWidth:"900px"},icon:(0,t.createElement)(r.Icon,{icon:h}),title:(0,i.__)("Touchup (Inpainting) Instructions","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("The Touchup feature allows you to customize and make modifications to an image in a more precise way. It allows you to remove or replace parts of the image with new content generated from your prompt. This is useful for removing unwanted objects like watermarks, signatures, or duplicates. Or you can also use it to add new objects to the image, such as a new object or background. Touchup allows you to create the exact image you want by choosing where each element in the image goes. You can create the complex image you have in mind, even if it is too specific to get right with one initial prompt.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Touchup works by choosing an image as an input, masking an area with the brush that you want to modify, then adjusting your prompt to describe what you want in that area. However, this can be quite difficult to work with if you don’t use it right, because sometimes you select an area and put in the prompt, but the image doesn't change. So, here are some tips to help you get the best results from Touchup.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Best Practices","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Prompt Modification","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("The most important thing to keep in mind is whether you should describe the entire image you want or only what you want to add. For example, let’s say you want to change an image of an empty shoreline to add a boat floating on the water. You select an area where you want the boat to go, and your prompt in most cases shouldn’t be “a boat”. Instead it should be “Shoreline with a boat floating on the water”. This is because Imajinn needs to know what the context of the entire image should look like, and then it will fill in the area you selected with the boat. If you just say “a boat”, you are more likely to just get an erased area.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('There are some cases when you do want to describe only the thing you want to add instead of the final result. For example, if you are trying to simply erase parts of the image, it may work better to describe "a gray background", or whatever it should be replaced with. Also if you are building an image step-by-step and there are a lot of different subjects, focus your prompt on the section you are painting and generalize the rest of the image as detailed below.',"imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When modifying the prompt, there is no need to get too poetic or descriptive because most of the image and its styles are already still there and taken into account, unless you paint out a very large portion of the image. Also if Prompt Genie or our style selectors were used initially, the styles will already be applied to your modified prompt. If you entered your own styles and modifiers to the prompt field, it is best to leave them there so they will be applied to the selected area. Be careful not to change or add styles in the modified prompt that will clash with the rest of the image.","imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Step-by-Step Image Building","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('If you are trying to create a complex image with lots of subjects like people, animals, or objects, it can be impossible to do this with just one long prompt. Instead you can use Touchup to add new elements to the image one-by-one. For example, if you are building a landscape, you can use Touchup to add a new tree, mountain, or different characters one at a time. In this case as you add more objects, you should not describe the entire image in your modified prompt, but instead describe the new object you are adding, and summarize or skip the rest. For example, if you were adding a "girl with a dog", you would not put "girl with a dog, boy dancing, other boy with red shirt sitting" as then Imajinn would loose focus on what you want to put in the masked area. Instead summarize the existing objects like "a bunch of children including a girl with a dog".',"imajinn-ai")),(0,t.createElement)("h4",null,(0,i.__)("Other Tips","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("When you are making adjustments to part of an existing object, make sure you mask enough of that object so that Imajinn can make a smooth transition between old and new. For example to add a hat to a person, include the top of their head in the masked area. If you want a person next to a cat to be petting the cat, mask their entire arm and part of the cat where their hand would go before prompting “person petting a cat”.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)("Be careful with shadows and reflections. Be sure to select not just the object but its shadow and reflection so that the replacement will look more realistic.","imajinn-ai")),(0,t.createElement)("p",null,(0,i.__)('Size matters! Try to select larger areas to replace rather than smaller ones, because the smaller the area is, the less likely it is to actually do anything. Also, the contextual size of the new object to the rest of the image is important too. For example, if you try to replace a cat with an elephant, the size does not make sense to Imajinn, so either nothing will happen or you\'ll only get a piece of the elephant. Either stick with similar sized replacements, or make the prompt ask for a "tiny elephant".',"imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:l},(0,i.__)("Close","imajinn-ai"))))}function g(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(!1),[l,h]=(0,t.useState)([]),[d,m]=(0,t.useState)([]),[p,f]=(0,t.useState)(null),g=()=>a(!0),y=()=>a(!1),v=l.map(((n,a)=>(0,t.createElement)(r.PanelBody,{key:a.toString(),opened:!0},(0,t.createElement)(r.PanelRow,null,(0,t.createElement)("span",null,(0,t.createElement)("em",null,e.prompt)," ",n),(0,t.createElement)(r.Button,{variant:"primary",isSmall:!0,disabled:d.some((e=>e.index===a)),className:"genie-generate",onClick:()=>{if(e.clearStyles(),e.prompt)e.setPromptStyle(n),e.startJob(null,null,null,null,n);else{let t=n.split(",")[0];e.setPrompt(t);let i=n.split(",").slice(1).join();e.setPromptStyle(i),e.startJob(null,null,null,t,i)}m((e=>[...e,{index:a}])),y()}},(0,i.__)("Generate","imajinn-ai"))))));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.BaseControl,{label:(0,i.__)("Prompt Genie","imajinn-ai"),id:"imajinn-prompt-genie-button",className:"prompt-genie"},(0,t.createElement)("div",null,(0,t.createElement)((()=>o?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Generating prompt masterpieces...","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:e.isLoading,variant:"secondary",id:"imajinn-prompt-genie-button",label:(0,i.__)("Prompt Genie: AI generated prompt masterpiece","imajinn-ai"),onClick:()=>{e.setError(""),e.prompt===p?g():(async t=>{s(!0);const n=await fetch(`${ajaxurl}?action=imajinn-create-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:t,nonce:IMAJINN.nonce})}),i=await n.json();s(!1),i.success?(h(i.data.prompts),m([]),f(t),g()):(e.setError(i.data[0].message),y())})(e.prompt)},icon:(0,t.createElement)(c.DT,null)},(0,i.__)("Summon","imajinn-ai"))),null))),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:y,style:{maxWidth:"90%"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("AI Generated Prompt Ideas","imajinn-ai")}),(0,t.createElement)(r.Panel,null,v)))}function y(e){const[n,a]=(0,t.useState)(!1),o=()=>a(!1);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>a(!0)},e.buttonLabel||(0,i.__)("License / Restrictions","imajinn-ai")),n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"800px"},icon:(0,t.createElement)(r.Icon,{icon:(0,t.createElement)(r.Icon,{icon:h})}),title:(0,i.__)("License / Usage Restrictions","imajinn-ai")}),(0,t.createElement)("p",null,"CreativeML Open RAIL-M dated August 22, 2022"),(0,t.createElement)("p",null,"Section I: PREAMBLE"),(0,t.createElement)("p",null,"Multimodal generative models are being widely adopted and used, and have the potential to transform the way artists, among other individuals, conceive and benefit from AI or ML technologies as a tool for content creation."),(0,t.createElement)("p",null,"Notwithstanding the current and potential benefits that these artifacts can bring to society at large, there are also concerns about potential misuses of them, either due to their technical limitations or ethical considerations."),(0,t.createElement)("p",null,"In short, this license strives for both the open and responsible downstream use of the accompanying model. When it comes to the open character, we took inspiration from open source permissive licenses regarding the grant of IP rights. Referring to the downstream responsible use, we added use-based restrictions not permitting the use of the Model in very specific scenarios, in order for the licensor to be able to enforce the license in case potential misuses of the Model may occur. At the same time, we strive to promote open and responsible research on generative models for art and content generation."),(0,t.createElement)("p",null,"Even though downstream derivative versions of the model could be released under different licensing terms, the latter will always have to include - at minimum - the same use-based restrictions as the ones in the original license (this license). We believe in the intersection between open and responsible AI development; thus, this License aims to strike a balance between both in order to enable responsible open-science in the field of AI."),(0,t.createElement)("p",null,"This License governs the use of the model (and its derivatives) and is informed by the model card associated with the model."),(0,t.createElement)("p",null,"NOW THEREFORE, You and Licensor agree as follows:"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,t.createElement)("p",null,"Definitions")),(0,t.createElement)("li",null,(0,t.createElement)("p",null,'"License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.')),(0,t.createElement)("li",null,'"Data" means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.'),(0,t.createElement)("li",null,'"Output" means the results of operating a Model as embodied in informational content resulting therefrom.'),(0,t.createElement)("li",null,'"Model" means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.'),(0,t.createElement)("li",null,'"Derivatives of the Model" means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.'),(0,t.createElement)("li",null,'"Complementary Material" means the accompanying source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, etc, if any.'),(0,t.createElement)("li",null,'"Distribution" means any transmission, reproduction, publication or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means - e.g. API-based or web access.'),(0,t.createElement)("li",null,'"Licensor" means the copyright owner or entity authorized by the copyright owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.'),(0,t.createElement)("li",null,'"You" (or "Your") means an individual or Legal Entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application - e.g. chatbot, translator, image generator.'),(0,t.createElement)("li",null,'"Third Parties" means individuals or legal entities that are not under common control with Licensor or You.'),(0,t.createElement)("li",null,'"Contribution" means any work of authorship, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."'),(0,t.createElement)("li",null,'"Contributor" means Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.')),(0,t.createElement)("p",null,"Section II: INTELLECTUAL PROPERTY RIGHTS"),(0,t.createElement)("p",null,"Both copyright and patent grants apply to the Model, Derivatives of the Model and Complementary Material. The Model and Derivatives of the Model are subject to additional terms as described in Section III."),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Complementary Material, the Model, and Derivatives of the Model."),(0,t.createElement)("li",null,"Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and the Complementary Material, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model and/or Complementary Material or a Contribution incorporated within the Model and/or Complementary Material constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Work shall terminate as of the date such litigation is asserted or filed.")),(0,t.createElement)("p",null,"Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Distribution and Redistribution. You may host for Third Party remote access purposes (e.g. software-as-a-service), reproduce and distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the following conditions: Use-based restrictions as referenced in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (e.g. a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model or Derivatives of the Model are subject to paragraph 5. This provision does not apply to the use of Complementary Material. You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License; You must cause any modified files to carry prominent notices stating that You changed the files; You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model, Derivatives of the Model. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions - respecting paragraph 4.a. - for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License."),(0,t.createElement)("li",null,"Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Therefore You cannot use the Model and the Derivatives of the Model for the specified restricted uses. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, finetuning, updating, running, training, evaluating and/or reparametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph (paragraph 5)."),(0,t.createElement)("li",null,"The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are accountable for the Output you generate and its subsequent uses. No use of the output can contravene any provision as stated in the License.")),(0,t.createElement)("p",null,"Section IV: OTHER PROVISIONS"),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,"Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License, update the Model through electronic means, or modify the Output of the Model based on updates. You shall undertake reasonable efforts to use the latest version of the Model."),(0,t.createElement)("li",null,"Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors."),(0,t.createElement)("li",null,'Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model and the Complementary Material (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model, Derivatives of the Model, and the Complementary Material and assume any risks associated with Your exercise of permissions under this License.'),(0,t.createElement)("li",null,"Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model and the Complementary Material (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages."),(0,t.createElement)("li",null,"Accepting Warranty or Additional Liability. While redistributing the Model, Derivatives of the Model and the Complementary Material thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability."),(0,t.createElement)("li",null,"If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.")),(0,t.createElement)("p",null,"END OF TERMS AND CONDITIONS"),(0,t.createElement)("p",null,"Attachment A"),(0,t.createElement)("p",null,"Use Restrictions"),(0,t.createElement)("p",null,"You agree not to use the Model or Derivatives of the Model:"),(0,t.createElement)("ul",null,(0,t.createElement)("li",null,"In any way that violates any applicable national, federal, state, local or international law or regulation;"),(0,t.createElement)("li",null,"For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;"),(0,t.createElement)("li",null,"To generate or disseminate verifiably false information and/or content with the purpose of harming others;"),(0,t.createElement)("li",null,"To generate or disseminate personal identifiable information that can be used to harm an individual;"),(0,t.createElement)("li",null,"To defame, disparage or otherwise harass others;"),(0,t.createElement)("li",null,"For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;"),(0,t.createElement)("li",null,"To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;"),(0,t.createElement)("li",null,"For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;"),(0,t.createElement)("li",null,"To provide medical advice and medical results interpretation;"),(0,t.createElement)("li",null,"To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","imajinn-ai"))))}var v=n.p+"images/imajinn-demo.6ce7fccc.jpg";function w(e){const[n,a]=(0,t.useState)(!1),[o,s]=(0,t.useState)(null),[l,c]=(0,t.useState)(null),[u,h]=(0,t.useState)(IMAJINN.email),[d,m]=(0,t.useState)(""),[p,f]=(0,t.useState)(!1),[g,w]=(0,t.useState)(!1);if(e.isConnected)return null;const b=e=>e.target.select();return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("img",{src:v,alt:(0,i.__)("Example images generated by Imajinn AI","imajinn-ai"),style:{width:"100%"}}),(0,t.createElement)("p",null,(0,i.__)("We hope you are excited to turn your imagination into creative media for your WordPress site. To get started please create a free account or login with your existing Infinite Uploads/Imajinn credentials and we'll connect your site to our cloud.","imajinn-ai")),(0,t.createElement)((()=>o?(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,o,"incorrect_password"===l&&(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/wp-login.php?action=lostpassword",target:"_blank"},(0,i.__)("Reset Password","imajinn-ai")))):null),null),(0,t.createElement)(r.__experimentalHeading,{as:"label"},(0,i.__)("Register / Login","imajinn-ai")),(0,t.createElement)(r.Flex,{align:"bottom",wrap:"true",className:"connect-wrapper"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.TextControl,{label:(0,i.__)("Email","imajinn-ai"),type:"email",value:u,onFocus:b,onChange:e=>h(e),help:(0,i.__)("You'll need a valid email to enable your credits.","imajinn-ai")}),(0,t.createElement)(r.TextControl,{label:(0,i.__)("Password","imajinn-ai"),type:"password",autoComplete:"off",value:d,onFocus:b,onChange:e=>m(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("I agree to the Terms of Service and Usage Restrictions:","imajinn-ai"),checked:g,value:"1",onChange:e=>w(e)}),(0,t.createElement)("div",{className:"license-links"},(0,t.createElement)(y,{buttonLabel:(0,i.__)("Usage Restrictions","imajinn-ai")}),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/terms-of-service/",target:"_blank"},(0,i.__)("Terms of Service","imajinn-ai")),(0,t.createElement)(r.ExternalLink,{href:"https://infiniteuploads.com/privacy/",target:"_blank"},(0,i.__)("Privacy Policy","imajinn-ai"))),(0,t.createElement)(r.CheckboxControl,{label:(0,i.__)("Notify me about usage tips & new features (unsubscribe anytime)","imajinn-ai"),checked:p,value:"1",onChange:e=>f(e)})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)((()=>n?(0,t.createElement)(r.Button,{className:"connect-button",disabled:!0},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{className:"connect-button",variant:"primary",disabled:n,onClick:()=>{a(!0),s(null),fetch(`${ajaxurl}?action=imajinn-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,password:d,signup_tos:g,signup_newsletter:p,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((t=>{console.log(t),t.success?(e.setIsConnected(!0),IMAJINN.connected=!0,e.setCredits(t.data.remaining_credits)):(a(!1),c(t.data[0].code),s(t.data[0].message))})).catch((e=>{a(!1),s(e)}))}},(0,i.__)("Connect","imajinn-ai"))),null))))}var b={styles:[{id:"painting, digital art, trending on artstation",name:(0,i.__)("Painting","imajinn-ai"),children:[{id:"digital art, trending on artstation, hd",name:(0,i.__)("Digital Art","imajinn-ai")},{id:"oil painting, award winning",name:(0,i.__)("Oil Painting","imajinn-ai")},{id:"watercolor painting",name:(0,i.__)("Watercolor","imajinn-ai")},{id:"acrylic painting, award winning art, trending",name:(0,i.__)("Acrylic","imajinn-ai")},{id:"airbrush art",name:(0,i.__)("Airbrushed","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")}]},{id:"artistic drawing, trending on artstation",name:(0,i.__)("Drawing","imajinn-ai"),children:[{id:"illustration, trending on artstation",name:(0,i.__)("Illustration","imajinn-ai")},{id:"cyberpunk, trending on artstation",name:(0,i.__)("Cyberpunk","imajinn-ai")},{id:"pencil sketch, drawing, trending on artstation",name:(0,i.__)("Pencil","imajinn-ai")},{id:"drawn in blue biro pen, artistic drawing, trending on artstation",name:(0,i.__)("Pen","imajinn-ai")},{id:"Ink dripping drawing, trending on artstation",name:(0,i.__)("Ink","imajinn-ai")},{id:"caligraphy",name:(0,i.__)("Caligraphy","imajinn-ai")},{id:"charcoal shaded, artistic drawing, trending on artstation",name:(0,i.__)("Charcoal","imajinn-ai")},{id:"cartoon",name:(0,i.__)("Cartoon","imajinn-ai")},{id:"comic, comic book",name:(0,i.__)("Comic Book","imajinn-ai")},{id:"schematic blueprint",name:(0,i.__)("Blueprint","imajinn-ai")},{id:"technical sketch",name:(0,i.__)("Technical Sketch","imajinn-ai")},{id:"made up of ink dots, artistic drawing, trending on artstation",name:(0,i.__)("Ink Dot","imajinn-ai")},{id:"line art",name:(0,i.__)("Line Art","imajinn-ai")},{id:"crayon drawing",name:(0,i.__)("Crayon","imajinn-ai")},{id:"pastel drawing, artistic",name:(0,i.__)("Pastel","imajinn-ai")},{id:"chalkboard drawing",name:(0,i.__)("Chalkboard","imajinn-ai")}]},{id:"animation",name:(0,i.__)("Animation","imajinn-ai"),children:[{id:"vintage disney animation",name:(0,i.__)("Vintage Disney","imajinn-ai")},{id:"Rendered by octane, disney animation studios",name:(0,i.__)("Disney Animation","imajinn-ai")},{id:"simpsons style animation",name:(0,i.__)("Simpsons","imajinn-ai")},{id:"anime style, Studio Ghibli, manga, trending on artstation",name:(0,i.__)("Anime","imajinn-ai")},{id:"disney pixar style animation, octane render",name:(0,i.__)("Pixar","imajinn-ai")}]},{id:"unreal engine, 3d render, Rendered by octane",name:(0,i.__)("Screen","imajinn-ai"),children:[{id:"Unreal Engine, Cinema 4D",name:(0,i.__)("Video Game HD","imajinn-ai")},{id:"animal crossing, mario, nintendo, pokemon",name:(0,i.__)("Nintendo","imajinn-ai")},{id:"3D render, composite",name:(0,i.__)("3D Render","imajinn-ai")},{id:"8bit graphics",name:(0,i.__)("8bit","imajinn-ai")},{id:"emoji",name:(0,i.__)("Emoji","imajinn-ai")},{id:"low poly ps1 graphics",name:(0,i.__)("Low Poly","imajinn-ai")},{id:"pixel art",name:(0,i.__)("Pixel Art","imajinn-ai")},{id:"ASCII art",name:(0,i.__)("ASCII","imajinn-ai")}]},{id:"photograph of, photo, 50mm portrait photograph",name:(0,i.__)("Photography (avoid people)","imajinn-ai"),children:[{id:"realistic photo of, award winning photograph, 50mm",name:(0,i.__)("Realistic","imajinn-ai")},{id:"Portrait photograph, symmetrical, award winning, bokeh, dof, Annie Leibovitz",name:(0,i.__)("Portrait","imajinn-ai")},{id:"polaroid photograph, polaroid frame",name:(0,i.__)("Polaroid","imajinn-ai")},{id:"war photograph, WWI photograph, WWII photograph",name:(0,i.__)("War","imajinn-ai")},{id:"Wildlife Photograph, national geographic photo, zoom, telephoto",name:(0,i.__)("Wildlife","imajinn-ai")},{id:"Photojournalism, award winning, photo of, magazine photograph",name:(0,i.__)("Photojournalism","imajinn-ai")},{id:"macro photograph, close up, zoom, depth of field",name:(0,i.__)("Macro","imajinn-ai")},{id:"long exposure, photograph, realistic",name:(0,i.__)("Long Exposure","imajinn-ai")},{id:"photograph, fish eye lense, wide-angle",name:(0,i.__)("Fish Eye","imajinn-ai")}]},{id:"realistic",name:(0,i.__)("Real Life Materials","imajinn-ai"),children:[{children:[{id:"marble statue",name:(0,i.__)("Marble","imajinn-ai")},{id:"stone statue",name:(0,i.__)("stone","imajinn-ai")},{id:"statue carved from wax",name:(0,i.__)("Wax","imajinn-ai")}],id:"statue",name:(0,i.__)("Statue","imajinn-ai")},{id:"origami paper folding",name:(0,i.__)("Origami","imajinn-ai")},{id:"paper mache art",name:(0,i.__)("Paper Mache","imajinn-ai")},{id:"paper cutout art",name:(0,i.__)("Paper Cutout","imajinn-ai")},{id:"graffiti street art",name:(0,i.__)("Graffiti","imajinn-ai")},{id:"halftone print",name:(0,i.__)("Halftone","imajinn-ai")},{id:"cross stitch art",name:(0,i.__)("Cross Stitch","imajinn-ai")},{id:"stained glass",name:(0,i.__)("Stained Glass","imajinn-ai")},{id:"made of crystals",name:(0,i.__)("Crystal","imajinn-ai")},{id:"made of flowers",name:(0,i.__)("Flowery","imajinn-ai")}]}],artists:[{value:"",label:""},{value:"by Albert Bierstadt",label:(0,i.__)("Albert Bierstadt","imajinn-ai")},{value:"by Andy Warhol",label:(0,i.__)("Andy Warhol","imajinn-ai")},{value:"by Asaf Hanuka",label:(0,i.__)("Asaf Hanuka","imajinn-ai")},{value:"by Aubrey Beardsley",label:(0,i.__)("Aubrey Beardsley","imajinn-ai")},{value:"by Claude Monet",label:(0,i.__)("Claude Monet","imajinn-ai")},{value:"by Diego Rivera",label:(0,i.__)("Diego Rivera","imajinn-ai")},{value:"by Frida Kahlo",label:(0,i.__)("Frida Kahlo","imajinn-ai")},{value:"by Greg Rutkowski",label:(0,i.__)("Greg Rutkowski","imajinn-ai")},{value:"by Hayao Miyazaki",label:(0,i.__)("Hayao Miyazaki","imajinn-ai")},{value:"by Hieronymus Bosch",label:(0,i.__)("Hieronymus Bosch","imajinn-ai")},{value:"by Jackson Pollock",label:(0,i.__)("Jackson Pollock","imajinn-ai")},{value:"by Leonardo da Vinci",label:(0,i.__)("Leonardo da Vinci","imajinn-ai")},{value:"by Michelangelo",label:(0,i.__)("Michelangelo","imajinn-ai")},{value:"by Pablo Picasso",label:(0,i.__)("Pablo Picasso","imajinn-ai")},{value:"by Salvador Dali",label:(0,i.__)("Salvador Dali","imajinn-ai")},{value:"by artgerm, art germ",label:(0,i.__)("Stanley Artgerm","imajinn-ai")},{value:"by Thomas Kinkade",label:(0,i.__)("Thomas Kinkade","imajinn-ai")},{value:"by Vincent van Gogh",label:(0,i.__)("Vincent van Gogh","imajinn-ai")}],modifiers:[{value:"",label:""},{value:"in the style of steampunk",label:(0,i.__)("Steampunk","imajinn-ai")},{value:"synthwave",label:(0,i.__)("Synthwave","imajinn-ai")},{value:"in the style of cyberpunk",label:(0,i.__)("Cyberpunk","imajinn-ai")},{value:"insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Detailed & Intricate","imajinn-ai")},{value:"in a symbolic and meaningful style, insanely detailed and intricate, hypermaximalist, elegant, ornate, hyper realistic, super detailed",label:(0,i.__)("Symbolic & Meaningful","imajinn-ai")},{value:"Cinematic Lighting",label:(0,i.__)("Cinematic Lighting","imajinn-ai")},{value:"Contre-Jour",label:(0,i.__)("Contre-Jour","imajinn-ai")},{value:"futuristic",label:(0,i.__)("Futuristic","imajinn-ai")},{value:"black and white",label:(0,i.__)("Black & White","imajinn-ai")},{value:"technicolor",label:(0,i.__)("Technicolor","imajinn-ai")},{value:"warm color palette",label:(0,i.__)("Warm","imajinn-ai")},{value:"neon",label:(0,i.__)("Neon","imajinn-ai")},{value:"colorful",label:(0,i.__)("Colorful","imajinn-ai")}]},_=e=>{let{image:n,setImage:i,generations:a}=e;return(0,t.createElement)(t.Fragment,null,null!==n&&(0,t.createElement)(r.Modal,{__experimentalHideHeader:!0,onRequestClose:()=>i(null),className:"imajinn-preview-modal",onKeyDown:e=>{const t=a.length-1;"ArrowRight"===e.key?i(n<t?n+1:0):"ArrowLeft"===e.key&&i(n>0?n-1:t)}},(0,t.createElement)("img",{style:{width:"100%"},src:a[n].preview,onClick:()=>i(null)})))},E=e=>{let{history:n,setPrompt:o,setPromptStyle:s,setGenerations:l,setRatio:c,clearStyles:u,setQueryRatio:h,setSaved:d,setFaceFixed:m}=e;return n.length<=0?null:(0,t.createElement)(a.InspectorControls,{key:"setting"},(0,t.createElement)(r.Panel,{header:(0,i.__)("Generation History","imajinn-ai"),className:"imajinn-history"},n.map(((e,n)=>(0,t.createElement)(r.PanelBody,{key:n},(0,t.createElement)("h2",{className:"components-panel__body-title"},e.generations.map(((e,n)=>(0,t.createElement)("img",{key:n,src:e.thumbnail,alt:sprintf((0,i.__)("Result %d","imajinn-ai"),(n+1).toString())}))),(0,t.createElement)(r.Button,{variant:"secondary",label:(0,i.__)("Load prompt results","imajinn-ai"),onClick:()=>{u(),o(e.prompt),s(e.prompt_style),l(e.generations),c(e.ratio),h(e.ratio),d([]),m([])}},(0,i.__)("Load","imajinn-ai"))),(0,t.createElement)(r.PanelRow,null,(0,t.createElement)(r.__experimentalText,{numberOfLines:2,truncate:!0},e.prompt)))))))},x=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),j=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})),M=e=>{let{ratio:n,isLoading:a,setRatio:o}=e;const s={"1:1":(0,i.__)("Square","imajinn-ai"),"3:2":(0,i.__)("Wide","imajinn-ai"),"2:3":(0,i.__)("Tall","imajinn-ai")}[n]+" images"+("1:1"!==n?" - "+(0,i.__)("slower to generate","imajinn-ai"):"");return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-ratio",label:(0,i.__)("Select an image ratio to generate.","imajinn-ai"),defaultChecked:"1:1",disabled:a,onChange:o,checked:n},(0,t.createElement)(r.__experimentalRadio,{value:"1:1",icon:x},"1:1"),(0,t.createElement)(r.__experimentalRadio,{value:"3:2",icon:j},"3:2"),(0,t.createElement)(r.__experimentalRadio,{className:"ratio-3-2",value:"2:3",icon:j},"2:3")),(0,t.createElement)("br",null),(0,t.createElement)(r.__experimentalText,null,s))},S=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})),k=function(e){const[n,a]=(0,t.useState)(e.showUpgrade),o=()=>{a(!1),e.setShowUpgrade(!1)};return(0,t.useEffect)((()=>{a(e.showUpgrade)}),[a,e]),(0,t.createElement)(t.Fragment,null,n&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:o,style:{maxWidth:"400px"},icon:S,title:(0,i.__)("Upgrade Plan","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Sorry, you are out of available image generation credits. You can get more credits by upgrading your account to one of our premium plans.","imajinn-ai")),(0,t.createElement)("div",{className:"imajinn-upgrade-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",href:IMAJINN.checkout_url,target:"_blank"},(0,i.__)("Get More Credits","imajinn-ai")),(0,t.createElement)(r.Button,{variant:"secondary",onClick:o},(0,i._x)("Cancel","Don't upgrade now","imajinn-ai")))))},C=window.React,I=n.n(C),D=e=>{let{isConnected:n,credits:o,refreshInfo:s,visitAccount:l}=e;const[c,u]=(0,C.useState)(!1),[h,d]=(0,C.useState)("refreshing-button");return(0,C.useEffect)((()=>{d(c?"refreshing-button is-refreshing":"refreshing-button")}),[c]),(0,t.createElement)(a.BlockControls,null,(0,t.createElement)(r.Toolbar,{label:(0,i.__)("Imajinn AI","imajinn-ai"),className:"imajinn-toolbar"},(0,t.createElement)(r.ToolbarGroup,null,n&&!1!==o&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"credit-label"},(0,i.__)("Credits:","imajinn-ai")),(0,t.createElement)("div",{className:"credits"},o),(0,t.createElement)(r.ToolbarButton,{className:h,disabled:c,icon:(0,t.createElement)(r.Dashicon,{icon:"update"}),label:(0,i.__)("Refresh count","imajinn-ai"),onClick:async()=>{u(!0),await s(),u(!1)}})),(0,t.createElement)(r.ToolbarButton,{onClick:l,icon:(0,t.createElement)(r.Dashicon,{icon:"admin-users"}),label:(0,i.__)("Account / Upgrade","imajinn-ai")}),(0,t.createElement)(p,null))))};const A=e=>{let{setImageStyle:n,isLoading:a,imageStyle:o,optionData:s}=e;return(0,t.createElement)(r.TreeSelect,{disabled:a,label:(0,i.__)("Select an image style","imajinn-ai"),noOptionLabel:" ",selectedId:o,onChange:e=>{n(e)},__next36pxDefaultSize:!0,tree:s.styles})},T=e=>{let{setImageArtist:n,isLoading:a,imageArtist:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select an Artist style","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.artists})},L=e=>{let{setImageModifier:n,isLoading:a,imageModifier:o,optionData:s}=e;return(0,t.createElement)(r.SelectControl,{__next36pxDefaultSize:!0,allowReset:!0,disabled:a,label:(0,i.__)("Select a style modifier","imajinn-ai"),value:o,onChange:e=>{n(e)},options:s.modifiers})};var P=e=>{let{hasError:n}=e;return(0,t.createElement)(r.Notice,{status:"warning"},(0,t.createElement)(r.__experimentalText,null,n))},N=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),O=e=>{let{saved:n,saveImage:a,...o}=e;const[s,l]=(0,C.useState)(!1);return IMAJINN.custom_editor?null:s?(0,t.createElement)(r.Button,{disabled:!0,className:"imajinn-image-insert",label:(0,i.__)("Inserting","imajinn-ai")},(0,t.createElement)(r.Spinner,null)):(0,t.createElement)(r.Button,{variant:"primary",className:"imajinn-image-insert",disabled:s,icon:N,onClick:async()=>{l(!0),await(async e=>{let t=!1;if(t=n.some((t=>t.index===e))?n.find((t=>t.index===e)).data:await a(e),t){const e=wp.data.select("core/block-editor").getBlocks().map((function(e){return"infinite-uploads/imajinn-ai"===e.name})).indexOf(!0),n=wp.blocks.createBlock("core/image",{id:t.attachment_id,url:t.url,width:t.width,height:t.height,sizeSlug:t.size,alt:o.prompt+" "+o.promptStyle,title:o.prompt,caption:o.prompt});return wp.data.dispatch("core/block-editor").insertBlocks(n,e),!0}return!1})(o.genindex)||l(!1)}},(0,i.__)("Insert","imajinn-ai"))},R=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),z=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),B=e=>{const[n,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{e.saved.some((t=>t.index===e.genindex))?(s(!0),a(!1)):(s(!1),a(!1))}),[e.saved]),o?(0,t.createElement)(r.Button,{disabled:!0,icon:R,label:(0,i.__)("Saved","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saved","imajinn-ai"):""):n?(0,t.createElement)(r.Button,{disabled:!0,style:IMAJINN.custom_editor?{}:{maxWidth:"36px"},icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Saving","imajinn-ai")},IMAJINN.custom_editor?(0,i.__)("Saving","imajinn-ai"):""):(0,t.createElement)(r.Button,{variant:IMAJINN.custom_editor?"primary":"secondary",disabled:n,icon:z,label:(0,i.__)("Save to Media Library","imajinn-ai"),onClick:async()=>{a(!0),await e.saveImage(e.genindex)||a(!1)}},IMAJINN.custom_editor?(0,i.__)("Save","imajinn-ai"):"")},W=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Y=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),F=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),V=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),G=n(227),H=n(301),U=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var a=i[n];e.call(t,a[1],a[0])}},t}()}(),J="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,q=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Z="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(q):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},X=["top","right","bottom","left","width","height","size","weight"],Q="undefined"!=typeof MutationObserver,$=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,a=0;function r(){n&&(n=!1,e()),i&&s()}function o(){Z(r)}function s(){var e=Date.now();if(n){if(e-a<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){J&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Q?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){J&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;X.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),K=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var a=i[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ee=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||q},te=oe(0,0,0,0);function ne(e){return parseFloat(e)||0}function ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+ne(e["border-"+n+"-width"])}),0)}var ae="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof ee(e).SVGGraphicsElement}:function(e){return e instanceof ee(e).SVGElement&&"function"==typeof e.getBBox};function re(e){return J?ae(e)?function(e){var t=e.getBBox();return oe(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return te;var i=ee(e).getComputedStyle(e),a=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var a=i[n],r=e["padding-"+a];t[a]=ne(r)}return t}(i),r=a.left+a.right,o=a.top+a.bottom,s=ne(i.width),l=ne(i.height);if("border-box"===i.boxSizing&&(Math.round(s+r)!==t&&(s-=ie(i,"left","right")+r),Math.round(l+o)!==n&&(l-=ie(i,"top","bottom")+o)),!function(e){return e===ee(e).document.documentElement}(e)){var c=Math.round(s+r)-t,u=Math.round(l+o)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return oe(a.left,a.top,s,l)}(e):te}function oe(e,t,n,i){return{x:e,y:t,width:n,height:i}}var se=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=re(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),le=function(e,t){var n,i,a,r,o,s,l,c=(i=(n=t).x,a=n.y,r=n.width,o=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),K(l,{x:i,y:a,width:r,height:o,top:a,right:i+r,bottom:o+a,left:i}),l);K(this,{target:e,contentRect:c})},ce=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new U,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new se(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof ee(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new le(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ue="undefined"!=typeof WeakMap?new WeakMap:new U,he=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=$.getInstance(),i=new ce(t,n,this);ue.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){he.prototype[e]=function(){var t;return(t=ue.get(this))[e].apply(t,arguments)}}));var de=void 0!==q.ResizeObserver?q.ResizeObserver:he;function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},me.apply(this,arguments)}function pe(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),ye=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:ge,viewMax:ge}),ve=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),we=function(){function e(e){var t=this,n=e.scaleExtents,i=e.documentSize;fe(this,"_scaleExtents",void 0),fe(this,"_documentSize",void 0),fe(this,"_canvas",null),fe(this,"_view",{scale:1,x:0,y:0}),fe(this,"_viewChangeListeners",new Set),fe(this,"setScale",(function(e){t.setView({scale:e})})),fe(this,"clampView",(function(e){var n=e.scale,i=e.x,a=e.y,r=t.scaleExtents,o=r.min,s=r.max,l=t.documentSize,c=l.width,u=l.height,h=t.canvasRect||ye,d=h.left,m=h.top,p=h.right-d,f=h.bottom-m,g=p/2,y=-(c*t._view.scale-p/2),v=f/2,w=-(u*t._view.scale-f/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(i,y),g),y:Math.min(Math.max(a,w),v)}})),fe(this,"resetView",(function(){t.setView({scale:1,x:0,y:0})})),fe(this,"setView",(function(e){var n=t.clampView(me({},t._view,e||{})),i=t._view,a=i.scale,r=i.x,o=i.y;return n.scale===a&&n.x===r&&n.y===o||(t._view=n,t._viewChangeListeners.forEach((function(e){return e&&e(n)}))),me({},t._view)})),fe(this,"scaleAtClientPoint",(function(e,n){var i=t.clientPointToViewPoint(n),a=t.clampView(me({},t._view,{scale:t._view.scale+e})),r=t.viewPointToClientPoint(i,a);return a.x=t._view.x-(r.clientX-n.clientX),a.y=t._view.y-(r.clientY-n.clientY),t.setView(a)})),fe(this,"clientPointToViewPoint",(function(e,n){var i=e.clientX,a=e.clientY;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=i-r.left,s=a-r.top;return{x:(o-n.x)/n.scale,y:(s-n.y)/n.scale,relativeClientX:o,relativeClientY:s}})),fe(this,"viewPointToClientPoint",(function(e,n){var i=e.x,a=e.y;void 0===n&&(n=t._view);var r=t.canvasRect||ye,o=r.left,s=r.top,l=i*n.scale+n.x,c=a*n.scale+n.y,u=l+o,h=c+s;return{clientX:u,clientY:h,relativeX:l,relativeY:c,x:u,y:h}})),fe(this,"attachViewChangeListener",(function(e){t._viewChangeListeners.add(e)})),this._scaleExtents=n,this._documentSize=i}var t,n;return t=e,(n=[{key:"canvas",get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:"scale",get:function(){return this._view.scale}},{key:"x",get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:"y",get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:"view",get:function(){return me({},this._view)}},{key:"scaleExtents",get:function(){return me({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:"documentSize",get:function(){return me({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:"transformMatrix",get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:"canvasBounds",get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,i=e.right,a=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:i,clientY:a}),left:t,top:n,right:i,bottom:a,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}}},{key:"canvasRect",get:function(){return this.canvas?this.canvas.getBoundingClientRect():void 0}}])&&pe(t.prototype,n),e}();function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=function(e){e.preventDefault()},Ee=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){var i=n.props,a=i.disabled,r=i.enablePanAndZoom,o=i.mouseZoomFactor;return a?new xe:(r&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Ae(t))),e)})),be(this,"handleDrawStart",(function(e,t){return t.props.disabled?new xe:e.ctrlKey&&t.props.enablePanAndZoom?(new je).handleDrawStart(e,t):(new Me).handleDrawStart(e,t)})),be(this,"handleDrawMove",(function(t,n){if(n.props.disabled)return new xe;var i=Te(n.coordSystem,t),a=i.x,r=i.y;return n.lazy.update({x:a,y:r}),e})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?new xe:e}))},xe=function(){var e=this;be(this,"handleMouseWheel",(function(t,n){return n.props.disabled?e:(new Ee).handleMouseWheel(t,n)})),be(this,"handleDrawStart",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawMove(t,n)})),be(this,"handleDrawEnd",(function(t,n){return n.props.disabled?e:(new Ee).handleDrawEnd(t,n)}))},je=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),e.dragStart=Ae(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Ae(t),a=i.clientX,r=i.clientY,o=a-e.dragStart.clientX,s=r-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e})),be(this,"handleDrawEnd",(function(){return new Ee}))},Me=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){var i=n.props.enablePanAndZoom;return t.preventDefault(),t.touches&&t.touches.length&&i?i&&t.touches&&t.touches.length>=2?(new Se).handleDrawStart(t,n):e.handleDrawMove(t,n):(new Ie).handleDrawStart(t,n)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return(new Se).handleDrawStart(t,n);var i=Ae(t);return e.deferredPoints.push(i),(new Date).valueOf()-e.startTimestamp<250&&(null===e.startClientPoint&&(e.startClientPoint=i),Math.abs(i.clientX-e.startClientPoint.clientX)+Math.abs(i.clientY-e.startClientPoint.clientY)<10)?e:e.issueDeferredPoints(n)})),be(this,"handleDrawEnd",(function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)})),be(this,"issueDeferredPoints",(function(t){for(var n=new Ie,i=0;i<e.deferredPoints.length;i++){var a=e.deferredPoints[i],r=new De(a);n=(0===i?n.handleDrawStart:n.handleDrawMove)(r,t)}return n})),this.startClientPoint=null,this.startTimestamp=(new Date).valueOf(),this.deferredPoints=[]},Se=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Ee:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)})),be(this,"handleDrawMove",(function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Ee;var i=e.recentMetrics=e.getTouchMetrics(t),a=i.centroid,r=i.distance;if(Math.abs(r-e.start.distance)>=10)return new Ce(e).handleDrawMove(t,n);var o=a.clientX-e.start.centroid.clientX,s=a.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=10?new ke(e).handleDrawMove(t,n):e})),be(this,"handleDrawEnd",(function(){return new Ee})),be(this,"getTouchMetrics",(function(e){var t=Ae(e.touches[0]),n=t.clientX,i=t.clientY,a=Ae(e.touches[1]),r=a.clientX,o=a.clientY,s=r-n,l=o-i;return{t1:{clientX:n,clientY:i},t2:{clientX:r,clientY:o},distance:Math.sqrt(s*s+l*l),centroid:{clientX:(n+r)/2,clientY:(i+o)/2}}}))},ke=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=(a.distance,r.clientX-i.start.centroid.clientX),s=r.clientY-i.start.centroid.clientY;return n.setView({x:i.panStart.x+o,y:i.panStart.y+s}),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ce=function(e){var t=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(){return t})),be(this,"handleDrawMove",(function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Ee;var i=t.scaleOrPanState,a=i.recentMetrics=i.getTouchMetrics(e),r=a.centroid,o=a.distance,s=i.scaleStart*(o/i.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,r),t})),be(this,"handleDrawEnd",(function(){return new Ee})),this.scaleOrPanState=e},Ie=function(){var e=this;be(this,"handleMouseWheel",_e.bind(this)),be(this,"handleDrawStart",(function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r},{both:!0})}return e.handleDrawMove(t,n)})),be(this,"handleDrawMove",(function(t,n){t.preventDefault();var i=Te(n.coordSystem,t),a=i.x,r=i.y;n.lazy.update({x:a,y:r});var o=!n.lazy.isEnabled();return e.isDrawing&&!o||(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e})),be(this,"handleDrawEnd",(function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Ee})),this.isDrawing=!1},De=function(e){var t=e.clientX,n=e.clientY;be(this,"preventDefault",(function(){})),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Ae(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Te(e,t){return e.clientPointToViewPoint(Ae(t))}var Le=!1;try{var Pe={get passive(){return Le=!0,!1}};window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(e){Le=!1}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Oe.apply(this,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var We={display:"block",position:"absolute"},Ye=["grid","drawing","temp","interface"],Fe=function(e){var t,n;function i(t){var n;return ze(Re(n=e.call(this,t)||this),"undo",(function(){var e=[];n.lines.length?e=n.lines.slice(0,-1):n.erasedLines.length&&(e=n.erasedLines.pop()),n.clearExceptErasedLines(),n.simulateDrawingLines({lines:e,immediate:!0}),n.triggerOnChange()})),ze(Re(n),"eraseAll",(function(){n.erasedLines.push([].concat(n.lines)),n.clearExceptErasedLines(),n.triggerOnChange()})),ze(Re(n),"clear",(function(){n.erasedLines=[],n.clearExceptErasedLines(),n.resetView()})),ze(Re(n),"resetView",(function(){return n.coordSystem.resetView()})),ze(Re(n),"setView",(function(e){return n.coordSystem.setView(e)})),ze(Re(n),"getSaveData",(function(){return JSON.stringify({lines:n.lines,width:n.props.canvasWidth,height:n.props.canvasHeight})})),ze(Re(n),"getDataURL",(function(e,t,i){var a=n.canvas.drawing,r=a.getContext("2d"),o=a.width,s=a.height,l=r.getImageData(0,0,o,s),c=r.globalCompositeOperation;if(r.globalCompositeOperation="destination-over",t){if(!n.props.imgSrc)return"Background image source not set";n.drawImage()}else null!=i&&(r.fillStyle=i,r.fillRect(0,0,o,s));e||(e="png");var u=a.toDataURL("image/"+e);return r.clearRect(0,0,o,s),r.putImageData(l,0,0),r.globalCompositeOperation=c,u})),ze(Re(n),"loadSaveData",(function(e,t){if(void 0===t&&(t=n.props.immediateLoading),"string"!=typeof e)throw new Error("saveData needs to be of type string!");var i=JSON.parse(e),a=i.lines,r=i.width,o=i.height;if(!a||"function"!=typeof a.push)throw new Error("saveData.lines needs to be an array!");if(n.clear(),r===n.props.canvasWidth&&o===n.props.canvasHeight)n.simulateDrawingLines({lines:a,immediate:t});else{var s=n.props.canvasWidth/r,l=n.props.canvasHeight/o,c=(s+l)/2;n.simulateDrawingLines({lines:a.map((function(e){return Oe({},e,{points:e.points.map((function(e){return{x:e.x*s,y:e.y*l}})),brushRadius:e.brushRadius*c})})),immediate:t})}})),ze(Re(n),"componentWillUnmount",(function(){n.canvasObserver.unobserve(n.canvasContainer),n.canvas.interface&&n.canvas.interface.removeEventListener("wheel",n.handleWheel)})),ze(Re(n),"handleWheel",(function(e){n.interactionSM=n.interactionSM.handleMouseWheel(e,Re(n))})),ze(Re(n),"handleDrawStart",(function(e){n.interactionSM=n.interactionSM.handleDrawStart(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawMove",(function(e){n.interactionSM=n.interactionSM.handleDrawMove(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"handleDrawEnd",(function(e){n.interactionSM=n.interactionSM.handleDrawEnd(e,Re(n)),n.mouseHasMoved=!0})),ze(Re(n),"applyView",(function(){if(n.ctx.drawing&&(Ye.map((function(e){return n.ctx[e]})).forEach((function(e){n.clearWindow(e);var t=n.coordSystem.transformMatrix;e.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)})),!n.deferRedrawOnViewChange)){n.drawGrid(n.ctx.grid),n.redrawImage(),n.loop({once:!0});var e=n.lines;n.lines=[],n.simulateDrawingLines({lines:e,immediate:!0})}})),ze(Re(n),"handleCanvasResize",(function(e){var t=n.getSaveData();n.deferRedrawOnViewChange=!0;try{for(var i,a=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(i=a()).done;){var r=i.value.contentRect,o=r.width,s=r.height;n.setCanvasSize(n.canvas.interface,o,s),n.setCanvasSize(n.canvas.drawing,o,s),n.setCanvasSize(n.canvas.temp,o,s),n.setCanvasSize(n.canvas.grid,o,s),n.coordSystem.documentSize={width:o,height:s},n.drawGrid(n.ctx.grid),n.drawImage(),n.loop({once:!0})}n.loadSaveData(t,!0)}finally{n.deferRedrawOnViewChange=!1}})),ze(Re(n),"clampPointToDocument",(function(e){return n.props.clampLinesToDocument?{x:Math.max(Math.min(e.x,n.props.canvasWidth),0),y:Math.max(Math.min(e.y,n.props.canvasHeight),0)}:e})),ze(Re(n),"redrawImage",(function(){n.image&&n.image.complete&&function(e){var t=void 0===e?{}:e,n=t.ctx,i=t.img,a=t.x,r=t.y,o=t.w,s=t.h,l=t.offsetX,c=t.offsetY;"number"!=typeof a&&(a=0),"number"!=typeof r&&(r=0),"number"!=typeof o&&(o=n.canvas.width),"number"!=typeof s&&(s=n.canvas.height),"number"!=typeof l&&(l=.5),"number"!=typeof c&&(c=.5),l<0&&(l=0),c<0&&(c=0),l>1&&(l=1),c>1&&(c=1);var u,h,d,m,p=i.width,f=i.height,g=Math.min(o/p,s/f),y=p*g,v=f*g,w=1;y<o&&(w=o/y),Math.abs(w-1)<1e-14&&v<s&&(w=s/v),(u=(p-(d=p/((y*=w)/o)))*l)<0&&(u=0),(h=(f-(m=f/((v*=w)/s)))*c)<0&&(h=0),d>p&&(d=p),m>f&&(m=f),n.drawImage(i,u,h,d,m,a,r,o,s)}({ctx:n.ctx.grid,img:n.image})})),ze(Re(n),"simulateDrawingLines",(function(e){var t=e.lines,i=e.immediate,a=0,r=i?0:n.props.loadTimeOffset;t.forEach((function(e){var t=e.points,o=e.brushColor,s=e.brushRadius;if(i)return n.drawPoints({points:t,brushColor:o,brushRadius:s}),n.points=t,void n.saveLine({brushColor:o,brushRadius:s});for(var l=function(e){a+=r,window.setTimeout((function(){n.drawPoints({points:t.slice(0,e+1),brushColor:o,brushRadius:s})}),a)},c=1;c<t.length;c++)l(c);a+=r,window.setTimeout((function(){n.points=t,n.saveLine({brushColor:o,brushRadius:s})}),a)}))})),ze(Re(n),"setCanvasSize",(function(e,t,n){e.width=t,e.height=n,e.style.width=t,e.style.height=n})),ze(Re(n),"drawPoints",(function(e){var t=e.points,i=e.brushColor,a=e.brushRadius;n.ctx.temp.lineJoin="round",n.ctx.temp.lineCap="round",n.ctx.temp.strokeStyle=i,n.clearWindow(n.ctx.temp),n.ctx.temp.lineWidth=2*a;var r=t[0],o=t[1];n.ctx.temp.moveTo(o.x,o.y),n.ctx.temp.beginPath();for(var s=1,l=t.length;s<l;s++){var c=Be(r,o);n.ctx.temp.quadraticCurveTo(r.x,r.y,c.x,c.y),r=t[s],o=t[s+1]}n.ctx.temp.lineTo(r.x,r.y),n.ctx.temp.stroke()})),ze(Re(n),"saveLine",(function(e){var t=void 0===e?{}:e,i=t.brushColor,a=t.brushRadius;n.points.length<2||(n.lines.push({points:[].concat(n.points),brushColor:i||n.props.brushColor,brushRadius:a||n.props.brushRadius}),n.points.length=0,n.inClientSpace([n.ctx.drawing,n.ctx.temp],(function(){n.ctx.drawing.drawImage(n.canvas.temp,0,0,n.canvas.drawing.width,n.canvas.drawing.height)})),n.clearWindow(n.ctx.temp),n.triggerOnChange())})),ze(Re(n),"triggerOnChange",(function(){n.props.onChange&&n.props.onChange(Re(n))})),ze(Re(n),"clearWindow",(function(e){n.inClientSpace([e],(function(){return e.clearRect(0,0,e.canvas.width,e.canvas.height)}))})),ze(Re(n),"clearExceptErasedLines",(function(){n.lines=[],n.valuesChanged=!0,n.clearWindow(n.ctx.drawing),n.clearWindow(n.ctx.temp)})),ze(Re(n),"loop",(function(e){var t=(void 0===e?{}:e).once,i=void 0!==t&&t;if(n.lazy&&(n.mouseHasMoved||n.valuesChanged)){var a=n.lazy.getPointerCoordinates(),r=n.lazy.getBrushCoordinates();n.drawInterface(n.ctx.interface,a,r),n.mouseHasMoved=!1,n.valuesChanged=!1}i||window.requestAnimationFrame((function(){n.loop()}))})),ze(Re(n),"inClientSpace",(function(e,t){e.forEach((function(e){e.save(),e.setTransform(ve.a,ve.b,ve.c,ve.d,ve.e,ve.f)}));try{t()}finally{e.forEach((function(e){return e.restore()}))}})),ze(Re(n),"drawImage",(function(){n.props.imgSrc&&(n.image=new Image,n.image.crossOrigin="anonymous",n.image.onload=n.redrawImage,n.image.src=n.props.imgSrc)})),ze(Re(n),"drawGrid",(function(e){if(!n.props.hideGrid){n.clearWindow(e);var t=25,i=n.coordSystem.canvasBounds,a=i.viewMin,r=i.viewMax,o=Math.floor(a.x/t-1)*t,s=Math.floor(a.y/t-1)*t,l=r.x+t,c=r.y+t;if(e.beginPath(),e.setLineDash([5,1]),e.setLineDash([]),e.strokeStyle=n.props.gridColor,e.lineWidth=n.props.gridLineWidth,!n.props.hideGridX){for(var u=o,h=n.props.gridSizeX;u<l;)u+=h,e.moveTo(u,s),e.lineTo(u,c);e.stroke()}if(!n.props.hideGridY){for(var d=s,m=n.props.gridSizeY;d<c;)d+=m,e.moveTo(o,d),e.lineTo(l,d);e.stroke()}}})),ze(Re(n),"drawInterface",(function(e,t,i){n.props.hideInterface||(n.clearWindow(e),e.beginPath(),e.fillStyle=n.props.brushColor,e.arc(i.x,i.y,n.props.brushRadius,0,2*Math.PI,!0),e.fill(),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(t.x,t.y,4,0,2*Math.PI,!0),e.fill(),n.lazy.isEnabled()&&(e.beginPath(),e.lineWidth=2,e.lineCap="round",e.setLineDash([2,4]),e.strokeStyle=n.props.catenaryColor,n.catenary.drawToCanvas(n.ctx.interface,i,t,n.chainLength),e.stroke()),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(i.x,i.y,2,0,2*Math.PI,!0),e.fill())})),n.canvas={},n.ctx={},n.catenary=new H.oT,n.points=[],n.lines=[],n.erasedLines=[],n.mouseHasMoved=!0,n.valuesChanged=!0,n.isDrawing=!1,n.isPressing=!1,n.deferRedrawOnViewChange=!1,n.interactionSM=new Ee,n.coordSystem=new we({scaleExtents:t.zoomExtents,documentSize:{width:t.canvasWidth,height:t.canvasHeight}}),n.coordSystem.attachViewChangeListener(n.applyView.bind(Re(n))),n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.componentDidMount=function(){var e,t=this;this.lazy=new G.xv({radius:this.props.lazyRadius*window.devicePixelRatio,enabled:!0,initialPoint:{x:window.innerWidth/2,y:window.innerHeight/2}}),this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.canvasObserver=new de((function(e,n){return t.handleCanvasResize(e,n)})),this.canvasObserver.observe(this.canvasContainer),this.drawImage(),this.loop(),window.setTimeout((function(){var e=window.innerWidth/2,n=window.innerHeight/2;t.lazy.update({x:e-t.chainLength/4,y:n},{both:!0}),t.lazy.update({x:e+t.chainLength/4,y:n},{both:!1}),t.mouseHasMoved=!0,t.valuesChanged=!0,t.clearExceptErasedLines(),t.props.saveData&&t.loadSaveData(t.props.saveData)}),100),this.canvas.interface&&this.canvas.interface.addEventListener("wheel",this.handleWheel,Le?{passive:e}:e)},a.componentDidUpdate=function(e){e.lazyRadius!==this.props.lazyRadius&&(this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.lazy.setRadius(this.props.lazyRadius*window.devicePixelRatio)),e.saveData!==this.props.saveData&&this.loadSaveData(this.props.saveData),JSON.stringify(e)!==JSON.stringify(this.props)&&(this.valuesChanged=!0),this.coordSystem.scaleExtents=this.props.zoomExtents,this.props.enablePanAndZoom||this.coordSystem.resetView(),e.imgSrc!==this.props.imgSrc&&this.drawImage()},a.render=function(){var e=this;return I().createElement("div",{className:this.props.className,style:Oe({display:"block",background:this.props.backgroundColor,touchAction:"none",width:this.props.canvasWidth,height:this.props.canvasHeight},this.props.style),ref:function(t){t&&(e.canvasContainer=t)}},Ye.map((function(t){var n="interface"===t;return I().createElement("canvas",{key:t,ref:function(i){i&&(e.canvas[t]=i,e.ctx[t]=i.getContext("2d"),n&&(e.coordSystem.canvas=i))},style:Oe({},We),onMouseDown:n?e.handleDrawStart:void 0,onMouseMove:n?e.handleDrawMove:void 0,onMouseUp:n?e.handleDrawEnd:void 0,onMouseOut:n?e.handleDrawEnd:void 0,onTouchStart:n?e.handleDrawStart:void 0,onTouchMove:n?e.handleDrawMove:void 0,onTouchEnd:n?e.handleDrawEnd:void 0,onTouchCancel:n?e.handleDrawEnd:void 0})})))},i}(C.PureComponent);ze(Fe,"defaultProps",{onChange:null,loadTimeOffset:5,lazyRadius:12,brushRadius:10,brushColor:"#444",catenaryColor:"#0a0302",gridColor:"rgba(150,150,150,0.17)",backgroundColor:"#FFF",hideGrid:!1,canvasWidth:400,canvasHeight:400,disabled:!1,imgSrc:"",saveData:"",immediateLoading:!1,hideInterface:!1,gridSizeX:25,gridSizeY:25,gridLineWidth:.5,hideGridX:!1,hideGridY:!1,enablePanAndZoom:!1,mouseZoomFactor:.01,zoomExtents:{min:.33,max:3},clampLinesToDocument:!1}),Fe.propTypes={};function Ve(e){const n=function(e){const[n,i]=(0,t.useState)({windowWidth:window.innerWidth,isDesiredWidth:window.innerWidth<e});return(0,t.useEffect)((()=>{const t=()=>{const t=window.innerWidth;i({windowWidth:t,isDesiredWidth:t<e})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[n.windowWidth]),n.isDesiredWidth}(600),[a,o]=(0,t.useState)(n?.6:1),[s,l]=(0,t.useState)(!1),[c,h]=(0,t.useState)(null),[d,m]=(0,t.useState)(null),[p,g]=(0,t.useState)(25),[y,v]=(0,t.useState)(e.prompt),[w,b]=(0,t.useState)(512*a),[_,E]=(0,t.useState)(512*a),[x,j]=(0,t.useState)(512),[M,S]=(0,t.useState)(512),[k,C]=(0,t.useState)(null);return(0,t.useEffect)((()=>{o(n?.6:1)}),[n]),(0,t.useEffect)((()=>{C(null==c?void 0:c.getSaveData()),"3:2"===e.queryRatio?(b(341*a),E(512*a),j(512),S(768)):"2:3"===e.queryRatio?(n?(b(768*a),E(512*a)):(b(512*a),E(341*a)),j(768),S(512)):(b(512*a),E(512*a)),g((e=>e*a)),null==c||c.clear()}),[a]),(0,t.useEffect)((()=>{null==c||c.loadSaveData(k,!0)}),[_]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.Button,{onClick:()=>l(!0),icon:Y,label:(0,i.__)("Touchup (beta)","imajinn-ai")}),s&&(0,t.createElement)(r.Modal,u({},e,{onRequestClose:()=>l(!1),className:"imajinn-inpainting-modal",shouldCloseOnClickOutside:!0,title:(0,i.__)("Touchup Image Editor (beta)","imajinn-ai")}),(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,null,(0,t.createElement)(Fe,{style:{position:"relative"},ref:e=>h(e),imgSrc:e.src,brushRadius:p,lazyRadius:0,hideInterface:!0,brushColor:"rgba(180,0,0,0.75)",canvasWidth:_,canvasHeight:w})),(0,t.createElement)(r.CardFooter,null,(0,t.createElement)((()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.__experimentalRadioGroup,{id:"imajinn-brush-size",label:(0,i.__)("Select the brush size","imajinn-ai"),defaultChecked:p,onChange:g,checked:p},(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Small","imajinn-ai"),className:"brush-sm",value:10*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("Medium","imajinn-ai"),className:"brush-md",value:25*a},(0,t.createElement)(r.Icon,{icon:Y})),(0,t.createElement)(r.__experimentalRadio,{label:(0,i.__)("large","imajinn-ai"),className:"brush-lg",value:40*a},(0,t.createElement)(r.Icon,{icon:Y}))))),null),(0,t.createElement)(f,{isMobile:n}),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(r.Button,{icon:F,label:(0,i.__)("Reset","imajinn-ai"),onClick:()=>{c.eraseAll()}}),(0,t.createElement)(r.Button,{icon:V,label:(0,i.__)("Undo","imajinn-ai"),onClick:()=>{c.undo()}})))),(0,t.createElement)(r.TextareaControl,{rows:3,maxLength:450,value:y,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Modified prompt describing the entire image and the masked area:","imajinn-ai")),className:"text-prompt",onFocus:e=>e.target.select(),onChange:e=>v(e)}),(0,t.createElement)(r.Flex,{wrap:!1},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"secondary",onClick:()=>l(!1)},(0,i.__)("Cancel","imajinn-ai"))),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{variant:"primary",onClick:()=>{const t=new Image;t.onload=()=>{const n=document.createElement("canvas");n.width=M,n.height=x;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height,0,0,M,x);let a=i.getImageData(0,0,n.width,n.height),r=0;for(r=0;r<a.data.length;r+=4){let e=255;a.data[r]+a.data[r+1]+a.data[r+2]>383&&(e=0),a.data[r]=e,a.data[r+1]=e,a.data[r+2]=e,a.data[r+3]=255}i.putImageData(a,0,0);const o=n.toDataURL("image/png");n.remove(),e.setRatio(e.queryRatio),e.startJob(e.src,o,e.queryRatio,y),e.setPrompt(y)},d.clear(),d.loadSaveData(c.getSaveData(),!0),t.src=d.getDataURL("png",!1,"#ffffff")}},(0,i.__)("Generate","imajinn-ai")))),(0,t.createElement)(Fe,{style:{visibility:"hidden",position:"absolute",top:"-99999px",left:"-99999px"},disabled:!0,hideGrid:!0,ref:e=>m(e),canvasWidth:M,canvasHeight:x})))}var Ge=(0,t.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(o.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),He=e=>{let{generations:n,setGenerations:a,faceFixed:o,setFaceFixed:s,setError:l,...c}=e;const[u,h]=(0,C.useState)(!1),[d,m]=(0,C.useState)(!1);return(0,C.useEffect)((()=>{o.some((e=>e.index===c.genindex))?(m(!0),h(!1)):(m(!1),h(!1))}),[o]),u?(0,t.createElement)(r.Button,{disabled:!0,icon:(0,t.createElement)(r.Spinner,null),label:(0,i.__)("Repairing","imajinn-ai")}):(0,t.createElement)(r.Button,{disabled:d,icon:Ge,label:(0,i.__)("Face Repair","imajinn-ai"),onClick:async()=>{h(!0),await(async e=>{let t=n[e].jpg;l(null);const r=await fetch(`${ajaxurl}?action=imajinn-face-repair`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,nonce:IMAJINN.nonce})}),o=await r.json();return o.success?(s((t=>[...t,{index:e}])),a((t=>(t[e]=o.data.image,[...t]))),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Face repair completed.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),o.data):(l(o.data[0].message),!1)})(c.genindex)||h(!1)}})},Ue=(0,t.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(o.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"})),Je=e=>{let n=e.generations[e.genindex].jpg;return(0,t.createElement)(r.Button,{icon:Ue,label:(0,i.__)("Generate Variations","imajinn-ai"),onClick:()=>{e.setRatio(e.queryRatio),e.startJob(n,null,e.queryRatio)}})},qe=e=>{let{...n}=e;return(0,t.createElement)(r.CardFooter,null,(0,t.createElement)(r.ButtonGroup,{className:"imajinn-image-actions"},(0,t.createElement)(r.Button,{href:`${ajaxurl}?action=imajinn-tweet&image=${n.src}`,target:"_blank",icon:W,label:(0,i.__)("Share on Twitter","imajinn-ai")}),(0,t.createElement)(Je,n),(0,t.createElement)(He,n),(0,t.createElement)(Ve,u({},n,{src:n.generations[n.genindex].jpg}))),(0,t.createElement)(r.ButtonGroup,null,(0,t.createElement)(B,n),(0,t.createElement)(O,n)))},Ze=e=>{let{setSelectedImage:n,...i}=e;const[a,o]=(0,t.useState)("300px"),[s,l]=(0,t.useState)("300px");(0,t.useEffect)((()=>{"3:2"===i.queryRatio?(l("200px"),o("300px")):"2:3"===i.queryRatio?(l("450px"),o("300px")):(l("300px"),o("300px"))}),[i.generations,i.queryRatio]);const c=e=>{let{...i}=e;return(0,t.createElement)(r.Card,null,(0,t.createElement)(r.CardMedia,{className:"loop-show",style:{width:i.width,height:i.height,position:"relative",cursor:"pointer"}},(0,t.createElement)("div",{className:"loop-icon",onClick:()=>n(i.genindex)},(0,t.createElement)("div",null,(0,t.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBmaWxsLXJ1bGU9ImV2ZW5vZGQiCiAgICBjbGlwLXJ1bGU9ImV2ZW5vZGQiCiAgICBkPSJNMTguMzE5IDE0LjQzMjZDMjAuNzYyOCAxMS4yOTQxIDIwLjU0MiA2Ljc1MzQ3IDE3LjY1NjkgMy44NjgyOUMxNC41MzI3IDAuNzQ0MDk4IDkuNDY3MzQgMC43NDQwOTggNi4zNDMxNSAzLjg2ODI5QzMuMjE4OTUgNi45OTI0OSAzLjIxODk1IDEyLjA1NzggNi4zNDMxNSAxNS4xODJDOS4yMjgzMyAxOC4wNjcyIDEzLjc2OSAxOC4yODc5IDE2LjkwNzUgMTUuODQ0MkMxNi45MjEgMTUuODU5NSAxNi45MzUxIDE1Ljg3NDUgMTYuOTQ5NyAxNS44ODkxTDIxLjE5MjQgMjAuMTMxN0MyMS41ODI5IDIwLjUyMjMgMjIuMjE2MSAyMC41MjIzIDIyLjYwNjYgMjAuMTMxN0MyMi45OTcxIDE5Ljc0MTIgMjIuOTk3MSAxOS4xMDgxIDIyLjYwNjYgMTguNzE3NUwxOC4zNjQgMTQuNDc0OUMxOC4zNDkzIDE0LjQ2MDMgMTguMzM0MyAxNC40NDYyIDE4LjMxOSAxNC40MzI2Wk0xNi4yNDI2IDUuMjgyNTFDMTguNTg1OCA3LjYyNTY1IDE4LjU4NTggMTEuNDI0NiAxNi4yNDI2IDEzLjc2NzhDMTMuODk5NSAxNi4xMTA5IDEwLjEwMDUgMTYuMTEwOSA3Ljc1NzM2IDEzLjc2NzhDNS40MTQyMSAxMS40MjQ2IDUuNDE0MjEgNy42MjU2NSA3Ljc1NzM2IDUuMjgyNTFDMTAuMTAwNSAyLjkzOTM2IDEzLjg5OTUgMi45MzkzNiAxNi4yNDI2IDUuMjgyNTFaIgogICAgZmlsbD0id2hpdGUiCiAgLz4KPC9zdmc+"}))),(0,t.createElement)("img",{className:"generation-zoom",alt:i.alt||i.label,src:i.src,width:i.width,height:i.height})),(0,t.createElement)(qe,i))};return(0,t.createElement)("div",{className:"results-grid",style:{gridTemplateColumns:!IMAJINN.custom_editor&&"1fr 1fr"}},i.generations&&i.generations.map(((e,n)=>(0,t.createElement)("div",{style:{minWidth:a,flexGrow:1},key:n},(0,t.createElement)(c,u({src:e.preview,genindex:n,width:a,height:s,label:"Result "+(n+1).toString()},i))))))},Xe=e=>{let{status:n,progress:a,cancelJob:o}=e;const s="processing"===n?(0,i.sprintf)((0,i.__)("Generating %s%%","imajinn-ai"),a):(0,i.__)("Queued","imajinn-ai");return(0,t.createElement)("div",{className:"imajinn-loading"},(0,t.createElement)(c.ZZ,null),(0,t.createElement)("div",null,(0,t.createElement)(r.__experimentalText,null,s),(0,t.createElement)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>{o()}},(0,i.__)("Cancel"))))},Qe=e=>{let{deleteBlock:n}=e;return(0,t.createElement)("div",{className:"corner-controls"},(0,t.createElement)(p,null),(0,t.createElement)(r.Button,{className:"imajinn-close-button",icon:s,label:(0,i.__)("Close Imajinn Block","imajinn-ai"),onClick:()=>{n()}}))},$e=function(e){let{showWelcome:n,setShowWelcome:a,...o}=e;const[s,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{l(n)}),[n]),(0,t.createElement)(t.Fragment,null,s&&(0,t.createElement)(r.Modal,u({},o,{isDismissible:!1,style:{maxWidth:"900px"},icon:(0,t.createElement)(c.DT,{iconSize:20}),title:(0,i.__)("Getting Started","imajinn-ai")}),(0,t.createElement)("p",null,(0,i.__)("Welcome to Imajinn! Here are some quick tips to get you started so you can create the best images possible.","imajinn-ai")),(0,t.createElement)("h3",null,(0,i.__)("Do:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Write a detailed and descriptive prompt in English.","imajinn-ai"),(0,t.createElement)(m,null)),(0,t.createElement)("li",null,(0,i.__)("Use Prompt Genie or our style dropdowns for the best results.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Only use 3:2 or 2:3 ratios to generate images with smaller or multiple details, not a single object.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Think like the AI not a human: What text would you find online associated with the image you want to create?","imajinn-ai"))),(0,t.createElement)("h3",null,(0,i.__)("Do Not:","imajinn-ai")),(0,t.createElement)("ol",null,(0,t.createElement)("li",null,(0,i.__)("Try to generate photo-realistic human faces or bodies, they will look deformed. Stick to artistic styles for images with people.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Expect to be able to create legible words, text, or logos. They will be gibberish.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Use 3:2 or 2:3 ratio for images with a single object or subject, as that tends to create strange duplications. It is best to use 1:1 for those types of images.","imajinn-ai")),(0,t.createElement)("li",null,(0,i.__)("Write your prompts in a language other than English. Sorry, the model was trained on primarily English image descriptions (automatic translation coming soon).","imajinn-ai"))),(0,t.createElement)("div",{className:"imajinn-starting-modal-buttons"},(0,t.createElement)(r.Button,{variant:"primary",onClick:async()=>{a(!1);const e=await fetch(`${ajaxurl}?action=imajinn-dismiss-welcome`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})});return!!(await e.json()).success&&(IMAJINN.show_welcome=!1,!0)}},(0,i.__)("Got it!","imajinn-ai")),(0,t.createElement)(p,null))))};(0,e.registerBlockType)(l,{edit:function(){const[e,n]=(0,t.useState)(IMAJINN.connected),[o,u]=(0,t.useState)(!1),[h,d]=(0,t.useState)(null),[p,f]=(0,t.useState)(null),[v,x]=(0,t.useState)([]),[j,S]=(0,t.useState)(IMAJINN.history),[C,I]=(0,t.useState)(null),[N,O]=(0,t.useState)(0),[R,z]=(0,t.useState)(""),[B,W]=(0,t.useState)(""),[Y,F]=(0,t.useState)("1:1"),[V,G]=(0,t.useState)(Y),[H,U]=(0,t.useState)(IMAJINN.remaining_credits),[J,q]=(0,t.useState)(!1),[Z,X]=(0,t.useState)(IMAJINN.show_welcome),[Q,$]=(0,t.useState)(""),[K,ee]=(0,t.useState)(""),[te,ne]=(0,t.useState)(""),[ie,ae]=(0,t.useState)(!1),[re,oe]=(0,t.useState)([]),[se,le]=(0,t.useState)([]),[ce,ue]=(0,t.useState)(null);(0,t.useEffect)((()=>()=>{ae(!1)}),[R,B,Y]),(0,t.useEffect)((()=>{IMAJINN.remaining_credits=H,H>0&&q(!1)}),[H]),(0,t.useEffect)((()=>{IMAJINN.history=j}),[j]),(0,t.useEffect)((()=>{W([Q,K,te].filter(Boolean).join(", "))}),[Q,K,te]);const he=(0,a.useBlockProps)(),de=(e,t,n,i,a)=>{if(H<=0&&pe(),H-1<0)return q(!0),!1;const r=e||null,o=t||null,s=n||Y,l=i||R,c=a||B;f(null),x([]),le([]),oe([]),G(s),u(!0),d(null),O(0),fetch(`${ajaxurl}?action=imajinn-start-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,prompt_style:c,ratio:s,num_variations:4,init_image:r,mask:o,nonce:IMAJINN.nonce})}).then((e=>e.json())).then((e=>{e.success?(f(e.data.job_id),I(e.data.status),U(e.data.remaining_credits),O(e.data.progress),me(e.data.job_id)):(u(!1),f(null),I(null),d(e.data[0].message))})).catch((e=>{u(!1),f(null),I(null),d(e)}))},me=async e=>{if(!e)return u(!1),f(null),!1;setTimeout((async()=>{const t=await fetch(`${ajaxurl}?action=imajinn-check-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:e,nonce:IMAJINN.nonce})}),n=await t.json();n.success?(I(n.data.status),O(n.data.progress),U(n.data.remaining_credits),"succeeded"===n.data.status?(x(n.data.generations),S((e=>[n.data.history,...e])),ae(!0)):"failed"===n.data.status&&(d(n.data.error),I(null),u(!1),f(null),ae(!0)),"starting"===n.data.status||"processing"===n.data.status?me(e):(I(null),u(!1),f(null),ae(!0))):(I(null),u(!1),f(null),d(n.data[0].message),ae(!0))}),4e3)},pe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?U(t.data.remaining_credits):d(t.data[0].message)},fe=async()=>{const e=await fetch(`${ajaxurl}?action=imajinn-account-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nonce:IMAJINN.nonce})}),t=await e.json();t.success?window.open(t.data.account_url,"_blank"):d(t.data[0].message)},ge=v.length?"":l.description,ye=()=>{$(""),ee(""),ne(""),W("")};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(_,{image:ce,setImage:ue,generations:v}),(0,t.createElement)("figure",he,(0,t.createElement)(D,{refreshInfo:pe,isConnected:e,credits:H,visitAccount:fe}),e&&(0,t.createElement)(E,{history:j,setPrompt:z,setPromptStyle:W,setGenerations:x,setRatio:F,clearStyles:ye,setQueryRatio:G,setSaved:oe,setFaceFixed:le}),(0,t.createElement)(r.Placeholder,{icon:IMAJINN.custom_editor?null:c.mC,instructions:ge,label:IMAJINN.custom_editor?null:(0,i.__)("AI Text-to-Image Generator","imajinn-ai")},!e&&(0,t.createElement)(w,{setCredits:U,isConnected:e,setIsConnected:n}),e&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(k,{showUpgrade:J,setShowUpgrade:q}),(0,t.createElement)($e,{showWelcome:Z,setShowWelcome:X}),h&&(0,t.createElement)(P,{hasError:h}),o&&(0,t.createElement)(Xe,{status:C,progress:N,cancelJob:async()=>{if(!p)return d("Error: No job id"),!1;const e=await fetch(`${ajaxurl}?action=imajinn-cancel-job`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({job_id:p,nonce:IMAJINN.nonce})}),t=await e.json();t.success?(I(null),u(!1),f(null),U(t.data.remaining_credits)):d(t.data[0].message)}}),(0,t.createElement)(Ze,{prompt:R,setPrompt:z,promptStyle:B,saved:re,queryRatio:V,setRatio:F,faceFixed:se,setFaceFixed:le,generations:v,setGenerations:x,startJob:de,saveImage:async e=>{let t=v[e].jpg;const n=await fetch(`${ajaxurl}?action=imajinn-save-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t,prompt:R,prompt_style:B,post_id:wp.data.select("core/editor").getCurrentPostId(),nonce:IMAJINN.nonce})}),a=await n.json();return!!a.success&&(oe((t=>[...t,{index:e,data:a.data}])),wp.data.dispatch("core/notices").createNotice("success",(0,i.__)("Image saved to media library.","imajinn-ai"),{type:"snackbar",isDismissible:!0,actions:[]}),a.data)},setSelectedImage:ue,setError:d}),(0,t.createElement)("div",{className:"prompt-form"},(0,t.createElement)(r.TextareaControl,{disabled:o,rows:2,maxLength:450,value:R,label:(0,t.createElement)(t.Fragment,null,(0,i.__)("Prompt - Enter a detailed English description of the image you would like to generate.","imajinn-ai"),(0,t.createElement)(m,null)),className:"text-prompt",onChange:e=>z(e),onFocus:e=>e.target.select()}),(0,t.createElement)(r.__experimentalText,{className:"prompt-style",numberOfLines:2,truncate:!0},B),(0,t.createElement)("div",{className:"styles-form"},(0,t.createElement)(g,{prompt:R,setPrompt:z,setPromptStyle:W,startJob:de,setError:d,clearStyles:ye,isLoading:o}),(0,t.createElement)(A,{setImageStyle:$,isLoading:o,imageStyle:Q,optionData:b}),(0,t.createElement)(T,{setImageArtist:ee,isLoading:o,imageArtist:K,optionData:b}),(0,t.createElement)(L,{setImageModifier:ne,isLoading:o,imageModifier:te,optionData:b}),(0,t.createElement)(r.Button,{icon:s,disabled:o,label:(0,i._x)("Clear styles","clear the image style selects","imajinn-ai"),onClick:ye}))),(0,t.createElement)(r.Flex,{align:"top",wrap:"true"},(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(M,{ratio:Y,setRatio:F,isLoading:o})),(0,t.createElement)(r.FlexItem,null,(0,t.createElement)(r.Button,{isPrimary:!0,disabled:o,onClick:()=>de()},(0,i.__)(ie?"Generate More":"Generate","imajinn-ai"))))),!IMAJINN.custom_editor&&(0,t.createElement)(Qe,{deleteBlock:()=>{const{removeBlocks:e}=wp.data.dispatch("core/block-editor");e(wp.data.select("core/block-editor").getSelectedBlockClientIds())}})),(0,t.createElement)("div",{className:"imajinn-footer"},(0,t.createElement)(r.Button,{onClick:()=>{fe()}},(0,i.__)("Account","imajinn-ai")),(0,t.createElement)(y,null),(0,t.createElement)("a",{href:"https://infiniteuploads.com/support/",target:"_blank"},(0,i.__)("Support","imajinn-ai")),(0,t.createElement)("span",{className:"imajinn-credits"},(0,i._x)("Made with ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)(r.Dashicon,{icon:"heart","aria-label":(0,i._x)("love","Made with love by Infinite Uploads","imajinn-ai")}),(0,i._x)(" by ","Made with love by Infinite Uploads","imajinn-ai"),(0,t.createElement)("a",{href:"https://infiniteuploads.com/",target:"_blank"},"Infinite Uploads")))))},save:function(){return null},icon:c.DT})}()}(); -
imajinn-ai/trunk/build/editor.asset.php
r2796851 r2833326 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-format-library', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-media-utils', 'wp-preferences'), 'version' => ' 7ef1d8407853a4dd1875');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-format-library', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-media-utils', 'wp-preferences'), 'version' => 'c75fee77c2519bd50317'); -
imajinn-ai/trunk/build/editor.css
r2796851 r2833326 1 .imajinn-header{align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;display:flex;height:80px;justify-content:flex-start;left:-20px;padding-left:20px;position:relative;width:calc(100% + 20px)}.imajinn-header__title{font-size:16px;padding:0 20px}.imajinn-sidebar{background:#fff;border-left:1px solid #e0e0e0;bottom:0;color:#1e1e1e; height:100vh;overflow:hidden;position:fixed;right:0;top:0;width:280px;z-index:z-index(".edit-site-sidebar")}@media(min-width:600px){.imajinn-sidebar{-webkit-overflow-scrolling:touch;height:auto;overflow:auto;top:126px}}@media(min-width:782px){.imajinn-sidebar{top:112px}}@media(min-width:600px){.imajinn-sidebar{display:block}}.imajinn-sidebar>.components-panel{border-left:0;border-right:0;margin-bottom:-1px;margin-top:-1px}.imajinn-sidebar>.components-panel>.components-panel__header{background:#e0e0e0}.imajinn-sidebar .block-editor-block-inspector h2,.imajinn-sidebar .block-editor-block-inspector h3,.imajinn-sidebar .block-editor-block-inspector__card{margin:0}.imajinn-block-editor__block-list{margin-left:auto;margin-right:20px;margin-top:140px!important;padding-bottom:0;padding-top:0}.imajinn-block-editor__block-list .block-editor-block-list__block{margin-left:auto;margin-right:auto}body.block-editor-page,html.wp-toolbar{background:#fff}body.block-editor-page #wpcontent{padding-left:0}body.block-editor-page #wpbody-content{padding-bottom:0}body.block-editor-page #wpbody-content>div:not(.block-editor):not(#screen-meta),body.block-editor-page #wpfooter{display:none}body.block-editor-page .a11y-speak-region{left:-1px;top:-1px}body.block-editor-page ul#adminmenu a.wp-has-current-submenu:after,body.block-editor-page ul#adminmenu>li.current>a.current:after{border-right-color:#fff}body.block-editor-page .media-frame select.attachment-filters:last-of-type{max-width:100%;width:auto}.imajinn-block-editor{min-height:calc(100vh - 32px)}.imajinn-block-editor .block-list-appender,.imajinn-block-editor .components-toolbar-group:has(.block-editor-block-settings-menu){display:none}.imajinn-block-editor .components-snackbar-list{bottom:40px;left:160px;padding-left:16px;padding-right:16px;position:fixed;right:0}.editor-styles-wrapper{color:#1e1e1e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:1.8;width:100%}@media(min-width:600px){.editor-styles-wrapper{width:calc(100% - 280px)}}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__no-avatar:before{content:"";font:normal 20px/1 dashicons;margin-right:5px;vertical-align:middle}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-avatar{flex-grow:0;flex-shrink:0;height:24px;margin-right:8px;max-width:none;width:24px}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-name{flex-grow:1;flex-shrink:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-slug{color:#757575;flex-grow:0;flex-shrink:0;margin-left:8px;max-width:100px;overflow:none;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user:hover .editor-autocompleters__user-slug{color:var(--wp-admin-theme-color)}.editor-styles-wrapper .document-outline{margin:20px 0}.editor-styles-wrapper .document-outline ul{margin:0;padding:0}.editor-styles-wrapper .document-outline__item{display:flex;margin:4px 0}.editor-styles-wrapper .document-outline__item a{text-decoration:none}.editor-styles-wrapper .document-outline__item .document-outline__emdash:before{color:#ddd;margin-right:4px}.editor-styles-wrapper .document-outline__item.is-h2 .document-outline__emdash:before{content:"—"}.editor-styles-wrapper .document-outline__item.is-h3 .document-outline__emdash:before{content:"——"}.editor-styles-wrapper .document-outline__item.is-h4 .document-outline__emdash:before{content:"———"}.editor-styles-wrapper .document-outline__item.is-h5 .document-outline__emdash:before{content:"————"}.editor-styles-wrapper .document-outline__item.is-h6 .document-outline__emdash:before{content:"—————"}.editor-styles-wrapper .document-outline__button{align-items:flex-start;background:none;border:none;border-radius:2px;color:#1e1e1e;cursor:pointer;display:flex;margin:0 0 0 -1px;padding:2px 5px 2px 1px;text-align:left}.editor-styles-wrapper .document-outline__button:disabled{cursor:default}.editor-styles-wrapper .document-outline__button:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .document-outline__level{background:#ddd;border-radius:3px;color:#1e1e1e;font-size:13px;margin-right:4px;padding:1px 6px}.is-invalid .editor-styles-wrapper .document-outline__level{background:#f0b849}.editor-styles-wrapper .document-outline__item-content{padding:1px 0}.editor-styles-wrapper .components-editor-notices__dismissible,.editor-styles-wrapper .components-editor-notices__pinned{color:#1e1e1e;left:0;position:relative;right:0;top:0}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice,.editor-styles-wrapper .components-editor-notices__pinned .components-notice{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;margin:0;min-height:60px;padding:0 12px}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice .components-notice__dismiss,.editor-styles-wrapper .components-editor-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}.editor-styles-wrapper .entities-saved-states__panel{background:#fff;bottom:0;box-sizing:border-box;left:0;overflow:auto;position:fixed;right:0;top:46px;z-index:z-index(".entities-saved-states__panel")}.editor-styles-wrapper .entities-saved-states__panel *,.editor-styles-wrapper .entities-saved-states__panel :after,.editor-styles-wrapper .entities-saved-states__panel :before{box-sizing:inherit}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:none}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:block}@media(min-width:782px){.editor-styles-wrapper .entities-saved-states__panel{border-left:1px solid #ddd;left:auto;top:32px;width:280px}body.is-fullscreen-mode .editor-styles-wrapper .entities-saved-states__panel{top:0}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:block}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:none}}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__panel-header{background:#fff;border-bottom:1px solid #ddd;height:61px;padding-left:8px;padding-right:8px}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__text-prompt{padding:16px 16px 4px}.editor-styles-wrapper .editor-error-boundary{box-shadow:0 10px 10px rgba(0,0,0,.25);margin:60px auto auto;max-width:780px;padding:20px}.editor-styles-wrapper .editor-page-attributes__order{width:100%}.editor-styles-wrapper .editor-page-attributes__order .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-page-attributes__order input{width:66px}.editor-styles-wrapper .editor-post-excerpt__textarea{margin-bottom:10px;width:100%}.editor-styles-wrapper .editor-post-featured-image{padding:0}.editor-styles-wrapper .editor-post-featured-image__container{margin-bottom:1em;position:relative}.editor-styles-wrapper .editor-post-featured-image .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.editor-styles-wrapper .editor-post-featured-image .components-button+.components-button{display:block;margin-top:1em}.editor-styles-wrapper .editor-post-featured-image .components-responsive-wrapper__content{max-width:100%;width:auto}.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{box-shadow:0 0 0 0 var(--wp-admin-theme-color);display:block;padding:0;transition:all .1s ease-out;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-featured-image__preview{height:auto}.editor-styles-wrapper .editor-post-featured-image__preview:not(:disabled):not([aria-disabled=true]):focus{box-shadow:0 0 0 4px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-featured-image__toggle{background-color:#f0f0f0;border-radius:2px;line-height:20px;min-height:90px;padding:8px 0;text-align:center}.editor-styles-wrapper .editor-post-featured-image__toggle:hover{background:#ddd;color:#1e1e1e}.editor-styles-wrapper [class].editor-post-format__suggestion{margin:4px 0 0}.editor-styles-wrapper .editor-post-last-revision__title{font-weight:600;width:100%}.editor-styles-wrapper .editor-post-last-revision__title .dashicon{margin-right:5px}.editor-styles-wrapper .components-button.editor-post-last-revision__title{height:100%}.editor-styles-wrapper .components-button.editor-post-last-revision__title:active,.editor-styles-wrapper .components-button.editor-post-last-revision__title:hover{background:#f0f0f0}.editor-styles-wrapper .components-button.editor-post-last-revision__title:focus{border-radius:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}@media(min-width:600px){.editor-styles-wrapper .editor-post-locked-modal{max-width:480px}}.editor-styles-wrapper .editor-post-locked-modal .components-modal__content{display:flex}.editor-styles-wrapper .editor-post-locked-modal__buttons{margin-top:24px}.editor-styles-wrapper .editor-post-locked-modal__avatar{border-radius:2px;margin-right:24px;margin-top:16px}.editor-styles-wrapper .editor-post-publish-button__button.has-changes-dot:before{background:currentcolor;border-radius:4px;content:"";height:8px;margin:auto 5px auto -3px;width:8px}.editor-styles-wrapper .editor-post-publish-panel{background:#fff}.editor-styles-wrapper .editor-post-publish-panel__content{min-height:calc(100% - 144px)}.editor-styles-wrapper .editor-post-publish-panel__content .components-spinner{display:block;margin:100px auto 0}.editor-styles-wrapper .editor-post-publish-panel__header{align-content:space-between;align-items:center;background:#fff;border-bottom:1px solid #ddd;display:flex;height:61px;padding-left:16px;padding-right:16px}.editor-styles-wrapper .editor-post-publish-panel__header .components-button{justify-content:center;width:100%}.editor-styles-wrapper .editor-post-publish-panel__header .has-icon{margin-left:auto;width:auto}.editor-styles-wrapper .components-site-card{align-items:center;display:flex;margin:16px 0}.editor-styles-wrapper .components-site-icon{border:none;border-radius:2px;height:36px;margin-right:12px;width:36px}.editor-styles-wrapper .components-site-name{display:block;font-size:14px}.editor-styles-wrapper .components-site-home{color:#757575;display:block;font-size:12px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{flex-grow:1}@media(min-width:480px){.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{max-width:160px}}.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{padding-right:4px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button{padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__header-published{flex-grow:1}.editor-styles-wrapper .editor-post-publish-panel__footer{padding:16px}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary{align-items:center;display:inline-flex}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary.is-busy .dashicon{display:none}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary .dashicon{margin-right:-4px}.editor-styles-wrapper .editor-post-publish-panel__link{font-weight:400;padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__prepublish{padding:16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish strong{color:#1e1e1e}.editor-styles-wrapper .editor-post-publish-panel__prepublish .components-panel__body{background:#fff;margin-left:-16px;margin-right:-16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish .editor-post-visibility__dialog-legend{display:none}.editor-styles-wrapper .post-publish-panel__postpublish .components-panel__body{border-bottom:1px solid #e0e0e0;border-top:none}.editor-styles-wrapper .post-publish-panel__postpublish-buttons{align-content:space-between;display:flex;flex-wrap:wrap;margin:-5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons>*{flex-grow:1;margin:5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-button{flex:1;height:auto;justify-content:center;line-height:1.6;padding:3px 10px 4px;text-align:center;white-space:normal}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-clipboard-button{width:100%}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container{align-items:flex-end;display:flex;margin-bottom:16px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .components-base-control__field{margin-bottom:0}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .post-publish-panel__postpublish-post-address{flex:1}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container input[readonly]{background:#ddd;overflow:hidden;padding:10px;text-overflow:ellipsis}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap{flex-shrink:0;margin-left:8px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap .components-button{height:38px}.editor-styles-wrapper .post-publish-panel__postpublish-header{font-weight:500}.editor-styles-wrapper .post-publish-panel__postpublish-subheader{margin:0 0 8px}.editor-styles-wrapper .post-publish-panel__tip{color:#f0b849}@media screen and (max-width:782px){.editor-styles-wrapper .post-publish-panel__postpublish-post-address__button-wrap .components-button{height:40px}}.editor-styles-wrapper .editor-post-saved-state{align-items:center;color:#757575;display:flex;overflow:hidden;padding:12px 4px;white-space:nowrap;width:28px}.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true]:hover,.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true]:hover{background:transparent;color:#757575}.editor-styles-wrapper .editor-post-saved-state svg{fill:currentColor;display:inline-block;flex:0 0 auto;margin-right:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-saved-state{padding:8px 12px;text-indent:inherit;width:auto}.editor-styles-wrapper .editor-post-saved-state svg{margin-right:0}}.editor-styles-wrapper .editor-post-save-draft.has-text.has-icon svg{margin-right:0}.editor-styles-wrapper :root[dir=rtl] .editor-post-saved-state.has-text.has-icon{justify-content:right}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-list{margin-left:-6px;margin-top:-6px;max-height:14em;overflow:auto;padding-left:6px;padding-top:6px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-choice{margin-bottom:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-subchoices{margin-left:16px;margin-top:8px}.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-add,.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-submit{margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-label{display:inline-block;margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-input{margin-top:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-filter{margin-bottom:8px;width:100%}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used .editor-post-taxonomies__flat-term-most-used-label{font-weight:400;margin-bottom:12px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list{margin:0}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list li{display:inline-block;margin-right:8px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list .components-button{font-size:12px}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{border:1px solid #949494;border-radius:0;box-shadow:none;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:16px!important;line-height:2.4;margin:0;min-height:200px;overflow:hidden;padding:16px;resize:none;transition:border .1s ease-out,box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{font-size:15px!important;padding:24px}}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);position:relative}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-url__link-label{font-size:13px;font-weight:400;margin:0}.editor-styles-wrapper .editor-post-url__link{direction:ltr;word-break:break-word}.editor-styles-wrapper .editor-post-url__link-slug{font-weight:600}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{border:1px solid #1e1e1e;border-radius:2px;border-radius:50%;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:24px;line-height:normal;margin-right:12px;margin-top:2px;padding:6px 8px;transition:box-shadow .1s linear;transition:none;width:24px}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:-ms-input-placeholder{color:rgba(30,30,30,.62)}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{height:20px;width:20px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:8px;margin:0;transform:translate(7px,7px);width:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{transform:translate(5px,5px)}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{color:#757575;margin-left:36px;margin-top:.5em}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{margin-left:32px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__choice:last-child .editor-post-visibility__info{margin-bottom:0}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-left:32px;padding:6px 8px;transition:box-shadow .1s linear;width:calc(100% - 32px)}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-title{position:relative}.editor-styles-wrapper .editor-post-title.is-focus-mode{opacity:.2;transition:opacity .1s linear}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-title.is-focus-mode{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-title.is-focus-mode:focus{opacity:1}.editor-styles-wrapper .editor-post-trash.components-button{display:flex;justify-content:center;margin-top:4px;width:100%}.editor-styles-wrapper .table-of-contents__popover.components-popover .components-popover__content{min-width:380px}.editor-styles-wrapper .components-popover.table-of-contents__popover{z-index:z-index(".components-popover.table-of-contents__popover")}.editor-styles-wrapper .table-of-contents__popover .components-popover__content{padding:16px}@media(min-width:600px){.editor-styles-wrapper .table-of-contents__popover .components-popover__content{max-height:calc(100vh - 120px);overflow-y:auto}}.editor-styles-wrapper .table-of-contents__popover hr{margin:10px -16px 0}.editor-styles-wrapper .table-of-contents__wrapper:focus:before{bottom:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}.editor-styles-wrapper .table-of-contents__counts{display:flex;flex-wrap:wrap;margin:-8px 0 0}.editor-styles-wrapper .table-of-contents__count{color:#1e1e1e;display:flex;flex-basis:33%;flex-direction:column;font-size:13px;margin-bottom:0;margin-top:8px;padding-right:8px}.editor-styles-wrapper .table-of-contents__count:nth-child(4n){padding-right:0}.editor-styles-wrapper .table-of-contents__number,.editor-styles-wrapper .table-of-contents__popover .word-count{color:#1e1e1e;font-size:21px;font-weight:400;line-height:30px}.editor-styles-wrapper .table-of-contents__title{display:block;font-size:15px;font-weight:600;margin-top:20px}.editor-styles-wrapper .editor-template-validation-notice{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-template-validation-notice .components-button{margin-left:5px}.components-modal__frame,.imajinn-block-editor{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before,.imajinn-block-editor *,.imajinn-block-editor :after,.imajinn-block-editor :before{box-sizing:inherit}1 .imajinn-header{align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;display:flex;height:80px;justify-content:flex-start;left:-20px;padding-left:20px;position:relative;width:calc(100% + 20px)}.imajinn-header__title{font-size:16px;padding:0 20px}.imajinn-sidebar{background:#fff;border-left:1px solid #e0e0e0;bottom:0;color:#1e1e1e;display:none;height:100vh;overflow:hidden;position:fixed;right:0;top:0;width:280px;z-index:z-index(".edit-site-sidebar")}@media(min-width:600px){.imajinn-sidebar{-webkit-overflow-scrolling:touch;height:auto;overflow:auto;top:126px}}@media(min-width:782px){.imajinn-sidebar{top:112px}}@media(min-width:600px){.imajinn-sidebar{display:block}}.imajinn-sidebar>.components-panel{border-left:0;border-right:0;margin-bottom:-1px;margin-top:-1px}.imajinn-sidebar>.components-panel>.components-panel__header{background:#e0e0e0}.imajinn-sidebar .block-editor-block-inspector h2,.imajinn-sidebar .block-editor-block-inspector h3,.imajinn-sidebar .block-editor-block-inspector__card{margin:0}.imajinn-block-editor__block-list{margin-left:auto;margin-right:20px;margin-top:140px!important;padding-bottom:0;padding-top:0}.imajinn-block-editor__block-list .block-editor-block-list__block{margin-left:auto;margin-right:auto}body.block-editor-page,html.wp-toolbar{background:#fff}body.block-editor-page #wpcontent{padding-left:0}body.block-editor-page #wpbody-content{padding-bottom:0}body.block-editor-page #wpbody-content>div:not(.block-editor):not(#screen-meta),body.block-editor-page #wpfooter{display:none}body.block-editor-page .a11y-speak-region{left:-1px;top:-1px}body.block-editor-page ul#adminmenu a.wp-has-current-submenu:after,body.block-editor-page ul#adminmenu>li.current>a.current:after{border-right-color:#fff}body.block-editor-page .media-frame select.attachment-filters:last-of-type{max-width:100%;width:auto}.imajinn-block-editor{min-height:calc(100vh - 32px)}.imajinn-block-editor .block-list-appender,.imajinn-block-editor .components-toolbar-group:has(.block-editor-block-settings-menu){display:none}.imajinn-block-editor .components-snackbar-list{bottom:40px;left:160px;padding-left:16px;padding-right:16px;position:fixed;right:0}.editor-styles-wrapper{color:#1e1e1e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:1.8;width:100%}@media(min-width:600px){.editor-styles-wrapper{width:calc(100% - 280px)}}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__no-avatar:before{content:"";font:normal 20px/1 dashicons;margin-right:5px;vertical-align:middle}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-avatar{flex-grow:0;flex-shrink:0;height:24px;margin-right:8px;max-width:none;width:24px}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-name{flex-grow:1;flex-shrink:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user .editor-autocompleters__user-slug{color:#757575;flex-grow:0;flex-shrink:0;margin-left:8px;max-width:100px;overflow:none;text-overflow:ellipsis;white-space:nowrap}.editor-styles-wrapper .editor-autocompleters__user:hover .editor-autocompleters__user-slug{color:var(--wp-admin-theme-color)}.editor-styles-wrapper .document-outline{margin:20px 0}.editor-styles-wrapper .document-outline ul{margin:0;padding:0}.editor-styles-wrapper .document-outline__item{display:flex;margin:4px 0}.editor-styles-wrapper .document-outline__item a{text-decoration:none}.editor-styles-wrapper .document-outline__item .document-outline__emdash:before{color:#ddd;margin-right:4px}.editor-styles-wrapper .document-outline__item.is-h2 .document-outline__emdash:before{content:"—"}.editor-styles-wrapper .document-outline__item.is-h3 .document-outline__emdash:before{content:"——"}.editor-styles-wrapper .document-outline__item.is-h4 .document-outline__emdash:before{content:"———"}.editor-styles-wrapper .document-outline__item.is-h5 .document-outline__emdash:before{content:"————"}.editor-styles-wrapper .document-outline__item.is-h6 .document-outline__emdash:before{content:"—————"}.editor-styles-wrapper .document-outline__button{align-items:flex-start;background:none;border:none;border-radius:2px;color:#1e1e1e;cursor:pointer;display:flex;margin:0 0 0 -1px;padding:2px 5px 2px 1px;text-align:left}.editor-styles-wrapper .document-outline__button:disabled{cursor:default}.editor-styles-wrapper .document-outline__button:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .document-outline__level{background:#ddd;border-radius:3px;color:#1e1e1e;font-size:13px;margin-right:4px;padding:1px 6px}.is-invalid .editor-styles-wrapper .document-outline__level{background:#f0b849}.editor-styles-wrapper .document-outline__item-content{padding:1px 0}.editor-styles-wrapper .components-editor-notices__dismissible,.editor-styles-wrapper .components-editor-notices__pinned{color:#1e1e1e;left:0;position:relative;right:0;top:0}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice,.editor-styles-wrapper .components-editor-notices__pinned .components-notice{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;margin:0;min-height:60px;padding:0 12px}.editor-styles-wrapper .components-editor-notices__dismissible .components-notice .components-notice__dismiss,.editor-styles-wrapper .components-editor-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}.editor-styles-wrapper .entities-saved-states__panel{background:#fff;bottom:0;box-sizing:border-box;left:0;overflow:auto;position:fixed;right:0;top:46px;z-index:z-index(".entities-saved-states__panel")}.editor-styles-wrapper .entities-saved-states__panel *,.editor-styles-wrapper .entities-saved-states__panel :after,.editor-styles-wrapper .entities-saved-states__panel :before{box-sizing:inherit}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:none}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:block}@media(min-width:782px){.editor-styles-wrapper .entities-saved-states__panel{border-left:1px solid #ddd;left:auto;top:32px;width:280px}body.is-fullscreen-mode .editor-styles-wrapper .entities-saved-states__panel{top:0}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity{display:block}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__find-entity-small{display:none}}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__panel-header{background:#fff;border-bottom:1px solid #ddd;height:61px;padding-left:8px;padding-right:8px}.editor-styles-wrapper .entities-saved-states__panel .entities-saved-states__text-prompt{padding:16px 16px 4px}.editor-styles-wrapper .editor-error-boundary{box-shadow:0 10px 10px rgba(0,0,0,.25);margin:60px auto auto;max-width:780px;padding:20px}.editor-styles-wrapper .editor-page-attributes__order{width:100%}.editor-styles-wrapper .editor-page-attributes__order .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-page-attributes__order input{width:66px}.editor-styles-wrapper .editor-post-excerpt__textarea{margin-bottom:10px;width:100%}.editor-styles-wrapper .editor-post-featured-image{padding:0}.editor-styles-wrapper .editor-post-featured-image__container{margin-bottom:1em;position:relative}.editor-styles-wrapper .editor-post-featured-image .components-spinner{left:50%;margin-left:-9px;margin-top:-9px;position:absolute;top:50%}.editor-styles-wrapper .editor-post-featured-image .components-button+.components-button{display:block;margin-top:1em}.editor-styles-wrapper .editor-post-featured-image .components-responsive-wrapper__content{max-width:100%;width:auto}.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{box-shadow:0 0 0 0 var(--wp-admin-theme-color);display:block;padding:0;transition:all .1s ease-out;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-featured-image__preview,.editor-styles-wrapper .editor-post-featured-image__toggle{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-featured-image__preview{height:auto}.editor-styles-wrapper .editor-post-featured-image__preview:not(:disabled):not([aria-disabled=true]):focus{box-shadow:0 0 0 4px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-featured-image__toggle{background-color:#f0f0f0;border-radius:2px;line-height:20px;min-height:90px;padding:8px 0;text-align:center}.editor-styles-wrapper .editor-post-featured-image__toggle:hover{background:#ddd;color:#1e1e1e}.editor-styles-wrapper [class].editor-post-format__suggestion{margin:4px 0 0}.editor-styles-wrapper .editor-post-last-revision__title{font-weight:600;width:100%}.editor-styles-wrapper .editor-post-last-revision__title .dashicon{margin-right:5px}.editor-styles-wrapper .components-button.editor-post-last-revision__title{height:100%}.editor-styles-wrapper .components-button.editor-post-last-revision__title:active,.editor-styles-wrapper .components-button.editor-post-last-revision__title:hover{background:#f0f0f0}.editor-styles-wrapper .components-button.editor-post-last-revision__title:focus{border-radius:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}@media(min-width:600px){.editor-styles-wrapper .editor-post-locked-modal{max-width:480px}}.editor-styles-wrapper .editor-post-locked-modal .components-modal__content{display:flex}.editor-styles-wrapper .editor-post-locked-modal__buttons{margin-top:24px}.editor-styles-wrapper .editor-post-locked-modal__avatar{border-radius:2px;margin-right:24px;margin-top:16px}.editor-styles-wrapper .editor-post-publish-button__button.has-changes-dot:before{background:currentcolor;border-radius:4px;content:"";height:8px;margin:auto 5px auto -3px;width:8px}.editor-styles-wrapper .editor-post-publish-panel{background:#fff}.editor-styles-wrapper .editor-post-publish-panel__content{min-height:calc(100% - 144px)}.editor-styles-wrapper .editor-post-publish-panel__content .components-spinner{display:block;margin:100px auto 0}.editor-styles-wrapper .editor-post-publish-panel__header{align-content:space-between;align-items:center;background:#fff;border-bottom:1px solid #ddd;display:flex;height:61px;padding-left:16px;padding-right:16px}.editor-styles-wrapper .editor-post-publish-panel__header .components-button{justify-content:center;width:100%}.editor-styles-wrapper .editor-post-publish-panel__header .has-icon{margin-left:auto;width:auto}.editor-styles-wrapper .components-site-card{align-items:center;display:flex;margin:16px 0}.editor-styles-wrapper .components-site-icon{border:none;border-radius:2px;height:36px;margin-right:12px;width:36px}.editor-styles-wrapper .components-site-name{display:block;font-size:14px}.editor-styles-wrapper .components-site-home{color:#757575;display:block;font-size:12px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{flex-grow:1}@media(min-width:480px){.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button,.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{max-width:160px}}.editor-styles-wrapper .editor-post-publish-panel__header-publish-button{padding-right:4px}.editor-styles-wrapper .editor-post-publish-panel__header-cancel-button{padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__header-published{flex-grow:1}.editor-styles-wrapper .editor-post-publish-panel__footer{padding:16px}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary{align-items:center;display:inline-flex}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary.is-busy .dashicon{display:none}.editor-styles-wrapper .components-button.editor-post-publish-panel__toggle.is-primary .dashicon{margin-right:-4px}.editor-styles-wrapper .editor-post-publish-panel__link{font-weight:400;padding-left:4px}.editor-styles-wrapper .editor-post-publish-panel__prepublish{padding:16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish strong{color:#1e1e1e}.editor-styles-wrapper .editor-post-publish-panel__prepublish .components-panel__body{background:#fff;margin-left:-16px;margin-right:-16px}.editor-styles-wrapper .editor-post-publish-panel__prepublish .editor-post-visibility__dialog-legend{display:none}.editor-styles-wrapper .post-publish-panel__postpublish .components-panel__body{border-bottom:1px solid #e0e0e0;border-top:none}.editor-styles-wrapper .post-publish-panel__postpublish-buttons{align-content:space-between;display:flex;flex-wrap:wrap;margin:-5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons>*{flex-grow:1;margin:5px}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-button{flex:1;height:auto;justify-content:center;line-height:1.6;padding:3px 10px 4px;text-align:center;white-space:normal}.editor-styles-wrapper .post-publish-panel__postpublish-buttons .components-clipboard-button{width:100%}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container{align-items:flex-end;display:flex;margin-bottom:16px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .components-base-control__field{margin-bottom:0}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container .post-publish-panel__postpublish-post-address{flex:1}.editor-styles-wrapper .post-publish-panel__postpublish-post-address-container input[readonly]{background:#ddd;overflow:hidden;padding:10px;text-overflow:ellipsis}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap{flex-shrink:0;margin-left:8px}.editor-styles-wrapper .post-publish-panel__postpublish-post-address__copy-button-wrap .components-button{height:38px}.editor-styles-wrapper .post-publish-panel__postpublish-header{font-weight:500}.editor-styles-wrapper .post-publish-panel__postpublish-subheader{margin:0 0 8px}.editor-styles-wrapper .post-publish-panel__tip{color:#f0b849}@media screen and (max-width:782px){.editor-styles-wrapper .post-publish-panel__postpublish-post-address__button-wrap .components-button{height:40px}}.editor-styles-wrapper .editor-post-saved-state{align-items:center;color:#757575;display:flex;overflow:hidden;padding:12px 4px;white-space:nowrap;width:28px}.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saved[aria-disabled=true]:hover,.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true],.editor-styles-wrapper .editor-post-saved-state.is-saving[aria-disabled=true]:hover{background:transparent;color:#757575}.editor-styles-wrapper .editor-post-saved-state svg{fill:currentColor;display:inline-block;flex:0 0 auto;margin-right:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-saved-state{padding:8px 12px;text-indent:inherit;width:auto}.editor-styles-wrapper .editor-post-saved-state svg{margin-right:0}}.editor-styles-wrapper .editor-post-save-draft.has-text.has-icon svg{margin-right:0}.editor-styles-wrapper :root[dir=rtl] .editor-post-saved-state.has-text.has-icon{justify-content:right}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-list{margin-left:-6px;margin-top:-6px;max-height:14em;overflow:auto;padding-left:6px;padding-top:6px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-choice{margin-bottom:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-subchoices{margin-left:16px;margin-top:8px}.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-add,.editor-styles-wrapper .components-button.editor-post-taxonomies__hierarchical-terms-submit{margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-label{display:inline-block;margin-top:12px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-input{margin-top:8px}.editor-styles-wrapper .editor-post-taxonomies__hierarchical-terms-filter{margin-bottom:8px;width:100%}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used .editor-post-taxonomies__flat-term-most-used-label{font-weight:400;margin-bottom:12px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list{margin:0}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list li{display:inline-block;margin-right:8px}.editor-styles-wrapper .editor-post-taxonomies__flat-term-most-used-list .components-button{font-size:12px}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{border:1px solid #949494;border-radius:0;box-shadow:none;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:16px!important;line-height:2.4;margin:0;min-height:200px;overflow:hidden;padding:16px;resize:none;transition:border .1s ease-out,box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor{font-size:15px!important;padding:24px}}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);position:relative}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .edit-post-text-editor__body textarea.editor-post-text-editor:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-url__link-label{font-size:13px;font-weight:400;margin:0}.editor-styles-wrapper .editor-post-url__link{direction:ltr;word-break:break-word}.editor-styles-wrapper .editor-post-url__link-slug{font-weight:600}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{border:1px solid #1e1e1e;border-radius:2px;border-radius:50%;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;height:24px;line-height:normal;margin-right:12px;margin-top:2px;padding:6px 8px;transition:box-shadow .1s linear;transition:none;width:24px}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:-ms-input-placeholder{color:rgba(30,30,30,.62)}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]{height:20px;width:20px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:8px;margin:0;transform:translate(7px,7px);width:8px}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked:before{transform:translate(5px,5px)}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{color:#757575;margin-left:36px;margin-top:.5em}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__info{margin-left:32px}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__choice:last-child .editor-post-visibility__info{margin-bottom:0}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{border:1px solid #757575;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-left:32px;padding:6px 8px;transition:box-shadow .1s linear;width:calc(100% - 32px)}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]{font-size:13px;line-height:normal}}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.editor-styles-wrapper .editor-post-visibility__fieldset .editor-post-visibility__password .editor-post-visibility__password-input[type=text]:-ms-input-placeholder{color:rgba(30,30,30,.62)}.editor-styles-wrapper .editor-post-title{position:relative}.editor-styles-wrapper .editor-post-title.is-focus-mode{opacity:.2;transition:opacity .1s linear}@media(prefers-reduced-motion:reduce){.editor-styles-wrapper .editor-post-title.is-focus-mode{transition-delay:0s;transition-duration:0s}}.editor-styles-wrapper .editor-post-title.is-focus-mode:focus{opacity:1}.editor-styles-wrapper .editor-post-trash.components-button{display:flex;justify-content:center;margin-top:4px;width:100%}.editor-styles-wrapper .table-of-contents__popover.components-popover .components-popover__content{min-width:380px}.editor-styles-wrapper .components-popover.table-of-contents__popover{z-index:z-index(".components-popover.table-of-contents__popover")}.editor-styles-wrapper .table-of-contents__popover .components-popover__content{padding:16px}@media(min-width:600px){.editor-styles-wrapper .table-of-contents__popover .components-popover__content{max-height:calc(100vh - 120px);overflow-y:auto}}.editor-styles-wrapper .table-of-contents__popover hr{margin:10px -16px 0}.editor-styles-wrapper .table-of-contents__wrapper:focus:before{bottom:0;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}.editor-styles-wrapper .table-of-contents__counts{display:flex;flex-wrap:wrap;margin:-8px 0 0}.editor-styles-wrapper .table-of-contents__count{color:#1e1e1e;display:flex;flex-basis:33%;flex-direction:column;font-size:13px;margin-bottom:0;margin-top:8px;padding-right:8px}.editor-styles-wrapper .table-of-contents__count:nth-child(4n){padding-right:0}.editor-styles-wrapper .table-of-contents__number,.editor-styles-wrapper .table-of-contents__popover .word-count{color:#1e1e1e;font-size:21px;font-weight:400;line-height:30px}.editor-styles-wrapper .table-of-contents__title{display:block;font-size:15px;font-weight:600;margin-top:20px}.editor-styles-wrapper .editor-template-validation-notice{align-items:center;display:flex;justify-content:space-between}.editor-styles-wrapper .editor-template-validation-notice .components-button{margin-left:5px}.components-modal__frame,.imajinn-block-editor{box-sizing:border-box}.components-modal__frame *,.components-modal__frame :after,.components-modal__frame :before,.imajinn-block-editor *,.imajinn-block-editor :after,.imajinn-block-editor :before{box-sizing:inherit} -
imajinn-ai/trunk/imajinn-ai.php
r2796851 r2833326 5 5 * Requires at least: 6.0 6 6 * Requires PHP: 7.0 7 * Version: 1. 47 * Version: 1.5 8 8 * Author: Infinite Uploads 9 9 * Author URI: https://infiniteuploads.com … … 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 13 * Text Domain: imajinn-ai 14 14 15 * 15 16 * @package imajinn-ai … … 20 21 */ 21 22 22 define( 'IMAJINN_AI_VERSION', '1. 4' );23 define( 'IMAJINN_AI_VERSION', '1.5' ); 23 24 24 25 class Imajinn_AI { … … 135 136 //get history from post type 136 137 $history = []; 137 $posts = get_posts( [138 'post_type' => 'imajinn_prompt',139 'post_status' => 'publish',140 'posts_per_page' => 20,141 'orderby' => 'date',142 'order' => 'DESC',138 $posts = get_posts( [ 139 'post_type' => 'imajinn_prompt', 140 'post_status' => 'publish', 141 'posts_per_page' => 20, 142 'orderby' => 'date', 143 'order' => 'DESC', 143 144 ] ); 144 145 foreach ( $posts as $post ) { … … 203 204 ?> 204 205 <div 205 id="imajinn-block-editor"206 class="imajinn-block-editor"206 id="imajinn-block-editor" 207 class="imajinn-block-editor" 207 208 > 208 209 <?php esc_html_e( 'Loading Editor...', 'imajinn-ai' ); ?> … … 331 332 //rename vars for saving 332 333 $full_prompt = $prompt; 333 $prompt = $orig_prompt;334 $prompt = $orig_prompt; 334 335 335 336 //save to history post type … … 407 408 408 409 // check caps 409 $params = $this->check_ajax(); 410 $image = esc_url_raw( $params['url'] ); 411 $prompt = sanitize_text_field( $params['prompt'] ); 412 $post_id = absint( $params['post_id'] ); 410 $params = $this->check_ajax(); 411 $image = esc_url_raw( $params['url'] ); 412 $orig_prompt = sanitize_text_field( $params['prompt'] ); 413 $post_id = absint( $params['post_id'] ); 414 415 $prompt_style = trim( sanitize_text_field( $params['prompt_style'] ), " \t\n\r\0\x0B,/." ); 416 $prompt = $orig_prompt . ' ' . $prompt_style; 413 417 414 418 $size = 'full'; 415 419 //make api call to upscale the image 416 $upscaled_result = $this->api_request( sprintf( 'site/%s/upscale', $this->get_site_id() ), compact( 'image' ) );420 $upscaled_result = $this->api_request( sprintf( 'site/%s/upscale', $this->get_site_id() ), compact( 'image', 'prompt' ) ); 417 421 if ( ! is_wp_error( $upscaled_result ) && ! empty( $upscaled_result->image ) ) { 418 422 $image = $upscaled_result->image; … … 420 424 } 421 425 422 $attachment_id = media_sideload_image( $image, $post_id, $ prompt, 'id' );426 $attachment_id = media_sideload_image( $image, $post_id, $orig_prompt, 'id' ); 423 427 if ( is_wp_error( $attachment_id ) ) { 424 428 wp_send_json_error( $attachment_id ); 425 429 } 426 430 431 //add alt text to attachment 432 $alt = wp_strip_all_tags( $prompt, true ); 433 update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $alt ) ); 434 427 435 list( $url, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $size ); 428 436 wp_send_json_success( compact( 'attachment_id', 'url', 'width', 'height', 'size' ) ); … … 434 442 $params = $this->check_ajax(); 435 443 436 $prompt 444 $prompt = sanitize_text_field( $params['prompt'] ); 437 445 438 446 //make api call to fix the image … … 454 462 $params = $this->check_ajax(); 455 463 456 $image 464 $image = esc_url_raw( $params['image'] ); 457 465 458 466 //make api call to fix the image … … 511 519 512 520 $headers = array( 513 'Accept' => 'application/json', 514 'Content-Type' => 'application/json', 521 'Accept' => 'application/json', 522 'Content-Type' => 'application/json', 523 'x-plugin-version' => IMAJINN_AI_VERSION, 515 524 ); 516 525
Note: See TracChangeset
for help on using the changeset viewer.