/*! For license information please see 4488-4f2cf239b8ee6db7948d.js.LICENSE.txt */
"use strict";(self.webpackChunkcircle=self.webpackChunkcircle||[]).push([[4488],{13435:(t,e,r)=>{r.d(e,{u:()=>u});var n=r(86385),o=r(81786),i=r(35282),a=r(37793),c=r(85893),u=function(t){var e=t.addEmbed,r=t.embedUrl,u=t.imageError,l=t.onChangeEmbedUrl;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.Y,{error:u}),(0,c.jsx)("input",{value:r,style:{borderWidth:1},className:"upload-input placeholder:text-light placeholder:opacity-100",placeholder:(0,n.t)("image_upload.paste_image_file"),onChange:l,type:"text"}),(0,c.jsx)("div",{className:"flex w-full flex-row justify-center",children:(0,c.jsx)(o.z,{large:!0,variant:"circle",disabled:!r,onClick:e,children:(0,n.t)("image_upload.embed_image")})}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(i.Z.BodySm,{textAlign:"text-center",children:(0,n.t)("image_upload.works_with_image_type")})})]})}},29613:(t,e,r)=>{r.d(e,{p:()=>u});var n=r(86385),o=r(54030),i=r(32942),a=r(37793),c=r(85893),u=function(t){var e=t.imageError,r=t.insertFiles,u=t.aspectRatioHelpText,l=(0,o.kK)();return(0,c.jsxs)("div",{className:"upload-form",children:[(0,c.jsx)(a.Y,{error:e}),(0,c.jsx)(i.r,{onFileDrop:r,dropTitle:l?(0,n.t)("image_upload.click_here_to_upload_image"):(0,n.t)("image_upload.drag_image"),helperText:(0,c.jsxs)(c.Fragment,{children:[(0,n.t)("image_upload.works_with_image_type"),u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),u]})]})})]})}},37793:(t,e,r)=>{r.d(e,{Y:()=>o});var n=r(85893),o=function(t){var e=t.error;return e?(0,n.jsx)("div",{className:"image-error",children:e}):(0,n.jsx)(n.Fragment,{})}},34488:(t,e,r)=>{r.d(e,{K:()=>U});var n=r(67294),o=r(86385),i=r(74666),a=r(44783),c=r(88604),u=r(33275),l=r(62977),s=r(41120),f=r(8786),h=r(85893),d=(0,s.Z)((function(t){return{root:{},margin:{height:t.spacing(1)}}})),p=(0,f.Z)({root:{height:8},thumb:{height:20,width:20,backgroundColor:"#fff",border:"2px solid rgba(138, 148, 166, 0.3)",marginTop:-8,marginLeft:-10,"&:focus,&:hover,&$active":{boxShadow:"inherit"}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:4,borderRadius:2,backgroundColor:"#506cf0"},rail:{height:4,borderRadius:2,backgroundColor:"#e5e7eb"}})(l.Z),v=function(t){var e=t.value,r=t.onChange,n=d();return(0,h.jsxs)("div",{className:n.root,children:[(0,h.jsx)("div",{className:n.margin}),(0,h.jsx)(p,{value:e,min:1,max:3,step:.1,"aria-labelledby":"Zoom",onChange:r})]})},y=r(37793),m=function(t){var e=t.imageError,r=t.file,n=t.crop,o=t.aspectRatio,i=t.zoom,a=t.setCrop,c=t.setZoom,l=t.onCropComplete;return(0,h.jsxs)("div",{className:"crop-content",children:[(0,h.jsx)(y.Y,{error:e}),(0,h.jsx)("div",{className:"crop-content__box",children:(0,h.jsx)(u.Z,{image:r,crop:n,aspect:o,zoom:i,onCropChange:a,onZoomChange:c,onCropComplete:l})}),(0,h.jsx)(v,{value:i,onChange:function(t,e){Array.isArray(e)&&"number"===typeof e[0]?c(e[0]):"number"===typeof e&&c(e)}})]})},g=r(2002),b=r(6952),w=r(6150),x=r(13435),_=r(29613),j=function(t){var e=t.addEmbed,r=t.addUnsplash,n=t.aspectRatioHelpText,i=t.embedUrl,a=t.hideEmbedUrl,c=t.hideUnsplash,u=t.imageError,l=t.insertFiles,s=t.onChangeEmbedUrl,f=t.searchUnsplash,d=t.unsplashResults;return(0,h.jsxs)(b.O.Group,{children:[(0,h.jsxs)(b.O.List,{className:"border-primary border-b",children:[(0,h.jsx)(b.O,{children:(0,o.t)("upload")}),!c&&(0,h.jsx)(b.O,{children:(0,h.jsx)(g.$,{})}),!a&&(0,h.jsx)(b.O,{children:(0,o.t)("image_upload.embed")})]}),(0,h.jsxs)(b.O.Panels,{className:"!h-[calc(100vh-57px-72px)] md:!h-full",children:[(0,h.jsx)(b.O.Panel,{children:(0,h.jsx)(_.p,{imageError:u,insertFiles:l,aspectRatioHelpText:n})}),!c&&(0,h.jsx)(b.O.Panel,{children:(0,h.jsx)(w.A,{unsplashResults:d,searchUnsplash:f,addUnsplash:r})}),!a&&(0,h.jsx)(b.O.Panel,{children:(0,h.jsx)(x.u,{imageError:u,embedUrl:i,onChangeEmbedUrl:s,addEmbed:e})})]})]})};function L(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var E=L(L(L(L(L({},i.pI.THUMBNAIL,(0,o.t)("image_upload.recommended_size_thumbnail")),i.pI.OPEN_GRAPH,(0,o.t)("image_upload.recommended_size_opengraph")),i.pI.DEFAULT,(0,o.t)("image_upload.recommended_size_default")),i.pI.SPACE_COVER,(0,o.t)("image_upload.recommended_size_v2_cover")),i.pI.COVER_V3,(0,o.t)("image_upload.recommended_size_v3_cover")),k=r(23082);function C(){C=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new S(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(T([])));_&&_!==r&&n.call(_,a)&&(w=_);var j=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,o(j,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),l(j,u,"Generator"),l(j,a,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function O(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function P(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){O(i,n,o,a,c,"next",t)}function c(t){O(i,n,o,a,c,"throw",t)}a(void 0)}))}}var A=function(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){return t.target&&t.target.result&&"string"===typeof t.target.result?e(t.target.result):e(void 0)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))},S=["image/gif","image/jpeg","image/png"],T=function(t){return!!t&&S.includes(t)},N=function(){return Math.random().toString(36).replace(/[^a-z]+/g,"").slice(0,5)},I=function(){var t=P(C().mark((function t(e){var r,n,o,i;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=e.trim(),t.next=4,k.q.search.getPhotos({query:n,page:1,perPage:30,orientation:"landscape"});case 4:if(o=t.sent,i=(null===(r=o.response)||void 0===r?void 0:r.results)||[],!(e.length>=1&&i.length>=1)){t.next=8;break}return t.abrupt("return",i);case 8:return t.abrupt("return",[]);case 11:return t.prev=11,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",[]);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),H=function(){var t=P(C().mark((function t(e){var r,n;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(e);case 3:if((r=t.sent).ok){t.next=6;break}throw new Error((0,o.t)("image_upload.embed_network_error"));case 6:if(n=r.headers.get("content-type"),T(n)){t.next=9;break}throw new Error((0,o.t)("image_upload.invalid_file_type_error"));case 9:t.next=14;break;case 11:throw t.prev=11,t.t0=t.catch(0),new Error((0,o.t)("image_upload.embed_error"));case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),F=function(t){return new Promise((function(e,r){var n=new Image;n.addEventListener("load",(function(){e(n)})),n.addEventListener("error",(function(){r(new Error((0,o.t)("image_upload.embed_error")))})),n.setAttribute("crossOrigin","anonymous"),n.src=t}))},R=function(){var t=P(C().mark((function t(e,r,n,i){var a,c,u,l,s,f,h,d,p;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=document.createElement("canvas"),c=a.getContext("2d")){t.next=4;break}throw new Error((0,o.t)("image_upload.canvas_context_error"));case 4:return a.width=r.width,a.height=r.height,t.next=8,F(e);case 8:return u=t.sent,l=r.x,s=r.y,f=r.width,h=r.height,0,0,d=a.width,p=a.height,c.drawImage(u,l,s,f,h,0,0,d,p),t.abrupt("return",new Promise((function(t,e){a.toBlob((function(r){if(r)try{var o=new File([r],n,{type:i});t(o)}catch(a){e(a)}else e(null)}),i)})));case 19:case"end":return t.stop()}}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}();function M(){M=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(S([])));_&&_!==r&&n.call(_,a)&&(w=_);var j=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,o(j,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),l(j,u,"Generator"),l(j,a,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function G(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function D(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){G(i,n,o,a,c,"next",t)}function c(t){G(i,n,o,a,c,"throw",t)}a(void 0)}))}}function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return B(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var U=function(t){var e=t.aspectRatio,r=void 0===e?i.pI.DEFAULT:e,u=t.attachImage,l=void 0===u?null:u,s=t.closeModal,f=t.customAspectRatioHelpText,d=void 0===f?"":f,p=t.formClass,v=void 0===p?"":p,y=t.hasFile,g=void 0!==y&&y,b=t.hideEmbedUrl,w=void 0!==b&&b,x=t.hideUnsplash,_=void 0!==x&&x,L=t.inputFieldName,k=void 0===L?"":L,C=t.isCropEnabled,O=void 0!==C&&C,P=t.setIsLoading,S=void 0===P?function(){return!1}:P,F=t.saveImage,G=void 0===F?null:F,B=t.setHasFile,U=t.showModal,Z=void 0!==U&&U,Y=t.title,W=void 0===Y?"":Y,z=t.uploadProgress,q=V((0,n.useState)(),2),$=q[0],Q=q[1],K=V((0,n.useState)(),2),J=K[0],X=K[1],tt=V((0,n.useState)({x:0,y:0}),2),et=tt[0],rt=tt[1],nt=V((0,n.useState)(null),2),ot=nt[0],it=nt[1],at=V((0,n.useState)(1),2),ct=at[0],ut=at[1],lt=V((0,n.useState)(""),2),st=lt[0],ft=lt[1],ht=V((0,n.useState)([]),2),dt=ht[0],pt=ht[1],vt=V((0,n.useState)(""),2),yt=vt[0],mt=vt[1],gt=g&&O,bt=d||(E[r]||""),wt=function(){var t=D(M().mark((function t(e){var r;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I(e);case 2:r=t.sent,pt(r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){wt("wallpapers")}),[]);var xt=function(){var t=D(M().mark((function t(e){var r,n,i,a;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return X(e.urls.regular),B(!0),t.prev=2,S(!0),t.next=6,fetch(e.urls.regular);case 6:return r=t.sent,t.next=9,r.blob();case 9:n=t.sent,i=new File([n],"unsplash-".concat(e.id,".jpg"),{type:"image/jpeg"}),a=new c.Q(i,kt,v,k,z),O||(s(),a.start()),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(2),console.error("Error handling Unsplash image:",t.t0),mt((0,o.t)("image_upload.unsplash_error"));case 19:case"end":return t.stop()}}),t,null,[[2,15]])})));return function(e){return t.apply(this,arguments)}}(),_t=function(){var t=D(M().mark((function t(e){var r,n,i,a,u;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:Q(e),S(!0),r=Array.from(e),n=0,i=r;case 6:if(!(n<i.length)){t.next=24;break}if(a=i[n],!T(a.type)){t.next=19;break}return mt(""),t.next=13,A(a);case 13:u=t.sent,B(!0),X(u),O||(s(),new c.Q(a,kt,v,k,z).start()),t.next=21;break;case 19:S(!1),mt((0,o.t)("image_upload.invalid_file_type_error"));case 21:n++,t.next=6;break;case 24:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),jt=function(){var t=D(M().mark((function t(){var e,r,n;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,H(st);case 3:return S(!0),X(st),B(!0),t.next=8,fetch(st);case 8:return e=t.sent,t.next=11,e.blob();case 11:r=t.sent,n=new File([r],"embed-".concat(N(),".jpg"),{type:e.headers.get("content-type")||"image/jpeg"}),O||(s(),new c.Q(n,kt,v,k,z).start()),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(0),t.t0 instanceof Error&&mt(t.t0.message);case 19:case"end":return t.stop()}}),t,null,[[0,16]])})));return function(){return t.apply(this,arguments)}}(),Lt=(0,n.useCallback)((function(t,e){it(e)}),[]),Et=(0,n.useCallback)(D(M().mark((function t(){var e,r,n,i,a;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,S(!0),J&&ot){t.next=4;break}throw new Error((0,o.t)("image_upload.file_cropped_area_error"));case 4:return e=$?Array.from($):[],r=e?e[0]:null,n=r?r.name:N(),i=r?r.type:"image/jpeg",t.next=10,R(J,ot,n,i);case 10:a=t.sent,s(),Ct(),new c.Q(a,kt,v,k,z).start(),t.next=22;break;case 17:t.prev=17,t.t0=t.catch(0),S(!1),console.error(t.t0),t.t0 instanceof Error&&mt(t.t0.message);case 22:case"end":return t.stop()}}),t,null,[[0,17]])}))),[ot]),kt=(0,n.useCallback)((function(t,e){l&&l(t,e),G&&G(e),S(!1)}),[l,G]),Ct=function(){X(void 0),Q(void 0),rt({x:0,y:0}),B(!1),ft("")};return(0,h.jsx)("div",{className:"editor-modal",children:(0,h.jsxs)(a.AB,{onClose:s,footerActions:{onCancel:Ct,onSaveChanges:Et},shouldShowActionsFooter:g&&O,title:W,isOpen:Z,children:[gt&&(0,h.jsx)(m,{file:J,crop:et,onCropComplete:Lt,aspectRatio:r,zoom:ct,setZoom:ut,setCrop:rt,imageError:yt}),!g&&(0,h.jsx)(j,{hideUnsplash:_,hideEmbedUrl:w,unsplashResults:dt,searchUnsplash:wt,addUnsplash:xt,imageError:yt,insertFiles:_t,aspectRatioHelpText:bt,embedUrl:st,onChangeEmbedUrl:function(t){mt(""),ft(t.target.value)},addEmbed:jt})]})})}},4873:(t,e,r)=>{r.d(e,{d:()=>d});var n=r(67294),o=r(32942),i=r(80023),a=r(30108),c=r(85893);function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new S(n||[]);return o(a,"_invoke",{value:C(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",p="suspendedYield",v="executing",y="completed",m={};function g(){}function b(){}function w(){}var x={};s(x,a,(function(){return this}));var _=Object.getPrototypeOf,j=_&&_(_(T([])));j&&j!==r&&n.call(j,a)&&(x=j);var L=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:b,configurable:!0}),b.displayName=s(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},E(k.prototype),s(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),s(L,l,"Generator"),s(L,a,(function(){return this})),s(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function l(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||f(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){if(t){if("string"==typeof t)return h(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var d=function(t){var e=t.onClose,r=t.accept,h=t.dropTitle,d=t.helperText,p=t.children,v=(0,a.DM)().insertFile,y=s((0,n.useState)(0),2),m=y[0],g=y[1],b=(0,n.useRef)(null),w=function(t){e&&e();var r,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;v(o)}}catch(i){n.e(i)}finally{n.f()}g(m+1)},x=function(){var t,e=(t=u().mark((function t(e){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.preventDefault(),r=e.target.files,w(r);case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){l(i,n,o,a,c,"next",t)}function c(t){l(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}();return p&&(p=(0,n.cloneElement)(p,{onClick:function(t){0!==(null===t||void 0===t?void 0:t.detail)&&(t.preventDefault(),b.current.click())}})),(0,c.jsxs)("div",{className:"file-upload",children:[(0,c.jsx)("input",{ref:b,onChange:x,type:"file",style:{display:"none"},accept:r}),(0,c.jsx)(i.If,{condition:!!p,children:p||""}),(0,c.jsx)(i.If,{condition:!p,children:(0,c.jsx)(o.r,{onFileDrop:w,dropTitle:h,helperText:d})})]},m)}},44783:(t,e,r)=>{r.d(e,{QE:()=>Q,AB:()=>W});var n=r(30108),o=r(89011),i=r(86385),a=r(62557),c=r(67294),u=r(94347),l=r(27391),s=r(85893);function f(){f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new S(n||[]);return o(a,"_invoke",{value:C(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var d="suspendedStart",p="suspendedYield",v="executing",y="completed",m={};function g(){}function b(){}function w(){}var x={};l(x,a,(function(){return this}));var _=Object.getPrototypeOf,j=_&&_(_(T([])));j&&j!==r&&n.call(j,a)&&(x=j);var L=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},E(k.prototype),l(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),l(L,u,"Generator"),l(L,a,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function d(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))}}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return v(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var y=(0,i.t)("trix_editor.modal_copy.embed_helper_text"),m=function(t){var e=t.onClose,r=t.embedPlaceholder,o=t.embedDesc,a=t.helperText,h=t.embedBtn,v=(0,n.DM)().trixApiWrapper,m=p((0,c.useState)(""),2),g=m[0],b=m[1],w=(0,u.k)(),x=function(){var t=d(f().mark((function t(){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&e(),t.next=3,(0,l.Q)({content:g,trixApiWrapper:v});case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_=function(){var t=d(f().mark((function t(e){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.preventDefault(),t.next=3,x();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=Boolean(o),L=a!==y,E=!j&&L;return(0,s.jsxs)("form",{onSubmit:_,children:[(0,s.jsx)("input",{ref:w,value:g,style:{borderWidth:1},className:"upload-input placeholder:text-light placeholder:opacity-100",placeholder:r,onChange:function(t){b(t.target.value)},type:"text"}),(0,s.jsx)("button",{type:"submit",className:"btn btn-primary upload-btn",onClick:_,children:h}),(0,s.jsxs)("div",{className:"upload-embed__description",children:[j&&o,E&&a,!L&&(0,s.jsxs)("span",{children:[(0,i.t)("trix_editor.embed_form.works_with")," ",(0,s.jsx)("a",{href:"https://iframely.com/domains",target:"_blank",rel:"noreferrer",children:(0,i.t)("trix_editor.embed_form.content_providers")}),(0,i.t)("trix_editor.embed_form.including")]})]})]})};function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){w(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function w(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var x=function(t){for(var e=t.embedPlaceholder,r=t.helperText,n=t.embedBtn,o=t.onClose,c=arguments.length,u=new Array(c>1?c-1:0),l=1;l<c;l++)u[l-1]=arguments[l];return(0,s.jsxs)(a.m,{defaultValue:"Embed link",children:[(0,s.jsx)("div",{label:(0,i.t)("trix_editor.modal_copy.embed_link"),children:(0,s.jsx)(m,b(b({},u),{},{onClose:o,embedPlaceholder:e,helperText:r,embedBtn:n}))}),(0,s.jsx)("div",{label:""})]})},_=r(4873);function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){E(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var k=function(t){for(var e=t.embedPlaceholder,r=t.dropTitle,n=t.helperText,o=t.embedDesc,c=t.embedBtn,u=t.onClose,l=arguments.length,f=new Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];return(0,s.jsxs)(a.m,{defaultValue:"Upload",children:[(0,s.jsx)("div",{label:(0,i.t)("upload"),children:(0,s.jsx)("div",{className:"pt-3",children:(0,s.jsx)(_.d,L({onClose:u,dropTitle:r,helperText:n},f))})}),(0,s.jsx)("div",{label:(0,i.t)("trix_editor.modal_copy.embed_link"),children:(0,s.jsx)(m,L(L({},f),{},{onClose:u,embedPlaceholder:e,helperText:n,embedDesc:o,embedBtn:c}))})]})},C=r(2002),O=r(6150),P=r(23082);function A(){A=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new S(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(T([])));_&&_!==r&&n.call(_,a)&&(w=_);var j=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,o(j,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),l(j,u,"Generator"),l(j,a,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function S(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function T(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){S(i,n,o,a,c,"next",t)}function c(t){S(i,n,o,a,c,"throw",t)}a(void 0)}))}}function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return I(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var H=function(t){var e=t.onClose,r=(0,n.DM)().insertFile,o=N((0,c.useState)([]),2),i=o[0],a=o[1],u=function(t){P.q.photos.trackDownload({downloadLocation:t.links.download_location})};function l(){return(l=T(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:f(e.trim());case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t){return h.apply(this,arguments)}function h(){return(h=T(A().mark((function t(e){var r,n;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,P.q.search.getPhotos({query:e,page:1,perPage:30});case 2:r=t.sent,n=r.response.results,e.length>=1&&n.length>=1&&a(n);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return(0,c.useEffect)((function(){f("wallpapers")}),[]),(0,s.jsx)(O.A,{unsplashResults:i,searchUnsplash:function(t){return l.apply(this,arguments)},addUnsplash:function(t){u(t),fetch(t.urls.regular).then((function(t){return t.blob()})).then((function(e){var n=new File([e],t.id,{type:"image/jpeg"});r(n)})).catch((function(t){console.error(t)})),e()}})};function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?F(Object(r),!0).forEach((function(e){M(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function M(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var G=function(t){for(var e=t.embedPlaceholder,r=t.embedDesc,n=t.dropTitle,o=t.helperText,c=t.embedBtn,u=t.onClose,l=arguments.length,f=new Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];return(0,s.jsxs)(a.m,{defaultValue:"Upload",variant:"underline",children:[(0,s.jsx)("div",{label:(0,i.t)("upload"),children:(0,s.jsx)("div",{className:"pt-3",children:(0,s.jsx)(_.d,R(R({onClose:u,dropTitle:n,helperText:o},f),{},{accept:"image/*"}))})}),(0,s.jsx)("div",{label:(0,i.t)("trix_editor.modal_copy.embed_link"),children:(0,s.jsx)(m,R(R({},f),{},{onClose:u,embedPlaceholder:e,embedDesc:r,helperText:o,embedBtn:c}))}),(0,s.jsx)("div",{label:(0,s.jsx)(C.$,{}),children:(0,s.jsx)(H,R({onClose:u},f))})]})},D=(0,i.t)("trix_editor.modal_copy.embed_link"),V=(0,i.t)("trix_editor.modal_copy.paste_https"),B=r(94184),U=r.n(B),Z=r(81786),Y=r(82177),W=function(t){var e=t.onClose,r=t.title,n=t.children,o=t.footerActions,a=t.shouldShowActionsFooter,c=void 0!==a&&a,u=t.isOpen,l=void 0===u||u;return(0,s.jsxs)(Y.u_,{isOpen:l,onClose:e,className:"modal__box trix-modal__upload editor-modal fullpage-modal__attachment",children:[(0,s.jsx)(Y.u_.Overlay,{}),(0,s.jsxs)(Y.u_.Content,{size:"lg",children:[(0,s.jsxs)(Y.u_.Header,{className:U()({"justify-between":!!r,"!justify-end":!r}),children:[r&&(0,s.jsx)(Y.u_.Title,{size:"sm",children:r}),(0,s.jsx)(Y.u_.HeaderActions,{children:(0,s.jsx)(Y.u_.CloseButton,{onClick:e})})]}),(0,s.jsx)(Y.u_.Body,{className:"!pt-0 md:pb-6",children:n}),c&&(0,s.jsxs)(Y.u_.Footer,{className:"flex justify-end space-x-4",children:[(0,s.jsx)(Z.z,{type:"button",variant:"secondary",onClick:o.onCancel,children:(0,i.t)("cancel")}),(0,s.jsx)(Z.z,{type:"submit",variant:"circle",onClick:o.onSaveChanges,children:(0,i.t)("save_changes")})]})]})]})},z=function(t){var e=t.attribute,r=t.subtype,n=t.onClose,o=function(t){var e="",r="",n="",o="",a="",c="";switch(t){case"image":e=(0,i.t)("trix_editor.modal_copy.paste_image_file_link"),n=(0,i.t)("trix_editor.modal_copy.drop_images_upload"),o=(0,i.t)("trix_editor.modal_copy.works_any_image"),a=(0,i.t)("trix_editor.modal_copy.embed_image"),c=(0,i.t)("trix_editor.modal_copy.image");break;case"pdf":e=(0,i.t)("trix_editor.modal_copy.https_placeholder"),n=(0,i.t)("trix_editor.modal_copy.drop_pdf"),o=(0,i.t)("trix_editor.modal_copy.works_pdf"),a=(0,i.t)("trix_editor.modal_copy.embed_pdf"),c=(0,i.t)("trix_editor.modal_copy.pdf");break;case"video":e=(0,i.t)("trix_editor.modal_copy.paste_video_link"),r=(0,i.t)("trix_editor.modal_copy.works_youtube"),n=(0,i.t)("trix_editor.modal_copy.drop_video"),o=(0,i.t)("trix_editor.modal_copy.upload_mp4"),a=(0,i.t)("trix_editor.modal_copy.embed_video"),c=(0,i.t)("trix_editor.modal_copy.video");break;case"audio":e=(0,i.t)("trix_editor.modal_copy.https_placeholder"),n=(0,i.t)("trix_editor.modal_copy.drop_audio"),o=(0,i.t)("trix_editor.modal_copy.works_audio"),a=(0,i.t)("trix_editor.modal_copy.embed_audio"),c=(0,i.t)("trix_editor.modal_copy.audio");break;case"file":e=(0,i.t)("trix_editor.modal_copy.paste_file_link"),n=(0,i.t)("trix_editor.modal_copy.drop_file"),o=(0,i.t)("trix_editor.modal_copy.works_links"),a=D,c=(0,i.t)("trix_editor.modal_copy.file");break;case"embed":e=V,n=(0,i.t)("trix_editor.modal_copy.drop_file"),o=(0,i.t)("trix_editor.modal_copy.embed_helper_text"),a=D,c=(0,i.t)("trix_editor.modal_copy.link");break;case"youtube":e=V,o=(0,i.t)("trix_editor.modal_copy.works_sharable_youtube"),a=(0,i.t)("trix_editor.modal_copy.embed_video"),c=(0,i.t)("trix_editor.modal_copy.youtube");break;case"wistia":e=V,o=(0,i.t)("trix_editor.modal_copy.works_wistia"),a=(0,i.t)("trix_editor.modal_copy.embed_video"),c=(0,i.t)("trix_editor.modal_copy.wistia");break;case"vimeo":e=V,o=(0,i.t)("trix_editor.modal_copy.works_vimeo"),a=(0,i.t)("trix_editor.modal_copy.embed_video"),c=(0,i.t)("trix_editor.modal_copy.vimeo");break;case"loom":e=V,o=(0,i.t)("trix_editor.modal_copy.works_loom"),a=D,c=(0,i.t)("trix_editor.modal_copy.loom");break;case"soundcloud":e=V,o=(0,i.t)("trix_editor.modal_copy.works_soundcloud"),a=D,c=(0,i.t)("trix_editor.modal_copy.soundcloud");break;case"spotify":e=V,o=(0,i.t)("trix_editor.modal_copy.works_spotify"),a=D,c=(0,i.t)("trix_editor.modal_copy.spotify");break;case"simplecast":e=V,o=(0,i.t)("trix_editor.modal_copy.works_simplecast"),a=D,c=(0,i.t)("trix_editor.modal_copy.simplecast");break;case"instagram":e=V,o=(0,i.t)("trix_editor.modal_copy.works_instagram"),a=D,c=(0,i.t)("trix_editor.modal_copy.instagram");break;case"facebook":e=V,o=(0,i.t)("trix_editor.modal_copy.works_facebook"),a=D,c=(0,i.t)("trix_editor.modal_copy.facebook");break;case"twitter":e=(0,i.t)("trix_editor.modal_copy.twitter_link_placeholder"),o=(0,i.t)("trix_editor.modal_copy.works_twitter"),a=(0,i.t)("trix_editor.modal_copy.embed_twitter"),c=(0,i.t)("trix_editor.modal_copy.twitter");break;case"typeform":e=(0,i.t)("trix_editor.modal_copy.paste_typeform"),o=(0,i.t)("trix_editor.modal_copy.works_typeform"),a=D,c=(0,i.t)("trix_editor.modal_copy.typeform");break;case"airtable":e=(0,i.t)("trix_editor.modal_copy.paste_airtable"),o=(0,i.t)("trix_editor.modal_copy.works_airtable"),a=D,c=(0,i.t)("trix_editor.modal_copy.airtable");break;case"videoask":e=(0,i.t)("trix_editor.modal_copy.paste_videoask"),o=(0,i.t)("trix_editor.modal_copy.works_videoask"),a=(0,i.t)("trix_editor.modal_copy.embed_videoask"),c=(0,i.t)("trix_editor.modal_copy.videoask");break;case"github":e=V,o=(0,i.t)("trix_editor.modal_copy.works_gist"),a=(0,i.t)("trix_editor.modal_copy.embed_gist"),c=(0,i.t)("trix_editor.modal_copy.github");break;case"googlemaps":e=(0,i.t)("trix_editor.modal_copy.maps_placeholder"),o=(0,i.t)("trix_editor.modal_copy.works_maps"),a=(0,i.t)("trix_editor.modal_copy.embed_map"),c=(0,i.t)("trix_editor.modal_copy.google_maps");break;case"codepen":e=V,o=(0,i.t)("trix_editor.modal_copy.works_codepen"),a=D,c=(0,i.t)("trix_editor.modal_copy.codepen");break;default:e=(0,i.t)("trix_editor.modal_copy.https_placeholder"),n=(0,i.t)("trix_editor.modal_copy.drop_file"),a=(0,i.t)("trix_editor.modal_copy.embed"),c=(0,i.t)("trix_editor.modal_copy.file")}return{embedPlaceholder:e,embedDesc:r,dropTitle:n,helperText:o,embedBtn:a,itemName:c}}(r),a=o.embedPlaceholder,c=o.embedDesc||"",u=o.dropTitle,l=o.helperText,f=o.embedBtn,h=o.itemName;return"attachment_image"===e?(0,s.jsx)(W,{onClose:n,title:h,children:(0,s.jsx)(G,{onClose:n,embedPlaceholder:a,dropTitle:u,helperText:l,embedBtn:f,embedDesc:c})}):"attachment_file"===e||"attachment_pdf"===e||"attachment_audio"===e||"attachment_video"===e?(0,s.jsx)(W,{onClose:n,title:h,children:(0,s.jsx)(k,{onClose:n,embedPlaceholder:a,dropTitle:u,helperText:l,embedDesc:c,embedBtn:f})}):"embed"===e?(0,s.jsx)(W,{onClose:n,title:h,children:(0,s.jsx)(x,{onClose:n,embedPlaceholder:a,dropTitle:u,helperText:l,embedBtn:f})}):null};function q(){q=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(S([])));_&&_!==r&&n.call(_,a)&&(w=_);var j=b.prototype=m.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,o(j,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(j),l(j,u,"Generator"),l(j,a,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function $(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var Q=function(){var t=(0,o.Xz)(),e=t.subMode,r=t.subType,i=t.showInlineModalSelector,a=t.resetEditorMode,c=t.restoreToLastKnownPosition,u=(0,n.DM)().editorElement;if(!i())return null;var l=function(){var t,e=(t=q().mark((function t(){return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a();case 2:return t.next=4,c();case 4:u.focus();case 5:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){$(i,n,o,a,c,"next",t)}function c(t){$(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();return(0,s.jsx)("div",{className:"inline-modal-selector",style:{height:0},children:(0,s.jsx)(z,{attribute:e,subtype:r,onClose:l})})}},65826:(t,e,r)=>{r.d(e,{io:()=>m,v:()=>y});var n=r(85893),o=function(t){var e=t.width,r=t.height,o=t.viewBox,i=t.children,a=t.fill,c=t.stroke,u=t.strokeWidth,l=t.strokeLinecap,s=t.strokeLinejoin,f=[t.dOne,t.dTwo,t.dThree,t.dFour,t.dFive,t.dSix];return(0,n.jsxs)("svg",{width:e,height:r,viewBox:o,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.map((function(t,e){if(t)return(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:t,fill:""===a?"":"#8D9CAE",stroke:c,strokeWidth:u,strokeLinecap:l,strokeLinejoin:s},e)})),i]})},i=function(){return(0,n.jsx)(o,{width:"10",height:"13",viewBox:"0 0 10 13",dOne:"M5.48583 0H1.11336C1.07493 0 1.03695 0.00195996 0.999526 0.00578599C0.438107 0.0631765 0 0.540434 0 1.12069V6.01097V11.8793C0 12.4983 0.498468 13 1.11336 13H5.97166C8.19659 13 10 11.1847 10 8.94514C10 7.59944 9.34889 6.40694 8.34645 5.66939C8.7752 5.07967 9.02834 4.35247 9.02834 3.56583C9.02834 1.59668 7.4421 0 5.48583 0ZM2.22604 7.13166H5.48583L5.48839 7.1316L5.97166 7.13166C6.96681 7.13166 7.77328 7.94344 7.77328 8.94514C7.77328 9.94684 6.96681 10.7586 5.97166 10.7586H2.22604V7.13166ZM5.48583 4.89028C6.21231 4.89028 6.80162 4.2971 6.80162 3.56583C6.80162 2.87758 6.27961 2.31164 5.61252 2.24744L5.48583 2.24138H2.22672V4.89028H5.48583Z"})},a=function(){return(0,n.jsx)(o,{width:"16",height:"12",viewBox:"0 0 16 12",dOne:"M3.8 3.30005L1 6.10005L3.8 8.90005",dTwo:"M12.2002 3.30005L15.0002 6.10005L12.2002 8.90005",dThree:"M6.76562 11.039L9.27293 1.00977L6.76562 11.039Z",fill:"",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})},c=function(){return(0,n.jsx)(o,{width:"8",height:"13",viewBox:"0 0 8 13",dOne:"M4 1.50251H4.60125L1.79606 11.4975H0.773109L0.668203 11.5043C0.290848 11.5541 0 11.8684 0 12.2487C0 12.6637 0.346133 13 0.773109 13H2.36978C2.3813 13.0003 2.39279 13.0002 2.40424 13H4L4.10491 12.9931C4.48226 12.9434 4.77311 12.6291 4.77311 12.2487C4.77311 11.8338 4.42698 11.4975 4 11.4975H3.39875L6.20394 1.50251H7.22689L7.3318 1.49565C7.70915 1.44591 8 1.13159 8 0.751256C8 0.336349 7.65387 0 7.22689 0H5.63024C5.61871 -0.000252011 5.6072 -0.000250653 5.59574 0H4L3.89509 0.00685808C3.51774 0.0566037 3.22689 0.370925 3.22689 0.751256C3.22689 1.16616 3.57302 1.50251 4 1.50251Z"})},u=function(){return(0,n.jsx)(o,{width:"15",height:"15",viewBox:"0 0 15 15",dOne:"M8.41 6.58997V6.58997C9.71 7.88997 9.71 9.90497 8.41 11.205L6.59 13.025C5.29 14.325 3.275 14.325 1.975 13.025C0.675 11.725 0.675 9.70997 1.975 8.40997L3.6 6.84997",dTwo:"M6.59023 8.41V8.41C5.29023 7.11 5.29023 5.095 6.59023 3.795L8.41023 1.975C9.71023 0.675 11.7252 0.675 13.0252 1.975C14.3252 3.275 14.3252 5.29 13.0252 6.59L11.4002 8.15",fill:"",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})},l=function(){return(0,n.jsxs)(o,{width:"14",height:"12",viewBox:"0 0 14 12",dOne:"M1.85714 0.928571C1.85714 1.44161 1.44161 1.85714 0.928571 1.85714C0.415536 1.85714 0 1.44161 0 0.928571C0 0.415536 0.415536 0 0.928571 0C1.44161 0 1.85714 0.415536 1.85714 0.928571Z",children:[(0,n.jsx)("path",{d:"M4.33301 0.928589H12.9997",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.85714 5.88096C1.85714 6.394 1.44161 6.80954 0.928571 6.80954C0.415536 6.80954 0 6.394 0 5.88096C0 5.36793 0.415536 4.95239 0.928571 4.95239C1.44161 4.95239 1.85714 5.36793 1.85714 5.88096Z",fill:"#8D9CAE"}),(0,n.jsx)("path",{d:"M4.33301 5.88098H12.9997",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.85714 10.8334C1.85714 11.3464 1.44161 11.7619 0.928571 11.7619C0.415536 11.7619 0 11.3464 0 10.8334C0 10.3203 0.415536 9.90479 0.928571 9.90479C1.44161 9.90479 1.85714 10.3203 1.85714 10.8334Z",fill:"#8D9CAE"}),(0,n.jsx)("path",{d:"M4.33301 10.8334H12.9997",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"})]})},s=function(){return(0,n.jsxs)(o,{width:"15",height:"14",viewBox:"0 0 15 14",dOne:"M0.364258 3.1567V2.72391L0.835388 2.68557C0.912084 2.68009 0.92304 2.65817 0.92304 2.576V0.663478C0.92304 0.597739 0.907214 0.56487 0.851823 0.548435L0.375214 0.449826L0.435475 0H1.75087V2.576C1.75087 2.66365 1.75634 2.68009 1.83852 2.68557L2.28774 2.72391V3.1567H0.364258Z",dTwo:"M0.0793635 8.06736V7.55788L0.814059 6.83962C1.36736 6.30275 1.60293 6.08362 1.60293 5.77136C1.60293 5.56867 1.50432 5.42075 1.21397 5.42075C0.912059 5.42075 0.786059 5.51936 0.786059 5.90832L0.0410156 5.84258C0.0464939 4.97153 0.709363 4.82849 1.28458 4.82849C2.13432 4.82849 2.43562 5.19006 2.43562 5.70562C2.43562 6.22058 2.07954 6.56023 1.67962 6.94371L1.05997 7.53597H1.86589C1.92067 7.53597 1.94258 7.52501 1.95354 7.47023L2.03023 7.03745H2.61093V8.06736H0.0793635Z",dThree:"M1.92896 11.2573C2.39522 11.3286 2.65209 11.608 2.65209 12.101C2.65209 12.8247 2.10974 13.1644 1.32635 13.1644C0.773043 13.1644 0.28 12.9672 0 12.6604L0.438261 12.1783C0.647043 12.381 0.876522 12.5393 1.26061 12.5393C1.56739 12.5393 1.83035 12.4303 1.83035 12.0462C1.83035 11.712 1.62217 11.5751 1.28252 11.5751C1.14557 11.5751 1.04148 11.586 0.876522 11.6134V11.0656L1.14557 11.0327C1.54 10.9834 1.75365 10.7917 1.75365 10.4411C1.75365 10.2323 1.66052 10.0631 1.35374 10.0631C1.05791 10.0631 0.915478 10.1617 0.915478 10.5507L0.164957 10.4843C0.164957 9.61874 0.81687 9.47083 1.39209 9.47083C2.23574 9.47083 2.55957 9.79404 2.55957 10.3808C2.55957 10.841 2.27409 11.1313 1.92896 11.2354V11.2573Z",children:[(0,n.jsx)("path",{d:"M4.28516 1.57849H13.4156",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M4.28516 6.448H13.4156",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M4.28516 11.3176H13.4156",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"})]})},f=function(){return(0,n.jsx)(o,{width:"15",height:"12",viewBox:"0 0 15 12",dOne:"M1.59082 1H13.9999",dTwo:"M1.59139 11.2267L1.66358 5.31824",dThree:"M5.72754 5.61369H14.0003",dFour:"M5.72754 10.9318H11.6366",stroke:"#8D9CAE",strokeWidth:"1.5",strokeLinecap:"round"})},h=function(){return(0,n.jsx)(o,{width:"15",height:"14",viewBox:"0 0 15 14",dOne:"M11.5323 3.15165C11.27 1.2493 9.78733 0 7.76961 0H6.53884L6.35102 0.0045072C4.35973 0.100288 2.76961 1.7107 2.76961 3.69231C2.76961 5.89758 3.92624 6.61807 6.99027 7.36492L7.67827 7.53689C7.91526 7.59864 8.10006 7.65096 8.26984 7.7049L8.56725 7.80612C8.92672 7.93641 9.32374 7.75063 9.45404 7.39116C9.58433 7.03169 9.39855 6.63467 9.03908 6.50437C8.69397 6.37928 8.39144 6.28935 7.89205 6.16208L6.84676 5.90107C4.75487 5.35544 4.15422 4.90072 4.15422 3.69231C4.15422 2.42144 5.21763 1.38462 6.53884 1.38462H7.76961L7.94128 1.38884C9.18131 1.45061 10.0015 2.18604 10.1607 3.34079C10.2129 3.71956 10.5623 3.98427 10.9411 3.93204C11.3199 3.87981 11.5846 3.53042 11.5323 3.15165ZM11.5388 9.69231C11.5388 9.30996 11.2289 9 10.8465 9C10.4642 9 10.1542 9.30996 10.1542 9.69231L10.1492 9.84364C10.0687 11.0445 9.03797 12 7.76961 12H6.53884L6.37338 11.9951C5.17453 11.9235 4.30011 11.0747 4.14863 9.89036C4.10011 9.5111 3.75334 9.24298 3.37407 9.29149C2.99481 9.34 2.72669 9.68678 2.7752 10.066C3.02042 11.9831 4.54576 13.3846 6.53884 13.3846H7.76961L7.95743 13.3801C9.94872 13.2843 11.5388 11.6739 11.5388 9.69231Z",dTwo:"M13.6154 6.46155C13.9977 6.46155 14.3077 6.7715 14.3077 7.15386C14.3077 7.50434 14.0472 7.794 13.7093 7.83984L13.6154 7.84616H0.692308C0.309957 7.84616 0 7.53621 0 7.15386C0 6.80337 0.26045 6.51371 0.598366 6.46787L0.692308 6.46155H13.6154Z"})},d=function(){return(0,n.jsx)(o,{width:"20",height:"15",viewBox:"0 0 20 15",dOne:"M0 0H6.41485V1.06838H5.42198C4.805 1.06838 4.30484 1.56854 4.30484 2.18551V6.42305H10.7187V2.18551C10.7187 1.56854 10.2185 1.06838 9.60157 1.06838H8.58509V0H15V1.06838H13.9945C13.3775 1.06838 12.8774 1.56854 12.8774 2.18551V12.8037C12.8774 13.4206 13.3775 13.9208 13.9945 13.9208H15V15H8.58509V13.9208H9.60157C10.2185 13.9208 10.7187 13.4206 10.7187 12.8037V7.5H4.30484V12.8037C4.30484 13.4206 4.805 13.9208 5.42198 13.9208H6.41485V15H0V13.9208H1.031C1.64798 13.9208 2.14814 13.4206 2.14814 12.8037V2.18552C2.14814 1.56854 1.64798 1.06838 1.031 1.06838H0V0ZM19.1 19.5C19.5971 19.5 20 19.9029 20 20.4C20 20.8971 19.5971 21.3 19.1 21.3H0.899999C0.402943 21.3 0 20.8971 0 20.4C0 19.9029 0.402944 19.5 0.9 19.5H19.1ZM17 24.9C17 24.4029 16.5971 24 16.1 24H0.9C0.402944 24 0 24.4029 0 24.9C0 25.3971 0.402943 25.8 0.899999 25.8H16.1C16.5971 25.8 17 25.3971 17 24.9Z",dTwo:"M16.0597 14.2135L17.2032 13.1047C18.0644 12.2759 18.4311 11.9376 18.4311 11.4556C18.4311 11.1426 18.2776 10.9143 17.8257 10.9143C17.3558 10.9143 17.1596 11.0665 17.1596 11.667L16 11.5655C16.0085 10.2208 17.0403 10 17.9356 10C19.2582 10 19.7271 10.5582 19.7271 11.3541C19.7271 12.149 19.1729 12.6734 18.5505 13.2654L17.7035 14.0797H18.6962C18.9171 14.0797 19.0962 13.9006 19.0962 13.6797V13.4101H20V15H16.0597V14.2135Z"})},p=function(){return(0,n.jsx)(o,{width:"20",height:"15",viewBox:"0 0 20 15",dOne:"M0 0H6.41485V1.06838H5.42198C4.805 1.06838 4.30484 1.56854 4.30484 2.18551V6.42305H10.7187V2.18551C10.7187 1.56854 10.2185 1.06838 9.60157 1.06838H8.58509V0H15V1.06838H13.9945C13.3775 1.06838 12.8774 1.56854 12.8774 2.18551V12.8037C12.8774 13.4206 13.3775 13.9208 13.9945 13.9208H15V15H8.58509V13.9208H9.60157C10.2185 13.9208 10.7187 13.4206 10.7187 12.8037V7.5H4.30484V12.8037C4.30484 13.4206 4.805 13.9208 5.42198 13.9208H6.41485V15H0V13.9208H1.031C1.64798 13.9208 2.14814 13.4206 2.14814 12.8037V2.18552C2.14814 1.56854 1.64798 1.06838 1.031 1.06838H0V0ZM19.1 19.5C19.5971 19.5 20 19.9029 20 20.4C20 20.8971 19.5971 21.3 19.1 21.3H0.899999C0.402943 21.3 0 20.8971 0 20.4C0 19.9029 0.402944 19.5 0.9 19.5H19.1ZM17 24.9C17 24.4029 16.5971 24 16.1 24H0.9C0.402944 24 0 24.4029 0 24.9C0 25.3971 0.402943 25.8 0.899999 25.8H16.1C16.5971 25.8 17 25.3971 17 24.9Z",dTwo:"M18.9093 12.1603C19.6126 12.2663 20 12.6824 20 13.4165C20 14.4942 19.182 15 18.0005 15C17.1659 15 16.4223 14.7063 16 14.2495L16.661 13.5316C16.9759 13.8335 17.322 14.0691 17.9013 14.0691C18.364 14.0691 18.7606 13.9069 18.7606 13.335C18.7606 12.8373 18.4466 12.6334 17.9344 12.6334C17.7278 12.6334 17.5708 12.6497 17.322 12.6905V11.8748L17.7278 11.8258C18.3227 11.7524 18.6449 11.4669 18.6449 10.9448C18.6449 10.6339 18.5045 10.3819 18.0418 10.3819C17.5956 10.3819 17.3808 10.5288 17.3808 11.1079L16.2488 11.0091C16.2488 9.72025 17.232 9.5 18.0996 9.5C19.372 9.5 19.8605 9.9813 19.8605 10.8551C19.8605 11.5403 19.4299 11.9726 18.9093 12.1276V12.1603Z"})},v=[{label:(0,n.jsx)(i,{}),showInInlineToolbar:!0,attribute:"bold"},{label:(0,n.jsx)(c,{}),showInInlineToolbar:!0,attribute:"italic"},{label:(0,n.jsx)(d,{}),attribute:"heading2",showInInlineToolbar:!0,shortcutPatten:"# "},{label:(0,n.jsx)(p,{}),attribute:"heading3",showInInlineToolbar:!0,shortcutPatten:"## "},{label:(0,n.jsx)(f,{}),showInInlineToolbar:!0,attribute:"quote"},{label:(0,n.jsx)(a,{}),attribute:"code"},{label:(0,n.jsx)(h,{}),showInInlineToolbar:!0,attribute:"strike"},{label:(0,n.jsx)(u,{}),showInInlineToolbar:!0,attribute:"href"},{label:(0,n.jsx)(l,{}),attribute:"bullet",showInInlineToolbar:!0,shortcutPatten:"- "},{label:(0,n.jsx)(s,{}),attribute:"number",showInInlineToolbar:!0,shortcutPatten:"1."},{attribute:"divider",showInInlineToolbar:!1,shortcutPatten:"---"}],y=v.filter((function(t){return t.shortcutPatten})),m=v.filter((function(t){return t.showInInlineToolbar}))},86965:(t,e,r)=>{r.d(e,{f:()=>l});var n=r(22837);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function c(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var l=c((function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.insertAttachment=function(t){var e=new n.default.Attachment(t);return r.editor.insertAttachment(e),e},this.insertLineBreak=function(){return r.editor.insertLineBreak()},this.insertFile=function(t){return r.editor.insertFile(t)},this.recordUndoEntry=function(t){return r.editor.recordUndoEntry(t)},this.activateAttribute=function(t,e){return r.editor.activateAttribute(t,e)},this.deactivateAttribute=function(t){return r.editor.deactivateAttribute(t)},this.attributeIsActive=function(t){return r.editor.attributeIsActive(t)},this.insertString=function(t){return r.editor.insertString(t)},this.getSelectedRange=function(){return r.editor.getSelectedRange()},this.setSelectedRange=function(t){var e=o(t,2),n=e[0],i=e[1];return r.editor.setSelectedRange([n,i])},this.getStringInRange=function(t){var e=o(t,2),n=e[0],i=e[1];return r.editor.getDocument().toString().substring(n,i)},this.getClientRectAtPosition=function(t){return r.editor.getClientRectAtPosition(t)},this.getPosition=function(){return r.editor.getPosition()},this.getDocument=function(){return r.editor.getDocument()},this.insertHr=function(){r.insertAttachment({content:"<hr />",contentType:"vnd.rubyonrails.horizontal-rule.html"})},this.getPieceAtPosition=function(t){return r.editor.getDocument().getPieceAtPosition(t)},this.getHrefAtPosition=function(t){var e=r.getPieceAtPosition(t);if(e)return e.attributes.values.href},this.getHrefAtCurrentPosition=function(){return r.getHrefAtPosition(r.getPosition())},this.getRangeOfHrefAtPosition=function(t){return r.getRangeOfCommonAttributeAtPosition("href",t)},this.getRangeOfCommonAttributeAtPosition=function(t,e){return r.editor.getDocument().getRangeOfCommonAttributeAtPosition(t,e)},this.getRangeOfHrefAtCurrentPosition=function(){return r.getRangeOfHrefAtPosition(r.getPosition())},this.getClosestAttachment=function(t){var e=t.closest("[data-trix-attachment]");return r.getAttachmentById(parseInt(e.dataset.trixId,10))},this.getAttachmentById=function(t){return r.editor.composition.attachments.find((function(e){return e.id===t}))},this.removeAttachmentById=function(t){r.editor.composition.removeAttachment(r.getAttachmentById(t))},this.editAttachment=function(t){r.editor.composition.editAttachment(t)},this.stopEditingAttachment=function(t){r.editor.composition.stopEditingAttachment(t)},this.addAttributeAtRange=function(t,e,n){return r.getDocument().addAttributeAtRange(t,e,n)},this.insertTextAtRange=function(t,e){return r.getDocument().insertTextAtRange(t,e)},this.getRangeOfAttachment=function(t){return r.getDocument().getRangeOfAttachment(t)},this.editor=e}))},30108:(t,e,r)=>{r.d(e,{DE:()=>u,DM:()=>s});var n=r(67294),o=r(22837),i=r(86965);function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var u=(0,n.createContext)();u.displayName="TrixEditorContext";var l=function(){return(0,n.useContext)(u)},s=function(){var t=l(),e=t.editor,r=new i.f(e);return{editorElement:t,trixApiWrapper:r,insertString:function(t){return e.insertString(t)},setSelectedRange:function(t){var r=a(t,2),n=r[0],o=r[1];return e.setSelectedRange([n,o])},insertAttachment:function(t){var r=new o.default.Attachment(t);return e.insertAttachment(r),r},insertFile:function(t){return e.insertFile(t)},insertLineBreak:function(){return e.insertLineBreak()},insertHr:r.insertHr,recordUndoEntry:function(t){return e.recordUndoEntry(t)},activateAttribute:function(t,r){return e.activateAttribute(t,r)},deactivateAttribute:function(t){return e.deactivateAttribute(t)},attributeIsActive:function(t){return e.attributeIsActive(t)},getStringInRange:function(t){var r=a(t,2),n=r[0],o=r[1];return e.getDocument().toString().substring(n,o)},getClientRectAtPosition:function(t){return e.getClientRectAtPosition(t)},getPosition:function(){return e.getPosition()},deleteInDirection:function(t){return e.deleteInDirection(t)},getPieceAtPosition:r.getPieceAtPosition,getHrefAtPosition:r.getHrefAtPosition}}},27391:(t,e,r)=>{r.d(e,{Q:()=>c});var n=r(91322);function o(){o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),c=new S(n||[]);return i(a,"_invoke",{value:C(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",p="suspendedYield",v="executing",y="completed",m={};function g(){}function b(){}function w(){}var x={};s(x,c,(function(){return this}));var _=Object.getPrototypeOf,j=_&&_(_(T([])));j&&j!==r&&n.call(j,c)&&(x=j);var L=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=s(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},E(k.prototype),s(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),s(L,l,"Generator"),s(L,c,(function(){return this})),s(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=function(t){var e=t.content;return fetch((0,n.wY)(),{body:JSON.stringify({embed:{content:e}}),method:"POST",dataType:"script",credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}})},c=function(){var t,e=(t=o().mark((function t(e){var r,n,i,c,u,l,s,f,h,d,p,v,y;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.content,n=e.trixApiWrapper,i=e.skipRecordUndoEntry,c=void 0!==i&&i,u=e.skipLineBreak,l=void 0!==u&&u,c||n.recordUndoEntry(),s=n.insertAttachment({content:'<div class="trix-preloader" />',contentType:"embed"}),l||n.insertLineBreak(),t.next=6,a({content:r});case 6:if(!(f=t.sent).ok){t.next=16;break}return t.next=10,f.json();case 10:h=t.sent,d=h.content,p=h.sgid,s.setAttributes({content:d,contentType:"embed",sgid:p}),t.next=23;break;case 16:v=n.getSelectedRange(),y=n.getRangeOfAttachment(s),n.setSelectedRange(y),n.insertString(r),n.setSelectedRange([y[0],y[0]+r.length]),n.activateAttribute("href",r),n.setSelectedRange(v.map((function(t){return t+r.length})));case 23:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t){return e.apply(this,arguments)}}()},89011:(t,e,r)=>{r.d(e,{P6:()=>p,Xz:()=>v,w2:()=>y});var n=r(67294),o=r(96486),i=r(95287),a=r(55798),c=r(54030),u=r(65826),l=r(86965);function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var h=String.fromCharCode(65532),d="inline-toolbar",p=(0,n.createContext)();p.displayName="TrixEditorModeContext";var v=function(){return(0,n.useContext)(p)},y=function(t){var e=s((0,n.useState)(null),2),r=e[0],f=e[1],p=s((0,n.useState)(null),2),v=p[0],y=p[1],m=s((0,n.useState)(null),2),g=m[0],b=m[1],w=s((0,n.useState)(null),2),x=w[0],_=w[1],j=s((0,n.useState)({}),2),L=j[0],E=j[1],k=s((0,n.useState)(null),2),C=k[0],O=k[1],P=s((0,n.useState)(null),2),A=P[0],S=P[1],T=s((0,n.useState)(!1),2),N=T[0],I=T[1],H=(0,c.Be)(),F=function(){f(null),y(null),b(null),_(null),O(null)};(0,n.useEffect)((function(){var e=function(){r&&null!==x&&t&&E(V())};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[x,E,r,t]),(0,n.useEffect)((function(){E(null!==x?V():{})}),[x,t]),(0,n.useEffect)((function(){if(t){var e=t.editor;if(e){var n=function(t){if(e){var n,o,i=e.getDocument().toString(),a=e.getPosition(),c=new l.f(e),s=function(e){var r=e.length,n=a-(r+1),o=a===r,c="\n"===i[n],u=i[n]===h,l=o||c||u;return e[r-1]===t.key&&i.substr(a-r,r)===e&&l};if(u.v.forEach((function(t){s(t.shortcutPatten)&&(n=t)})),n)if(e.recordUndoEntry("Applying shortcurt pattern ".concat(n.attribute)),e.setSelectedRange([a-n.shortcutPatten.length,a]),e.deleteInDirection("backward"),"divider"===n.attribute)c.insertHr();else c.activateAttribute(n.attribute);else"inline-emoji-selector"!==r||":"===i[x]&&(o=i.substring(x+1,a),!/\s/g.test(o))?":"===t.key&&H?(f("inline-emoji-selector"),_(a-1)):s("/")&&H?R():"inline-block-selector"===r&&"withPrefix"===v&&"/"!==i[x]&&F():F()}};return t.addEventListener("keyup",n),function(){t&&t.removeEventListener("keyup",n)}}}}),[r,f,t,x,_]);var R=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).withPrefix,r=void 0===e||e,n=t.editor;if(n){var o=n.getPosition();f("inline-block-selector"),r&&y("withPrefix");var i=o;r&&(i=o-1),_(i),E(D.getClientRectAtPosition(i))}},M=function(){if(!(0,i.s2)()){var e=t.editor.getDocument().toString(),r=s(t.editor.getSelectedRange(),2),n=r[0],o=r[1];if(n!==o){if(e.substr(n,o-n).includes(h))return;f(d),_(n),O(o)}}};(0,n.useEffect)((function(){if(t&&!(0,i.s2)()){var e=function(){return I(!0)},n=function(){I(!1);var e=s(t.editor.getSelectedRange(),2),n=e[0],o=e[1];r!==d&&n!==o&&setTimeout(M,100)};return n=(0,o.debounce)(n),document.addEventListener("mouseup",n),document.addEventListener("mousedown",e),function(){document.removeEventListener("mouseup",n),document.removeEventListener("mousedown",e)}}}),[t,I,r,M]),(0,a.h)(F);var G=function(t){(0,i.s2)()||"k"===t.key&&U()&&(t.preventDefault(),Z())};(0,n.useEffect)((function(){if(t){var e=function(t){t.metaKey&&G(t)};return t.addEventListener("keydown",e),function(){t.removeEventListener("keydown",e)}}}),[G,t]),(0,n.useEffect)((function(){if(t){var e=function(){S(t.editor.getPosition());var e=s(t.editor.getSelectedRange(),2);e[0]===e[1]?(r===d&&F(),(0,i.s2)()||(D.attributeIsActive("href")?(f("hyperlink-tooltip"),_(D.getPosition())):"hyperlink-tooltip"===r&&F())):("hyperlink-tooltip"===r&&F(),N||M())};return t.addEventListener("trix-selection-change",e),function(){t.removeEventListener("trix-selection-change",e)}}}),[r,f,t,x,_,N,S,A,M]);var D=new l.f(null===t||void 0===t?void 0:t.editor),V=function(){if(t){var e=D.getClientRectAtPosition(x);return e||((e=t.getBoundingClientRect().toJSON()).right=e.left,e.bottom=e.top,e)}},B=function(){return![null,void 0].includes(x)},U=function(){return r===d&&B()&&![null,void 0].includes(C)},Z=function(){f(d),y("href")};return{mode:r,subMode:v,subType:g,startPosition:x,endPosition:C,resetEditorMode:F,showInlineEmojiSelector:function(){return"inline-emoji-selector"===r&&B()},triggerInlineEmojiSelector:function(){D.insertString(":"),f("inline-emoji-selector"),_(D.getPosition()-1)},showInlineToolbar:U,showHyperlinkTooltip:function(){return"hyperlink-tooltip"===r&&B()},showInlineBlockSelector:function(){return"inline-block-selector"===r&&B()},showInlineModalSelector:function(){return"inline-modal-selector"===r&&v},startPositionRect:function(){return L},endPositionRect:function(){return D.getClientRectAtPosition(C)},setModeInlineModalSelector:function(t){f("inline-modal-selector"),y(t)},setSubTypeInlineModalSelector:function(t){f("inline-modal-selector"),b(t)},setModeInlineBlockSelector:R,showEmojiPicker:function(){return"toolbar-emoji-picker"===r},setModeEmojiPicker:function(){f("toolbar-emoji-picker")},showGiphyPicker:function(){return"toolbar-giphy-picker"===r},setModeGiphyPicker:function(){f("toolbar-giphy-picker")},restoreToLastKnownPosition:function(){var t=A||0;return D.setSelectedRange([t,t])},toggleOnInlineLinkForm:Z,toggleOffInlineLinkForm:function(){y(null)},showInlineLinkForm:function(){return r===d&&"href"===v},setModeModalBlockSelector:function(){_(D.getPosition()),f("modal-block-selector")},showModalBlockSelector:function(){return"modal-block-selector"===r}}}},2002:(t,e,r)=>{r.d(e,{$:()=>i});var n=r(86385),o=r(85893),i=function(){return(0,o.jsxs)("span",{className:"unsplash-label text-dark",children:[(0,o.jsx)("svg",{className:"unsplash-label__icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 0H5V4.5H11V0ZM5.0145 7H0V16H16V7H11.0277V11.54H5.0145V7Z",fill:"currentColor"})})," ",(0,n.t)("trix_editor.toolbar.unsplash")]})}},6150:(t,e,r)=>{r.d(e,{A:()=>i});var n=r(86385),o=r(85893),i=function(t){var e=t.unsplashResults,r=t.searchUnsplash,i=t.addUnsplash;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("input",{type:"text",style:{borderWidth:1},className:"upload-input placeholder:text-light placeholder:opacity-100",placeholder:(0,n.t)("image_upload.search_unsplash"),onChange:function(t){return r(t.target.value)}}),(0,o.jsx)("div",{className:"unsplash-tab__result-grid",children:e.length>=1&&e.map((function(t){return(0,o.jsxs)("button",{type:"button",className:"unsplash-tab__result text-left",onClick:function(){return i(t)},children:[(0,o.jsx)("img",{loading:"lazy",className:"unsplash-tab__result--image",src:t.urls.regular,alt:t.alt_description||""}),(0,o.jsx)("div",{className:"unsplash-tab__result--info",children:(0,o.jsxs)("div",{className:"unsplash-tab__result--author",children:[(0,n.t)("image_upload.by")," ",(0,o.jsxs)("a",{href:"".concat(t.links.html),target:"_blank",rel:"noreferrer",children:[t.user.first_name," ",t.user.last_name]})]})})]},t.id)}))})]})}},23082:(t,e,r)=>{r.d(e,{q:()=>n});var n=(0,r(90199).LC)({accessKey:"p0q6Nj3ZsO9QR5Isvl-5go1PlNq8nhJfCFJ3mxmw1cQ"})},88604:(t,e,r)=>{r.d(e,{Q:()=>f});var n=r(94849),o=r(91322);function i(){i=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new S(n||[]);return o(a,"_invoke",{value:C(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",p="suspendedYield",v="executing",y="completed",m={};function g(){}function b(){}function w(){}var x={};s(x,c,(function(){return this}));var _=Object.getPrototypeOf,j=_&&_(_(T([])));j&&j!==r&&n.call(j,c)&&(x=j);var L=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:b,configurable:!0}),b.displayName=s(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},E(k.prototype),s(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),s(L,l,"Generator"),s(L,c,(function(){return this})),s(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function a(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)}))}}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}var s=function(t){return"attachable_sgid"in t},f=function(){return t=function t(e,r,i,a,c){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.file=void 0,this.afterCompleteCallback=void 0,this.uploadProgress=void 0,this.formClass=void 0,this.inputFieldName=void 0,this.upload=void 0,this.file=e,this.afterCompleteCallback=r,this.uploadProgress=c,this.formClass=i,this.inputFieldName=a,this.upload=new n.TX(this.file,(0,o.hq)(),this)},e=[{key:"start",value:function(){var t=this.directUploadDidComplete.bind(this);this.upload.create((function(e,r){t(e,r)}))}},{key:"directUploadDidComplete",value:(l=c(i().mark((function t(e,r){var n,o,a,c,u,l,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.signed_id,o=r.filename,a=r.content_type,!e){t.next=9;break}if(!(e instanceof Error)){t.next=8;break}throw new Error("Direct upload failed: ".concat(e.message));case 8:throw e;case 9:if(!s(r)){t.next=12;break}return t.next=12,this.getAttachmentContent(r.attachable_sgid);case 12:""!==this.formClass&&""!==this.inputFieldName&&(u=document.createElement("input"),l=this.inputFieldName,u.setAttribute("type","hidden"),u.setAttribute("value",n),u.name=l,null===(c=document.querySelector(".".concat(this.formClass)))||void 0===c||c.appendChild(u)),f=this.createBlobUrl(n,o),this.afterCompleteCallback&&this.afterCompleteCallback(f,n,a,this.inputFieldName);case 15:case"end":return t.stop()}}),t,this)}))),function(t,e){return l.apply(this,arguments)})},{key:"getAttachmentContent",value:(a=c(i().mark((function t(e){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch((0,o.mb)(e));case 2:return r=t.sent,t.next=5,r.text();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),function(t){return a.apply(this,arguments)})},{key:"createBlobUrl",value:function(t,e){return(0,o.Gd)({signed_id:t,filename:e})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;t.upload.addEventListener("progress",(function(t){var r=Math.floor(t.loaded/t.total*100);e.uploadProgress(r,e.file.name)}))}}],e&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,a,l}()}}]);
//# sourceMappingURL=/packs/js/4488-4f2cf239b8ee6db7948d.js.map