PageSourceSearch

https://app.clarityflow.com/packs/js/551-baa16828f517f470ac4a.js

js clarityflow.com collected 2026-09-24 17:37:10 UTC 345,054 bytes, 3 lines download raw bytes

1/*! For license information please see 551-baa16828f517f470ac4a.js.LICENSE.txt */
2(self.webpackChunkjumpstart_app=self.webpackChunkjumpstart_app||[]).push([[551],{2877:function(t,e){!function(t){"use strict";var e={logger:self.console,WebSocket:self.WebSocket},n={log:function(){if(this.enabled){for(var t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];i.push(Date.now()),(t=e.logger).log.apply(t,["[ActionCable]"].concat(i))}}},i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(){return(new Date).getTime()},a=function(t){return(s()-t)/1e3},u=function(t,e,n){return Math.max(e,Math.min(n,t))},c=function(){function t(e){r(this,t),this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=e,this.reconnectAttempts=0}return t.prototype.start=function(){this.isRunning()||(this.startedAt=s(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),n.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms"))},t.prototype.stop=function(){this.isRunning()&&(this.stoppedAt=s(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),n.log("ConnectionMonitor stopped"))},t.prototype.isRunning=function(){return this.startedAt&&!this.stoppedAt},t.prototype.recordPing=function(){this.pingedAt=s()},t.prototype.recordConnect=function(){this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,n.log("ConnectionMonitor recorded connect")},t.prototype.recordDisconnect=function(){this.disconnectedAt=s(),n.log("ConnectionMonitor recorded disconnect")},t.prototype.startPolling=function(){this.stopPolling(),this.poll()},t.prototype.stopPolling=function(){clearTimeout(this.pollTimeout)},t.prototype.poll=function(){var t=this;this.pollTimeout=setTimeout((function(){t.reconnectIfStale(),t.poll()}),this.getPollInterval())},t.prototype.getPollInterval=function(){var t=this.constructor.pollInterval,e=t.min,n=t.max,i=t.multiplier*Math.log(this.reconnectAttempts+1);return Math.round(1e3*u(i,e,n))},t.prototype.reconnectIfStale=function(){this.connectionIsStale()&&(n.log("ConnectionMonitor detected stale connection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+a(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently()?n.log("ConnectionMonitor skipping reopening recent disconnect"):(n.log("ConnectionMonitor reopening"),this.connection.reopen()))},t.prototype.connectionIsStale=function(){return a(this.pingedAt?this.pingedAt:this.startedAt)>this.constructor.staleThreshold},t.prototype.disconnectedRecently=function(){return this.disconnectedAt&&a(this.disconnectedAt)<this.constructor.staleThreshold},t.prototype.visibilityDidChange=function(){var t=this;"visible"===document.visibilityState&&setTimeout((function(){!t.connectionIsStale()&&t.connection.isOpen()||(n.log("ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = "+document.visibilityState),t.connection.reopen())}),200)},t}();c.pollInterval={min:3,max:30,multiplier:5},c.staleThreshold=6;var l={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},p=l.message_types,h=l.protocols,d=h.slice(0,h.length-1),f=[].indexOf,g=function(){function t(e){r(this,t),this.open=this.open.bind(this),this.consumer=e,this.subscriptions=this.consumer.subscriptions,this.monitor=new c(this),this.disconnected=!0}return t.prototype.send=function(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)},t.prototype.open=function(){return this.isActive()?(n.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(n.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+h),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new e.WebSocket(this.consumer.url,h),this.installEventHandlers(),this.monitor.start(),!0)},t.prototype.close=function(){if((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{allowReconnect:!0}).allowReconnect||this.monitor.stop(),this.isActive())return this.webSocket.close()},t.prototype.reopen=function(){if(n.log("Reopening WebSocket, current state is "+this.getState()),!this.isActive())return this.open();try{return this.close()}catch(t){n.log("Failed to reopen WebSocket",t)}finally{n.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}},t.prototype.getProtocol=function(){if(this.webSocket)return this.webSocket.protocol},t.prototype.isOpen=function(){return this.isState("open")},t.prototype.isActive=function(){return this.isState("open","connecting")}
2,t.prototype.isProtocolSupported=function(){return f.call(d,this.getProtocol())>=0},t.prototype.isState=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return f.call(e,this.getState())>=0},t.prototype.getState=function(){if(this.webSocket)for(var t in e.WebSocket)if(e.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase();return null},t.prototype.installEventHandlers=function(){for(var t in this.events){var e=this.events[t].bind(this);this.webSocket["on"+t]=e}},t.prototype.uninstallEventHandlers=function(){for(var t in this.events)this.webSocket["on"+t]=function(){}},t}();g.reopenDelay=500,g.prototype.events={message:function(t){if(this.isProtocolSupported()){var e=JSON.parse(t.data),i=e.identifier,r=e.message,o=e.reason,s=e.reconnect;switch(e.type){case p.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case p.disconnect:return n.log("Disconnecting. Reason: "+o),this.close({allowReconnect:s});case p.ping:return this.monitor.recordPing();case p.confirmation:return this.subscriptions.confirmSubscription(i),this.subscriptions.notify(i,"connected");case p.rejection:return this.subscriptions.reject(i);default:return this.subscriptions.notify(i,"received",r)}}},open:function(){if(n.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupported())return n.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(t){if(n.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){n.log("WebSocket onerror event")}};var m=function(t,e){if(null!=e)for(var n in e){var i=e[n];t[n]=i}return t},y=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2];r(this,t),this.consumer=e,this.identifier=JSON.stringify(n),m(this,i)}return t.prototype.perform=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.action=t,this.send(e)},t.prototype.send=function(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})},t.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},t}(),v=function(){function t(e){r(this,t),this.subscriptions=e,this.pendingSubscriptions=[]}return t.prototype.guarantee=function(t){-1==this.pendingSubscriptions.indexOf(t)?(n.log("SubscriptionGuarantor guaranteeing "+t.identifier),this.pendingSubscriptions.push(t)):n.log("SubscriptionGuarantor already guaranteeing "+t.identifier),this.startGuaranteeing()},t.prototype.forget=function(t){n.log("SubscriptionGuarantor forgetting "+t.identifier),this.pendingSubscriptions=this.pendingSubscriptions.filter((function(e){return e!==t}))},t.prototype.startGuaranteeing=function(){this.stopGuaranteeing(),this.retrySubscribing()},t.prototype.stopGuaranteeing=function(){clearTimeout(this.retryTimeout)},t.prototype.retrySubscribing=function(){var t=this;this.retryTimeout=setTimeout((function(){t.subscriptions&&"function"===typeof t.subscriptions.subscribe&&t.pendingSubscriptions.map((function(e){n.log("SubscriptionGuarantor resubscribing "+e.identifier),t.subscriptions.subscribe(e)}))}),500)},t}(),b=function(){function t(e){r(this,t),this.consumer=e,this.guarantor=new v(this),this.subscriptions=[]}return t.prototype.create=function(t,e){var n=t,r="object"===("undefined"===typeof n?"undefined":i(n))?n:{channel:n},o=new y(this.consumer,r,e);return this.add(o)},t.prototype.add=function(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t},t.prototype.remove=function(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t},t.prototype.reject=function(t){var e=this;return this.findAll(t).map((function(t){return e.forget(t),e.notify(t,"rejected"),t}))},t.prototype.forget=function(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((function(e){return e!==t})),t},t.prototype.findAll=function(t){return this.subscriptions.filter((function(e){return e.identifier===t}))},t.prototype.reload=function(){var t=this;return this.subscriptions.map((function(e){return t.subscribe(e)}))},t.prototype.notifyAll=function(t){for(var e=this,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return this.subscriptions.map((function(n){return e.notify.apply(e,[n,t].concat(i))}))},t.prototype.notify=function(t,e){for(var n=arguments.length,i=Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return("string"===typeof t?this.findAll(t):[t]).map((function(t){return"function"===typeof t[e]?t[e].apply(t,i):void 0}))},t.prototype.subscribe=function(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)},t.prototype.confirmSubscription=function(t){var e=this;n.log("Subscription confirmed "+t),this.findAll(t).map((function(t){return e.guarantor.forget(t)}))},t.prototype.sendCommand=function(t,e){var n=t.identifier;return this.consumer.send({command:e,identifier:n})},t}(),A=function(){function t(e){r(this,t),this._url=e,this.subscriptions=new b(this),this.connection=new g(this)}return t.prototype.send=function(t){return this.connection.send(t)},t.prototype.connect=function(){return this.connection.open()},t.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},t.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},o(t,[{key:"url",get:function(){return w(this._url)}}]),t}();function w(t){if("function"===typeof t&&(t=t()),t&&!/^wss?:/i.test(t)){var e=document.createElement("a");return e.href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href}return t}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C("url")||l.default_mount_path;return new A(t)}function C(t){var e=document.head.querySelector("meta[name='action-cable-"+t+"']");if(e)return e.getAttribute("content")}t.Connection=g,t.ConnectionMonitor=c,t.Consumer=A,t.INTERNAL=l,t.Subscription=y,t.Subscriptions=b,t.SubscriptionGuarantor=v,t.adapters=e,t.createWebSocketURL=w,t.logger=n,t.createConsumer=x,t.getConfig=C,Object.defineProperty(t,"__esMo
2dule",{value:!0})}(e)},7552:function(t,e,n){"use strict";n.r(e);var i=n(9292);class r{constructor(t,e){this.attachment=t,this.element=e,this.directUpload=new i.DirectUpload(t.file,this.directUploadUrl,this)}start(){this.directUpload.create(this.directUploadDidComplete.bind(this))}directUploadWillStoreFileWithXHR(t){t.upload.addEventListener("progress",(t=>{const e=t.loaded/t.total*100;this.attachment.setUploadProgress(e)}))}directUploadDidComplete(t,e){if(t)throw new Error(`Direct upload failed: ${t}`);this.attachment.setAttributes({sgid:e.attachable_sgid,url:this.createBlobUrl(e.signed_id,e.filename)})}createBlobUrl(t,e){return this.blobUrlTemplate.replace(":signed_id",t).replace(":filename",encodeURIComponent(e))}get directUploadUrl(){return this.element.dataset.directUploadUrl}get blobUrlTemplate(){return this.element.dataset.blobUrlTemplate}}addEventListener("trix-attachment-add",(t=>{const{attachment:e,target:n}=t;if(e.file){new r(e,n).start()}}))},9292:function(t,e){!function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e((function(t,e){!function(e){t.exports=e()}((function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],i=t[1],r=t[2],o=t[3];i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[0]-680876936|0)<<7|n>>>25)+i|0)&i|~n&r)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&i)+e[2]+606105819|0)<<17|r>>>15)+o|0)&o|~r&n)+e[3]-1044525330|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[4]-176418897|0)<<7|n>>>25)+i|0)&i|~n&r)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&i)+e[6]-1473231341|0)<<17|r>>>15)+o|0)&o|~r&n)+e[7]-45705983|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[8]+1770035416|0)<<7|n>>>25)+i|0)&i|~n&r)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&i)+e[10]-42063|0)<<17|r>>>15)+o|0)&o|~r&n)+e[11]-1990404162|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&r|~i&o)+e[12]+1804603682|0)<<7|n>>>25)+i|0)&i|~n&r)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&i)+e[14]-1502002290|0)<<17|r>>>15)+o|0)&o|~r&n)+e[15]+1236535329|0)<<22|i>>>10)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[1]-165796510|0)<<5|n>>>27)+i|0)&r|i&~r)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&i|n&~i)+e[11]+643717713|0)<<14|r>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[5]-701558691|0)<<5|n>>>27)+i|0)&r|i&~r)+e[10]+38016083|0)<<9|o>>>23)+n|0)&i|n&~i)+e[15]-660478335|0)<<14|r>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[9]+568446438|0)<<5|n>>>27)+i|0)&r|i&~r)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&i|n&~i)+e[3]-187363961|0)<<14|r>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i&o|r&~o)+e[13]-1444681467|0)<<5|n>>>27)+i|0)&r|i&~r)+e[2]-51403784|0)<<9|o>>>23)+n|0)&i|n&~i)+e[7]+1735328473|0)<<14|r>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|i>>>12)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[5]-378558|0)<<4|n>>>28)+i|0)^i^r)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^i)+e[11]+1839030562|0)<<16|r>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[1]-1530992060|0)<<4|n>>>28)+i|0)^i^r)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^i)+e[7]-155497632|0)<<16|r>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[13]+681279174|0)<<4|n>>>28)+i|0)^i^r)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^i)+e[3]-722521979|0)<<16|r>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|i>>>9)+r|0,i=((i+=((r=((r+=((o=((o+=((n=((n+=(i^r^o)+e[9]-640364487|0)<<4|n>>>28)+i|0)^i^r)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^i)+e[15]+530742520|0)<<16|r>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|i>>>9)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[0]-198630844|0)<<6|n>>>26)+i|0)|~r))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[14]-1416354905|0)<<15|r>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[12]+1700485571|0)<<6|n>>>26)+i|0)|~r))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[10]-1051523|0)<<15|r>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[8]+1873313359|0)<<6|n>>>26)+i|0)|~r))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[6]-1560198380|0)<<15|r>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|i>>>11)+r|0,i=((i+=((o=((o+=(i^((n=((n+=(r^(i|~o))+e[4]-145523070|0)<<6|n>>>26)+i|0)|~r))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((r=((r+=(n^(o|~i))+e[2]+718787259|0)<<15|r>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|i>>>11)+r|0,t[0]=n+t[0]|0,t[1]=i+t[1]|0,t[2]=r+t[2]|0,t[3]=o+t[3]|0}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,r,o,s,a,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;
vendor: 4,838 bytes, line 2
2e+=64)n(l,i(t.substring(e-64,e)));for(r=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<r;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,n(l,o),l}function s(t){var e,i,o,s,a,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.subarray(e-64,e)));for(i=(t=e-64<c?t.subarray(e-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,n(l,o),l}function a(t){var n,i="";for(n=0;n<4;n+=1)i+=e[t>>8*n+4&15]+e[t>>8*n&15];return i}function u(t){var e;for(e=0;e<t.length;e+=1)t[e]=a(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function l(t,e){var n,i=t.length,r=new ArrayBuffer(i),o=new Uint8Array(r);for(n=0;n<i;n+=1)o[n]=t.charCodeAt(n);return e?o:r}function p(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function h(t,e,n){var i=new Uint8Array(t.byteLength+e.byteLength);return i.set(new Uint8Array(t)),i.set(new Uint8Array(e),t.byteLength),n?i:i.buffer}function d(t){var e,n=[],i=t.length;for(e=0;e<i-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function f(){this.reset()}return u(o("hello")),"undefined"===typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,i){var r,o,s,a,u=this.byteLength,c=e(n,u),l=u;return i!==t&&(l=e(i,u)),c>l?new ArrayBuffer(0):(r=l-c,o=new ArrayBuffer(r),s=new Uint8Array(o),a=new Uint8Array(this,c,r),s.set(a),o)}}(),f.prototype.append=function(t){return this.appendBinary(c(t)),this},f.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,r=this._buff.length;for(e=64;e<=r;e+=64)n(this._hash,i(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},f.prototype.end=function(t){var e,n,i=this._buff,r=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=i.charCodeAt(e)<<(e%4<<3);return this._finish(o,r),n=u(this._hash),t&&(n=d(n)),this.reset(),n},f.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},f.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},f.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},f.prototype._finish=function(t,e){var i,r,o,s=e;if(t[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,t),s=0;s<16;s+=1)t[s]=0;i=(i=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(i[2],16),o=parseInt(i[1],16)||0,t[14]=r,t[15]=o,n(this._hash,t)},f.hash=function(t,e){return f.hashBinary(c(t),e)},f.hashBinary=function(t,e){var n=u(o(t));return e?d(n):n},f.ArrayBuffer=function(){this.reset()},f.ArrayBuffer.prototype.append=function(t){var e,i=h(this._buff.buffer,t,!0),o=i.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,r(i.subarray(e-64,e)));return this._buff=e-64<o?new Uint8Array(i.buffer.slice(e-64)):new Uint8Array(0),this},f.ArrayBuffer.prototype.end=function(t){var e,n,i=this._buff,r=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=i[e]<<(e%4<<3);return this._finish(o,r),n=u(this._hash),t&&(n=d(n)),this.reset(),n},f.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.ArrayBuffer.prototype.getState=function(){var t=f.prototype.getState.call(this);return t.buff=p(t.buff),t},f.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),f.prototype.setState.call(this,t)},f.ArrayBuffer.prototype.destroy=f.prototype.destroy,f.ArrayBuffer.prototype._finish=f.prototype._finish,f.ArrayBuffer.hash=function(t,e){var n=u(s(new Uint8Array(t)));return e?d(n):n},f}))})),i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,s=function(){function t(e){i(this,t),this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}
2return r(t,null,[{key:"create",value:function(e,n){new t(e).create(n)}}]),r(t,[{key:"create",value:function(t){var e=this;this.callback=t,this.md5Buffer=new n.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",(function(t){return e.fileReaderDidLoad(t)})),this.fileReader.addEventListener("error",(function(t){return e.fileReaderDidError(t)})),this.readNextChunk()}},{key:"fileReaderDidLoad",value:function(t){if(this.md5Buffer.append(t.target.result),!this.readNextChunk()){var e=this.md5Buffer.end(!0),n=btoa(e);this.callback(null,n)}}},{key:"fileReaderDidError",value:function(t){this.callback("Error reading "+this.file.name)}},{key:"readNextChunk",value:function(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){var t=this.chunkIndex*this.chunkSize,e=Math.min(t+this.chunkSize,this.file.size),n=o.call(this.file,t,e);return this.fileReader.readAsArrayBuffer(n),this.chunkIndex++,!0}return!1}}]),t}();function a(t){var e=c(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}function u(t,e){return"string"==typeof t&&(e=t,t=document),p(t.querySelectorAll(e))}function c(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function l(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.disabled,r=n.bubbles,o=n.cancelable,s=n.detail,a=document.createEvent("Event");a.initEvent(e,r||!0,o||!0),a.detail=s||{};try{t.disabled=!1,t.dispatchEvent(a)}finally{t.disabled=i}return a}function p(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}var h=function(){function t(e,n,r){var o=this;i(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:n},this.xhr=new XMLHttpRequest,this.xhr.open("POST",r,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var s=a("csrf-token");void 0!=s&&this.xhr.setRequestHeader("X-CSRF-Token",s),this.xhr.addEventListener("load",(function(t){return o.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return o.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),t}(),d=function(){function t(e){var n=this;i(this,t),this.blob=e,this.file=e.file;var r=e.directUploadData,o=r.url,s=r.headers;for(var a in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",o,!0),this.xhr.responseType="text",s)this.xhr.setRequestHeader(a,s[a]);this.xhr.addEventListener("load",(function(t){return n.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return n.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,n=e.status,i=e.response;n>=200&&n<300?this.callback(null,i):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}(),f=0,g=function(){function t(e,n,r){i(this,t),this.id=++f,this.file=e,this.url=n,this.delegate=r}return r(t,[{key:"create",value:function(t){var e=this;s.create(this.file,(function(n,i){if(n)t(n);else{var r=new h(e.file,i,e.url);m(e.delegate,"directUploadWillCreateBlobWithXHR",r.xhr),r.create((function(n){if(n)t(n);else{var i=new d(r);m(e.delegate,"directUploadWillStoreFileWithXHR",i.xhr),i.create((function(e){e?t(e):t(null,r.toJSON())}))}}))}}))}}]),t}();function m(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,i=Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return t[e].apply(t,i)}}var y=function(){function t(e,n){i(this,t),this.input=e,this.file=n,this.directUpload=new g(this.file,this.url,this),this.dispatch("initialize")}return r(t,[{key:"start",value:function(t){var e=this,n=document.createElement("input");n.type="hidden",n.name=this.input.name,this.input.insertAdjacentElement("beforebegin",n),this.dispatch("start"),this.directUpload.create((function(i,r){i?(n.parentNode.removeChild(n),e.dispatchError(i)):n.value=r.signed_id,e.dispatch("end"),t(i)}))}},{key:"uploadRequestDidProgress",value:function(t){var e=t.loaded/t.total*100;e&&this.dispatch("progress",{progress:e})}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,l(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",(function(t){return e.uploadRequestDidProgress(t)}))}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}(),v="input[type=file][data-direct-upload-url]:not([disabled])",b=function(){function t(e){i(this,t),this.form=e,this.inputs=u(e,v).filter((function(t){return t.files.length}))}return r(t,[{key:"start",value:function(t){var e=this,n=this.createDirectUploadControllers(),i=function i(){var r=n.shift();r?r.start((function(n){n?(t(n),e.dispatch("end")):i()})):(t(),e.dispatch("end"))};this.dispatch("start"),i()}},{key:"createDirectUploadControllers",value:function(){var t=[];
2return this.inputs.forEach((function(e){p(e.files).forEach((function(n){var i=new y(e,n);t.push(i)}))})),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this.form,"direct-uploads:"+t,{detail:e})}}]),t}(),A="data-direct-uploads-processing",w=new WeakMap,x=!1;function C(){x||(x=!0,document.addEventListener("click",E,!0),document.addEventListener("submit",S),document.addEventListener("ajax:before",k))}function E(t){var e=t.target;"INPUT"!=e.tagName&&"BUTTON"!=e.tagName||"submit"!=e.type||!e.form||w.set(e.form,e)}function S(t){R(t)}function k(t){"FORM"==t.target.tagName&&R(t)}function R(t){var e=t.target;if(e.hasAttribute(A))t.preventDefault();else{var n=new b(e),i=n.inputs;i.length&&(t.preventDefault(),e.setAttribute(A,""),i.forEach(D),n.start((function(t){e.removeAttribute(A),t?i.forEach(T):L(e)})))}}function L(t){var e=w.get(t)||c(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);w.delete(t)}function D(t){t.disabled=!0}function T(t){t.disabled=!1}function O(){window.ActiveStorage&&C()}setTimeout(O,1),t.start=C,t.DirectUpload=g,Object.defineProperty(t,"__esModule",{value:!0})}(e)},8535:function(t,e,n){var i,r;(function(){(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form:not([data-turbo=true])",formInputClickSelector:"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(this);var o=this.Rails;(function(){(function(){var t;t=null,o.loadCSPNonce=function(){var e;return t=null!=(e=document.querySelector("meta[name=csp-nonce]"))?e.content:void 0},o.cspNonce=function(){return null!=t?t:o.loadCSPNonce()}}).call(this),function(){var t,e;e=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,o.matches=function(t,n){return null!=n.exclude?e.call(t,n.selector)&&!e.call(t,n.exclude):e.call(t,n)},t="_ujsData",o.getData=function(e,n){var i;return null!=(i=e[t])?i[n]:void 0},o.setData=function(e,n,i){return null==e[t]&&(e[t]={}),e[t][n]=i},o.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}.call(this),function(){var t,e,n;t=o.$,n=o.csrfToken=function(){var t;return(t=document.querySelector("meta[name=csrf-token]"))&&t.content},e=o.csrfParam=function(){var t;return(t=document.querySelector("meta[name=csrf-param]"))&&t.content},o.CSRFProtection=function(t){var e;if(null!=(e=n()))return t.setRequestHeader("X-CSRF-Token",e)},o.refreshCSRFTokens=function(){var i,r;if(r=n(),i=e(),null!=r&&null!=i)return t('form input[name="'+i+'"]').forEach((function(t){return t.value=r}))}}.call(this),function(){var t,e,n,i;n=o.matches,"function"!==typeof(t=window.CustomEvent)&&((t=function(t,e){var n;return(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype,i=t.prototype.preventDefault,t.prototype.preventDefault=function(){var t;return t=i.call(this),this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),t}),e=o.fire=function(e,n,i){var r;return r=new t(n,{bubbles:!0,cancelable:!0,detail:i}),e.dispatchEvent(r),!r.defaultPrevented},o.stopEverything=function(t){return e(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()}
2,o.delegate=function(t,e,i,r){return t.addEventListener(i,(function(t){var i;for(i=t.target;i instanceof Element&&!n(i,e);)i=i.parentNode;if(i instanceof Element&&!1===r.call(i,t))return t.preventDefault(),t.stopPropagation()}))}}.call(this),function(){var t,e,n,i,r,s;i=o.cspNonce,e=o.CSRFProtection,o.fire,t={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},o.ajax=function(t){var e;return t=r(t),e=n(t,(function(){var n,i;return i=s(null!=(n=e.response)?n:e.responseText,e.getResponseHeader("Content-Type")),2===Math.floor(e.status/100)?"function"===typeof t.success&&t.success(i,e.statusText,e):"function"===typeof t.error&&t.error(i,e.statusText,e),"function"===typeof t.complete?t.complete(e,e.statusText):void 0})),!(null!=t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)},r=function(e){return e.url=e.url||location.href,e.type=e.type.toUpperCase(),"GET"===e.type&&e.data&&(e.url.indexOf("?")<0?e.url+="?"+e.data:e.url+="&"+e.data),null==t[e.dataType]&&(e.dataType="*"),e.accept=t[e.dataType],"*"!==e.dataType&&(e.accept+=", */*; q=0.01"),e},n=function(t,n){var i;return(i=new XMLHttpRequest).open(t.type,t.url,!0),i.setRequestHeader("Accept",t.accept),"string"===typeof t.data&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||(i.setRequestHeader("X-Requested-With","XMLHttpRequest"),e(i)),i.withCredentials=!!t.withCredentials,i.onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE)return n(i)},i},s=function(t,e){var n,r;if("string"===typeof t&&"string"===typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(o){}else if(e.match(/\b(?:java|ecma)script\b/))(r=document.createElement("script")).setAttribute("nonce",i()),r.text=t,document.head.appendChild(r).parentNode.removeChild(r);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(o){}}return t},o.href=function(t){return t.href},o.isCrossDomain=function(t){var e,n;(e=document.createElement("a")).href=location.href,n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host===n.protocol+"//"+n.host)}catch(i){return i,!0}}}.call(this),function(){var t,e;t=o.matches,e=function(t){return Array.prototype.slice.call(t)},o.serializeElement=function(n,i){var r,o;return r=[n],t(n,"form")&&(r=e(n.elements)),o=[],r.forEach((function(n){if(n.name&&!n.disabled&&!t(n,"fieldset[disabled] *"))return t(n,"select")?e(n.options).forEach((function(t){if(t.selected)return o.push({name:n.name,value:t.value})})):n.checked||-1===["radio","checkbox","submit"].indexOf(n.type)?o.push({name:n.name,value:n.value}):void 0})),i&&o.push(i),o.map((function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t})).join("&")},o.formElements=function(n,i){return t(n,"form")?e(n.elements).filter((function(e){return t(e,i)})):e(n.querySelectorAll(i))}}.call(this),function(){var t,e,n;e=o.fire,n=o.stopEverything,o.handleConfirm=function(e){if(!t(this))return n(e)},o.confirm=function(t,e){return confirm(t)},t=function(t){var n,i,r;if(!(r=t.getAttribute("data-confirm")))return!0;if(n=!1,e(t,"confirm")){try{n=o.confirm(r,t)}catch(s){}i=e(t,"confirm:complete",[n])}return n&&i}}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p,h;l=o.matches,u=o.getData,p=o.setData,h=o.stopEverything,a=o.formElements,o.handleDisabledElement=function(t){if(this,this.disabled)return h(t)},o.enableElement=function(t){var e;if(t instanceof Event){if(c(t))return;e=t.target}else e=t;return l(e,o.linkDisableSelector)?s(e):l(e,o.buttonDisableSelector)||l(e,o.formEnableSelector)?i(e):l(e,o.formSubmitSelector)?r(e):void 0},o.disableElement=function(i){var r;return r=i instanceof Event?i.target:i,l(r,o.linkDisableSelector)?n(r):l(r,o.buttonDisableSelector)||l(r,o.formDisableSelector)?t(r):l(r,o.formSubmitSelector)?e(r):void 0},n=function(t){var e;if(!u(t,"ujs:disabled"))return null!=(e=t.getAttribute("data-disable-with"))&&(p(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",h),p(t,"ujs:disabled",!0)},s=function(t){var e;return null!=(e=u(t,"ujs:enable-with"))&&(t.innerHTML=e,p(t,"ujs:enable-with",null)),t.removeEventListener("click",h),p(t,"ujs:disabled",null)},e=function(e){return a(e,o.formDisableSelector).forEach(t)},t=function(t){var e;if(!u(t,"ujs:disabled"))return null!=(e=t.getAttribute("data-disable-with"))&&(l(t,"button")?(p(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(p(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,p(t,"ujs:disabled",!0)},r=function(t){return a(t,o.formEnableSelector).forEach(i)},i=function(t){var e;return null!=(e=u(t,"ujs:enable-with"))&&(l(t,"button")?t.innerHTML=e:t.value=e,p(t,"ujs:enable-with",null)),t.disabled=!1,p(t,"ujs:disabled",null)},c=function(t){var e,n;return null!=(null!=(n=null!=(e=t.detail)?e[0]:void 0)?n.getResponseHeader("X-Xhr-Redirect"):void 0)}}.call(this),function(){var t;t=o.stopEverything,o.handleMethod=function(e){var n,i,r,s,a,u,c;if(c=(u=this).getAttribute("data-method"))return a=o.href(u),i=o.csrfToken(),n=o.csrfParam(),r=document.createElement("form"),s="<input name='_method' value='"+c+"' type='hidden' />",null==n||null==i||o.isCrossDomain(a)||(s+="<input name='"+n+"' value='"+i+"' type='hidden' />"),s+='<input type="submit" />',r.method="post",r.action=a,r.target=u.target,r.innerHTML=s,r.style.display="none",document.body.appendChild(r),r.querySelector('[type="submit"]').click(),t(e)}}.call(this),function(){var t,e,n,i,r,s,a,u,c,l=[].slice;s=o.matches,n=o.getData,u=o.setData,e=o.fire,c=o.stopEverything,t=o.ajax,i=o.isCrossDomain,a=o.serializeElement,r=function(t){var e;return null!=(e=t.getAttribute("data-remote"))&&"false"!==e},o.handleRemote=function(p){var h,d,f,g,m,y,v;return!r(g=this)||(e(g,"ajax:before")?(v=g.getAttribute("data-with-credentials"),f=g.getAttribute("data-type")||"script",s(g,o.formSubmitSelector)?(h=n(g,"ujs:submit-button"),m=n(g,"ujs:submit-button-formmethod")||g.method,y=n(g,"ujs:submit-button-formaction")||g.getAttribute("action")||location.href,"GET"===m.toUpperCase()&&(y=y.replace(/\?.*$/,"")),"multipart/form-data"===g.enctype?(d=new FormData(g),null!=h&&d.append(h.name,h.value)):d=a(g,h),u(g,"ujs:submit-button",null),u(g,"ujs:submit-button-formmethod",null),u(g,"ujs:submit-button-formaction",null)):s(g,o.buttonClickSelector)||s(g,o.inputChangeSelector)?(m=g.getAttribute("data-method"),y=g.getAttribute("data-url"),d=a(g,g.getAttribute("data-params"))):(m=g.getAttribute("data-method"),y=o.href(g),d=g.getAttribute("data-params")),t({type:m||"GET",url:y,data:d,dataType:f,beforeSend:function(t,n){return e(g,"ajax:beforeSend",[t,n])?e(g,"ajax:send",[t]):(e(g,"ajax:stopped"),!1)},success:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(g,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(g,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(g,"ajax:complete",t)},crossDomain:i(y),withCredentials:null!=v&&"false"!==v}),c(p)):(e(g,"ajax:stopped"),!1))},o.formSubmitButtonClick=function(t){var e,n;if(n=(e=this).form)return e.name&&u(n,"ujs:submit-button",{name:e.name,value:e.value}),u(n,"ujs:formnovalidate-button",e.formNoValidate),u(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),u(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))},o.preventInsignificantClick=function(t){var e,n,i;if(this,i=(this.getAttribute("data-method")||"GET").toUpperCase(),e=this.getAttribute("data-params"),n=(t.metaKey||t.ctrlKey)&&"GET"===i&&!e,null!=t.button&&0!==t.button||n)return t.stopImmediatePropagation()}}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p,h,d,f,g;if(s=o.fire,n=o.delegate,u=o.getData,t=o.$,g=o.refreshCSRFTokens,e=o.CSRFProtection,d=o.loadCSPNonce,r=o.enableElement,i=o.disableElement,l=o.handleDisabledElement,c=o.handleConfirm,f=o.preventInsignificantClick,h=o.handleRemote,a=o.formSubmitButtonClick,p=o.handleMethod,"undefined"!==typeof jQuery&&null!==jQuery&&null!=jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-u
2js, use rails-ujs only.");jQuery.rails=o,jQuery.ajaxPrefilter((function(t,n,i){if(!t.crossDomain)return e(i)}))}o.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",(function(){return t(o.formEnableSelector).forEach((function(t){if(u(t,"ujs:disabled"))return r(t)})),t(o.linkDisableSelector).forEach((function(t){if(u(t,"ujs:disabled"))return r(t)}))})),n(document,o.linkDisableSelector,"ajax:complete",r),n(document,o.linkDisableSelector,"ajax:stopped",r),n(document,o.buttonDisableSelector,"ajax:complete",r),n(document,o.buttonDisableSelector,"ajax:stopped",r),n(document,o.linkClickSelector,"click",f),n(document,o.linkClickSelector,"click",l),n(document,o.linkClickSelector,"click",c),n(document,o.linkClickSelector,"click",i),n(document,o.linkClickSelector,"click",h),n(document,o.linkClickSelector,"click",p),n(document,o.buttonClickSelector,"click",f),n(document,o.buttonClickSelector,"click",l),n(document,o.buttonClickSelector,"click",c),n(document,o.buttonClickSelector,"click",i),n(document,o.buttonClickSelector,"click",h),n(document,o.inputChangeSelector,"change",l),n(document,o.inputChangeSelector,"change",c),n(document,o.inputChangeSelector,"change",h),n(document,o.formSubmitSelector,"submit",l),n(document,o.formSubmitSelector,"submit",c),n(document,o.formSubmitSelector,"submit",h),n(document,o.formSubmitSelector,"submit",(function(t){return setTimeout((function(){return i(t)}),13)}
vendor: 4,523 bytes, line 2
2)),n(document,o.formSubmitSelector,"ajax:send",i),n(document,o.formSubmitSelector,"ajax:complete",r),n(document,o.formInputClickSelector,"click",f),n(document,o.formInputClickSelector,"click",l),n(document,o.formInputClickSelector,"click",c),n(document,o.formInputClickSelector,"click",a),document.addEventListener("DOMContentLoaded",g),document.addEventListener("DOMContentLoaded",d),window._rails_loaded=!0},window.Rails===o&&s(document,"rails:attachBindings")&&o.start()}.call(this)}).call(this),t.exports?t.exports=o:void 0===(r="function"===typeof(i=o)?i.call(e,n,e,t):i)||(t.exports=r)}).call(this)},1051:function(t,e,n){"use strict";function i(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function r(t){return t instanceof i(t).Element||t instanceof Element}function o(t){return t instanceof i(t).HTMLElement||t instanceof HTMLElement}function s(t){return"undefined"!==typeof ShadowRoot&&(t instanceof i(t).ShadowRoot||t instanceof ShadowRoot)}n.d(e,{ZP:function(){return pe}});var a=Math.max,u=Math.min,c=Math.round;function l(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function p(){return!/^((?!chrome|android).)*safari/i.test(l())}function h(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var s=t.getBoundingClientRect(),a=1,u=1;e&&o(t)&&(a=t.offsetWidth>0&&c(s.width)/t.offsetWidth||1,u=t.offsetHeight>0&&c(s.height)/t.offsetHeight||1);var l=(r(t)?i(t):window).visualViewport,h=!p()&&n,d=(s.left+(h&&l?l.offsetLeft:0))/a,f=(s.top+(h&&l?l.offsetTop:0))/u,g=s.width/a,m=s.height/u;return{width:g,height:m,top:f,right:d+g,bottom:f+m,left:d,x:d,y:f}}function d(t){var e=i(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function f(t){return t?(t.nodeName||"").toLowerCase():null}function g(t){return((r(t)?t.ownerDocument:t.document)||window.document).documentElement}function m(t){return h(g(t)).left+d(t).scrollLeft}function y(t){return i(t).getComputedStyle(t)}function v(t){var e=y(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function b(t,e,n){void 0===n&&(n=!1);var r,s,a=o(e),u=o(e)&&function(t){var e=t.getBoundingClientRect(),n=c(e.width)/t.offsetWidth||1,i=c(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),l=g(e),p=h(t,u,n),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!n)&&(("body"!==f(e)||v(l))&&(y=(r=e)!==i(r)&&o(r)?{scrollLeft:(s=r).scrollLeft,scrollTop:s.scrollTop}:d(r)),o(e)?((b=h(e,!0)).x+=e.clientLeft,b.y+=e.clientTop):l&&(b.x=m(l))),{x:p.left+y.scrollLeft-b.x,y:p.top+y.scrollTop-b.y,width:p.width,height:p.height}}function A(t){var e=h(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function w(t){return"html"===f(t)?t:t.assignedSlot||t.parentNode||(s(t)?t.host:null)||g(t)}function x(t){return["html","body","#document"].indexOf(f(t))>=0?t.ownerDocument.body:o(t)&&v(t)?t:x(w(t))}function C(t,e){var n;void 0===e&&(e=[]);var r=x(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),s=i(r),a=o?[s].concat(s.visualViewport||[],v(r)?r:[]):r,u=e.concat(a);return o?u:u.concat(C(w(a)))}function E(t){return["table","td","th"].indexOf(f(t))>=0}function S(t){return o(t)&&"fixed"!==y(t).position?t.offsetParent:null}function k(t){for(var e=i(t),n=S(t);n&&E(n)&&"static"===y(n).position;)n=S(n);return n&&("html"===f(n)||"body"===f(n)&&"static"===y(n).position)?e:n||function(t){var e=/firefox/i.test(l());if(/Trident/i.test(l())&&o(t)&&"fixed"===y(t).position)return null;var n=w(t);for(s(n)&&(n=n.host);o(n)&&["html","body"].indexOf(f(n))<0;){var i=y(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}var R="top",L="bottom",D="right",T="left",O="auto",P=[R,L,D,T],N="start",I="end",B="clippingParents",_="viewport",M="popper",F="reference",j=P.reduce((function(t,e){return t.concat([e+"-"+N,e+"-"+I])}),[]),q=[].concat(P,[O]).reduce((function(t,e){return t.concat([e,e+"-"+N,e+"-"+I])}),[]),W=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEac
vendor: 11,085 bytes, line 2
2h((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}var U={placement:"bottom",modifiers:[],strategy:"absolute"};function V(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"===typeof t.getBoundingClientRect)}))}function z(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,o=e.defaultOptions,s=void 0===o?U:o;return function(t,e,n){void 0===n&&(n=s);var o,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},U,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,p={state:u,setOptions:function(n){var o="function"===typeof n?n(u.options):n;h(),u.options=Object.assign({},s,u.options,o),u.scrollParents={reference:r(t)?C(t):t.contextElement?C(t.contextElement):[],popper:C(e)};var a,l,d=function(t){var e=H(t);return W.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((a=[].concat(i,u.options.modifiers),l=a.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(l).map((function(t){return l[t]}))));return u.orderedModifiers=d.filter((function(t){return t.enabled})),u.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,r=t.effect;if("function"===typeof r){var o=r({state:u,name:e,instance:p,options:i}),s=function(){};c.push(o||s)}})),p.update()},forceUpdate:function(){if(!l){var t=u.elements,e=t.reference,n=t.popper;if(V(e,n)){u.rects={reference:b(e,k(n),"fixed"===u.options.strategy),popper:A(n)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(t){return u.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<u.orderedModifiers.length;i++)if(!0!==u.reset){var r=u.orderedModifiers[i],o=r.fn,s=r.options,a=void 0===s?{}:s,c=r.name;"function"===typeof o&&(u=o({state:u,options:a,name:c,instance:p})||u)}else u.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){p.forceUpdate(),t(u)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){h(),l=!0}};if(!V(t,e))return p;function h(){c.forEach((function(t){return t()})),c=[]}return p.setOptions(n).then((function(t){!l&&n.onFirstUpdate&&n.onFirstUpdate(t)})),p}}var J={passive:!0};function K(t){return t.split("-")[0]}function G(t){return t.split("-")[1]}function X(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function $(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?K(r):null,s=r?G(r):null,a=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2;switch(o){case R:e={x:a,y:n.y-i.height};break;case L:e={x:a,y:n.y+n.height};break;case D:e={x:n.x+n.width,y:u};break;case T:e={x:n.x-i.width,y:u};break;default:e={x:n.x,y:n.y}}var c=o?X(o):null;if(null!=c){var l="y"===c?"height":"width";switch(s){case N:e[c]=e[c]-(n[l]/2-i[l]/2);break;case I:e[c]=e[c]+(n[l]/2-i[l]/2)}}return e}var Y={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(t){var e,n=t.popper,r=t.popperRect,o=t.placement,s=t.variation,a=t.offsets,u=t.position,l=t.gpuAcceleration,p=t.adaptive,h=t.roundOffsets,d=t.isFixed,f=a.x,m=void 0===f?0:f,v=a.y,b=void 0===v?0:v,A="function"===typeof h?h({x:m,y:b}):{x:m,y:b};m=A.x,b=A.y;var w=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),C=T,E=R,S=window;if(p){var O=k(n),P="clientHeight",N="clientWidth";if(O===i(n)&&"static"!==y(O=g(n)).position&&"absolute"===u&&(P="scrollHeight",N="scrollWidth"),o===R||(o===T||o===D)&&s===I)E=L,b-=(d&&O===S&&S.visualViewport?S.visualViewport.height:O[P])-r.height,b*=l?1:-1;if(o===T||(o===R||o===L)&&s===I)C=D,m-=(d&&O===S&&S.visualViewport?S.visualViewport.width:O[N])-r.width,m*=l?1:-1}var B,_=Object.assign({position:u},p&&Y),M=!0===h?function(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:c(n*r)/r||0,y:c(i*r)/r||0}}({x:m,y:b},i(n)):{x:m,y:b};return m=M.x,b=M.y,l?Object.assign({},_,((B={})[E]=x?"0":"",B[C]=w?"0":"",B.transform=(S.devicePixelRatio||1)<=1?"translate("+m+"px, "+b+"px)":"translate3d("+m+"px, "+b+"px, 0)",B)):Object.assign({},_,((e={})[E]=x?b+"px":"",e[C]=w?m+"px":"",e.transform="",e))}var Z={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];o(r)&&f(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});o(i)&&f(i)&&(Object.assign(i.style,s),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};var tt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,s=q.reduce((function(t,n){return t[n]=function(t,e,n){var i=K(t),r=[T,R].indexOf(i)>=0?-1:1,o="function"===typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[T,D].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,o),t}),{}),a=s[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}},et={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,(function(t){return et[t]}))}var it={start:"end",end:"start"};function rt(t){return t.replace(/start|end/g,(function(t){return it[t]}))}function ot(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&s(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function st(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function at(t,e,n){return e===_?st(function(t,e){var n=i(t),r=g(t),o=n.visualViewport,s=r.clientWidth,a=r.clientHeight,u=0,c=0;if(o){s=o.width,a=o.height;var l=p();(l||!l&&"fixed"===e)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:s,height:a,x:u+m(t),y:c}}(t,n)):r(e)?function(t,e){var n=h(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):st(function(t){var e,n=g(t),i=d(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=a(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=a(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-i.scrollLeft+m(t),c=-i.scrollTop;return"rtl"===y(r||n).direction&&(u+=a(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:u,y:c}}(g(t)))}function ut(t,e,n,i){var s="clippingParents"===e?function(t){var e=C(w(t)),n=["absolute","fixed"].indexOf(y(t).position)>=0&&o(t)?k(t):t;return r(n)?e.filter((function(t){return r(t)&&ot(t,n)&&"body"!==f(t)})):[]}(t):[].concat(e),c=[].concat(s,[n]),l=c[0],p=c.reduce((function(e,n){var r=at(t,n,i);return e.top=a(r.top,e.top),e.right=u(r.right,e.right),e.bottom=u(r.bottom,e.bottom),e.left=a(r.left,e.left),e}),at(t,l,i));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function ct(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function lt(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function pt(t,e){void 0===e&&(e={});var n=e,i=n.placement,o=void 0===i?t.placement:i,s=n.strategy,a=void 0===s?t.strategy:s,u=n.boundary,c=void 0===u?B:u,l=n.rootBoundary,p=void 0===l?_:l,d=n.elementContext,f=void 0===d?M:d,m=n.altBoundary,y=void 0!==m&&m,v=n.padding,b=void 0===v?0:v,A=ct("number"!==typeof b?b:lt(b,P)),w=f===M?F:M,x=t.rects.popper,C=t.elements[y?w:f],E=ut(r(C)?C:C.contextElement||g(t.elements.popper),c,p,a),S=h(t.elements.reference),k=$({reference:S,element:x,strategy:"absolute",placement:o}),T=st(Object.assign({},x,k)),O=f===M?T:S,N={top:E.top-O.top+A.top,bottom:O.bottom-E.bottom+A.bottom,left:E.left-O.left+A.left,right:O.right-E.right+A.right},I=t.modifiersData.offset;if(f===M&&I){var j=I[o];Object.keys(N).forEach((function(t){var e=[D,L].indexOf(t)>=0?1:-1,n=[R,L].indexOf(t)>=0?"y":"x";N[t]+=j[n]*e}))}return N}function ht(t,e,n){return a(t,u(e,n))}var dt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,c=void 0!==s&&s,l=n.boundary,p=n.rootBoundary,h=n.altBoundary,d=n.padding,f=n.tether,g=void 0===f||f,m=n.tetherOffset,y=void 0===m?0:m,v=pt(e,{boundary:l,rootBoundary:p,padding:d,altBoundary:h}),b=K(e.placement),w=G(e.placement),x=!w,C=X(b),E="x"===C?"y":"x",S=e.modifiersData.popperOffsets,O=e.rects.reference,P=e.rects.popper,I="function"===typeof y?y(Object.assign({},e.rects,{placement:e.placement})):y,B="number"===typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(S){if(o){var F,j="y"===C?R:T,q="y"===C?L:D,W="y"===C?"height":"width",H=S[C],U=H+v[j],V=H-v[q],z=g?-P[W]/2:0,J=w===N?O[W]:P[W],$=w===N?-P[W]:-O[W],Y=e.elements.arrow,Q=g&&Y?A(Y):{width:0,height:0},Z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Z[j],et=Z[q],nt=ht(0,O[W],Q[W]),it=x?O[W]/2-z-nt-tt-B.mainAxis:J-nt-tt-B.mainAxis,rt=x?-O[W]/2+z+nt+et+B.mainAxis:$+nt+et+B.mainAxis,ot=e.elements.arrow&&k(e.elements.arrow),st=ot?"y"===C?ot.clientTop||0:ot.clientLeft||0:0,at=null!=(F=null==_?void 0:_[C])?F:0,ut=H+rt-at,ct=ht(g?u(U,H+it-at-st):U,H,g?a(V,ut):V);S[C]=ct,M[C]=ct-H}if(c){var lt,dt="x"===C?R:T,ft="x"===C?L:D,gt=S[E],mt="y"===E?"height":"width",yt=gt+v[dt],vt=gt-v[ft],bt=-1!==[R,T].indexOf(b),At=null!=(lt=null==_?void 0:_[E])?lt:0,wt=bt?yt:gt-O[mt]-P[mt]-At+B.altAxis,xt=bt?gt+O[mt]+P[mt]-At-B.altAxis:vt,Ct=g&&bt?function(t,e,n){var i=ht(t,e,n);return i>n?n:i}(wt,gt,xt):ht(g?wt:yt,gt,g?xt:vt);S[E]=Ct,M[E]=Ct-gt}e.modifiersData[i]=M}},requiresIfExists:["offset"]};var ft={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=K(n.placement),u=X(a),c=[T,D].indexOf(a)>=0?"height":"width";if(o&&s){var l=function(t,e){return ct("number"!==typeof(t="function"===typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:lt(t,P))}(r.padding,n),p=A(o),h="y"===u?R:T,d="y"===u?L:D,f=n.rects.reference[c]+n.rects.reference[u]-s[u]-n.rects.popper[c],g=s[u]-n.rects.reference[u],m=k(o),y=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,v=f/2-g/2,b
vendor: 8,143 bytes, line 2
2=l[h],w=y-p[c]-l[d],x=y/2-p[c]/2+v,C=ht(b,x,w),E=u;n.modifiersData[i]=((e={})[E]=C,e.centerOffset=C-x,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!==typeof i||(i=e.elements.popper.querySelector(i)))&&ot(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function mt(t){return[R,D,L,T].some((function(e){return t[e]>=0}))}var yt=z({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,s=void 0===o||o,a=r.resize,u=void 0===a||a,c=i(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach((function(t){t.addEventListener("scroll",n.update,J)})),u&&c.addEventListener("resize",n.update,J),function(){s&&l.forEach((function(t){t.removeEventListener("scroll",n.update,J)})),u&&c.removeEventListener("resize",n.update,J)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=$({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,u=void 0===a||a,c={placement:K(e.placement),variation:G(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Q(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Q(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Z,tt,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,u=n.fallbackPlacements,c=n.padding,l=n.boundary,p=n.rootBoundary,h=n.altBoundary,d=n.flipVariations,f=void 0===d||d,g=n.allowedAutoPlacements,m=e.options.placement,y=K(m),v=u||(y===m||!f?[nt(m)]:function(t){if(K(t)===O)return[];var e=nt(t);return[rt(t),e,rt(e)]}(m)),b=[m].concat(v).reduce((function(t,n){return t.concat(K(n)===O?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?q:u,l=G(i),p=l?a?j:j.filter((function(t){return G(t)===l})):P,h=p.filter((function(t){return c.indexOf(t)>=0}));0===h.length&&(h=p);var d=h.reduce((function(e,n){return e[n]=pt(t,{placement:n,boundary:r,rootBoundary:o,padding:s})[K(n)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:n,boundary:l,rootBoundary:p,padding:c,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),A=e.rects.reference,w=e.rects.popper,x=new Map,C=!0,E=b[0],S=0;S<b.length;S++){var k=b[S],I=K(k),B=G(k)===N,_=[R,L].indexOf(I)>=0,M=_?"width":"height",F=pt(e,{placement:k,boundary:l,rootBoundary:p,altBoundary:h,padding:c}),W=_?B?D:T:B?L:R;A[M]>w[M]&&(W=nt(W));var H=nt(W),U=[];if(o&&U.push(F[I]<=0),a&&U.push(F[W]<=0,F[H]<=0),U.every((function(t){return t}))){E=k,C=!1;break}x.set(k,U)}if(C)for(var V=function(t){var e=b.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return E=e,"break"},z=f?3:1;z>0;z--){if("break"===V(z))break}e.placement!==E&&(e.modifiersData[i]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},dt,ft,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=pt(e,{elementContext:"reference"}),a=pt(e,{altBoundary:!0}),u=gt(s,i),c=gt(a,r,o),l=mt(u),p=mt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}}]}),vt="tippy-content",bt="tippy-backdrop",At="tippy-arrow",wt="tippy-svg-arrow",xt={passive:!0,capture:!0},Ct=function(){return document.body};function Et(t,e,n){if(Array.isArray(t)){var i=t[e];return null==i?Array.isArray(n)?n[e]:n:i}return t}function St(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function kt(t,e){return"function"===typeof t?t.apply(void 0,e):t}function Rt(t,e){return 0===e?t:function(i){clearTimeout(n),n=setTimeout((function(){t(i)}),e)};var n}function Lt(t){return[].concat(t)}function Dt(t,e){-1===t.indexOf(e)&&t.push(e)}function Tt(t){return t.split("-")[0]}function Ot(t){return[].slice.call(t)}function Pt(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function Nt(){return document.createElement("div")}function It(t){return["Element","Fragment"].some((function(e){return St(t,e)}))}function Bt(t){return St(t,"MouseEvent")}function _t(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function Mt(t){return It(t)?[t]:function(t){return St(t,"NodeList")}(t)?Ot(t):Array.isArray(t)?t:Ot(document.querySelectorAll(t))}function Ft(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function jt(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function qt(t){var e,n=Lt(t)[0];return null!=n&&null!=(e=n.ownerDocument)&&e.body?n.ownerDocument:document}function Wt(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[i](e,n)}))}function Ht(t,e){for(var n=e;n;){var i;if(t.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var Ut={isTouch:!1},Vt=0;function zt(){Ut.isTouch||(Ut.isTouch=!0,window.performance&&document.addEventListener("mousemove",Jt))}function Jt(){var t=performance.now();t-Vt<20&&(Ut.isTouch=!1,document.removeEventListener("mousemove",Jt)),Vt=t}function Kt(){var t=document.activeElement;if(_t(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var Gt=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var Xt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},$t=Object.assign({appendTo:Ct,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Xt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Yt=Object.keys($t);function Qt(t){var e=(t.plugins||[]).reduce((function(e,n){var i,r=n.name,o=n.defaultValue;r&&(e[r]=void 0!==t[r]?t[r]:null!=(i=$t[r])?i:o);return e}),{});return Object.assign({},t,e)}function Zt(t,e){var n=Object.assign({},e,{content:kt(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Qt(Object.assign({},$t,{plugins:e}))):Yt).reduce((function(e,n){var i=(t.getAttribute("data-tippy-"+n)||"").trim();if(!i)return e;if("content"===n)e[n]=i;else try{e[n]=JSON.parse(i)}catch(r){e[n]=i}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},$t.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.
2interactive?null:"describedby":n.aria.content},n}var te=function(){return"innerHTML"};function ee(t,e){t[te()]=e}function ne(t){var e=Nt();return!0===t?e.className=At:(e.className=wt,It(t)?e.appendChild(t):ee(e,t)),e}function ie(t,e){It(e.content)?(ee(t,""),t.appendChild(e.content)):"function"!==typeof e.content&&(e.allowHTML?ee(t,e.content):t.textContent=e.content)}function re(t){var e=t.firstElementChild,n=Ot(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(vt)})),arrow:n.find((function(t){return t.classList.contains(At)||t.classList.contains(wt)})),backdrop:n.find((function(t){return t.classList.contains(bt)}))}}function oe(t){var e=Nt(),n=Nt();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Nt();function r(n,i){var r=re(e),o=r.box,s=r.content,a=r.arrow;i.theme?o.setAttribute("data-theme",i.theme):o.removeAttribute("data-theme"),"string"===typeof i.animation?o.setAttribute("data-animation",i.animation):o.removeAttribute("data-animation"),i.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"===typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?o.setAttribute("role",i.role):o.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||ie(s,t.props),i.arrow?a?n.arrow!==i.arrow&&(o.removeChild(a),o.appendChild(ne(i.arrow))):o.appendChild(ne(i.arrow)):a&&o.removeChild(a)}return i.className=vt,i.setAttribute("data-state","hidden"),ie(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props),{popper:e,onUpdate:r}}oe.$$tippy=!0;var se=1,ae=[],ue=[];function ce(t,e){var n,i,r,o,s,a,u,c,l=Zt(t,Object.assign({},$t,Qt(Pt(e)))),p=!1,h=!1,d=!1,f=!1,g=[],m=Rt(K,l.interactiveDebounce),y=se++,v=(c=l.plugins).filter((function(t,e){return c.indexOf(t)===e})),b={id:y,reference:t,popper:Nt(),popperInstance:null,props:l,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(r)},setProps:function(e){0;if(b.state.isDestroyed)return;N("onBeforeUpdate",[b,e]),z();var n=b.props,i=Zt(t,Object.assign({},n,Pt(e),{ignoreAttributes:!0}));b.props=i,V(),n.interactiveDebounce!==i.interactiveDebounce&&(_(),m=Rt(K,i.interactiveDebounce));n.triggerTarget&&!i.triggerTarget?Lt(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):i.triggerTarget&&t.removeAttribute("aria-expanded");B(),P(),x&&x(n,i);b.popperInstance&&(Y(),Z().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));N("onAfterUpdate",[b,e])},setContent:function(t){b.setProps({content:t})},show:function(){0;var t=b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,i=Ut.isTouch&&!b.props.touch,r=Et(b.props.duration,0,$t.duration);if(t||e||n||i)return;if(L().hasAttribute("disabled"))return;if(N("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,R()&&(w.style.visibility="visible");P(),q(),b.state.isMounted||(w.style.transition="none");if(R()){var o=T();Ft([o.box,o.content],0)}a=function(){var t;if(b.state.isVisible&&!f){if(f=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,R()&&b.props.animation){var e=T(),n=e.box,i=e.content;Ft([n,i],r),jt([n,i],"visible")}I(),B(),Dt(ue,b),null==(t=b.popperInstance)||t.forceUpdate(),N("onMount",[b]),b.props.animation&&R()&&function(t,e){H(t,e)}(r,(function(){b.state.isShown=!0,N("onShown",[b])}))}},function(){var t,e=b.props.appendTo,n=L();t=b.props.interactive&&e===Ct||"parent"===e?n.parentNode:kt(e,[n]);t.contains(w)||t.appendChild(w);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var t=!b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,i=Et(b.props.duration,1,$t.duration);if(t||e||n)return;if(N("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,f=!1,p=!1,R()&&(w.style.visibility="hidden");if(_(),W(),P(!0),R()){var r=T(),o=r.box,s=r.content;b.props.animation&&(Ft([o,s],i),jt([o,s],"hidden"))}I(),B(),b.props.animation?R()&&function(t,e){H(t,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&e()}))}(i,b.unmount):b.unmount()},hideWithInteractivity:function(t){0;D().addEventListener("mousemove",m),Dt(ae,m),m(t)}
vendor: 3,661 bytes, line 2
2,enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;Q(),Z().forEach((function(t){t._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);ue=ue.filter((function(t){return t!==b})),b.state.isMounted=!1,N("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),z(),delete t._tippy,b.state.isDestroyed=!0,N("onDestroy",[b])}};if(!l.render)return b;var A=l.render(b),w=A.popper,x=A.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var C=v.map((function(t){return t.fn(b)})),E=t.hasAttribute("aria-expanded");return V(),B(),P(),N("onCreate",[b]),l.showOnCreate&&tt(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",m)})),b;function S(){var t=b.props.touch;return Array.isArray(t)?t:[t,0]}function k(){return"hold"===S()[0]}function R(){var t;return!(null==(t=b.props.render)||!t.$$tippy)}function L(){return u||t}function D(){var t=L().parentNode;return t?qt(t):document}function T(){return re(w)}function O(t){return b.state.isMounted&&!b.state.isVisible||Ut.isTouch||o&&"focus"===o.type?0:Et(b.props.delay,t?0:1,$t.delay)}function P(t){void 0===t&&(t=!1),w.style.pointerEvents=b.props.interactive&&!t?"":"none",w.style.zIndex=""+b.props.zIndex}function N(t,e,n){var i;(void 0===n&&(n=!0),C.forEach((function(n){n[t]&&n[t].apply(n,e)})),n)&&(i=b.props)[t].apply(i,e)}function I(){var e=b.props.aria;if(e.content){var n="aria-"+e.content,i=w.id;Lt(b.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(b.state.isVisible)t.setAttribute(n,e?e+" "+i:i);else{var r=e&&e.replace(i,"").trim();r?t.setAttribute(n,r):t.removeAttribute(n)}}))}}function B(){!E&&b.props.aria.expanded&&Lt(b.props.triggerTarget||t).forEach((function(t){b.props.interactive?t.setAttribute("aria-expanded",b.state.isVisible&&t===L()?"true":"false"):t.removeAttribute("aria-expanded")}))}function _(){D().removeEventListener("mousemove",m),ae=ae.filter((function(t){return t!==m}))}function M(e){if(!Ut.isTouch||!d&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!b.props.interactive||!Ht(w,n)){if(Lt(b.props.triggerTarget||t).some((function(t){return Ht(t,n)}))){if(Ut.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[b,e]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),h=!0,setTimeout((function(){h=!1})),b.state.isMounted||W())}}}function F(){d=!0}function j(){d=!1}function q(){var t=D();t.addEventListener("mousedown",M,!0),t.addEventListener("touchend",M,xt),t.addEventListener("touchstart",j,xt),t.addEventListener("touchmove",F,xt)}function W(){var t=D();t.removeEventListener("mousedown",M,!0),t.removeEventListener("touchend",M,xt),t.removeEventListener("touchstart",j,xt),t.removeEventListener("touchmove",F,xt)}function H(t,e){var n=T().box;function i(t){t.target===n&&(Wt(n,"remove",i),e())}if(0===t)return e();Wt(n,"remove",s),Wt(n,"add",i),s=i}function U(e,n,i){void 0===i&&(i=!1),Lt(b.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,i),g.push({node:t,eventType:e,handler:n,options:i})}))}function V(){var t;k()&&(U("touchstart",J,{passive:!0}),U("touchend",G,{passive:!0})),(t=b.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(U(t,J),t){case"mouseenter":U("mouseleave",G);break;
2case"focus":U(Gt?"focusout":"blur",X);break;case"focusin":U("focusout",X)}}))}function z(){g.forEach((function(t){var e=t.node,n=t.eventType,i=t.handler,r=t.options;e.removeEventListener(n,i,r)})),g=[]}function J(t){var e,n=!1;if(b.state.isEnabled&&!$(t)&&!h){var i="focus"===(null==(e=o)?void 0:e.type);o=t,u=t.currentTarget,B(),!b.state.isVisible&&Bt(t)&&ae.forEach((function(e){return e(t)})),"click"===t.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:tt(t),"click"===t.type&&(p=!n),n&&!i&&et(t)}}function K(t){var e=t.target,n=L().contains(e)||w.contains(e);if("mousemove"!==t.type||!n){var i=Z().concat(w).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:l}:null})).filter(Boolean);(function(t,e){var n=e.clientX,i=e.clientY;return t.every((function(t){var e=t.popperRect,r=t.popperState,o=t.props.interactiveBorder,s=Tt(r.placement),a=r.modifiersData.offset;if(!a)return!0;var u="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,l="right"===s?a.left.x:0,p="left"===s?a.right.x:0,h=e.top-i+u>o,d=i-e.bottom-c>o,f=e.left-n+l>o,g=n-e.right-p>o;return h||d||f||g}))})(i,t)&&(_(),et(t))}}function G(t){$(t)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(t):et(t))}function X(t){b.props.trigger.indexOf("focusin")<0&&t.target!==L()||b.props.interactive&&t.relatedTarget&&w.contains(t.relatedTarget)||et(t)}function $(t){return!!Ut.isTouch&&k()!==t.type.indexOf("touch")>=0}function Y(){Q();var e=b.props,n=e.popperOptions,i=e.placement,r=e.offset,o=e.getReferenceClientRect,s=e.moveTransition,u=R()?re(w).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||L()}:t,l={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(R()){var n=T().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}},p=[{name:"offset",options:{offset:r}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},l];R()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),b.popperInstance=yt(c,w,Object.assign({},n,{placement:i,onFirstUpdate:a,modifiers:p}))}function Q(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return Ot(w.querySelectorAll("[data-tippy-root]"))}function tt(t){b.clearDelayTimeouts(),t&&N("onTrigger",[b,t]),q();var e=O(!0),i=S(),r=i[0],o=i[1];Ut.isTouch&&"hold"===r&&o&&(e=o),e?n=setTimeout((function(){b.show()}),e):b.show()}function et(t){if(b.clearDelayTimeouts(),N("onUntrigger",[b,t]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&p)){var e=O(!1);e?i=setTimeout((function(){b.state.isVisible&&b.hide()}),e):r=requestAnimationFrame((function(){b.hide()}))}}else W()}}function le(t,e){void 0===e&&(e={});var n=$t.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",zt,xt),window.addEventListener("blur",Kt);var i=Object.assign({},e,{plugins:n}),r=Mt(t).reduce((function(t,e){var n=e&&ce(e,i);return n&&t.push(n),t}),[]);return It(t)?r[0]:r}le.defaultProps=$t,le.setDefaultProps=function(t){Object.keys(t).forEach((function(e){$t[e]=t[e]}))},le.currentInput=Ut;Object.assign({},Z,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});le.setDefaultProps({render:oe});var pe=le},6250:function(t,e,n){var i,r;(function(){}).call(this),function(){null==window.Set&&(window.Set=function(){function t(){this.clear()}return t.prototype.clear=function(){return this.values=[]},t.prototype.has=function(t){return-1!==this.values.indexOf(t)},t.prototype.add=function(t){return this.has(t)||this.values.push(t),this},t.prototype.delete=function(t){var e;return-1!==(e=this.values.indexOf(t))&&(this.values.splice(e,1),!0)},t.prototype.forEach=function(){var t;
2return(t=this.values).forEach.apply(t,arguments)},t}())}.call(this),function(e){function n(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void p((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var i;try{i=n(t._value)}catch(r){return void s(e.promise,r)}o(e.promise,i)}else(1===t._state?o:s)(e.promise,t._value)})))}function o(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void a(t);if("function"==typeof n)return void c(function(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,a(t)}catch(o){s(t,o)}}function s(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&setTimeout((function(){t._handled||h(t._value)}),1);for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function u(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function c(t,e){var n=!1;try{t((function(t){n||(n=!0,o(e,t))}),(function(t){n||(n=!0,s(e,t))}))}catch(i){if(n)return;n=!0,s(e,i)}}var l=setTimeout,p="function"==typeof setImmediate&&setImmediate||function(t){l(t,1)},h=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var o=new i(n);return r(this,new u(t,e,o)),o},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(t){i(o,t)}),n)}e[o]=s,0===--r&&t(e)}catch(u){n(u)}}if(0===e.length)return t([]);for(var r=e.length,o=0;o<e.length;o++)i(o,e[o])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))}
2,i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var i=0,r=t.length;r>i;i++)t[i].then(e,n)}))},i._setImmediateFn=function(t){p=t},i._setUnhandledRejectionFn=function(t){h=t},t.exports?t.exports=i:e.Promise||(e.Promise=i)}(this),function(){var t="object"==typeof window.customElements,e="function"==typeof document.registerElement;t||e||("undefined"==typeof WeakMap&&function(){var t=Object.defineProperty,e=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+e+++"__"};n.prototype={set:function(e,n){var i=e[this.name];return i&&i[0]===e?i[1]=n:t(e,this.name,{value:[e,n],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},delete:function(t){var e=t[this.name];return!(!e||e[0]!==t)&&(e[0]=e[1]=void 0,!0)},has:function(t){var e=t[this.name];return!!e&&e[0]===t}},window.WeakMap=n}(),function(t){function e(t){y.push(t),m||(m=!0,l(n))}function n(){m=!1;var t=y;y=[],t.sort((function(t,e){return t.uid_-e.uid_}));var e=!1;t.forEach((function(t){var n=t.takeRecords();(function(t){t.nodes_.forEach((function(e){var n=p.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))})(t),n.length&&(t.callback_(n,t),e=!0)})),e&&n()}function i(t,e){for(var n=t;n;n=n.parentNode){var i=p.get(n);if(i)for(var r=0;r<i.length;r++){var o=i[r],s=o.options;if(n===t||s.subtree){var a=e(s);a&&o.enqueue(a)}}}}function r(t){this.callback_=t,this.nodes_=[],this.records_=[],this.uid_=++v}function o(t,e){this.type=t,this.target=e,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function s(t,e){return f=new o(t,e)}function a(t){return g||(g=function(t){var e=new o(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}(f),g.oldValue=t,g)}function u(t,e){return t===e?t:g&&function(t){return t===g||t===f}(t)?g:null}function c(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}if(!t.JsMutationObserver){var l,p=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))l=setTimeout;else if(window.setImmediate)l=window.setImmediate;else{var h=[],d=String(Math.random());window.addEventListener("message",(function(t){if(t.data===d){var e=h;h=[],e.forEach((function(t){t()}))}})),l=function(t){h.push(t),window.postMessage(d,"*")}}var f,g,m=!1,y=[],v=0;r.prototype={observe:function(t,e){if(t=function(t){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(t)||t}(t),!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n=p.get(t);n||p.set(t,n=[]);for(var i,r=0;r<n.length;r++)if(n[r].observer===this){(i=n[r]).removeListeners(),i.options=e;break}i||(i=new c(this,t,e),n.push(i),this.nodes_.push(t)),i.addListeners()},disconnect:function(){this.nodes_.forEach((function(t){for(var e=p.get(t),n=0;n<e.length;n++){var i=e[n];if(i.observer===this){i.removeListeners(),e.splice(n,1);break}}}),this),this.records_=[]},takeRecords:function(){var t=this.records_;return this.records_=[],t}},c.prototype={enqueue:function(t){var n=this.observer.records_,i=n.length;if(n.length>0){var r=u(n[i-1],t);if(r)return void(n[i-1]=r)}else e(this.observer);n[i]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;
2e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){if(t!==this.target){this.addListeners_(t),this.transientObservedNodes.push(t);var e=p.get(t);e||p.set(t,e=[]),e.push(this)}},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=p.get(t),n=0;n<e.length;n++)if(e[n]===this){e.splice(n,1);break}}),this)},handleEvent:function(t){switch(t.stopImmediatePropagation(),t.type){case"DOMAttrModified":var e=t.attrName,n=t.relatedNode.namespaceURI,r=t.target;(u=new s("attributes",r)).attributeName=e,u.attributeNamespace=n;var o=t.attrChange===MutationEvent.ADDITION?null:t.prevValue;i(r,(function(t){return!t.attributes||t.attributeFilter&&t.attributeFilter.length&&-1===t.attributeFilter.indexOf(e)&&-1===t.attributeFilter.indexOf(n)?void 0:t.attributeOldValue?a(o):u}));break;case"DOMCharacterDataModified":var u=s("characterData",r=t.target);o=t.prevValue;i(r,(function(t){return t.characterData?t.characterDataOldValue?a(o):u:void 0}));break;case"DOMNodeRemoved":this.addTransientObserver(t.target);case"DOMNodeInserted":var c,l,p=t.target;"DOMNodeInserted"===t.type?(c=[p],l=[]):(c=[],l=[p]);var h=p.previousSibling,d=p.nextSibling;(u=s("childList",t.target.parentNode)).addedNodes=c,u.removedNodes=l,u.previousSibling=h,u.nextSibling=d,i(t.relatedNode,(function(t){return t.childList?u:void 0}))}f=g=void 0}},t.JsMutationObserver=r,t.MutationObserver||(t.MutationObserver=r,r._isPolyfilled=!0)}}(self),function(){"use strict";if(!window.performance||!window.performance.now){var t=Date.now();window.performance={now:function(){return Date.now()-t}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return t?function(e){return t((function(){e(performance.now())}))}:function(t){return window.setTimeout(t,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)});var e=function(){var t=document.createEvent("Event");return t.initEvent("foo",!0,!0),t.preventDefault(),t.defaultPrevented}();if(!e){var n=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(n.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var i=/Trident/.test(navigator.userAgent);if((!window.CustomEvent||i&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(t,e){e=e||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.Event||i&&"function"!=typeof window.Event){var r=window.Event;window.Event=function(t,e){e=e||{};var n=document.createEvent("Event");return n.initEvent(t,Boolean(e.bubbles),Boolean(e.cancelable)),n},window.Event.prototype=r.prototype}}(window.WebComponents),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,n=[];t.addModule=function(t){n.push(t)},t.initializeModules=function(){n.forEach((function(e){e(t)}))},t.hasNative=Boolean(document.registerElement),t.isIE=/Trident/.test(navigator.userAgent),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule((function(t){function e(t,e){n(t,(function(t){return!!e(t)||void i(t,e)})),i(t,e)}function n(t,e,i){var r=t.firstElementChild;if(!r)for(r=t.firstChild;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.nextSibling;for(;r;)!0!==e(r,i)&&n(r,e,i),r=r.nextElementSibling;return null}function i(t,n){for(var i=t.shadowRoot;i;)e(i,n),i=i.olderShadowRoot}function r(t,e,n){if(t=window.wrap(t),!(n.indexOf(t)>=0)){n.push(t);for(var i,s=t.querySelectorAll("link[rel="+o+"]"),a=0,u=s.length;u>a&&(i=s[a]);a++)i.import&&r(i.import,e,n);e(t)}}var o=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=function(t,e){r(t,e,[])},t.forSubtree=e})),window.CustomElements.addModule((function(t){function e(t,e){return n(t,e)||i(t,e)}function n(e,n){return!!t.upgrade(e,n)||void(n&&s(e))}function i(t,e){f(t,(function(t){return!!n(t,e)||void 0}))}function r(t){v.push(t),y||(y=!0,setTimeout(o))}function o(){y=!1;for(var t,e=v,n=0,i=e.length;i>n&&(t=e[n]);n++)t();v=[]}function s(t){m?r((function(){a(t)})):a(t)}function a(t){t.__upgraded__&&!t.__attached&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function u(t){m?r((function(){c(t)})):c(t)}function c(t){t.__upgraded__&&t.__attached&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function l(t,n){if(d.dom){var i=n[0];if(i&&"childList"===i.type&&i.addedNodes&&i.addedNodes){for(var r=i.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var o=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,o||"")}var s=function(t){for(var e=t,n=window.wrap(document);e;){if(e==n)return!0;e=e.parentNode||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host}}(t);
2n.forEach((function(t){"childList"===t.type&&(b(t.addedNodes,(function(t){t.localName&&e(t,s)})),b(t.removedNodes,(function(t){t.localName&&function(t){u(t),f(t,(function(t){u(t)}))}(t)})))})),d.dom&&console.groupEnd()}function p(t){if(!t.__observer){var e=new MutationObserver(l.bind(this,t));e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function h(t){t=window.wrap(t),d.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t,t===window.wrap(document)),p(t),d.dom&&console.groupEnd()}var d=t.flags,f=t.forSubtree,g=t.forDocumentTree,m=window.MutationObserver._isPolyfilled&&d["throttle-attached"];t.hasPolyfillMutations=m,t.hasThrottledAttached=m;var y=!1,v=[],b=Array.prototype.forEach.call.bind(Array.prototype.forEach),A=Element.prototype.createShadowRoot;A&&(Element.prototype.createShadowRoot=function(){var t=A.call(this);return window.CustomElements.watchShadow(this),t}),t.watchShadow=function(t){if(t.shadowRoot&&!t.shadowRoot.__watched){d.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)p(e),e=e.olderShadowRoot}},t.upgradeDocumentTree=function(t){g(t,h)},t.upgradeDocument=h,t.upgradeSubtree=i,t.upgradeAll=e,t.attached=s,t.takeRecords=function(t){for((t=window.wrap(t))||(t=window.wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(l(t,e.takeRecords()),o())}})),window.CustomElements.addModule((function(t){function e(e,r,o){return i.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,function(t){t.createdCallback&&t.createdCallback()}(e),o&&t.attached(e),t.upgradeSubtree(e,o),i.upgrade&&console.groupEnd(),e}function n(t,e){Object.__proto__||function(t,e,n){for(var i={},r=e;r!==n&&r!==HTMLElement.prototype;){for(var o,s=Object.getOwnPropertyNames(r),a=0;o=s[a];a++)i[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o)),i[o]=1);r=Object.getPrototypeOf(r)}}(t,e.prototype,e.native),t.__proto__=e.prototype}var i=t.flags;t.upgrade=function(n,i){if("template"===n.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(n),!n.__upgraded__&&n.nodeType===Node.ELEMENT_NODE){var r=n.getAttribute("is"),o=t.getRegisteredDefinition(n.localName)||t.getRegisteredDefinition(r);if(o&&(r&&o.tag==n.localName||!r&&!o.extends))return e(n,o,i)}},t.upgradeWithDefinition=e,t.implementPrototype=n})),window.CustomElements.addModule((function(t){function e(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,i){n.call(this,t,i,e)};var i=t.removeAttribute;t.removeAttribute=function(t){n.call(this,t,null,i)},t.setAttribute._polyfilled=!0}}function n(t,e,n){t=t.toLowerCase();var i=this.getAttribute(t);n.apply(this,arguments);var r=this.getAttribute(t);this.attributeChangedCallback&&r!==i&&this.attributeChangedCallback(t,i,r)}function i(t){var e=r(t);return e?i(e.extends).concat([e]):[]}function r(t){return t?g[t.toLowerCase()]:void 0}function o(t){return function(){return function(t){return p(y(t.tag),t)}(t)}}function s(t,e){t&&(t=t.toLowerCase()),e&&(e=e.toLowerCase());var n,i=r(e||t);if(i){if(t==i.tag&&e==i.is)return new i.ctor;if(!e&&!i.is)return new i.ctor}return e?((n=s(t)).setAttribute("is",e),n):(n=y(t),t.indexOf("-")>=0&&h(n,HTMLElement),n)}function a(t,e){var n=t[e];t[e]=function(){var t=n.apply(this,arguments);return l(t),t}}var u,c=(t.isIE,t.upgradeDocumentTree),l=t.upgradeAll,p=t.upgradeWithDefinition,h=t.implementPrototype,d=t.useNative,f=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],g={},m="http://www.w3.org/1999/xhtml",y=document.createElement.bind(document),v=document.createElementNS.bind(document);u=Object.__proto__||d?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;for(var n=t;n;){if(n===e.prototype)return!0;n=n.__proto__}return!1},a(Node.prototype,"cloneNode"),a(document,"importNode"),document.registerElement=function(n,s){var a=s||{};if(!n)throw new Error("document.registerElement: first argument `name` must not be empty");if(n.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(n)+"'.");if(function(t){for(var e=0;e<f.length;e++)if(t===f[e])return!0}(n))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(n)+"'. The type name is invali
2d.");if(r(n))throw new Error("DuplicateDefinitionError: a type with name '"+String(n)+"' is already registered");return a.prototype||(a.prototype=Object.create(HTMLElement.prototype)),a.__name=n.toLowerCase(),a.extends&&(a.extends=a.extends.toLowerCase()),a.lifecycle=a.lifecycle||{},a.ancestry=i(a.extends),function(t){for(var e,n=t.extends,i=0;e=t.ancestry[i];i++)n=e.is&&e.tag;t.tag=n||t.__name,n&&(t.is=t.__name)}(a),function(t){if(!Object.__proto__){var e=HTMLElement.prototype;if(t.is){var n=document.createElement(t.tag);e=Object.getPrototypeOf(n)}for(var i,r=t.prototype,o=!1;r;)r==e&&(o=!0),(i=Object.getPrototypeOf(r))&&(r.__proto__=i),r=i;o||console.warn(t.tag+" prototype not found in prototype chain for "+t.is),t.native=e}}(a),e(a.prototype),function(t,e){g[t]=e}(a.__name,a),a.ctor=o(a),a.ctor.prototype=a.prototype,a.prototype.constructor=a.ctor,t.ready&&c(document),a.ctor},document.createElement=s,document.createElementNS=function(t,e,n){return t===m?s(e,n):v(t,e)},t.registry=g,t.instanceof=u,t.reservedTagList=f,t.getRegisteredDefinition=r,document.register=document.registerElement})),function(t){function e(){o(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(t){setTimeout(t,16)})((function(){setTimeout((function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))}))}))}var n=t.useNative,i=t.initializeModules;if(t.isIE,n){var r=function(){};t.watchShadow=r,t.upgrade=r,t.upgradeAll=r,t.upgradeDocumentTree=r,t.upgradeSubtree=r,t.takeRecords=r,t.instanceof=function(t,e){return t instanceof e}}else i();var o=t.upgradeDocumentTree,s=t.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(t){t.import&&s(wrap(t.import))}),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var a=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(a,e)}else e()}(window.CustomElements))}.call(this),function(){}.call(this),function(){(function(){(function(){this.Trix={VERSION:"1.3.1",ZERO_WIDTH_SPACE:"\ufeff",NON_BREAKING_SPACE:"\xa0",OBJECT_REPLACEMENT_CHARACTER:"\ufffc",browser:{composesExistingText:/Android.*Chrome/.test(navigator.userAgent),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:function(){var t,e,n;if("undefined"==typeof InputEvent)return!1;for(t=0,e=(n=["data","getTargetRanges","inputType"]).length;e>t;t++)if(!(n[t]in InputEvent.prototype))return!1;return!0}()},config:{}}}).call(this)}).call(this);var o=this.Trix;(function(){(function(){o.BasicObject=function(){function t(){}var e,n,i;return t.proxyMethod=function(t){var i,r,o,s,a;return o=n(t),i=o.name,s=o.toMethod,a=o.toProperty,r=o.optional,this.prototype[i]=function(){var t,n;return t=null!=s?r?"function"==typeof this[s]?this[s]():void 0:this[s]():null!=a?this[a]:void 0,r?null!=(n=null!=t?t[i]:void 0)?e.call(n,t,arguments):void 0:(n=t[i],e.call(n,t,arguments))}},n=function(t){var e,n;if(!(n=t.match(i)))throw new Error("can't parse @proxyMethod expression: "+t);return e={name:n[4]},null!=n[2]?e.toMethod=n[1]:e.toProperty=n[1],null!=n[3]&&(e.optional=!0),e},e=Function.prototype.apply,i=/^(.+?)(\(\))?(\?)?\.(.+?)$/,t}()}).call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Object=function(e){function n(){this.id=++i}var i;return t(n,e),i=0,n.fromJSONString=function(t){return this.fromJSON(JSON.parse(t))},n.prototype.hasSameConstructorAs=function(t){return this.constructor===(null!=t?t.constructor:void 0)},n.prototype.isEqualTo=function(t){return this===t},n.prototype.inspect=function(){var t,e,n;return t=function(){var t,i,r;for(e in r=[],i=null!=(t=this.contentsForInspection())?t:{})n=i[e],r.push(e+"="+n);return r}.call(this),"#<"+this.constructor.name+":"+this.id+(t.length?" "+t.join(", "):"")+">"},n.prototype.contentsForInspection=function(){},n.prototype.toJSONString=function(){return JSON.stringify(this)},n.prototype.toUTF16String=function(){return o.UTF16String.box(this)},n.prototype.getCacheKey=function(){return this.id.toString()},n}(o.BasicObject)}.call(this),function(){o.extend=function(t){var e,n;for(e in t)n=t[e],this[e]=n;return this}}.call(this),function(){o.extend({defer:function(t){return setTimeout(t,1)}})}.call(this),function(){var t,e;o.extend({normalizeSpaces:function(t){return t.replace(RegExp(""+o.ZERO_WIDTH_SPACE,"g"),"").replace(RegExp(""+o.NON_BREAKING_SPACE,"g")," ")},normalizeNewlines:function(t){return t.replace(/\r\n/g,"\n")},breakableWhitespacePattern:RegExp("[^\\S"+o.NON_BREAKING_SPACE+"]"),squishBreakableWhitespace:function(t){return t.replace(RegExp(""+o.breakableWhitespacePattern.source,"g")," ").replace(/\ {2,}/g," ")},summarizeStringChange:function(t,n){var i,r,s,a;return t=o.UTF16String.box(t),(n=o.UTF16String.box(n)).length<t.length?(a=(r=e(t,n))[0],i=r[1]):(i=(s=e(n,t))[0],a=s[1]),{added:i,removed:a}}}),e=function(e,n){var i,r,s,a,u;return e.isEqualTo(n)?["",""]:(s=(a=(r=t(e,n)).utf16String.length)?(u=r.offset,i=e.codepoints.slice(0,u).concat(e.codepoints.slice(u+a)),t(n,o.UTF16String.fromCodepoints(i))):t(n,e),[r.utf16String.toString(),s.utf16String.toString()])},t=function(t,e){var n,i,r;for(n=0,i=t.length,r=e.length;i>n&&t.charAt(n).isEqualTo(e.charAt(n));)n++;for(;i>n+1&&t.charAt(i-1).isEqualTo(e.charAt(r-1));)i--,r--;return{utf16String:t.slice(n,i),offset:n}}}.call(this),function(){o.extend({copyObject:function(t){var e,n,i;for(e in null==t&&(t={}),n={},t)i=t[e],n[e]=i;return n},objectsAreEqual:function(t,e){var n;if(null==t&&(t={}),null==e&&(e={}),Object.keys(t).length!==Object.keys(e).length)return!1;for(n in t)if(t[n]!==e[n])return!1;return!0}})}.call(this),function(){var t=[].slice;o.extend({arraysAreEqual:function(t,e){var n,i,r;if(null==t&&(t=[]),null==e&&(e=[]),t.length!==e.length)return!1;for(i=n=0,r=t.length;r>n;i=++n)if(t[i]!==e[i])return!1;return!0},arrayStartsWith:function(t,e){return null==t&&(t=[]),null==e&&(e=[]),o.arraysAreEqual(t.slice(0,e.length),e)},spliceArray:function(){var e,n,i;
2return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],(i=n.slice(0)).splice.apply(i,e),i},summarizeArrayChange:function(t,e){var n,i,r,o,s,a,u,c,l,p,h;for(null==t&&(t=[]),null==e&&(e=[]),n=[],p=[],r=new Set,o=0,u=t.length;u>o;o++)h=t[o],r.add(h);for(i=new Set,s=0,c=e.length;c>s;s++)h=e[s],i.add(h),r.has(h)||n.push(h);for(a=0,l=t.length;l>a;a++)h=t[a],i.has(h)||p.push(h);return{added:n,removed:p}}})}.call(this),function(){var t,e,n,i;t=null,e=null,i=null,n=null,o.extend({getAllAttributeNames:function(){return null!=t?t:t=o.getTextAttributeNames().concat(o.getBlockAttributeNames())},getBlockConfig:function(t){return o.config.blockAttributes[t]},getBlockAttributeNames:function(){return null!=e?e:e=Object.keys(o.config.blockAttributes)},getTextConfig:function(t){return o.config.textAttributes[t]},getTextAttributeNames:function(){return null!=i?i:i=Object.keys(o.config.textAttributes)},getListAttributeNames:function(){var t,e;return null!=n?n:n=function(){var n,i;for(t in i=[],n=o.config.blockAttributes)null!=(e=n[t].listAttribute)&&i.push(e);return i}()}})}.call(this),function(){var t,e,n,i,r,s=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=document.documentElement,e=null!=(n=null!=(i=null!=(r=t.matchesSelector)?r:t.webkitMatchesSelector)?i:t.msMatchesSelector)?n:t.mozMatchesSelector,o.extend({handleEvent:function(e,n){var i,r,s,a,u,c,l,p,h,d,f;return u=(l=null!=n?n:{}).onElement,a=l.matchingSelector,f=l.withCallback,s=l.inPhase,c=l.preventDefault,h=l.times,i=null!=u?u:t,p=a,f,d="capturing"===s,r=function(t){var e;return null!=h&&0===--h&&r.destroy(),null!=(e=o.findClosestElementFromNode(t.target,{matchingSelector:p}))&&(null!=f&&f.call(e,t,e),c)?t.preventDefault():void 0},r.destroy=function(){return i.removeEventListener(e,r,d)},i.addEventListener(e,r,d),r},handleEventOnce:function(t,e){return null==e&&(e={}),e.times=1,o.handleEvent(t,e)},triggerEvent:function(e,n){var i,r,s,a,u,c,l;return c=(l=null!=n?n:{}).onElement,r=l.bubbles,s=l.cancelable,i=l.attributes,a=null!=c?c:t,r=!1!==r,s=!1!==s,(u=document.createEvent("Events")).initEvent(e,r,s),null!=i&&o.extend.call(u,i),a.dispatchEvent(u)},elementMatchesSelector:function(t,n){return 1===(null!=t?t.nodeType:void 0)?e.call(t,n):void 0},findClosestElementFromNode:function(t,e){var n,i,r;for(n=(i=null!=e?e:{}).matchingSelector,r=i.untilNode;null!=t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;if(null!=t){if(null==n)return t;if(t.closest&&null==r)return t.closest(n);for(;t&&t!==r;){if(o.elementMatchesSelector(t,n))return t;t=t.parentNode}}},findInnerElement:function(t){for(;null!=t?t.firstElementChild:void 0;)t=t.firstElementChild;return t},innerElementIsActive:function(t){return document.activeElement!==t&&o.elementContainsNode(t,document.activeElement)},elementContainsNode:function(t,e){if(t&&e)for(;e;){if(e===t)return!0;e=e.parentNode}},findNodeFromContainerAndOffset:function(t,e){var n;if(t)return t.nodeType===Node.TEXT_NODE?t:0===e?null!=(n=t.firstChild)?n:t:t.childNodes.item(e-1)},findElementFromContainerAndOffset:function(t,e){var n;return n=o.findNodeFromContainerAndOffset(t,e),o.findClosestElementFromNode(n)},findChildIndexOfNode:function(t){var e;if(null!=t?t.parentNode:void 0){for(e=0;t=t.previousSibling;)e++;return e}},removeNode:function(t){var e;return null!=t&&null!=(e=t.parentNode)?e.removeChild(t):void 0},walkTree:function(t,e){var n,i,r,o,s;return i=(r=null!=e?e:{}).onlyNodesOfType,o=r.usingFilter,n=r.expandEntityReferences,s=function(){switch(i){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}}(),document.createTreeWalker(t,s,null!=o?o:null,!0===n)},tagName:function(t){var e;return null!=t&&null!=(e=t.tagName)?e.toLowerCase():void 0},makeElement:function(t,e){var n,i,r,o,s,a,u,c,l,p,h,d,f,g;if(null==e&&(e={}),"object"==typeof t?t=(e=t).tagName:e={attributes:e},r=document.createElement(t),null!=e.editable&&(null==e.attributes&&(e.attributes={}),e.attributes.contenteditable=e.editable),e.attributes)for(a in l=e.attributes)g=l[a],r.setAttribute(a,g);if(e.style)for(a in p=e.style)g=p[a],r.style[a]=g;if(e.data)for(a in h=e.data)g=h[a],r.dataset[a]=g;if(e.className)for(o=0,u=(d=e.className.split(" ")).length;u>o;o++)i=d[o],r.classList.add(i);if(e.textContent&&(r.textContent=e.textContent),e.childNodes)for(s=0,c=(f=[].concat(e.childNodes)).length;c>s;s++)n=f[s],r.appendChild(n);return r},getBlockTagNames:function(){var t,e;return null!=o.blockTagNames?o.blockTagNames:o.blockTagNames=function(){var n,i;for(t in i=[],n=o.config.blockAttributes)(e=n[t].tagName)&&i.push(e);return i}()},nodeIsBlockContainer:function(t){return o.nodeIsBlockStartComment(null!=t?t.firstChild:void 0)},nodeProbablyIsBlockContainer:function(t){var e,n;return e=o.tagName(t),s.call(o.getBlockTagNames(),e)>=0&&(n=o.tagName(t.firstChild),s.call(o.getBlockTagNames(),n)<0)},nodeIsBlockStart:function(t,e){return(null!=e?e:{strict:!0}).strict?o.nodeIsBlockStartComment(t):o.nodeIsBlockStartComment(t)||!o.nodeIsBlockStartComment(t.firstChild)&&o.nodeProbablyIsBlockContainer(t)},nodeIsBlockStartComment:function(t){return o.nodeIsCommentNode(t)&&"block"===(null!=t?t.data:void 0)},nodeIsCommentNode:function(t){return(null!=t?t.nodeType:void 0)===Node.COMMENT_NODE},nodeIsCursorTarget:function(t,e){var n;return n=(null!=e?e:{}).name,t?o.nodeIsTextNode(t)?t.data===o.ZERO_WIDTH_SPACE?!n||t.parentNode.dataset.trixCursorTarget===n:void 0:o.nodeIsCursorTarget(t.firstChild):void 0},nodeIsAttachmentElement:function(t){return o.elementMatchesSelector(t,o.AttachmentView.attachmentSelector)},nodeIsEmptyTextNode:function(t){return o.nodeIsTextNode(t)&&""===(null!=t?t.data:void 0)},nodeIsTextNode:function(t){return(null!=t?t.nodeType:void 0)===Node.TEXT_NODE}})}.call(this),function(){var t,e,n,i,r;t=o.copyObject,i=o.objectsAreEqual,o.extend({normalizeRange:n=function(t){var n;if(null!=t)return Array.isArray(t)||(t=[t,t]),[e(t[0]),e(null!=(n=t[1])?n:t[0])]},rangeIsCollapsed:function(t){var e,i,o;if(null!=t)return o=(i=n(t))[0],e=i[1],r(o,e)},rangesAreEqual:function(t,e){var i,o,s,a,u,c;if(null!=t&&null!=e)return o=(s=n(t))[0],i=s[1],c=(a=n(e))[0],u=a[1],r(o,c)&&r(i,u)}}),e=function(e){return"number"==typeof e?e:t(e)},r=function(t,e){return"number"==typeof t?t===e:i(t,e)}}.call(this),function(){var t,e,n,i,r,s,a;o.registerElement=function(t,e){var n,o;return null==e&&(e={}),t=t.toLowerCase(),e=a(e),(n=(o=s(e)).defaultCSS)&&(delete o.defaultCSS,i(n,t)),r(t,o)},i=function(t,e){return n(e).textContent=t.replace(/%t/g,e)},n=function(e){var n,i;return(n=document.createElement("style")).setAttribute("type","text/css"),n.setAttribute("data-tag-name",e.toLowerCase()),(i=t())&&n.setAttribute("nonce",i),document.head.insertBefore(n,document.head.firstChild),n},t=function(){var t;return(t=e("trix-csp-nonce")||e("csp-nonce"))?t.getAttribute("content"):void 0},e=function(t){return document.head.querySelector("meta[name="+t+"]")},s=function(t){var e,n,i;for(e in n={},t)i=t[e],n[e]="function"==typeof i?{value:i}:i;return n},a=function(){var t;return t=function(t){var e,n,i,r,o;for(e={},n=0,r=(o=["initialize","connect","disconnect"]).length;r>n;n++)e[i=o[n]]=t[i],delete t[i];return e},window.customElements?function(e){var n,i,r,o,s;
2return s=t(e),r=s.initialize,n=s.connect,i=s.disconnect,r&&(o=n,n=function(){return this.initialized||(this.initialized=!0,r.call(this)),null!=o?o.call(this):void 0}),n&&(e.connectedCallback=n),i&&(e.disconnectedCallback=i),e}:function(e){var n,i,r,o;return r=(o=t(e)).initialize,n=o.connect,i=o.disconnect,r&&(e.createdCallback=r),n&&(e.attachedCallback=n),i&&(e.detachedCallback=i),e}}(),r=window.customElements?function(t,e){var n;return n=function(){return"object"==typeof Reflect?Reflect.construct(HTMLElement,[],n):HTMLElement.apply(this)},Object.setPrototypeOf(n.prototype,HTMLElement.prototype),Object.setPrototypeOf(n,HTMLElement),Object.defineProperties(n.prototype,e),window.customElements.define(t,n),n}:function(t,e){var n,i;return i=Object.create(HTMLElement.prototype,e),n=document.registerElement(t,{prototype:i}),Object.defineProperty(i,"constructor",{value:n}),n}}.call(this),function(){var t,e;o.extend({getDOMSelection:function(){var t;return(t=window.getSelection()).rangeCount>0?t:void 0},getDOMRange:function(){var e,n;return(e=null!=(n=o.getDOMSelection())?n.getRangeAt(0):void 0)&&!t(e)?e:void 0},setDOMRange:function(t){var e;return(e=window.getSelection()).removeAllRanges(),e.addRange(t),o.selectionChangeObserver.update()}}),t=function(t){return e(t.startContainer)||e(t.endContainer)},e=function(t){return!Object.getPrototypeOf(t)}}.call(this),function(){var t;t={"application/x-trix-feature-detection":"test"},o.extend({dataTransferIsPlainText:function(t){var e,n,i;return i=t.getData("text/plain"),n=t.getData("text/html"),i&&n?(e=(new DOMParser).parseFromString(n,"text/html").body).textContent===i?!e.querySelector("*"):void 0:null!=i?i.length:void 0},dataTransferIsWritable:function(e){var n,i;if(null!=(null!=e?e.setData:void 0)){for(n in t)if(i=t[n],!function(){try{return e.setData(n,i),e.getData(n)===i}catch(t){}}())return;return!0}},keyEventIsKeyboardCommand:/Mac|^iP/.test(navigator.platform)?function(t){return t.metaKey}:function(t){return t.ctrlKey}})}.call(this),function(){o.extend({RTL_PATTERN:/[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/,getDirection:function(){var t,e,n,i;return e=o.makeElement("input",{dir:"auto",name:"x",dirName:"x.dir"}),(t=o.makeElement("form")).appendChild(e),n=function(){try{return new FormData(t).has(e.dirName)}catch(o){}}(),i=function(){try{return e.matches(":dir(ltr),:dir(rtl)")}catch(t){}}(),n?function(n){return e.value=n,new FormData(t).get(e.dirName)}:i?function(t){return e.value=t,e.matches(":dir(rtl)")?"rtl":"ltr"}:function(t){var e;return e=t.trim().charAt(0),o.RTL_PATTERN.test(e)?"rtl":"ltr"}}()})}.call(this),function(){}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=o.arraysAreEqual,o.Hash=function(n){function i(t){null==t&&(t={}),this.values=s(t),i.__super__.constructor.apply(this,arguments)}var r,s,a,u,c;return e(i,n),i.fromCommonAttributesOfObjects=function(t){var e,n,i,o,s,a;if(null==t&&(t=[]),!t.length)return new this;
2for(i=(e=r(t[0])).getKeys(),n=0,o=(a=t.slice(1)).length;o>n;n++)s=a[n],i=e.getKeysCommonToHash(r(s)),e=e.slice(i);return e},i.box=function(t){return r(t)},i.prototype.add=function(t,e){return this.merge(u(t,e))},i.prototype.remove=function(t){return new o.Hash(s(this.values,t))},i.prototype.get=function(t){return this.values[t]},i.prototype.has=function(t){return t in this.values},i.prototype.merge=function(t){return new o.Hash(a(this.values,c(t)))},i.prototype.slice=function(t){var e,n,i,r;for(r={},e=0,i=t.length;i>e;e++)n=t[e],this.has(n)&&(r[n]=this.values[n]);return new o.Hash(r)},i.prototype.getKeys=function(){return Object.keys(this.values)},i.prototype.getKeysCommonToHash=function(t){var e,n,i,o,s;for(t=r(t),s=[],e=0,i=(o=this.getKeys()).length;i>e;e++)n=o[e],this.values[n]===t.values[n]&&s.push(n);return s},i.prototype.isEqualTo=function(e){return t(this.toArray(),r(e).toArray())},i.prototype.isEmpty=function(){return 0===this.getKeys().length},i.prototype.toArray=function(){var t,e,n;return(null!=this.array?this.array:this.array=function(){var i;for(t in e=[],i=this.values)n=i[t],e.push(t,n);return e}.call(this)).slice(0)},i.prototype.toObject=function(){return s(this.values)},i.prototype.toJSON=function(){return this.toObject()},i.prototype.contentsForInspection=function(){return{values:JSON.stringify(this.values)}},u=function(t,e){var n;return(n={})[t]=e,n},a=function(t,e){var n,i,r;for(n in i=s(t),e)r=e[n],i[n]=r;return i},s=function(t,e){var n,i,r,o,s;for(o={},n=0,r=(s=Object.keys(t).sort()).length;r>n;n++)(i=s[n])!==e&&(o[i]=t[i]);return o},r=function(t){return t instanceof o.Hash?t:new o.Hash(t)},c=function(t){return t instanceof o.Hash?t.values:t},i}(o.Object)}.call(this),function(){o.ObjectGroup=function(){function t(t,e){var n,i;this.objects=null!=t?t:[],i=e.depth,(n=e.asTree)&&(this.depth=i,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}return t.groupObjects=function(t,e){var n,i,r,o,s,a,u,c,l;for(null==t&&(t=[]),r=(l=null!=e?e:{}).depth,(n=l.asTree)&&null==r&&(r=0),c=[],s=0,a=t.length;a>s;s++){if(u=t[s],o){if(("function"==typeof u.canBeGrouped?u.canBeGrouped(r):void 0)&&("function"==typeof(i=o[o.length-1]).canBeGroupedWith?i.canBeGroupedWith(u,r):void 0)){o.push(u);continue}c.push(new this(o,{depth:r,asTree:n})),o=null}("function"==typeof u.canBeGrouped?u.canBeGrouped(r):void 0)?o=[u]:c.push(u)}return o&&c.push(new this(o,{depth:r,asTree:n})),c},t.prototype.getObjects=function(){return this.objects},t.prototype.getDepth=function(){return this.depth},t.prototype.getCacheKey=function(){var t,e,n,i,r;for(e=["objectGroup"],t=0,n=(r=this.getObjects()).length;n>t;t++)i=r[t],e.push(i.getCacheKey());return e.join("/")},t}()}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.ObjectMap=function(e){function n(t){var e,n,i,r,o;for(null==t&&(t=[]),this.objects={},i=0,r=t.length;r>i;i++)o=t[i],n=JSON.stringify(o),null==(e=this.objects)[n]&&(e[n]=o)}return t(n,e),n.prototype.find=function(t){var e;return e=JSON.stringify(t),this.objects[e]},n}(o.BasicObject)}.call(this),function(){o.ElementStore=function(){function t(t){this.reset(t)}var e;return t.prototype.add=function(t){var n;return n=e(t),this.elements[n]=t},t.prototype.remove=function(t){var n,i;return n=e(t),(i=this.elements[n])?(delete this.elements[n],i):void 0},t.prototype.reset=function(t){var e,n,i;for(null==t&&(t=[]),this.elements={},n=0,i=t.length;i>n;n++)e=t[n],this.add(e);return t},e=function(t){return t.dataset.trixStoreKey},t}()}.call(this),function(){}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Operation=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.isPerforming=function(){return!0===this.performing},n.prototype.hasPerformed=function(){return!0===this.performed},n.prototype.hasSucceeded=function(){return this.performed&&this.succeeded},n.prototype.hasFailed=function(){return this.performed&&!this.succeeded},n.prototype.getPromise=function(){return null!=this.promise?this.promise:this.promise=new Promise(function(t){return function(e,n){return t.performing=!0,t.perform((function(i,r){return t.succeeded=i,t.performing=!1,t.performed=!0,t.succeeded?e(r):n(r)}))}}(this))},n.prototype.perform=function(t){return t(!1)},n.prototype.release=function(){var t;return null!=(t=this.promise)&&"function"==typeof t.cancel&&t.cancel(),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null},n.proxyMethod("getPromise().then"),n.proxyMethod("getPromise().catch"),n}(o.BasicObject)}.call(this),function(){var t,e,n,i,r,s={}.hasOwnProperty;o.UTF16String=function(t){function e(t,e){this.ucs2String=t,this.co
2depoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}return function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t),e.box=function(t){return null==t&&(t=""),t instanceof this?t:this.fromUCS2String(null!=t?t.toString():void 0)},e.fromUCS2String=function(t){return new this(t,i(t))},e.fromCodepoints=function(t){return new this(r(t),t)},e.prototype.offsetToUCS2Offset=function(t){return r(this.codepoints.slice(0,Math.max(0,t))).length},e.prototype.offsetFromUCS2Offset=function(t){return i(this.ucs2String.slice(0,Math.max(0,t))).length},e.prototype.slice=function(){var t;return this.constructor.fromCodepoints((t=this.codepoints).slice.apply(t,arguments))},e.prototype.charAt=function(t){return this.slice(t,t+1)},e.prototype.isEqualTo=function(t){return this.constructor.box(t).ucs2String===this.ucs2String},e.prototype.toJSON=function(){return this.ucs2String},e.prototype.getCacheKey=function(){return this.ucs2String},e.prototype.toString=function(){return this.ucs2String},e}(o.BasicObject),t=1===("function"==typeof Array.from?Array.from("\ud83d\udc7c").length:void 0),e=null!=("function"==typeof" ".codePointAt?" ".codePointAt(0):void 0),n=" \ud83d\udc7c"===("function"==typeof String.fromCodePoint?String.fromCodePoint(32,128124):void 0),i=t&&e?function(t){return Array.from(t).map((function(t){return t.codePointAt(0)}))}:function(t){var e,n,i,r,o;for(r=[],e=0,i=t.length;i>e;)(o=t.charCodeAt(e++))>=55296&&56319>=o&&i>e&&(56320===(64512&(n=t.charCodeAt(e++)))?o=((1023&o)<<10)+(1023&n)+65536:e--),r.push(o);return r},r=n?function(t){return String.fromCodePoint.apply(String,t)}:function(t){var e,n,i;return e=function(){var e,r,o;for(o=[],e=0,r=t.length;r>e;e++)i=t[e],n="",i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|1023&i),o.push(n+String.fromCharCode(i));return o}(),e.join("")}}.call(this),function(){}.call(this),function(){}.call(this),function(){o.config.lang={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"}}.call(this),function(){o.config.css={attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"}}.call(this),function(){var t;o.config.blockAttributes=t={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test:function(e){return o.tagName(e.parentNode)===t[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test:function(e){return o.tagName(e.parentNode)===t[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}}}.call(this),function(){var t,e;t=o.config.lang,e=[t.bytes,t.KB,t.MB,t.GB,t.TB,t.PB],o.config.fileSize={prefix:"IEC",precision:2,formatter:function(n){var i,r;switch(n){case 0:return"0 "+t.bytes;case 1:return"1 "+t.byte;default:return i=function(){switch(this.prefix){case"SI":return 1e3;case"IEC":return 1024}}
2.call(this),r=Math.floor(Math.log(n)/Math.log(i)),(n/Math.pow(i,r)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"")+" "+e[r]}}}}.call(this),function(){o.config.textAttributes={bold:{tagName:"strong",inheritable:!0,parser:function(t){var e;return"bold"===(e=window.getComputedStyle(t)).fontWeight||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:function(t){return"italic"===window.getComputedStyle(t).fontStyle}},href:{groupTagName:"a",parser:function(t){var e,n;return n="a:not("+o.AttachmentView.attachmentSelector+")",(e=o.findClosestElementFromNode(t,{matchingSelector:n}))?e.getAttribute("href"):void 0}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}}}.call(this),function(){var t,e,n,i;i=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],n="["+(e="data-trix-serialized-attributes")+"]",t=new RegExp("\x3c!--block--\x3e","g"),o.extend({serializers:{"application/json":function(t){var e;if(t instanceof o.Document)e=t;else{if(!(t instanceof HTMLElement))throw new Error("unserializable object");e=o.Document.fromHTML(t.innerHTML)}return e.toSerializableDocument().toJSONString()},"text/html":function(r){var s,a,u,c,l,p,h,d,f,g,m,y,v,b,A,w,x;if(r instanceof o.Document)c=o.DocumentView.render(r);else{if(!(r instanceof HTMLElement))throw new Error("unserializable object");c=r.cloneNode(!0)}for(l=0,f=(b=c.querySelectorAll("[data-trix-serialize=false]")).length;f>l;l++)u=b[l],o.removeNode(u);for(p=0,g=i.length;g>p;p++)for(s=i[p],h=0,m=(A=c.querySelectorAll("["+s+"]")).length;m>h;h++)(u=A[h]).removeAttribute(s);for(d=0,y=(w=c.querySelectorAll(n)).length;y>d;d++){u=w[d];try{for(v in a=JSON.parse(u.getAttribute(e)),u.removeAttribute(e),a)x=a[v],u.setAttribute(v,x)}catch(C){}}return c.innerHTML.replace(t,"")}},deserializers:{"application/json":function(t){return o.Document.fromJSONString(t)},"text/html":function(t){return o.Document.fromHTML(t)}},serializeToContentType:function(t,e){var n;if(n=o.serializers[e])return n(t);throw new Error("unknown content type: "+e)},deserializeFromContentType:function(t,e){var n;if(n=o.deserializers[e])return n(t);throw new Error("unknown content type: "+e)}})}.call(this),function(){var t;t=o.config.lang,o.config.toolbar={getDefaultHTML:function(){return'<div class="trix-button-row">\n  <span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title="'+t.bold+'" tabindex="-1">'+t.bold+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-italic" data-trix-attribute="italic" data-trix-key="i" title="'+t.italic+'" tabindex="-1">'+t.italic+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-strike" data-trix-attribute="strike" title="'+t.strike+'" tabindex="-1">'+t.strike+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-link" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="'+t.link+'" tabindex="-1">'+t.link+'</button>\n  </span>\n\n  <span class="trix-button-group trix-button-group--block-tools" data-trix-button-group="block-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-heading-1" data-trix-attribute="heading1" title="'+t.heading1+'" tabindex="-1">'+t.heading1+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-quote" data-trix-attribute="quote" title="'+t.quote+'" tabindex="-1">'+t.quote+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-code" data-trix-attribute="code" title="'+t.code+'" tabindex="-1">'+t.code+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-bullet-list" data-trix-attribute="bullet" title="'+t.bullets+'" tabindex="-1">'+t.bullets+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-number-list" data-trix-attribute="number" title="'+t.numbers+'" tabindex="-1">'+t.numbers+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title="'+t.outdent+'" tabindex="-1">'+t.outdent+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title="'+t.indent+'" tabindex="-1">
2'+t.indent+'</button>\n  </span>\n\n  <span class="trix-button-group trix-button-group--file-tools" data-trix-button-group="file-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-attach" data-trix-action="attachFiles" title="'+t.attachFiles+'" tabindex="-1">'+t.attachFiles+'</button>\n  </span>\n\n  <span class="trix-button-group-spacer"></span>\n\n  <span class="trix-button-group trix-button-group--history-tools" data-trix-button-group="history-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-undo" data-trix-action="undo" data-trix-key="z" title="'+t.undo+'" tabindex="-1">'+t.undo+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-redo" data-trix-action="redo" data-trix-key="shift+z" title="'+t.redo+'" tabindex="-1">'+t.redo+'</button>\n  </span>\n</div>\n\n<div class="trix-dialogs" data-trix-dialogs>\n  <div class="trix-dialog trix-dialog--link" data-trix-dialog="href" data-trix-dialog-attribute="href">\n    <div class="trix-dialog__link-fields">\n      <input type="url" name="href" class="trix-input trix-input--dialog" placeholder="'+t.urlPlaceholder+'" aria-label="'+t.url+'" required data-trix-input>\n      <div class="trix-button-group">\n        <input type="button" class="trix-button trix-button--dialog" value="'+t.link+'" data-trix-method="setAttribute">\n        <input type="button" class="trix-button trix-button--dialog" value="'+t.unlink+'" data-trix-method="removeAttribute">\n      </div>\n    </div>\n  </div>\n</div>'}}}.call(this),function(){o.config.undoInterval=5e3}.call(this),function(){o.config.attachments={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}}}.call(this),function(){o.config.keyNames={8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"}}.call(this),function(){o.config.input={level2Enabled:!0,getLevel:function(){return this.level2Enabled&&o.browser.supportsInputEvents?2:0},pickFiles:function(t){var e;return(e=o.makeElement("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId})).addEventListener("change",(function(){return t(e.files),o.removeNode(e)})),o.removeNode(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()},fileInputId:"trix-file-input-"+Date.now().toString(16)}}.call(this),function(){}.call(this),function(){o.registerElement("trix-toolbar",{defaultCSS:"%t {\n  display: block;\n}\n\n%t {\n  white-space: nowrap;\n}\n\n%t [data-trix-dialog] {\n  display: none;\n}\n\n%t [data-trix-dialog][data-trix-active] {\n  display: block;\n}\n\n%t [data-trix-dialog] [data-trix-validate]:invalid {\n  background-color: #ffdddd;\n}",initialize:function(){return""===this.innerHTML?this.innerHTML=o.config.toolbar.getDefaultHTML():void 0}})}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};o.ObjectView=function(e){function i(t,e){this.object=t,this.options=null!=e?e:{},this.childViews=[],this.rootView=this}return t(i,e),i.prototype.getNodes=function(){var t,e,n,i,r;for(null==this.nodes&&(this.nodes=this.createNodes()),r=[],t=0,e=(i=this.nodes).length;e>t;t++)n=i[t],r.push(n.cloneNode(!0));return r},i.prototype.invalidate=function(){var t;return this.nodes=null,this.childViews=[],null!=(t=this.parentView)?t.invalidate():void 0},i.prototype.invalidateViewForObject=function(t){var e;return null!=(e=this.findViewForObject(t))?e.invalidate():void 0},i.prototype.findOrCreateCachedChildView=function(t,e){var n;return(n=this.getCachedViewForObject(e))?this.recordChildView(n):(n=this.createChildView.apply(this,arguments),this.cacheViewForObject(n,e)),n},i.prototype.createChildView=function(t,e,n){var i;return null==n&&(n={}),e instanceof o.ObjectGroup&&(n.viewClass=t,t=o.ObjectGroupView),i=new t(e,n),this.recordChildView(i)},i.prototype.recordChildView=function(t){return t.parentView=this,t.rootView=this.root
2View,this.childViews.push(t),t},i.prototype.getAllChildViews=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.childViews).length;n>e;e++)t=i[e],r.push(t),r=r.concat(t.getAllChildViews());return r},i.prototype.findElement=function(){return this.findElementForObject(this.object)},i.prototype.findElementForObject=function(t){var e;return(e=null!=t?t.id:void 0)?this.rootView.element.querySelector("[data-trix-id='"+e+"']"):void 0},i.prototype.findViewForObject=function(t){var e,n,i,r;for(e=0,n=(i=this.getAllChildViews()).length;n>e;e++)if((r=i[e]).object===t)return r},i.prototype.getViewCache=function(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?null!=this.viewCache?this.viewCache:this.viewCache={}:void 0},i.prototype.isViewCachingEnabled=function(){return!1!==this.shouldCacheViews},i.prototype.enableViewCaching=function(){return this.shouldCacheViews=!0},i.prototype.disableViewCaching=function(){return this.shouldCacheViews=!1},i.prototype.getCachedViewForObject=function(t){var e;return null!=(e=this.getViewCache())?e[t.getCacheKey()]:void 0},i.prototype.cacheViewForObject=function(t,e){var n;return null!=(n=this.getViewCache())?n[e.getCacheKey()]=t:void 0},i.prototype.garbageCollectCachedViews=function(){var t,e,i,r,o,s;if(t=this.getViewCache()){for(e in s=this.getAllChildViews().concat(this),i=function(){var t,e,n;for(n=[],t=0,e=s.length;e>t;t++)o=s[t],n.push(o.object.getCacheKey());return n}(),r=[],t)n.call(i,e)<0&&r.push(delete t[e]);return r}},i}(o.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.ObjectGroupView=function(e){function n(){n.__super__.constructor.apply(this,arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}return t(n,e),n.prototype.getChildViews=function(){var t,e,n,i;if(!this.childViews.length)for(t=0,e=(i=this.objectGroup.getObjects()).length;e>t;t++)n=i[t],this.findOrCreateCachedChildView(this.viewClass,n,this.options);return this.childViews},n.prototype.createNodes=function(){var t,e,n,i,r,o,s,a;for(t=this.createContainerElement(),e=0,i=(s=this.getChildViews()).length;i>e;e++)for(n=0,r=(a=s[e].getNodes()).length;r>n;n++)o=a[n],t.appendChild(o);return[t]},n.prototype.createContainerElement=function(t){return null==t&&(t=this.objectGroup.getDepth()),this.getChildViews()[0].createContainerElement(t)},n}(o.ObjectView)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Controller=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n}(o.BasicObject)}.call(this),function(){var t,e,n,i,r,s,a=function(t,e){function n(){this.constructor=t}for(var i in e)u.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty,c=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=o.findClosestElementFromNode,n=o.nodeIsEmptyTextNode,e=o.nodeIsBlockStartComment,i=o.normalizeSpaces,r=o.summarizeStringChange,s=o.tagName,o.MutationObserver=function(o){function u(t){this.element=t,this.didMutate=function(t,e){return function(){return t.apply(e,arguments)}}(this.didMutate,this),this.observer=new window.MutationObserver(this.didMutate),this.start()}var l,p,h,d;return a(u,o),h="["+(p="data-trix-mutable")+"]",d={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},u.prototype.start=function(){return this.reset(),this.observer.observe(this.element,d)},u.prototype.stop=function(){return this.observer.disconnect()},u.prototype.didMutate=function(t){var e,n;return(e=this.mutations).push.apply(e,this.findSignificantMutations(t)),this.mutations.length?(null!=(n=this.delegate)&&"function"==typeof n.elementDidMutate&&n.elementDidMutate(this.getMutationSummary()),this.reset()):void 0},u.prototype.reset=function(){return this.mutations=[]},u.prototype.findSignificantMutations=function(t){var e,n,i,r;for(r=[],e=0,n=t.length;n>e;e++)i=t[e],this.mutationIsSignificant(i)&&r.push(i);return r},u.prototype.mutationIsSignificant=function(t){var e,n,i,r;if(this.nodeIsMutable(t.target))return!1;for(e=0,n=(r=this.nodesModifiedByMutation(t)).length;n>e;e++)if(i=r[e],this.nodeIsSignificant(i))return!0;return!1},u.prototype.nodeIsSignificant=function(t){return t!==this.element&&!this.nodeIsMutable(t)&&!n(t)},u.prototype.nodeIsMutable=function(e){return t(e,{matchingSelector:h})},u.prototype.nodesModifiedByMutation=function(t){var e;switch(e=[],t.type){case"attributes":t.attributeName!==p&&e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push.apply(e,t.addedNodes),e.push.apply(e,t.removedNodes
2)}return e},u.prototype.getMutationSummary=function(){return this.getTextMutationSummary()},u.prototype.getTextMutationSummary=function(){var t,e,n,i,r,o,s,a,u,l,p;for(n=(a=this.getTextChangesFromCharacterData()).additions,r=a.deletions,o=0,s=(u=(p=this.getTextChangesFromChildList()).additions).length;s>o;o++)e=u[o],c.call(n,e)<0&&n.push(e);return r.push.apply(r,p.deletions),l={},(t=n.join(""))&&(l.textAdded=t),(i=r.join(""))&&(l.textDeleted=i),l},u.prototype.getMutationsByType=function(t){var e,n,i,r,o;for(o=[],e=0,n=(r=this.mutations).length;n>e;e++)(i=r[e]).type===t&&o.push(i);return o},u.prototype.getTextChangesFromChildList=function(){var t,n,r,o,s,a,u,c,p,h;for(t=[],u=[],n=0,o=(a=this.getMutationsByType("childList")).length;o>n;n++)s=a[n],t.push.apply(t,s.addedNodes),u.push.apply(u,s.removedNodes);return 0===t.length&&1===u.length&&e(u[0])?(p=[],h=["\n"]):(p=l(t),h=l(u)),{additions:function(){var t,e,n;for(n=[],r=t=0,e=p.length;e>t;r=++t)(c=p[r])!==h[r]&&n.push(i(c));return n}(),deletions:function(){var t,e,n;for(n=[],r=t=0,e=h.length;e>t;r=++t)(c=h[r])!==p[r]&&n.push(i(c));return n}()}},u.prototype.getTextChangesFromCharacterData=function(){var t,e,n,o,s,a,u,c;return(e=this.getMutationsByType("characterData")).length&&(c=e[0],n=e[e.length-1],s=i(c.oldValue),o=i(n.target.data),t=(a=r(s,o)).added,u=a.removed),{additions:t?[t]:[],deletions:u?[u]:[]}},l=function(t){var e,n,i,r;for(null==t&&(t=[]),r=[],e=0,n=t.length;n>e;e++)switch(i=t[e],i.nodeType){case Node.TEXT_NODE:r.push(i.data);break;case Node.ELEMENT_NODE:"br"===s(i)?r.push("\n"):r.push.apply(r,l(i.childNodes))}return r},u}(o.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.FileVerificationOperation=function(e){function n(t){this.file=t}return t(n,e),n.prototype.perform=function(t){var e;return(e=new FileReader).onerror=function(){return t(!1)},e.onload=function(n){return function(){e.onerror=null;try{e.abort()}catch(i){}return t(!0,n.file)}}(this),e.readAsArrayBuffer(this.file)},n}(o.Operation)}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;t=o.handleEvent,e=o.innerElementIsActive,o.InputController=function(i){function r(e){var n;for(n in this.element=e,this.mutationObserver=new o.MutationObserver(this.element),this.mutationObserver.delegate=this,this.events)t(n,{onElement:this.element,withCallback:this.handlerFor(n)})}return n(r,i),r.prototype.events={},r.prototype.elementDidMutate=function(){},r.prototype.editorWillSyncDocumentView=function(){return this.mutationObserver.stop()},r.prototype.editorDidSyncDocumentView=function(){return this.mutationObserver.start()},r.prototype.requestRender=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidRequestRender?t.inputControllerDidRequestRender():void 0},r.prototype.requestReparse=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidRequestReparse&&t.inputControllerDidRequestReparse(),this.requestRender()},r.prototype.attachFiles=function(t){var e,n;return n=function(){var n,i,r;for(r=[],n=0,i=t.length;i>n;n++)e=t[n],r.push(new o.FileVerificationOperation(e));return r}(),Promise.all(n).then(function(t){return function(e){return t.handleInput((function(){var t,n;return null!=(t=this.delegate)&&t.inputControllerWillAttachFiles(),null!=(n=this.responder)&&n.insertFiles(e),this.requestRender()}))}}(this))},r.prototype.handlerFor=function(t){return function(n){return function(i){return i.defaultPrevented?void 0:n.handleInput((function(){return e(this.element)?void 0:(this.eventName=t,this.events[t].call(this,i))}))}}(this)},r.prototype.handleInput=function(t){var e,n;try{return null!=(e=this.delegate)&&e.inputControllerWillHandleInput(),t.call(this)}finally{null!=(n=this.delegate)&&n.inputControllerDidHandleInput()}},r.prototype.createLinkHTML=function(t,e){var n;return(n=document.createElement("a")).href=t,n.textContent=null!=e?e:t,n.outerHTML},r}(o.BasicObject)}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p,h,d=function(t,e){function n(){this.constructor=t}for(var i in e)f.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},f={}.hasOwnProperty,g=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};c=o.makeElement,l=o.objectsAreEqual,o.tagName,e=o.browser,a=o.keyEventIsKeyboardCommand,i=o.dataTransferIsWritable,n=o.dataTransferIsPlainText,u=o.config.keyNames,o.Level0InputController=function(e){function s(){s.__super__.constructor.apply(this,arguments),this.resetInputSummary()}var f;return d(s,e),f=0,s.prototype.setInputSummary=function(t){var e,n;for(e in null==t&&(t={}),this.inputSummary.eventName=this.eventName,t)n=t[e],this.inputSummary[e]=n;return this.inputSummary},s.prototype.resetInputSummary=function(){return this.inputSummary={}},s.prototype.reset=function(){return this.resetInputSummary(),o.selectionChangeObserver.reset()},s.prototype.elementDidMutate=function(t){var e;return this.isComposing()?null!=(e=this.delegate)&&"function"==typeof e.inputControllerDidAllowUnhandledInput?e.inputControllerDidAllowUnhandledInput():void 0:this.handleInput((function(){return this.mutationIsSignificant(t)&&(this.mutationIsExpected(t)?this.requestRender():this.requestReparse()),this.reset()}))},s.prototype.mutationIsExpected=function(t){var e,n,i,r,o,s,a,u,c;return s=t.textAdded,a=t.textDeleted,!!this.inputSummary.preferDocument||(e=null!=s?s===this.inputSummary.textAdded:!this.inputSummary.textAdded,n=null!=a?this.inputSummary.didDelete:!this.inputSummary.didDelete,c="\n"===a&&!n,!!(((u=("\n"===s||" \n"===s)&&!e)&&!c||c&&!u)&&(r=this.getSelectedRange())&&(i=u?s.replace(/\n$/,"").length||-1:(null!=s?s.length:void 0)||1,null!=(o=this.responder)?o.positionIsBlockBreak(r[1]+i):void 0))||e&&n)},s.prototype.mutationIsSignificant=function(t){var e,n,i;return i=Object.keys(t).length>0,e=""===(null!=(n=this.compositionInput)?n.getEndData():void 0),i||
2!e},s.prototype.events={keydown:function(t){var e,n,i,r,s,c,l,p,h;if(this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0,r=u[t.keyCode]){for(n=this.keys,i=0,c=(p=["ctrl","alt","shift","meta"]).length;c>i;i++)t[(l=p[i])+"Key"]&&("ctrl"===l&&(l="control"),n=null!=n?n[l]:void 0);null!=(null!=n?n[r]:void 0)&&(this.setInputSummary({keyName:r}),o.selectionChangeObserver.reset(),n[r].call(this,t))}return a(t)&&(e=String.fromCharCode(t.keyCode).toLowerCase())&&(s=function(){var e,n,i,r;for(r=[],e=0,n=(i=["alt","shift"]).length;n>e;e++)t[(l=i[e])+"Key"]&&r.push(l);return r}(),s.push(e),null!=(h=this.delegate)?h.inputControllerDidReceiveKeyboardCommand(s):void 0)?t.preventDefault():void 0},keypress:function(t){var e,n,i;if(null==this.inputSummary.eventName&&!t.metaKey&&(!t.ctrlKey||t.altKey))return(i=h(t))?(null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString(i),this.setInputSummary({textAdded:i,didDelete:this.selectionIsExpanded()})):void 0},textInput:function(t){var e,n,i,r;return e=t.data,(r=this.inputSummary.textAdded)&&r!==e&&r.toUpperCase()===e?(n=this.getSelectedRange(),this.setSelectedRange([n[0],n[1]+r.length]),null!=(i=this.responder)&&i.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(n)):void 0},dragenter:function(t){return t.preventDefault()},dragstart:function(t){var e;return t.target,this.serializeSelectionToDataTransfer(t.dataTransfer),this.draggedRange=this.getSelectedRange(),null!=(e=this.delegate)&&"function"==typeof e.inputControllerDidStartDrag?e.inputControllerDidStartDrag():void 0},dragover:function(t){var e,n;return!this.draggedRange&&!this.canAcceptDataTransfer(t.dataTransfer)||(t.preventDefault(),e={x:t.clientX,y:t.clientY},l(e,this.draggingPoint))?void 0:(this.draggingPoint=e,null!=(n=this.delegate)&&"function"==typeof n.inputControllerDidReceiveDragOverPoint?n.inputControllerDidReceiveDragOverPoint(this.draggingPoint):void 0)},dragend:function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidCancelDrag&&t.inputControllerDidCancelDrag(),this.draggedRange=null,this.draggingPoint=null},drop:function(t){var e,n,i,r,s,a,u,c,l;return t.preventDefault(),i=null!=(s=t.dataTransfer)?s.files:void 0,r={x:t.clientX,y:t.clientY},null!=(a=this.responder)&&a.setLocationRangeFromPointRange(r),(null!=i?i.length:void 0)?this.attachFiles(i):this.draggedRange?(null!=(u=this.delegate)&&u.inputControllerWillMoveText(),null!=(c=this.responder)&&c.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()):(n=t.dataTransfer.getData("application/x-trix-document"))&&(e=o.Document.fromJSONString(n),null!=(l=this.responder)&&l.insertDocument(e),this.requestRender()),this.draggedRange=null,this.draggingPoint=null},cut:function(t){var e,n;return(null!=(e=this.responder)?e.selectionIsExpanded():void 0)&&(this.serializeSelectionToDataTransfer(t.clipboardData)&&t.preventDefault(),null!=(n=this.delegate)&&n.inputControllerWillCutText(),this.deleteInDirection("backward"),t.defaultPrevented)?this.requestRender():void 0},copy:function(t){var e;return(null!=(e=this.responder)?e.selectionIsExpanded():void 0)&&this.serializeSelectionToDataTransfer(t.clipboardData)?t.preventDefault():void 0},paste:function(t){var e,i,s,a,u,c,l,h,d,m,y,v,b,A,w,x,C,E,S,k,R,L,D;return e=null!=(h=t.clipboardData)?h:t.testClipboardData,l={clipboard:e},null==e||p(t)?void this.getPastedHTMLUsingHiddenElement(function(t){return function(e){var n,i,r;return l.type="text/html",l.html=e,null!=(n=t.delegate)&&n.inputControllerWillPaste(l),null!=(i=t.responder)&&i.insertHTML(l.html),t.requestRender(),null!=(r=t.delegate)?r.inputControllerDidPaste(l):void 0}}(this)):((a=e.getData("URL"))?(l.type="text/html",D=(c=e.getData("public.url-name"))?o.squishBreakableWhitespace(c).trim():a,l.html=this.createLinkHTML(a,D),null!=(d=this.delegate)&&d.inputControllerWillPaste(l),this.setInputSummary({textAdded:D,didDelete:this.selectionIsExpanded()}),null!=(w=this.responder)&&w.insertHTML(l.html),this.requestRender(),null!=(x=this.delegate)&&x.inputControllerDidPaste(l)):n(e)?(l.type="text/plain",l.string=e.getData("text/plain"),null!=(C=this.delegate)&&C.inputControllerWillPaste(l),this.setInputSummary({textAdded:l.string,didDelete:this.selectionIsExpanded()}),null!=(E=this.responder)&&E.insertString(l.string),this.requestRender(),null!=(S=this.delegate)&&S.inputControllerDidPaste(l)):(u=e.getData("text/html"))?(l.type="text/html",l.html=u,null!=(k=this.delegate)&&k.inputControllerWillPaste(l),null!=(R=this.responder)&&R.insertHTML(l.html),this.requestRender(),null!=(L=this.delegate)&&L.inputControllerDidPaste(l)):g.call(e.types,"Files")>=0&&(s=null!=(m=e.items)&&null!=(y=m[0])&&"function"==typeof y.getAsFile?y.getAsFile():void 0)&&(!s.name&&(i=r
2(s))&&(s.name="pasted-file-"+ ++f+"."+i),l.type="File",l.file=s,null!=(v=this.delegate)&&v.inputControllerWillAttachFiles(),null!=(b=this.responder)&&b.insertFile(l.file),this.requestRender(),null!=(A=this.delegate)&&A.inputControllerDidPaste(l)),t.preventDefault())},compositionstart:function(t){return this.getCompositionInput().start(t.data)},compositionupdate:function(t){return this.getCompositionInput().update(t.data)},compositionend:function(t){return this.getCompositionInput().end(t.data)},beforeinput:function(){return this.inputSummary.didInput=!0},input:function(t){return this.inputSummary.didInput=!0,t.stopPropagation()}},s.prototype.keys={backspace:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},delete:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},return:function(){var t,e;return this.setInputSummary({preferDocument:!0}),null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),null!=(e=this.responder)?e.insertLineBreak():void 0},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canIncreaseNestingLevel():void 0)?(null!=(n=this.responder)&&n.increaseNestingLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("backward"):void 0):void 0},right:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("forward"):void 0):void 0},control:{d:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},h:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},o:function(t){var e,n;return t.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString("\n",{updatePosition:!1}),this.requestRender()}},shift:{return:function(t){var e,n;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString("\n"),this.requestRender(),t.preventDefault()},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canDecreaseNestingLevel():void 0)?(null!=(n=this.responder)&&n.decreaseNestingLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("backward")):void 0},right:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("forward")):void 0}},alt:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}},meta:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}}},s.prototype.getCompositionInput=function(){return this.isComposing()?this.compositionInput:this.compositionInput=new t(this)},s.prototype.isComposing=function(){return null!=this.compositionInput&&!this.compositionInput.isEnded()},s.prototype.deleteInDirection=function(t,e){var n;return!1!==(null!=(n=this.responder)?n.deleteInDirection(t):void 0)?this.setInputSummary({didDelete:!0}):e?(e.preventDefault(),this.requestRender()):void 0},s.prototype.serializeSelectionToDataTransfer=function(t){var e,n;if(i(t))return e=null!=(n=this.responder)?n.getSelectedDocument().toSerializableDocument():void 0,t.setData("application/x-trix-document",JSON.stringify(e)),t.setData("text/html",o.DocumentView.render(e).innerHTML),t.setData("text/plain",e.toString().replace(/\n$/,"")),!0},s.prototype.canAcceptDataTransfer=function(t){var e,n,i,r,o;for(o={},e=0,n=(r=null!=(i=null!=t?t.types:void 0)?i:[]).length;n>e;e++)o[r[e]]=!0;return o.Files||o["application/x-trix-document"]||o["text/html"]||o["text/plain"]},s.prototype.getPastedHTMLUsingHiddenElement=function(t){var e,n,i;return n=this.getSelectedRange(),i={position:"absolute",left:window.pageXOffset+"px",to
2p:window.pageYOffset+"px",opacity:0},e=c({style:i,tagName:"div",editable:!0}),document.body.appendChild(e),e.focus(),requestAnimationFrame(function(i){return function(){var r;return r=e.innerHTML,o.removeNode(e),i.setSelectedRange(n),t(r)}}(this))},s.proxyMethod("responder?.getSelectedRange"),s.proxyMethod("responder?.setSelectedRange"),s.proxyMethod("responder?.expandSelectionInDirection"),s.proxyMethod("responder?.selectionIsInCursorTarget"),s.proxyMethod("responder?.selectionIsExpanded"),s}(o.InputController),r=function(t){var e,n;return null!=(e=t.type)&&null!=(n=e.match(/\/(\w+)$/))?n[1]:void 0},s=null!=("function"==typeof" ".codePointAt?" ".codePointAt(0):void 0),h=function(t){var e;return t.key&&s&&t.key.codePointAt(0)===t.keyCode?t.key:(null===t.which?e=t.keyCode:0!==t.which&&0!==t.charCode&&(e=t.charCode),null!=e&&"escape"!==u[e]?o.UTF16String.fromCodepoints([e]).toString():void 0)},p=function(t){var e,n,i,r,o,s,a,u,c;if(a=t.clipboardData){if(g.call(a.types,"text/html")>=0){for(i=0,s=(u=a.types).length;s>i;i++)if(c=u[i],e=/^CorePasteboardFlavorType/.test(c),n=/^dyn\./.test(c)&&a.getData(c),e||n)return!0;return!1}return r=g.call(a.types,"com.apple.webarchive")>=0,o=g.call(a.types,"com.apple.flat-rtfd")>=0,r||o}},t=function(t){function n(t){var e;this.inputController=t,e=this.inputController,this.responder=e.responder,this.delegate=e.delegate,this.inputSummary=e.inputSummary,this.data={}}return d(n,t),n.prototype.start=function(t){var e,n;return this.data.start=t,this.isSignificant()?("keypress"===this.inputSummary.eventName&&this.inputSummary.textAdded&&null!=(e=this.responder)&&e.deleteInDirection("left"),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=null!=(n=this.responder)?n.getSelectedRange():void 0):void 0},n.prototype.update=function(t){var e;return this.data.update=t,this.isSignificant()&&(e=this.selectPlaceholder())?(this.forgetPlaceholder(),this.range=e):void 0},n.prototype.end=function(t){var e,n,i,r;return this.data.end=t,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.setSelectedRange(this.range),null!=(i=this.responder)&&i.insertString(this.data.end),null!=(r=this.responder)?r.setSelectedRange(this.range[0]+this.data.end.length):void 0):null!=this.data.start||null!=this.data.update?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset()},n.prototype.getEndData=function(){return this.data.end},n.prototype.isEnded=function(){return null!=this.getEndData()},n.prototype.isSignificant=function(){return!e.composesExistingText||this.inputSummary.didInput},n.prototype.canApplyToDocument=function(){var t,e;return 0===(null!=(t=this.data.start)?t.length:void 0)&&(null!=(e=this.data.end)?e.length:void 0)>0&&null!=this.range},n.proxyMethod("inputController.setInputSummary"),n.proxyMethod("inputController.requestRender"),n.proxyMethod("inputController.requestReparse"),n.proxyMethod("responder?.selectionIsExpanded"),n.proxyMethod("responder?.insertPlaceholder"),n.proxyMethod("responder?.selectPlaceholder"),n.proxyMethod("responder?.forgetPlaceholder"),n}(o.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=o.dataTransferIsPlainText,e=o.keyEventIsKeyboardCommand,n=o.objectsAreEqual,o.Level2InputController=function(r){function a(){return this.render=function(t,e){return function(){return t.apply(e,arguments)}}(this.render,this),a.__super__.constructor.apply(this,arguments)}var u,c,l,p,h,d;return i(a,r),a.prototype.elementDidMutate=function(){var t;return this.scheduledRender?this.composing&&null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidAllowUnhandledInput?t.inputControllerDidAllowUnhandledInput():void 0:this.reparse()},a.prototype.scheduleRender=function(){return null!=this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)},a.prototype.render=function(){var t;return cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||null!=(t=this.delegate)&&t.render(),"function"==typeof this.afterRender&&this.afterRender(),this.afterRender=null},a.prototype.reparse=function(){var t;return null!=(t=this.delegate)?t.reparse():void 0},a.prototype.events={keydown:function(t){var n,i,r,o;
2if(e(t)){if(n=c(t),null!=(o=this.delegate)?o.inputControllerDidReceiveKeyboardCommand(n):void 0)return t.preventDefault()}else if(r=t.key,t.altKey&&(r+="+Alt"),t.shiftKey&&(r+="+Shift"),i=this.keys[r])return this.withEvent(t,i)},paste:function(t){var e,n,i,r,o,s,a,u,c;return l(t)?(t.preventDefault(),this.attachFiles(t.clipboardData.files)):p(t)?(t.preventDefault(),n={type:"text/plain",string:t.clipboardData.getData("text/plain")},null!=(i=this.delegate)&&i.inputControllerWillPaste(n),null!=(r=this.responder)&&r.insertString(n.string),this.render(),null!=(o=this.delegate)?o.inputControllerDidPaste(n):void 0):(e=null!=(s=t.clipboardData)?s.getData("URL"):void 0)?(t.preventDefault(),n={type:"text/html",html:this.createLinkHTML(e)},null!=(a=this.delegate)&&a.inputControllerWillPaste(n),null!=(u=this.responder)&&u.insertHTML(n.html),this.render(),null!=(c=this.delegate)?c.inputControllerDidPaste(n):void 0):void 0},beforeinput:function(t){var e;return(e=this.inputTypes[t.inputType])?(this.withEvent(t,e),this.scheduleRender()):void 0},input:function(){return o.selectionChangeObserver.reset()},dragstart:function(t){var e,n;return(null!=(e=this.responder)?e.selectionContainsAttachments():void 0)?(t.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:null!=(n=this.responder)?n.getSelectedRange():void 0,point:h(t)}):void 0},dragenter:function(t){return u(t)?t.preventDefault():void 0},dragover:function(t){var e,i;if(this.dragging){if(t.preventDefault(),e=h(t),!n(e,this.dragging.point))return this.dragging.point=e,null!=(i=this.responder)?i.setLocationRangeFromPointRange(e):void 0}else if(u(t))return t.preventDefault()},drop:function(t){var e,n,i,r;return this.dragging?(t.preventDefault(),null!=(n=this.delegate)&&n.inputControllerWillMoveText(),null!=(i=this.responder)&&i.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender()):u(t)?(t.preventDefault(),e=h(t),null!=(r=this.responder)&&r.setLocationRangeFromPointRange(e),this.attachFiles(t.dataTransfer.files)):void 0},dragend:function(){var t;return this.dragging?(null!=(t=this.responder)&&t.setSelectedRange(this.dragging.range),this.dragging=null):void 0},compositionend:function(){return this.composing?(this.composing=!1,this.scheduleRender()):void 0}},a.prototype.keys={ArrowLeft:function(){var t,e;return(null!=(t=this.responder)?t.shouldManageMovingCursorInDirection("backward"):void 0)?(this.event.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("backward"):void 0):void 0},ArrowRight:function(){var t,e;return(null!=(t=this.responder)?t.shouldManageMovingCursorInDirection("forward"):void 0)?(this.event.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("forward"):void 0):void 0},Backspace:function(){var t,e,n;return(null!=(t=this.responder)?t.shouldManageDeletingInDirection("backward"):void 0)?(this.event.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.deleteInDirection("backward"),this.render()):void 0},Tab:function(){var t,e;return(null!=(t=this.responder)?t.canIncreaseNestingLevel():void 0)?(this.event.preventDefault(),null!=(e=this.responder)&&e.increaseNestingLevel(),this.render()):void 0},"Tab+Shift":function(){var t,e;return(null!=(t=this.responder)?t.canDecreaseNestingLevel():void 0)?(this.event.preventDefault(),null!=(e=this.responder)&&e.decreaseNestingLevel(),this.render()):void 0}},a.prototype.inputTypes={deleteByComposition:function(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut:function(){return this.deleteInDirection("backward")},deleteByDrag:function(){return this.event.preventDefault(),this.withTargetDOMRange((function(){var t;return this.deleteByDragRange=null!=(t=this.responder)?t.getSelectedRange():void 0}))},deleteCompositionText:function(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent:function(){return this.deleteInDirection("backward")},deleteContentBackward:function(){return this.deleteInDirection("backward")},deleteContentForward:function(){return this.deleteInDirection("forward")},deleteEntireSoftLine:function(){return this.deleteInDirection("forward")},deleteHardLineBackward:function(){return this.deleteInDirection("backward")},deleteHardLineForward:function(){return this.deleteInDirection("forward")},deleteSoftLineBackward:function(){return this.deleteInDirection("backward")},deleteSoftLineForward:function(){return this.deleteInDirection("forward")},deleteWordBackward:function(){return this.deleteInDirection("backward")}
2,deleteWordForward:function(){return this.deleteInDirection("forward")},formatBackColor:function(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold:function(){return this.toggleAttributeIfSupported("bold")},formatFontColor:function(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName:function(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent:function(){var t;return(null!=(t=this.responder)?t.canIncreaseNestingLevel():void 0)?this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.increaseNestingLevel():void 0})):void 0},formatItalic:function(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter:function(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull:function(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft:function(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight:function(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent:function(){var t;return(null!=(t=this.responder)?t.canDecreaseNestingLevel():void 0)?this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.decreaseNestingLevel():void 0})):void 0},formatRemove:function(){return this.withTargetDOMRange((function(){var t,e,n,i;for(t in i=[],null!=(e=this.responder)?e.getCurrentAttributes():void 0)i.push(null!=(n=this.responder)?n.removeCurrentAttribute(t):void 0);return i}))},formatSetBlockTextDirection:function(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection:function(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough:function(){return this.toggleAttributeIfSupported("strike")},formatSubscript:function(){return this.toggleAttributeIfSupported("sub")},formatSuperscript:function(){return this.toggleAttributeIfSupported("sup")},formatUnderline:function(){return this.toggleAttributeIfSupported("underline")},historyRedo:function(){var t;return null!=(t=this.delegate)?t.inputControllerWillPerformRedo():void 0},historyUndo:function(){var t;return null!=(t=this.delegate)?t.inputControllerWillPerformUndo():void 0},insertCompositionText:function(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition:function(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop:function(){var t,e;return(t=this.deleteByDragRange)?(this.deleteByDragRange=null,null!=(e=this.delegate)&&e.inputControllerWillMoveText(),this.withTargetDOMRange((function(){var e;return null!=(e=this.responder)?e.moveTextFromRange(t):void 0}))):void 0},insertFromPaste:function(){var e,n,i,r,s,a,u,c,l,p,h;return e=this.event.dataTransfer,s={dataTransfer:e},(n=e.getData("URL"))?(this.event.preventDefault(),s.type="text/html",h=(r=e.getData("public.url-name"))?o.squishBreakableWhitespace(r).trim():n,s.html=this.createLinkHTML(n,h),null!=(a=this.delegate)&&a.inputControllerWillPaste(s),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertHTML(s.html):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(s):void 0}}(this)):t(e)?(s.type="text/plain",s.string=e.getData("text/plain"),null!=(u=this.delegate)&&u.inputControllerWillPaste(s),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertString(s.string):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(s):void 0}}(this)):(i=e.getData("text/html"))?(this.event.preventDefault(),s.type="text/html",s.html=i,null!=(c=this.delegate)&&c.inputControllerWillPaste(s),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertHTML(s.html):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(s):void 0}}(this)):(null!=(l=e.files)?l.length:void 0)?(s.type="File",s.file=e.files[0],null!=(p=this.delegate)&&p.inputControllerWillPaste(s),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertFile(s.file):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(s):void 0}}(this)):void 0},insertFromYank:function(){return this.insertString(this.event.data)},insertLineBreak:function(){return this.insertString("\n")},insertLink:function(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList:function(){return this.toggleAttributeIfSupported("number")},insertParagraph:function(){var t;return null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertLineBreak():void 0}))},insertReplacementText:function(){return this.insertString(this.event.dataTransfer.getData("text/plain"),{updatePosition:!1})},insertText:function(){var t,e;return this.insertString(null!=(t=this.event.data)?t:null!=(e=this.event.dataTransfer)?e.getData("text/plain"):void 0)},insertTranspose:function(){return this.insertString(this.event.data)},insertUnorderedList:function(){return this.toggleAttributeIfSupported("bullet")}},a.prototype.insertString=function(t,e){var n;return null==t&&(t=""),null!=(n=this.delegate)&&n.inputControllerWillPerformTyping(),this.withTargetDOMRange((function(){var n;return null!=(n=this.responder)?n.insertString(t,e):void 0}))},a.prototype.toggleAttributeIfSupported=function(t){var e;return s.call(o.getAllAttributeNames(),t)>=0?(null!=(e=this.delegate)&&e.inputControllerWillPerformFormatting(t),this.withTargetDOMRange((function(){var e;return null!=(e=this.responder)?e.toggleCurrentAttribute(t):void 0}))):void 0},a.prototype.activateAttributeIfSupported=function(t,e){var n;return s.call(o.getAllAttributeNames(),t)>=0?(null!=(n=this.delegate)&&n.inputControllerWillPerformFormatting(t),this.withTargetDOMRange((function(){var n;return null!=(n=this.responder)?n.setCurrentAttribute(t,e):void 0}))):void 0},a.prototype.deleteInDirection=function(t,e){var n,i,r;return(null!=e?e:{recordUndoEntry:!0}).recordUndoEntry&&null!=(r=this.delegate)&&r.inputControllerWillPerformTyping(),i=function(e){return function(){var n;return null!=(n=e.responder)?n.deleteInDirection(t):void 0}}(this),(n=this.getTargetDOMRange({minLength:2}))?this.withTargetDOMRange(n,i):i()},a.prototype.withTargetDOMRange=function(t,e){var n;return"function"==typeof t&&(e=t,t=this.getTargetDOMRange()),t?null!=(n=this.responder)?n.withTargetDOMRange(t,e.bind(this)):void 0:(o.selectionChangeObserver.reset(),e.call(this))},a.prototype.getTargetDOMRange=function(t){var e,n,i,r;return i=(null!=t?t:{minLength:0}).minLength,(r="function"==typeof(e=this.event).getTargetRanges?e.getTargetRanges():void 0)&&r.length&&(n=d(r[0]),0===i||n.toString().length>=i)?n:void 0},d=function(t){var e;return(e=document.createRange()).setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),e},a.prototype.withEvent=function(t,e){var n;this.event=t;try{n=e.call(this)}finally{this.event=null}return n},u=function(t){var e,n;return s.call(null!=(e=null!=(n=t.dataTransfer)?n.types:void 0)?e:[],"Files")>=0},l=function(t){var e;return(e=t.clipboardData)?s.call(e.types,"Files")>=0&&1===e.types.length&&e.files.length>=1:void 0},p=function(t){var e;return(e=t.clipboardData)?s.call(e.types,"text/plain")>=0&&1===e.types.length:void 0},c=function(t){var e;return e=[],t.altKey&&e.push("alt"),t.shiftKey&&e.push("shift"),e.push(t.key),e},h=function(t){return{x:t.clientX,y:t.clientY}},a}(o.InputController)}.call(this),function(){var t,e,n,i,r,s,a,u,c=function(t,e){return function(){return t.apply(e,arguments)}},l=function(t,e){function n(){this.constructor=t}for(var i in e)p.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},p={}.hasOwnProperty;e=o.defer,n=o.handleEvent,s=o.makeElement,u=o.tagName,a=o.config,r=a.lang,t=a.css,i=a.keyNames,o.AttachmentEditorController=function(a){function p(t,e,n,i){this.attachmentPiece=t,this.element=e,this.container=n,this.options=null!=i?i:{},this.didBlurCaption=c(this.didBlurCaption,this),this.didChangeCaption=c(this.didChangeCaption,this),this.didInputCaption=c(this.didInputCaption,this),this.didKeyDownCaption=c(this.didKeyDownCaption,this),this.didClickActionButton=c(this.didClickActionButton,this),this.didClickToolbar=c(this.didClickToolbar,this),this.attachment=this.attachmentPiece.attachment,"a"===u(this.element)&&(this.element=this.element.firstChild),this.install()}var h;return l(p,a),h=function(t){return function(){var e;return(e=t.apply(this,arguments)).do(),null==this.undos&&(this.undos=[]),this.undos.push(e.undo)}},p.prototype.install=function(){return this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()?this.installCaptionEditor():void 0},p.prototype.uninstall=function(){var t,e;for(this.savePendingCaption();e=this.undos.pop();)e();return null!=(t=this.delegate)?t.didUninstallAttachmentEditor(this):void 0},p.prototype.savePendingCaption=function(){var t,e,n;return null!=this.pendingCaption?(t=this.pendingCaption,this.pendingCaption=null,t?null!=(e=this.delegate)&&"function"==typeof e.attachmentEditorDidRequestUpdatingAttributesForAttachment?e.attachmentEditorDidRequestUpdatingAttributesForAttachment({caption:t},this.attachment):void 0:null!=(n=this.delegate)&&"function"==typeof n.attachmentEditorDidRequestRemovingAttributeForAttachment?n.attachmentEditorDidRequestRemovingAttributeForAttachment("caption",this.attachment):void 0):void 0},p.prototype.makeElementMutable=h((function(){return{do:function(t){return function(){return t.element.dataset.trixMutable=!0}}(this),undo:function(t){return function(){return delete t.element.dataset.trixMutable}}(this)}})),p.prototype.addToolbar=h((function(){var e;return e=s({tagName:"div",className:t.attachmentToolbar,data:{trixMutable:!0},childNodes:s({tagName:"div",className:"trix-button-row",childNodes:s({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:s({tagName:"button",className:"trix-button trix-button--remove",textContent:r.remove,attributes:{title:r.remove},data:{trixAction:"remove"}})})})}),this.attachment.isPreviewable()&&e.appendChild(s({tagName:"div",className:t.attachmentMetadataContainer,childNodes:s({tagName:"span",className:t.attachmentMetadata,childNodes:[s({tagName:"span",className:t.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),s({tagName:"span",className:t.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),n("click",{onElement:e,withCallback:this.didClickToolbar}),n("click",{onElement:e,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),{do:function(t){return function(){return t.element.appendChild(e)}}(this),undo:function(){return o.removeNode(e)}}})),p.prototype.installCaptionEditor=h((function(){var i,a,u,c,l;return(c=s({tagName:"textarea",className:t.attachmentCaptionEditor,attributes:{placeholder:r.captionPlaceholder},data:{trixMutable:!0}})).value=this.attachmentPiece.getCaption(),(l=c.cloneNode()).classList.add("trix-autoresize-clone"),l.tabIndex=-1,i=function(){return l.value=c.value,c.style.height=l.scrollHeight+"px"},n("input",{onElement:c,withCallback:i}),n("input",{onElement:c,withCallback:this.didInputCaption}),n("keydown",{onElement:c,withCallback:this.didKeyDownCaption}),n("change",{onElement:c,withCallback:this.didChangeCaption}),n("blur",{onElement:c,withCallback:this.didBlurCaption}),u=this.element.querySelector("figcaption"),a=u.cloneNode(),{do:function(n){return function(){return u.style.display="none",a.appendChild(c),a.appendChild(l),a.classList.add(t.attachmentCaption+"--editing"),u.parentElement.insertBefore(a,u),i(),n.options.editCaption?e((function(){return c.focus()})):void 0}}(this),undo:function(){return o.removeNode(a),u.style.display=null}}})),p.prototype.didClickToolbar=function(t){return t.preventDefault(),t.stopPropagation()},p.prototype.didClickActionButton=function(t){var e;if("remove"===t.target.getAttribute("data-trix-action"))return null!=(e=this.delegate)?e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment):void 0},p.prototype.didKeyDownCaption=function(t){var e;return"return"===i[t.keyCode]?(t.preventDefault(),this.savePendingCaption(),null!=(e=this.delegate)&&"function"==typeof e.attachmentEditorDidRequestDeselectingAttachment?e.attachmentEditorDidRequestDeselectingAttachment(this.attachment):void 0):void 0},p.prototype.didInputCaption=function(t){return this.pendingCaption=t.target.value.replace(/\s/g," ").trim()},p.prototype.didChangeCaption=function(){return this.savePendingCaption()},p.prototype.didBlurCaption=function(){return this.savePendingCaption()},p}(o.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;n=o.makeElement,t=o.config.css,o.AttachmentView=function(r){function s(){s.__super__.constructor.apply(this,arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}var a;return i(s,r),s.attachmentSelector="[data-trix-attachment]",s.prototype.createContentNodes=function(){return[]},s.prototype.createNodes=function(){var e,i,r,o,s,u,c;if(e=o=n({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),(i=this.getHref())&&(o=n({tagName:"a",editable:!1,attributes:{href:i,tabindex:-1}}),e.appendChild(o)),this.attachment.hasContent())o.innerHTML=this.attachment.getContent();else for(r=0,s=(c=this.createContentNodes()).length;s>r;r++)u=c[r],o.appendChild(u);return o.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=n({tagName:"progress",attributes:{class:t.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),e.appendChild(this.progressElement)),[a("left"),e,a("right")]},s.prototype.createCaptionElement=function(){var e,i,r,o,s,a,u;return r=n({tagName:"figcaption",className:t.attachmentCaption}),(e=this.attachmentPiece.getCaption())?(r.classList.add(t.attachmentCaption+"--edited"),r.textContent=e):((i=this.getCaptionConfig()).name&&(o=this.attachment.getFilename()),i.size&&(a=this.attachment.getFormattedFilesize()),o&&(s=n({tagName:"span",className:t.attachmentName,textContent:o}),r.appendChild(s)),a&&(o&&r.appendChild(document.createTextNode(" ")),u=n({tagName:"span",className:t.attachmentSize,textContent:a}),r.appendChild(u))),r},s.prototype.getClassName=function(){var e,n;return n=[t.attachment,t.attachment+"--"+this.attachment.getType()],(e=this.attachment.getExtension())&&n.push(t.attachment+"--"+e),n.join(" ")},s.prototype.getData=function(){var t,e;return e={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},(t=this.attachmentPiece.attributes).isEmpty()||(e.trixAttributes=JSON.stringify(t)),this.attachment.isPending()&&(e.trixSerialize=!1),e},s.prototype.getHref=function(){return e(this.attachment.getContent(),"a")?void 0:this.attachment.getHref()},s.prototype.getCaptionConfig=function(){var t,e,n;return n=this.attachment.getType(),t=o.copyObject(null!=(e=o.config.attachments[n])?e.caption:void 0),"file"===n&&(t.name=!0),t},s.prototype.findProgressElement=function(){var t;return null!=(t=this.findElement())?t.querySelector("progress"):void 0},a=function(t){return n({tagName:"span",textContent:o.ZERO_WIDTH_SPACE,data:{trixCursorTarget:t,trixSerialize:!1}})},s.prototype.attachmentDidChangeUploadProgress=function(){var t,e;return e=this.attachment.getUploadProgress(),null!=(t=this.findProgressElement())?t.value=e:void 0},s}(o.ObjectView),e=function(t,e){var i;return(i=n("div")).innerHTML=null!=t?t:"",i.querySelector(e)}}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=o.makeElement,o.PreviewableAttachmentView=function(n){function i(){i
2.__super__.constructor.apply(this,arguments),this.attachment.previewDelegate=this}return e(i,n),i.prototype.createContentNodes=function(){return this.image=t({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]},i.prototype.createCaptionElement=function(){var t;return(t=i.__super__.createCaptionElement.apply(this,arguments)).textContent||t.setAttribute("data-trix-placeholder",o.config.lang.captionPlaceholder),t},i.prototype.refresh=function(t){var e;return null==t&&(t=null!=(e=this.findElement())?e.querySelector("img"):void 0),t?this.updateAttributesForImage(t):void 0},i.prototype.updateAttributesForImage=function(t){var e,n,i,r,o,s;return o=this.attachment.getURL(),n=this.attachment.getPreviewURL(),t.src=n||o,n===o?t.removeAttribute("data-trix-serialized-attributes"):(i=JSON.stringify({src:o}),t.setAttribute("data-trix-serialized-attributes",i)),s=this.attachment.getWidth(),e=this.attachment.getHeight(),null!=s&&(t.width=s),null!=e&&(t.height=e),r=["imageElement",this.attachment.id,t.src,t.width,t.height].join("/"),t.dataset.trixStoreKey=r},i.prototype.attachmentDidChangeAttributes=function(){return this.refresh(this.image),this.refresh()},i}(o.AttachmentView)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;n=o.makeElement,t=o.findInnerElement,e=o.getTextConfig,o.PieceView=function(r){function s(){var t;s.__super__.constructor.apply(this,arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),t=this.options,this.textConfig=t.textConfig,this.context=t.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}var a;return i(s,r),s.prototype.createNodes=function(){var e,n,i,r,o,s;if(s=this.attachment?this.createAttachmentNodes():this.createStringNodes(),e=this.createElement()){for(i=t(e),n=0,r=s.length;r>n;n++)o=s[n],i.appendChild(o);s=[e]}return s},s.prototype.createAttachmentNodes=function(){var t;return t=this.attachment.isPreviewable()?o.PreviewableAttachmentView:o.AttachmentView,this.createChildView(t,this.piece.attachment,{piece:this.piece}).getNodes()},s.prototype.createStringNodes=function(){var t,e,i,r,o,s,a,u,c;if(null!=(a=this.textConfig)?a.plaintext:void 0)return[document.createTextNode(this.string)];for(s=[],i=e=0,r=(u=this.string.split("\n")).length;r>e;i=++e)c=u[i],i>0&&(t=n("br"),s.push(t)),c.length&&(o=document.createTextNode(this.preserveSpaces(c)),s.push(o));return s},s.prototype.createElement=function(){var t,i,r,o,s,a,u,c,l;for(o in c={},a=this.attributes)if(l=a[o],(t=e(o))&&(t.tagName&&(s=n(t.tagName),r?(r.appendChild(s),r=s):i=r=s),t.styleProperty&&(c[t.styleProperty]=l),t.style))for(o in u=t.style)l=u[o],c[o]=l;if(Object.keys(c).length)for(o in null==i&&(i=n("span")),c)l=c[o],i.style[o]=l;return i},s.prototype.createContainerElement=function(){var t,i,r,o,s;for(r in o=this.attributes)if(s=o[r],(i=e(r))&&i.groupTagName)return(t={})[r]=s,n(i.groupTagName,t)},a=o.NON_BREAKING_SPACE,s.prototype.preserveSpaces=function(t){return this.context.isLast&&(t=t.replace(/\ $/,a)),t=t.replace(/(\S)\ {3}(\S)/g,"$1 "+a+" $2").replace(/\ {2}/g,a+" ").replace(/\ {2}/g," "+a),(this.context.isFirst||this.context.followsWhitespace)&&(t=t.replace(/^\ /,a)),t},s}(o.ObjectView)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.TextView=function(e){function n(){n.__super__.constructor.apply(this,arguments),this.text=this.object,this.textConfig=this.options.textConfig}var i;return t(n,e),n.prototype.createNodes=function(){var t,e,n,r,s,a,u,c,l,p;for(a=[],r=(c=o.ObjectGroup.groupObjects(this.getPieces())).length-1,n=e=0,s=c.length;s>e;n=++e)u=c[n],t={},0===n&&(t.isFirst=!0),n===r&&(t.isLast=!0),i(l)&&(t.followsWhitespace=!0),p=this.findOrCreateCachedChildView(o.PieceView,u,{textConfig:this.textConfig,context:t}),a.push.apply(a,p.getNodes()),l=u;return a},n.prototype.getPieces=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.text.getPieces()).length;e>t;t++)(n=i[t]).hasAttribute("blockBreak")||r.push(n);return r},i=function(t){return/\s$/.test(null!=t?t.toString():void 0)},n}(o.ObjectView)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;n=o.makeElement,e=o.getBlockConfig,t=o.config.css,o.BlockView=function(r){function s(){s.__super__.constructor.apply(this,arguments),this.block=this.object,this.attributes=this.block.getAttributes()}return i(s,r),s.prototype.createNodes=function(){var t,i,r,s,a,u,c,l,p,h;
2if(u=[document.createComment("block")],this.block.isEmpty()?u.push(n("br")):(p=null!=(c=e(this.block.getLastAttribute()))?c.text:void 0,h=this.findOrCreateCachedChildView(o.TextView,this.block.text,{textConfig:p}),u.push.apply(u,h.getNodes()),this.shouldAddExtraNewlineElement()&&u.push(n("br"))),this.attributes.length)return u;for(l=o.config.blockAttributes.default.tagName,this.block.isRTL()&&(t={dir:"rtl"}),i=n({tagName:l,attributes:t}),r=0,s=u.length;s>r;r++)a=u[r],i.appendChild(a);return[i]},s.prototype.createContainerElement=function(i){var r,o,s,a,u;return r=this.attributes[i],u=e(r).tagName,0===i&&this.block.isRTL()&&(o={dir:"rtl"}),"attachmentGallery"===r&&(a=this.block.getBlockBreakPosition(),s=t.attachmentGallery+" "+t.attachmentGallery+"--"+a),n({tagName:u,className:s,attributes:o})},s.prototype.shouldAddExtraNewlineElement=function(){return/\n\n$/.test(this.block.toString())},s}(o.ObjectView)}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;t=o.defer,e=o.makeElement,o.DocumentView=function(i){function r(){r.__super__.constructor.apply(this,arguments),this.element=this.options.element,this.elementStore=new o.ElementStore,this.setDocument(this.object)}var s,a,u;return n(r,i),r.render=function(t){var n,i;return(i=new this(t,{element:n=e("div")})).render(),i.sync(),n},r.prototype.setDocument=function(t){return t.isEqualTo(this.document)?void 0:this.document=this.object=t},r.prototype.render=function(){var t,n,i,r,s,a,u;if(this.childViews=[],this.shadowElement=e("div"),!this.document.isEmpty()){for(a=[],t=0,n=(s=o.ObjectGroup.groupObjects(this.document.getBlocks(),{asTree:!0})).length;n>t;t++)r=s[t],u=this.findOrCreateCachedChildView(o.BlockView,r),a.push(function(){var t,e,n,r;for(r=[],t=0,e=(n=u.getNodes()).length;e>t;t++)i=n[t],r.push(this.shadowElement.appendChild(i));return r}.call(this));return a}},r.prototype.isSynced=function(){return s(this.shadowElement,this.element)},r.prototype.sync=function(){var t;for(t=this.createDocumentFragmentForSync();this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()},r.prototype.didSync=function(){return this.elementStore.reset(a(this.element)),t(function(t){return function(){return t.garbageCollectCachedViews()}}(this))},r.prototype.createDocumentFragmentForSync=function(){var t,e,n,i,r,o,s,u,c,l;for(e=document.createDocumentFragment(),n=0,r=(u=this.shadowElement.childNodes).length;r>n;n++)s=u[n],e.appendChild(s.cloneNode(!0));for(i=0,o=(c=a(e)).length;o>i;i++)t=c[i],(l=this.elementStore.remove(t))&&t.parentNode.replaceChild(l,t);return e},a=function(t){return t.querySelectorAll("[data-trix-store-key]")},s=function(t,e){return u(t.innerHTML)===u(e.innerHTML)},u=function(t){return t.replace(/&nbsp;/g," ")},r}(o.ObjectView)}.call(this),function(){var t,e,n,i,r,s=function(t,e){return function(){return t.apply(e,arguments)}},a=function(t,e){function n(){this.constructor=t}for(var i in e)u.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;n=o.findClosestElementFromNode,i=o.handleEvent,r=o.innerElementIsActive,e=o.defer,t=o.AttachmentView.attachmentSelector,o.CompositionController=function(u){function c(e,n){this.element=e,this.composition=n,this.didClickAttachment=s(this.didClickAttachment,this),this.didBlur=s(this.didBlur,this),this.didFocus=s(this.didFocus,this),this.documentView=new o.DocumentView(this.composition.document,{element:this.element}),i("focus",{onElement:this.element,withCallback:this.didFocus}),i("blur",{onElement:this.element,withCallback:this.didBlur}),i("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),i("mousedown",{onElement:this.element,matchingSelector:t,withCallback:this.didClickAttachment}),i("click",{onElement:this.element,matchingSelector:"a"+t,preventDefault:!0})}return a(c,u),c.prototype.didFocus=function(){var t,e,n;return t=function(t){return function(){var e;return t.focused?void 0:(t.focused=!0,null!=(e=t.delegate)&&"function"==typeof e.compositionControllerDidFocus?e.compositionControllerDidFocus():void 0)}}(this),null!=(e=null!=(n=this.blurPromise)?n.then(t):void 0)?e:t()},c.prototype.didBlur=function(){return this.blurPromise=new Promise(function(t){return function(n){return e((function(){var e;return r(t.element)||(t.focused=null,null!=(e=t.delegate)&&"function"==typeof e.compositionControllerDidBlur&&e.compositionControllerDidBlur()),t.blurPromise=null,n()}))}}(this))},c.prototype.didClickAttachment=function(t,e){var i,r,o;return i=this.findAttachmentForElement(e),r=null!=n(t.target,{matchingSelector:"figcaption"}),null!=(o=this.delegate)&&"function"==typeof o.compositionControllerDidSelectAttachment?o.compositionControllerDidSelectAttachment(i,{editCaption:r}):void 0},c.prototype.getSerializableElement=function(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element},c.prototype.render=function(){var t,e,n;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&(null!=(t=this.delegate)&&"function"==typeof t.compositionControllerWillSyncDocumentView&&t.compositionControllerWillSyncDocumentView(),this.documentView.sync(),null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidSyncDocumentView&&e.compositionControllerDidSyncDocumentView()),null!=(n=this.delegate)&&"function"==typeof n.compositionControllerDidRender?n.compositionControllerDidRender():void 0},c.prototype.rerenderViewForObject=function(t){return this.invalidateViewForObject(t),this.render()},c.prototype.invalidateViewForObject=function(t){return this.documentView.invalidateViewForObject(t)},c.prototype.isViewCachingEnabled=function(){return this.documentView.isViewCachingEnabled()},c.prototype.enableViewCaching=function(){return this.documentView.enableViewCaching()},c.prototype.disableViewCaching=function(){return this.documentView.disableViewCaching()},c.prototype.refreshViewCache=function(){return this.documentView.garbageCollectCachedViews()},c.prototype.isEditingAttachment=function(){return null!=this.attachmentEditor},c.prototype.installAttachmentEditorForAttachment=function(t,e){var n,i,r;if((null!=(r=this.attachmentEditor)?r.attachment:void 0)!==t&&(i=this.documentView.findElementForOb
2ject(t)))return this.uninstallAttachmentEditor(),n=this.composition.document.getAttachmentPieceForAttachment(t),this.attachmentEditor=new o.AttachmentEditorController(n,i,this.element,e),this.attachmentEditor.delegate=this},c.prototype.uninstallAttachmentEditor=function(){var t;return null!=(t=this.attachmentEditor)?t.uninstall():void 0},c.prototype.didUninstallAttachmentEditor=function(){return this.attachmentEditor=null,this.render()},c.prototype.attachmentEditorDidRequestUpdatingAttributesForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.updateAttributesForAttachment(t,e)},c.prototype.attachmentEditorDidRequestRemovingAttributeForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.removeAttributeForAttachment(t,e)},c.prototype.attachmentEditorDidRequestRemovalOfAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestRemovalOfAttachment?e.compositionControllerDidRequestRemovalOfAttachment(t):void 0},c.prototype.attachmentEditorDidRequestDeselectingAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestDeselectingAttachment?e.compositionControllerDidRequestDeselectingAttachment(t):void 0},c.prototype.canSyncDocumentView=function(){return!this.isEditingAttachment()},c.prototype.findAttachmentForElement=function(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))},c}(o.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;e=o.handleEvent,n=o.triggerEvent,t=o.findClosestElementFromNode,o.ToolbarController=function(o){function s(t){this.element=t,this.didKeyDownDialogInput=i(this.didKeyDownDialogInput,this),this.didClickDialogButton=i(this.didClickDialogButton,this),this.didClickAttributeButton=i(this.didClickAttributeButton,this),this.didClickActionButton=i(this.didClickActionButton,this),this.attributes={},this.actions={},this.resetDialogInputs(),e("mousedown",{onElement:this.element,matchingSelector:a,withCallback:this.didClickActionButton}),e("mousedown",{onElement:this.element,matchingSelector:c,withCallback:this.didClickAttributeButton}),e("click",{onElement:this.element,matchingSelector:y,preventDefault:!0}),e("click",{onElement:this.element,matchingSelector:l,withCallback:this.didClickDialogButton}),e("keydown",{onElement:this.element,matchingSelector:p,withCallback:this.didKeyDownDialogInput})}var a,u,c,l,p,h,d,f,g,m,y;return r(s,o),y=(c="[data-trix-attribute]")+", "+(a="[data-trix-action]"),u=(h="[data-trix-dialog]")+"[data-trix-active]",l=h+" [data-trix-method]",p=h+" [data-trix-input]",s.prototype.didClickActionButton=function(t,e){var n,i,r;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=d(e),this.getDialog(n)?this.toggleDialog(n):null!=(r=this.delegate)?r.toolbarDidInvokeAction(n):void 0},s.prototype.didClickAttributeButton=function(t,e){var n,i,r;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=f(e),this.getDialog(n)?this.toggleDialog(n):null!=(r=this.delegate)&&r.toolbarDidToggleAttribute(n),this.refreshAttributeButtons()},s.prototype.didClickDialogButton=function(e,n){var i;return i=t(n,{matchingSelector:h}),this[n.getAttribute("data-trix-method")].call(this,i)},s.prototype.didKeyDownDialogInput=function(t,e){var n,i;return 13===t.keyCode&&(t.preventDefault(),n=e.getAttribute("name"),i=this.getDialog(n),this.setAttribute(i)),27===t.keyCode?(t.preventDefault(),this.hideDialog()):void 0},s.prototype.updateActions=function(t){return this.actions=t,this.refreshActionButtons()},s.prototype.refreshActionButtons=function(){return this.eachActionButton(function(t){return function(e,n){return e.disabled=!1===t.actions[n]}}(this))},s.prototype.eachActionButton=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.element.querySelectorAll(a)).length;i>n;n++)e=r[n],o.push(t(e,d(e)));return o},s.prototype.updateAttributes=function(t){return this.attributes=t,this.refreshAttributeButtons()},s.prototype.refreshAttributeButtons=function(){return this.eachAttributeButton(function(t){return function(e,n){return e.disabled=!1===t.attributes[n],t.attributes[n]||t.dialogIsVisible(n)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))}}(this))},s.prototype.eachAttributeButton=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.element.querySelectorAll(c)).length;i>n;n++)e=r[n],o.push(t(e,f(e)));return o},s.prototype.applyKeyboardCommand=function(t){var e,i,r,o,s,a;for(o=JSON.stringify(t.sort()),r=0,s=(a=this.element.querySelectorAll("[data-trix-key]")).length;s>r;r++)if(i=(e=a[r]).getAttribute("data-trix-key").split("+"),JSON.stringify(i.sort())===o)return n("mousedown",{onElement:e}),!0;return!1},s.prototype.dialogIsVisible=function(t){var e;return(e=this.getDialog(t))?e.hasAttribute("data-trix-active"):void 0},s.prototype.toggleDialog=function(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)}
2,s.prototype.showDialog=function(t){var e,n,i,r,o,s,a,u,c;for(this.hideDialog(),null!=(s=this.delegate)&&s.toolbarWillShowDialog(),(n=this.getDialog(t)).setAttribute("data-trix-active",""),n.classList.add("trix-active"),i=0,o=(a=n.querySelectorAll("input[disabled]")).length;o>i;i++)a[i].removeAttribute("disabled");return(e=f(n))&&(r=m(n,t))&&(r.value=null!=(u=this.attributes[e])?u:"",r.select()),null!=(c=this.delegate)?c.toolbarDidShowDialog(t):void 0},s.prototype.setAttribute=function(t){var e,n,i;return e=f(t),(n=m(t,e)).willValidate&&!n.checkValidity()?(n.setAttribute("data-trix-validate",""),n.classList.add("trix-validate"),n.focus()):(null!=(i=this.delegate)&&i.toolbarDidUpdateAttribute(e,n.value),this.hideDialog())},s.prototype.removeAttribute=function(t){var e,n;return e=f(t),null!=(n=this.delegate)&&n.toolbarDidRemoveAttribute(e),this.hideDialog()},s.prototype.hideDialog=function(){var t,e;return(t=this.element.querySelector(u))?(t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"),this.resetDialogInputs(),null!=(e=this.delegate)?e.toolbarDidHideDialog(g(t)):void 0):void 0},s.prototype.resetDialogInputs=function(){var t,e,n,i,r;for(r=[],t=0,n=(i=this.element.querySelectorAll(p)).length;n>t;t++)(e=i[t]).setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),r.push(e.classList.remove("trix-validate"));return r},s.prototype.getDialog=function(t){return this.element.querySelector("[data-trix-dialog="+t+"]")},m=function(t,e){return null==e&&(e=f(t)),t.querySelector("[data-trix-input][name='"+e+"']")},d=function(t){return t.getAttribute("data-trix-action")},f=function(t){var e;return null!=(e=t.getAttribute("data-trix-attribute"))?e:t.getAttribute("data-trix-dialog-attribute")},g=function(t){return t.getAttribute("data-trix-dialog")},s}(o.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.ImagePreloadOperation=function(e){function n(t){this.url=t}return t(n,e),n.prototype.perform=function(t){var e;return(e=new Image).onload=function(n){return function(){return e.width=n.width=e.naturalWidth,e.height=n.height=e.naturalHeight,t(!0,e)}}(this),e.onerror=function(){return t(!1)},e.src=this.url},n}(o.Operation)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Attachment=function(e){function n(t){null==t&&(t={}),this.releaseFile=function(t,e){return function(){return t.apply(e,arguments)}}(this.releaseFile,this),n.__super__.constructor.apply(this,arguments),this.attributes=o.Hash.box(t),this.didChangeAttributes()}return t(n,e),n.previewablePattern=/^image(\/(gif|png|jpe?g)|$)/,n.attachmentForFile=function(t){var e;return(e=new this(this.attributesForFile(t))).setFile(t),e},n.attributesForFile=function(t){return new o.Hash({filename:t.name,filesize:t.size,contentType:t.type})},n.fromJSON=function(t){return new this(t)},n.prototype.getAttribute=function(t){return this.attributes.get(t)},n.prototype.hasAttribute=function(t){return this.attributes.has(t)},n.prototype.getAttributes=function(){return this.attributes.toObject()},n.prototype.setAttributes=function(t){var e,n,i;return null==t&&(t={}),e=this.attributes.merge(t),this.attributes.isEqualTo(e)?void 0:(this.attributes=e,this.didChangeAttributes(),null!=(n=this.previewDelegate)&&"function"==typeof n.attachmentDidChangeAttributes&&n.attachmentDidChangeAttributes(this),null!=(i=this.delegate)&&"function"==typeof i.attachmentDidChangeAttributes?i.attachmentDidChangeAttributes(this):void 0)},n.prototype.didChangeAttributes=function(){return this.isPreviewable()?this.preloadURL():void 0},n.prototype.isPending=function(){return null!=this.file&&!(this.getURL()||this.getHref())},n.prototype.isPreviewable=function(){return this.attributes.has("previewable")?this.attributes.get("previewable"):this.constructor.previewablePattern.test(this.getContentType())},n.prototype.getType=function(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"},n.prototype.getURL=function(){return this.attributes.get("url")},n.prototype.getHref=function(){return this.attributes.get("href")},n.prototype.getFilename=function(){var t;return null!=(t=this.attributes.get("filename"))?t:""},n.prototype.getFilesize=function(){return this.attributes.get("filesize")},n.prototype.getFormattedFilesize=function(){var t;
2return"number"==typeof(t=this.attributes.get("filesize"))?o.config.fileSize.formatter(t):""},n.prototype.getExtension=function(){var t;return null!=(t=this.getFilename().match(/\.(\w+)$/))?t[1].toLowerCase():void 0},n.prototype.getContentType=function(){return this.attributes.get("contentType")},n.prototype.hasContent=function(){return this.attributes.has("content")},n.prototype.getContent=function(){return this.attributes.get("content")},n.prototype.getWidth=function(){return this.attributes.get("width")},n.prototype.getHeight=function(){return this.attributes.get("height")},n.prototype.getFile=function(){return this.file},n.prototype.setFile=function(t){return this.file=t,this.isPreviewable()?this.preloadFile():void 0},n.prototype.releaseFile=function(){return this.releasePreloadedFile(),this.file=null},n.prototype.getUploadProgress=function(){var t;return null!=(t=this.uploadProgress)?t:0},n.prototype.setUploadProgress=function(t){var e;return this.uploadProgress!==t?(this.uploadProgress=t,null!=(e=this.uploadProgressDelegate)&&"function"==typeof e.attachmentDidChangeUploadProgress?e.attachmentDidChangeUploadProgress(this):void 0):void 0},n.prototype.toJSON=function(){return this.getAttributes()},n.prototype.getCacheKey=function(){return[n.__super__.getCacheKey.apply(this,arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")},n.prototype.getPreviewURL=function(){return this.previewURL||this.preloadingURL},n.prototype.setPreviewURL=function(t){var e,n;return t!==this.getPreviewURL()?(this.previewURL=t,null!=(e=this.previewDelegate)&&"function"==typeof e.attachmentDidChangeAttributes&&e.attachmentDidChangeAttributes(this),null!=(n=this.delegate)&&"function"==typeof n.attachmentDidChangePreviewURL?n.attachmentDidChangePreviewURL(this):void 0):void 0},n.prototype.preloadURL=function(){return this.preload(this.getURL(),this.releaseFile)},n.prototype.preloadFile=function(){return this.file?(this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)):void 0},n.prototype.releasePreloadedFile=function(){return this.fileObjectURL?(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null):void 0},n.prototype.preload=function(t,e){return t&&t!==this.getPreviewURL()?(this.preloadingURL=t,new o.ImagePreloadOperation(t).then(function(n){return function(i){var r,o;return o=i.width,r=i.height,n.getWidth()&&n.getHeight()||n.setAttributes({width:o,height:r}),n.preloadingURL=null,n.setPreviewURL(t),"function"==typeof e?e():void 0}}(this)).catch(function(t){return function(){return t.preloadingURL=null,"function"==typeof e?e():void 0}}(this))):void 0},n}(o.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Piece=function(e){function n(t,e){null==e&&(e={}),n.__super__.constructor.apply(this,arguments),this.attributes=o.Hash.box(e)}return t(n,e),n.types={},n.registerType=function(t,e){return e.type=t,this.types[t]=e},n.fromJSON=function(t){var e;return(e=this.types[t.type])?e.fromJSON(t):void 0},n.prototype.copyWithAttributes=function(t){return new this.constructor(this.getValue(),t)},n.prototype.copyWithAdditionalAttributes=function(t){return this.copyWithAttributes(this.attributes.merge(t))},n.prototype.copyWithoutAttribute=function(t){return this.copyWithAttributes(this.attributes.remove(t))},n.prototype.copy=function(){return this.copyWithAttributes(this.attributes)},n.prototype.getAttribute=function(t){return this.attributes.get(t)},n.prototype.getAttributesHash=function(){return this.attributes},n.prototype.getAttributes=function(){return this.attributes.toObject()},n.prototype.getCommonAttributes=function(){var t,e,n;return(n=pieceList.getPieceAtIndex(0))?(t=n.attributes,e=t.getKeys(),pieceList.eachPiece((function(n){return e=t.getKeysCommonToHash(n.attributes),t=t.slice(e)})),t.toObject()):{}},n.prototype.hasAttribute=function(t){return this.attributes.has(t)},n.prototype.hasSameStringValueAsPiece=function(t){return null!=t&&this.toString()===t.toString()},n.prototype.hasSameAttributesAsPiece=function(t){return null!=t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))},n.prototype.isBlockBreak=function(){return!1},n.prototype.isEqualTo=function(t){return n.__super__.isEqualTo.apply(this,arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)},n.prototype.isEmpty=function(){return 0===this.length},n.prototype.isSerializable=function(){return!0},n.prototype.toJSON=function(){return{type:this.constructor.type,attributes:this.getAttributes()}},n.prototype.contentsForInspection=function(){return{type:this.constructor.type,attributes:this.attributes.inspect()}},n.prototype.canBeGrouped=function(){return this.hasAttribute("href")},n.prototype.canBeGroupedWith=function(t){return this.getAttribute("href")===t.getAttribute("href")},n.prototype.getLength=function(){return this.length},n.prototype.canBeConsolidatedWith=function(){return!1},n}(o.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Piece.registerType("attachment",o.AttachmentPiece=function(e){function n(t){this.attachment=t,n.__super__.constructor.apply(this,arguments),this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}return t(n,e),n.fromJSON=function(t){return new this(o.Attachment.fromJSON(t.attachment),t.attributes)},n.permittedAttributes=["caption","presentation"],n.prototype.ensureAttachmentExclusivelyHasAttribute=function(t){return this.hasAttribute(t)?(this.attachment.hasAttribute(t)||this.attachment.setAttributes(this.attributes.slice(t)),this.attributes=this.attributes.remove(t)):void 0},n.prototype.removeProhibitedAttributes=function(){var t;return(t=this.attributes.slice(this.constructor.permittedAttributes)).isEqualTo(this.attributes)?void 0:this.attributes=t},n.prototype.getValue=function(){return this.attachment},n.prototype.isSerializable=function(){return!this.attachment.isPending()},n.prototype.getCaption=function(){var t;return null!=(t=this.attributes.get("caption"))?t:""},n.prototype.isEqualTo=function(t){var e;return n.__super__.isEqualTo.apply(this,arguments)&&this.attachment.id===(null!=t&&null!=(e=t.attachment)?e.id:void 0)},n.prototype.toString=function(){return o.OBJECT_REPLACEMENT_CHARACTER},n.prototype.toJSON=function(){var t;return(t=n.__super__.toJSON.apply(this,arguments)).attachment=this.attachment,t},n.prototype.getCacheKey=function(){return[n.__super__.getCacheKey.apply(this,arguments),this.attachment.getCacheKey()].join("/")},n.prototype.toConsole=function(){return JSON.stringify(this.toString())},n}(o.Piece))}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=o.normalizeNewlines,o.Piece.registerType("string",o.StringPiece=function(n){function i(e){i.__super__.constructor.apply(this,arguments),this.string=t(e),this.length=this.string.length}return e(i,n),i.fromJSON=function(t){return new this(t.string,t.attributes)},i.prototype.getValue=function(){return this.string},i.prototype.toString=function(){return this.string.toString()},i.prototype.isBlockBreak=function(){return"\n"===this.toString()&&!0===this.getAttribute("blockBreak")},i.prototype.toJSON=function(){var t;
2return(t=i.__super__.toJSON.apply(this,arguments)).string=this.string,t},i.prototype.canBeConsolidatedWith=function(t){return null!=t&&this.hasSameConstructorAs(t)&&this.hasSameAttributesAsPiece(t)},i.prototype.consolidateWith=function(t){return new this.constructor(this.toString()+t.toString(),this.attributes)},i.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.length?(e=this,n=null):(e=new this.constructor(this.string.slice(0,t),this.attributes),n=new this.constructor(this.string.slice(t),this.attributes)),[e,n]},i.prototype.toConsole=function(){var t;return(t=this.string).length>15&&(t=t.slice(0,14)+"\u2026"),JSON.stringify(t.toString())},i}(o.Piece))}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty,i=[].slice;t=o.spliceArray,o.SplittableList=function(n){function r(t){null==t&&(t=[]),r.__super__.constructor.apply(this,arguments),this.objects=t.slice(0),this.length=this.objects.length}var o,s,a;return e(r,n),r.box=function(t){return t instanceof this?t:new this(t)},r.prototype.indexOf=function(t){return this.objects.indexOf(t)},r.prototype.splice=function(){var e;return e=1<=arguments.length?i.call(arguments,0):[],new this.constructor(t.apply(null,[this.objects].concat(i.call(e))))},r.prototype.eachObject=function(t){var e,n,i,r,o,s;for(s=[],n=e=0,i=(o=this.objects).length;i>e;n=++e)r=o[n],s.push(t(r,n));return s},r.prototype.insertObjectAtIndex=function(t,e){return this.splice(e,0,t)},r.prototype.insertSplittableListAtIndex=function(t,e){return this.splice.apply(this,[e,0].concat(i.call(t.objects)))},r.prototype.insertSplittableListAtPosition=function(t,e){var n,i,r;return i=(r=this.splitObjectAtPosition(e))[0],n=r[1],new this.constructor(i).insertSplittableListAtIndex(t,n)},r.prototype.editObjectAtIndex=function(t,e){return this.replaceObjectAtIndex(e(this.objects[t]),t)},r.prototype.replaceObjectAtIndex=function(t,e){return this.splice(e,1,t)},r.prototype.removeObjectAtIndex=function(t){return this.splice(t,1)},r.prototype.getObjectAtIndex=function(t){return this.objects[t]},r.prototype.getSplittableListInRange=function(t){var e,n,i,r;return n=(i=this.splitObjectsAtRange(t))[0],e=i[1],r=i[2],new this.constructor(n.slice(e,r+1))},r.prototype.selectSplittableList=function(t){var e,n;return n=function(){var n,i,r,o;for(o=[],n=0,i=(r=this.objects).length;i>n;n++)e=r[n],t(e)&&o.push(e);return o}.call(this),new this.constructor(n)},r.prototype.removeObjectsInRange=function(t){var e,n,i,r;return n=(i=this.splitObjectsAtRange(t))[0],e=i[1],r=i[2],new this.constructor(n).splice(e,r-e+1)},r.prototype.transformObjectsInRange=function(t,e){var n,i,r,o,s,a,u;return s=this.splitObjectsAtRange(t),o=s[0],i=s[1],a=s[2],u=function(){var t,s,u;for(u=[],n=t=0,s=o.length;s>t;n=++t)r=o[n],u.push(n>=i&&a>=n?e(r):r);return u}(),new this.constructor(u)},r.prototype.splitObjectsAtRange=function(t){var e,n,i,r,s;return n=(r=this.splitObjectAtPosition(a(t)))[0],e=r[1],i=r[2],[n=(s=new this.constructor(n).splitObjectAtPosition(o(t)+i))[0],e,s[1]-1]},r.prototype.getObjectAtPosition=function(t){var e,n;return e=(n=this.findIndexAndOffsetAtPosition(t)).index,n.offset,this.objects[e]},r.prototype.splitObjectAtPosition=function(t){var e,n,i,r,o,s,a,u,c;return e=(o=this.findIndexAndOffsetAtPosition(t)).index,r=o.offset,i=this.objects.slice(0),null!=e?0===r?(u=e,c=0):(n=(s=this.getObjectAtIndex(e).splitAtOffset(r))[0],a=s[1],i.splice(e,1,n,a),u=e+1,c=n.getLength()-r):(u=i.length,c=0),[i,u,c]},r.prototype.consolidate=function(){var t,e,n,i,r,o;for(i=[],r=this.objects[0],t=0,e=(o=this.objects.slice(1)).length;e>t;t++)n=o[t],("function"==typeof r.canBeConsolidatedWith?r.canBeConsolidatedWith(n):void 0)?r=r.consolidateWith(n):(i.push(r),r=n);return null!=r&&i.push(r),new this.constructor(i)},r.prototype.consolidateFromIndexToIndex=function(t,e){var n,r;return r=this.objects.slice(0).slice(t,e+1),n=new this.constructor(r).consolidate().toArray(),this.splice.apply(this,[t,r.length].concat(i.call(n)))},r.prototype.findIndexAndOffsetAtPosition=function(t){var e,n,i,r,o,s;for(e=0,i=n=0,r=(s=this.objects).length;r>n;i=++n){if(o=e+s[i].getLength(),t>=e&&o>t)return{index:i,offset:t-e};e=o}return{index:null,offset:null}},r.prototype.findPositionAtIndexAndOffset=function(t,e){var n,i,r,o,s,a;for(s=0,n=i=0,r=(a=this.objects).length;r>i;n=++i)if(o=a[n],t>n)s+=o.getLength();else if(n===t){s+=e;break}return s},r.prototype.getEndPosition=function(){var t,e;return null!=this.endPosition?this.endPosition:this.endPosition=function(){var n,i,r;for(e=0,n=0,i=(r=this.objects).length;i>n;n++)t=r[n],e+=t.getLength();return e}.call(this)},r.prototype.toString=function(){return this.objects.join("")},r.prototype.toArray=function(){return this.objects.slice(0)},r.prototype.toJSON=function(){return this.toArray()},r.prototype.isEqualTo=function(t){return r.__super__.isEqualTo.apply(this,arguments)||s(this.objects,null!=t?t.objects:void 0)},s=function(t,e){var n,i,r,o,s;if(null==e&&(e=[]),t.length!==e.length)return!1;for(s=!0,i=n=0,r=t.length;r>n;i=++n)o=t[i],s&&!o.isEqualTo(e[i])&&(s=!1);return s},r.prototype.contentsForInspection=function(){var t;return{objects:"["+function(){var e,n,i,r;for(r=[],e=0,n=(i=this.objects).length;n>e;e++)t=i[e],r.push(t.inspect());return r}.call(this).join(", ")+"]"}},a=function(t){return t[0]},o=function(t){return t[1]},r}(o.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.Text=function(e){function n(t){var e;null==t&&(t=[]),n.__super__.constructor.apply(this,arguments),this.pieceList=new o.SplittableList(function(){var n,i,r;for(r=[],n=0,i=t.length;i>n;n++)(e=t[n]).isEmpty()||r.push(e);return r}())}return t(n,e),n.textForAttachmentWithAttributes=function(t,e){return new this([new o.AttachmentPiece(t,e)])},n.textForStringWithAttributes=function(t,e){return new this([new o.StringPiece(t,e)])},n.fromJSON=function(t){var e;return new this(function(){var n,i,r;for(r=[],n=0,i=t.length;i>n;n++)e=t[n],r.push(o.Piece.fromJSON(e));return r}())},n.prototype.copy=function(){return this.copyWithPieceList(this.pieceList)},n.prototype.copyWithPieceList=function(t){return new this.constructor(t.consolidate().toArray())},n.prototype.copyUsingObjectMap=function(t){var e,n;return n=function(){var n,i,r,o,s;for(s=[],n=0,i=(r=this.getPieces()).length;i>n;n++)e=r[n],s.push(null!=(o=t.find(e))?o:e);return s}.call(this),new this.constructor(n)},n.prototype.appendText=function(t){return this.insertTextAtPosition(t,this.getLength())},n.prototype.insertTextAtPosition=function(t,e){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList,e))},n.prototype.removeTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t))},n.prototype.replaceTextAtRange=function(t,e){return this.removeTextAtRange(e).insertTextAtPosition(t,e[0])},n.prototype.moveTextFromRangeToPosition=function(t,e){var n,i;if(!(t[0]<=e&&e<=t[1]))return n=(i=this.getTextAtRange(t)).getLength(),t[0]<e&&(e-=n),this.removeTextAtRange(t).insertTextAtPosition(i,e)},n.prototype.addAttributeAtRange=function(t,e,n){var i;return(i={})[t]=e,this.addAttributesAtRange(i,n)},n.prototype.addAttributesAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithAdditionalAttributes(t)})))},n.prototype.removeAttributeAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithoutAttribute(t)})))},n.prototype.setAttributesAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithAttributes(t)})))},n.prototype.getAttributesAtPosition=function(t){var e,n;return null!=(e=null!=(n=this.pieceList.getObjectAtPosition(t))?n.getAttributes():void 0)?e:{}},n.prototype.getCommonAttributes=function(){var t,e;return t=function(){var t,n,i,r;for(r=[],t=0,n=(i=this.pieceList.toArray()).length;n>t;t++)e=i[t],r.push(e.getAttributes());return r}.call(this),o.Hash.fromCommonAttributesOfObjects(t).toObject()},n.prototype.getCommonAttributesAtRange=function(t){var e;return null!=(e=this.getTextAtRange(t).getCommonAttributes())?e:{}},n.prototype.getExpandedRangeForAttributeAtOffset=function(t,e){var n,i,r;for(n=r=e,i=this.getLength();n>0&&this.getCommonAttributesAtRange([n-1,r])[t];)n--;for(;i>r&&this.getCommonAttributesAtRange([e,r+1])[t];)r++;return[n,r]},n.prototype.getTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.getSplittableListInRange(t))},n.prototype.getStringAtRange=function(t){return this.pieceList.getSplittableListInRange(t).toString()}
2,n.prototype.getStringAtPosition=function(t){return this.getStringAtRange([t,t+1])},n.prototype.startsWithString=function(t){return this.getStringAtRange([0,t.length])===t},n.prototype.endsWithString=function(t){var e;return e=this.getLength(),this.getStringAtRange([e-t.length,e])===t},n.prototype.getAttachmentPieces=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.pieceList.toArray()).length;e>t;t++)null!=(n=i[t]).attachment&&r.push(n);return r},n.prototype.getAttachments=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.getAttachmentPieces()).length;e>t;t++)n=i[t],r.push(n.attachment);return r},n.prototype.getAttachmentAndPositionById=function(t){var e,n,i,r,o,s;for(r=0,e=0,n=(o=this.pieceList.toArray()).length;n>e;e++){if((null!=(s=(i=o[e]).attachment)?s.id:void 0)===t)return{attachment:i.attachment,position:r};r+=i.length}return{attachment:null,position:null}},n.prototype.getAttachmentById=function(t){var e,n;return e=(n=this.getAttachmentAndPositionById(t)).attachment,n.position,e},n.prototype.getRangeOfAttachment=function(t){var e,n;return t=(n=this.getAttachmentAndPositionById(t.id)).attachment,e=n.position,null!=t?[e,e+1]:void 0},n.prototype.updateAttributesForAttachment=function(t,e){var n;return(n=this.getRangeOfAttachment(e))?this.addAttributesAtRange(t,n):this},n.prototype.getLength=function(){return this.pieceList.getEndPosition()},n.prototype.isEmpty=function(){return 0===this.getLength()},n.prototype.isEqualTo=function(t){var e;return n.__super__.isEqualTo.apply(this,arguments)||(null!=t&&null!=(e=t.pieceList)?e.isEqualTo(this.pieceList):void 0)},n.prototype.isBlockBreak=function(){return 1===this.getLength()&&this.pieceList.getObjectAtIndex(0).isBlockBreak()},n.prototype.eachPiece=function(t){return this.pieceList.eachObject(t)},n.prototype.getPieces=function(){return this.pieceList.toArray()},n.prototype.getPieceAtPosition=function(t){return this.pieceList.getObjectAtPosition(t)},n.prototype.contentsForInspection=function(){return{pieceList:this.pieceList.inspect()}},n.prototype.toSerializableText=function(){var t;return t=this.pieceList.selectSplittableList((function(t){return t.isSerializable()})),this.copyWithPieceList(t)},n.prototype.toString=function(){return this.pieceList.toString()},n.prototype.toJSON=function(){return this.pieceList.toJSON()},n.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,r;for(r=[],e=0,n=(i=this.pieceList.toArray()).length;n>e;e++)t=i[e],r.push(JSON.parse(t.toConsole()));return r}.call(this))},n.prototype.getDirection=function(){return o.getDirection(this.toString())},n.prototype.isRTL=function(){return"rtl"===this.getDirection()},n}(o.Object)}.call(this),function(){var t,e,n,i,r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},u=[].slice;t=o.arraysAreEqual,i=o.spliceArray,e=o.getBlockConfig,o.getBlockAttributeNames,n=o.getListAttributeNames,o.Block=function(s){function c(t,e){null==t&&(t=new o.Text),null==e&&(e=[]),c.__super__.constructor.apply(this,arguments),this.text=p(t),this.attributes=e}var l,p,h,d,f,g,m,y,v;return r(c,s),c.fromJSON=function(t){return new this(o.Text.fromJSON(t.text),t.attributes)},c.prototype.isEmpty=function(){return this.text.isBlockBreak()},c.prototype.isEqualTo=function(e){return c.__super__.isEqualTo.apply(this,arguments)||this.text.isEqualTo(null!=e?e.text:void 0)&&t(this.attributes,null!=e?e.attributes:void 0)},c.prototype.copyWithText=function(t){return new this.constructor(t,this.attributes)},c.prototype.copyWithoutText=function(){return this.copyWithText(null)},c.prototype.copyWithAttributes=function(t){return new this.constructor(this.text,t)},c.prototype.copyWithoutAttributes=function(){return this.copyWithAttributes(null)},c.prototype.copyUsingObjectMap=function(t){var e;return this.copyWithText((e=t.find(this.text))?e:this.text.copyUsingObjectMap(t))},c.prototype.addAttribute=function(t){var e;return e=this.attributes.concat(d(t)),this.copyWithAttributes(e)},c.prototype.removeAttribute=function(t){var n,i;return i=e(t).listAttribute,n=g(g(this.attributes,t),i),this.copyWithAttributes(n)},c.prototype.removeLastAttribute=function(){return this.removeAttribute(this.getLastAttribute())},c.prototype.getLastAttribute=function(){return f(this.attributes)},c.prototype.getAttributes=function(){return this.attributes.slice(0)},c.prototype.getAttributeLevel=function(){return this.attributes.length},c.prototype.getAttributeAtLevel=function(t){return this.attributes[t-1]},c.prototype.hasAttribute=function(t){return a.call(this.attributes,t)>=0},c.prototype.hasAttributes=function(){return this.getAttributeLevel()>0},c.prototype.getLastNestableAttribute=function(){return f(this.getNestableAttributes())},c.prototype.getNestableAttributes=function(){var t,n,i,r,o;for(o=[],n=0,i=(r=this.attributes).length;i>n;n++)t=r[n],e(t).nestable&&o.push(t);return o},c.prototype.getNestingLevel=function(){return this.getNestableAttributes().length},c.prototype.decreaseNestingLevel=function(){var t;return(t=this.getLastNestableAttribute())?this.removeAttribute(t):this},c.prototype.increaseNestingLevel=function(){var t,e,n;return(t=this.getLastNestableAttribute())?(n=this.attributes.lastIndexOf(t),e=i.apply(null,[this.attributes,n+1,0].c
2oncat(u.call(d(t)))),this.copyWithAttributes(e)):this},c.prototype.getListItemAttributes=function(){var t,n,i,r,o;for(o=[],n=0,i=(r=this.attributes).length;i>n;n++)t=r[n],e(t).listAttribute&&o.push(t);return o},c.prototype.isListItem=function(){var t;return null!=(t=e(this.getLastAttribute()))?t.listAttribute:void 0},c.prototype.isTerminalBlock=function(){var t;return null!=(t=e(this.getLastAttribute()))?t.terminal:void 0},c.prototype.breaksOnReturn=function(){var t;return null!=(t=e(this.getLastAttribute()))?t.breakOnReturn:void 0},c.prototype.findLineBreakInDirectionFromPosition=function(t,e){var n,i;return i=this.toString(),-1!==(n=function(){switch(t){case"forward":return i.indexOf("\n",e);case"backward":return i.slice(0,e).lastIndexOf("\n")}}())?n:void 0},c.prototype.contentsForInspection=function(){return{text:this.text.inspect(),attributes:this.attributes}},c.prototype.toString=function(){return this.text.toString()},c.prototype.toJSON=function(){return{text:this.text,attributes:this.attributes}},c.prototype.getDirection=function(){return this.text.getDirection()},c.prototype.isRTL=function(){return this.text.isRTL()},c.prototype.getLength=function(){return this.text.getLength()},c.prototype.canBeConsolidatedWith=function(t){return!this.hasAttributes()&&!t.hasAttributes()&&this.getDirection()===t.getDirection()},c.prototype.consolidateWith=function(t){var e,n;return e=o.Text.textForStringWithAttributes("\n"),n=this.getTextWithoutBlockBreak().appendText(e),this.copyWithText(n.appendText(t.text))},c.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.getLength()?(e=this,n=null):(e=this.copyWithText(this.text.getTextAtRange([0,t])),n=this.copyWithText(this.text.getTextAtRange([t,this.getLength()]))),[e,n]},c.prototype.getBlockBreakPosition=function(){return this.text.getLength()-1},c.prototype.getTextWithoutBlockBreak=function(){return m(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()},c.prototype.canBeGrouped=function(t){return this.attributes[t]},c.prototype.canBeGroupedWith=function(t,i){var r,o,s,u;return o=(s=t.getAttributes())[i],!((r=this.attributes[i])!==o||!1===e(r).group&&(u=s[i+1],a.call(n(),u)<0)||this.getDirection()!==t.getDirection()&&!t.isEmpty())},p=function(t){return t=v(t),l(t)},v=function(t){var e,n,i,r,s,a;return r=!1,a=t.getPieces(),n=2<=a.length?u.call(a,0,e=a.length-1):(e=0,[]),null==(i=a[e++])?t:(n=function(){var t,e,i;for(i=[],t=0,e=n.length;e>t;
2t++)(s=n[t]).isBlockBreak()?(r=!0,i.push(y(s))):i.push(s);return i}(),r?new o.Text(u.call(n).concat([i])):t)},h=o.Text.textForStringWithAttributes("\n",{blockBreak:!0}),l=function(t){return m(t)?t:t.appendText(h)},m=function(t){var e;return 0!==(e=t.getLength())&&t.getTextAtRange([e-1,e]).isBlockBreak()},y=function(t){return t.copyWithoutAttribute("blockBreak")},d=function(t){var n;return null!=(n=e(t).listAttribute)?[n,t]:[t]},f=function(t){return t.slice(-1)[0]},g=function(t,e){var n;return-1===(n=t.lastIndexOf(e))?t:i(t,n,1)},c}(o.Object)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty,s=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=[].slice;e=o.tagName,n=o.walkTree,t=o.nodeIsAttachmentElement,o.HTMLSanitizer=function(r){function u(t,e){var n;n=null!=e?e:{},this.allowedAttributes=n.allowedAttributes,this.forbiddenProtocols=n.forbiddenProtocols,this.forbiddenElements=n.forbiddenElements,null==this.allowedAttributes&&(this.allowedAttributes=c),null==this.forbiddenProtocols&&(this.forbiddenProtocols=p),null==this.forbiddenElements&&(this.forbiddenElements=l),this.body=h(t)}var c,l,p,h;return i(u,r),c="style href src width height class".split(" "),p="javascript:".split(" "),l="script iframe".split(" "),u.sanitize=function(t,e){var n;return(n=new this(t,e)).sanitize(),n},u.prototype.sanitize=function(){return this.sanitizeElements(),this.normalizeListElementNesting()},u.prototype.getHTML=function(){return this.body.innerHTML},u.prototype.getBody=function(){return this.body},u.prototype.sanitizeElements=function(){var t,e,i,r,s;for(s=n(this.body),r=[];s.nextNode();)switch(i=s.currentNode,i.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(i)?r.push(i):this.sanitizeElement(i);break;case Node.COMMENT_NODE:r.push(i)}for(t=0,e=r.length;e>t;t++)i=r[t],o.removeNode(i);return this.body},u.prototype.sanitizeElement=function(t){var e,n,i,r,o;for(t.hasAttribute("href")&&(r=t.protocol,s.call(this.forbiddenProtocols,r)>=0&&t.removeAttribute("href")),e=0,n=(o=a.call(t.attributes)).length;n>e;e++)i=o[e].name,s.call(this.allowedAttributes,i)>=0||0===i.indexOf("data-trix")||t.removeAttribute(i);return t},u.prototype.normalizeListElementNesting=function(){var t,n,i,r,o;for(t=0,n=(o=a.call(this.body.querySelectorAll("ul,ol"))).length;n>t;t++)(r=(i=o[t]).previousElementSibling)&&"li"===e(r)&&r.appendChild(i);return this.body},u.prototype.elementIsRemovable=function(t){return(null!=t?t.nodeType:void 0)===Node.ELEMENT_NODE?this.elementIsForbidden(t)||this.elementIsntSerializable(t):void 0},u.prototype.elementIsForbidden=function(t){var n;return n=e(t),s.call(this.forbiddenElements,n)>=0}
2,u.prototype.elementIsntSerializable=function(e){return"false"===e.getAttribute("data-trix-serialize")&&!t(e)},h=function(t){var e,n,i,r,o;for(null==t&&(t=""),t=t.replace(/<\/html[^>]*>[^]*$/i,"</html>"),(e=document.implementation.createHTMLDocument("")).documentElement.innerHTML=t,i=0,r=(o=e.head.querySelectorAll("style")).length;r>i;i++)n=o[i],e.body.appendChild(n);return e.body},u}(o.BasicObject)}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p,h=function(t,e){function n(){this.constructor=t}for(var i in e)d.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},d={}.hasOwnProperty,f=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=o.arraysAreEqual,s=o.makeElement,l=o.tagName,r=o.getBlockTagNames,p=o.walkTree,i=o.findClosestElementFromNode,n=o.elementContainsNode,a=o.nodeIsAttachmentElement,u=o.normalizeSpaces,e=o.breakableWhitespacePattern,c=o.squishBreakableWhitespace,o.HTMLParser=function(d){function g(t,e){this.html=t,this.referenceElement=(null!=e?e:{}).referenceElement,this.blocks=[],this.blockElements=[],this.processedElements=[]}var m,y,v,b,A,w,x,C,E,S,k,R;return h(g,d),g.parse=function(t,e){var n;return(n=new this(t,e)).parse(),n},g.prototype.getDocument=function(){return o.Document.fromJSON(this.blocks)},g.prototype.parse=function(){var t,e;try{for(this.createHiddenContainer(),t=o.HTMLSanitizer.sanitize(this.html).getHTML(),this.containerElement.innerHTML=t,e=p(this.containerElement,{usingFilter:x});e.nextNode();)this.processNode(e.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}},g.prototype.createHiddenContainer=function(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=s({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))},g.prototype.removeHiddenContainer=function(){return o.removeNode(this.containerElement)},x=function(t){return"style"===l(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},g.prototype.processNode=function(t){switch(t.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(t))return this.appendBlockForTextNode(t),this.processTextNode(t);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}},g.prototype.appendBlockForTextNode=function(e){var n,i,r;return(i=e.parentNode)===this.currentBlockElement&&this.isBlockElement(e.previousSibling)?this.appendStringWithAttributes("\n"):i!==this.containerElement&&!this.isBlockElement(i)||(n=this.getBlockAttributes(i),t(n,null!=(r=this.currentBlock)?r.attributes:void 0))?void 0:(this.currentBlock=this.appendBlockForAttributesWithElement(n,i),this.currentBlockElement=i)},g.prototype.appendBlockForElement=function(e){var i,r,o,s;if(o=this.isBlockElement(e),r=n(this.currentBlockElement,e),o&&!this.isBlockElement(e.firstChild)){if((!this.isInsignificantTextNode(e.firstChild)||!this.isBlockElement(e.firstElementChild))&&(i=this.getBlockAttributes(e),e.firstChild))return r&&t(i,this.currentBlock.attributes)?this.appendStringWithAttributes("\n"):(this.currentBlock=this.appendBlockForAttributesWithElement(i,e),this.currentBlockElement=e)}else if(this.currentBlockElement&&!r&&!o)return(s=this.findParentBlockElement(e))?this.appendBlockForElement(s):(this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null)},g.prototype.findParentBlockElement=function(t){var e;for(e=t.parentElement;e&&e!==this.containerElement;){if(this.isBlockElement(e)&&f.call(this.blockElements,e)>=0)return e;e=e.parentElement}return null},g.prototype.processTextNode=function(t){var e,n;return n=t.data,y(t.parentNode)||(n=c(n),k(null!=(e=t.previousSibling)?e.textContent:void 0)&&(n=A(n))),this.appendStringWithAttributes(n,this.getTextAttributes(t.parentNode))},g.prototype.processElement=function(t){var e,n,i,r,o;
2if(a(t))return e=C(t,"attachment"),Object.keys(e).length&&(r=this.getTextAttributes(t),this.appendAttachmentWithAttributes(e,r),t.innerHTML=""),this.processedElements.push(t);switch(l(t)){case"br":return this.isExtraBR(t)||this.isBlockElement(t.nextSibling)||this.appendStringWithAttributes("\n",this.getTextAttributes(t)),this.processedElements.push(t);case"img":for(n in e={url:t.getAttribute("src"),contentType:"image"},i=b(t))o=i[n],e[n]=o;return this.appendAttachmentWithAttributes(e,this.getTextAttributes(t)),this.processedElements.push(t);case"tr":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes("\n");break;case"td":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes(" | ")}},g.prototype.appendBlockForAttributesWithElement=function(t,e){var n;return this.blockElements.push(e),n=m(t),this.blocks.push(n),n},g.prototype.appendEmptyBlock=function(){return this.appendBlockForAttributesWithElement([],null)},g.prototype.appendStringWithAttributes=function(t,e){return this.appendPiece(S(t,e))},g.prototype.appendAttachmentWithAttributes=function(t,e){return this.appendPiece(E(t,e))},g.prototype.appendPiece=function(t){return 0===this.blocks.length&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)},g.prototype.appendStringToTextAtIndex=function(t,e){var n,i;return"string"===(null!=(n=(i=this.blocks[e].text)[i.length-1])?n.type:void 0)?n.string+=t:i.push(S(t))},g.prototype.prependStringToTextAtIndex=function(t,e){var n,i;return"string"===(null!=(n=(i=this.blocks[e].text)[0])?n.type:void 0)?n.string=t+n.string:i.unshift(S(t))},S=function(t,e){return null==e&&(e={}),"string",{string:t=u(t),attributes:e,type:"string"}},E=function(t,e){return null==e&&(e={}),"attachment",{attachment:t,attributes:e,type:"attachment"}},m=function(t){return null==t&&(t={}),{text:[],attributes:t}},g.prototype.getTextAttributes=function(t){var e,n,r,s,u,c,l,p,h,d,f,g;for(e in r={},h=o.config.textAttributes)if((u=h[e]).tagName&&i(t,{matchingSelector:u.tagName,untilNode:this.containerElement}))r[e]=!0;else if(u.parser){if(g=u.parser(t)){for(n=!1,c=0,p=(d=this.findBlockElementAncestors(t)).length;p>c;c++)if(s=d[c],u.parser(s)===g){n=!0;break}n||(r[e]=g)}}else u.styleProperty&&(g=t.style[u.styleProperty])&&(r[e]=g);if(a(t))for(l in f=C(t,"attributes"))g=f[l],r[l]=g;return r},g.prototype.getBlockAttributes=function(t){var e,n,i,r;for(n=[];t&&t!==this.containerElement;){for(e in r=o.config.blockAttributes)!1!==(i=r[e]).parse&&l(t)===i.tagName&&(("function"==typeof i.test?i.test(t):void 0)||!i.test)&&(n.push(e),i.listAttribute&&n.push(i.listAttribute));t=t.parentNode}return n.reverse()},g.prototype.findBlockElementAncestors=function(t){var e,n;for(e=[];t&&t!==this.containerElement;)n=l(t),f.call(r(),n)>=0&&e.push(t),t=t.parentNode;return e},C=function(t,n){try{return JSON.parse(t.getAttribute("data-trix-"+n))}catch(e){return{}}},b=function(t){var e,n,i;return i=t.getAttribute("width"),n=t.getAttribute("height"),e={},i&&(e.width=parseInt(i,10)),n&&(e.height=parseInt(n,10)),e},g.prototype.isBlockElement=function(t){var e;if((null!=t?t.nodeType:void 0)===Node.ELEMENT_NODE&&!a(t)&&!i(t,{matchingSelector:"td",untilNode:this.containerElement}))return e=l(t),f.call(r(),e)>=0||"block"===window.getComputedStyle(t).display},g.prototype.isInsignificantTextNode=function(t){var e,n,i;if((null!=t?t.nodeType:void 0)===Node.TEXT_NODE&&R(t.data)&&(n=t.parentNode,i=t.previousSibling,e=t.nextSibling,(!w(n.previousSibling)||this.isBlockElement(n.previousSibling))&&!y(n)))return!i||this.isBlockElement(i)||!e||this.isBlockElement(e)},g.prototype.isExtraBR=function(t){return"br"===l(t)&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t},y=function(t){var e;return"pre"===(e=window.getComputedStyle(t).whiteSpace)||"pre-wrap"===e||"pre-line"===e},w=function(t){return t&&!k(t.textContent)},g.prototype.translateBlockElementMarginsToNewlines=function(){var t,e,n,i,r,o,s;for(t=this.getMarginOfDefaultBlockElement(),s=[],n=e=0,i=(o=this.blocks).length;i>e;n=++e)o[n],(r=this.getMarginOfBlockElementAtIndex(n))&&(r.top>2*t.top&&this.prependStringToTextAtIndex("\n",n),s.push(r.bottom>2*t.bottom?this.appendStringToTextAtIndex("\n",n):void 0));return s},g.prototype.getMarginOfBlockElementAtIndex=function(t){var e,n;return!(e=this.blockElements[t])||!e.textContent||(n=l(e),f.call(r(),n)>=0||f.call(this.processedElements,e)>=0)?void 0:v(e)},g.prototype.getMarginOfDefaultBlockElement=function(){var t;return t=s(o.config.blockAttributes.default.tagName),this.containerElement.appendChild(t),v(t)},v=function(t){var e;return"block"===(e=window.getComputedStyle(t)).display?{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}:void 0},A=function(t){return t.replace(RegExp("^"+e.source+"+"),"")},R=function(t){return RegExp("^"+e.source+"*$").test(t)},k=function(t){return/\s$/.test(t)},g}(o.BasicObject)}.call(this),function(){var t,e,n,i,r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=[].slice,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=o.arraysAreEqual,n=o.normalizeRange,i=o.rangeIsCollapsed,e=o.getBlockConfig,o.Document=function(s){function c(t){null==t&&(t=[]),c.__super__.constructor.apply(this,arguments),0===t.length&&(t=[new o.Block]),this.blockList=o.SplittableList.box(t)}var l;return r(c,s),c.fromJSON=function(t){var e,n;return n=function(){var n,i,r;for(r=[],n=0,i=t.length;i>n;n++)e=t[n],r.push(o.Block.fromJSON(e));return r}(),new this(n)},c.fromHTML=function(t,e){return o.HTMLParser.parse(t,e).getDocument()},c.fromString=function(t,e){var n;return n=o.Text.textForStringWithAttributes(t,e),new this([new o.Block(n)])},c.prototype.isEmpty=function(){var t;return 1===this.blockList.length&&((t=this.getBlockAtIndex(0)).isEmpty()&&!t.hasAttributes())},c.prototype.copy=function(t){var e;return null==t&&(t={}),e=t.consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray(),new this.constructor(e)},c.prototype.copyUsingObjectsFromDocument=function(t){var e;return e=new o.ObjectMap(t.getObjects()),this.copyUsingObjectMap(e)},c.prototype.copyUsingObjectMap=function(t){var e,n,i;return n=function(){var n,r,o,s;for(s=[],n=0,r=(o=this.getBlocks()).length;r>n;n++)e=o[n],s.push((i=t.find(e))?i:e.copyUsingObjectMap(t));return s}.call(this),new this.constructor(n)},c.prototype.copyWithBaseBlockAttributes=function(t){var e,n,i;return null==t&&(t=[]),i=function(){var i,r,o,s;for(s=[],i=0,r=(o=this.getBlocks()).length;r>i;i++)n=o[i],e=t.concat(n.getAttributes()),s.push(n.copyWithAttributes(e));return s}.call(this),new this.constructor(i)},c.prototype.replaceBlock=function(t,e){var n;return-1===(n=this.blockList.indexOf(t))?this:new this.constructor(this.blockList.replaceObjectAtIndex(e,n))},c.prototype.insertDocumentAtRange=function(t,e){var r,o,s,a,u,c,l;return o=t.blockList,u=(e=n(e))[0],s=(c=this.locationFromPosition(u)).index,a=c.offset,l=this,r=this.getBlockAtPosition(u),i(e)&&r.isEmpty()&&!r.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):r.getBlockBreakPosition()===a&&u++,l=l.removeTextAtRange(e),new this.constructor(l.blockList.insertSplittableListAtPosition(o,u))},c.prototype.mergeDocumentAtRange=function(e,i){var r,o,s,a,u,c,l,p,h,d,f,g;return f=(i=n(i))[0],d=this.locationFromPosition(f),o=this.getBlockAtIndex(d.index).getAttributes(),r=e.getBaseBlockAttributes(),g=
2o.slice(-r.length),t(r,g)?(l=o.slice(0,-r.length),c=e.copyWithBaseBlockAttributes(l)):c=e.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(o),s=c.getBlockCount(),a=c.getBlockAtIndex(0),t(o,a.getAttributes())?(u=a.getTextWithoutBlockBreak(),h=this.insertTextAtRange(u,i),s>1&&(c=new this.constructor(c.getBlocks().slice(1)),p=f+u.getLength(),h=h.insertDocumentAtRange(c,p))):h=this.insertDocumentAtRange(c,i),h},c.prototype.insertTextAtRange=function(t,e){var i,r,o,s,a;return a=(e=n(e))[0],r=(s=this.locationFromPosition(a)).index,o=s.offset,i=this.removeTextAtRange(e),new this.constructor(i.blockList.editObjectAtIndex(r,(function(e){return e.copyWithText(e.text.insertTextAtPosition(t,o))})))},c.prototype.removeTextAtRange=function(t){var e,r,o,s,a,u,c,l,p,h,d,f,g,m,y,v,b,A;return l=(h=t=n(t))[0],v=h[1],i(t)?this:(u=(d=this.locationRangeFromRange(t))[0],m=d[1],a=u.index,c=u.offset,s=this.getBlockAtIndex(a),g=m.index,y=m.offset,f=this.getBlockAtIndex(g),v-l===1&&s.getBlockBreakPosition()===c&&f.getBlockBreakPosition()!==y&&"\n"===f.text.getStringAtPosition(y)?o=this.blockList.editObjectAtIndex(g,(function(t){return t.copyWithText(t.text.removeTextAtRange([y,y+1]))})):(p=s.text.getTextAtRange([0,c]),b=f.text.getTextAtRange([y,f.getLength()]),A=p.appendText(b),r=a!==g&&0===c&&s.getAttributeLevel()>=f.getAttributeLevel()?f.copyWithText(A):s.copyWithText(A),e=g+1-a,o=this.blockList.splice(a,e,r)),new this.constructor(o))},c.prototype.moveTextFromRangeToPosition=function(t,e){var i,r,o,s,u,c,l,p,h,d;return h=(c=t=n(t))[0],o=c[1],e>=h&&o>=e?this:(r=this.getDocumentAtRange(t),p=this.removeTextAtRange(t),(u=e>h)&&(e-=r.getLength()),s=(l=r.getBlocks())[0],0===(i=2<=l.length?a.call(l,1):[]).length?(d=s.getTextWithoutBlockBreak(),u&&(e+=1)):d=s.text,p=p.insertTextAtRange(d,e),0===i.length?p:(r=new this.constructor(i),e+=d.getLength(),p.insertDocumentAtRange(r,e)))},c.prototype.addAttributeAtRange=function(t,n,i){var r;return r=this.blockList,this.eachBlockAtRange(i,(function(i,o,s){return r=r.editObjectAtIndex(s,(function(){return e(t)?i.addAttribute(t,n):o[0]===o[1]?i:i.copyWithText(i.text.addAttributeAtRange(t,n,o))}))})),new this.constructor(r)},c.prototype.addAttribute=function(t,e){var n;return n=this.blockList,this.eachBlock((function(i,r){return n=n.editObjectAtIndex(r,(function(){return i.addAttribute(t,e)}))})),new this.constructor(n)},c.prototype.removeAttributeAtRange=function(t,n){var i;return i=this.blockList,this.eachBlockAtRange(n,(function(n,r,o){return e(t)?i=i.editObjectAtIndex(o,(function(){return n.removeAttribute(t)})):r[0]!==r[1]?i=i.editObjectAtIndex(o,(function(){return n.copyWithText(n.text.removeAttributeAtRange(t,r))})):void 0})),new this.constructor(i)},c.prototype.updateAttributesForAttachment=function(t,e){var n,i,r;return i=this.getRangeOfAttachment(e)[0],n=this.locationFromPosition(i).index,r=this.getTextAtIndex(n),new this.constructor(this.blockList.editObjectAtIndex(n,(function(n){return n.copyWithText(r.updateAttributesForAttachment(t,e))})))},c.prototype.removeAttributeForAttachment=function(t,e){var n;return n=this.getRangeOfAttachment(e),this.removeAttributeAtRange(t,n)},c.prototype.insertBlockBreakAtRange=function(t){var e,i,r,s;return s=(t=n(t))[0],r=this.locationFromPosition(s).offset,i=this.removeTextAtRange(t),0===r&&(e=[new o.Block]),new this.constructor(i.blockList.insertSplittableListAtPosition(new o.SplittableList(e),s))},c.prototype.applyBlockAttributeAtRange=function(t,n,i){var r,o,s,a;return o=(s=this.expandRangeToLineBreaksAndSplitBlocks(i)).document,i=s.range,(r=e(t)).listAttribute?(a=(o=o.removeLastListAttributeAtRange(i,{exceptAttributeName:t})).convertLineBreaksToBlockBreaksInRange(i),o=a.document,i=a.range):o=r.exclusive?o.removeBlockAttributesAtRange(i):r.terminal?o.removeLastTerminalAttributeAtRange(i):o.consolidateBlocksAtRange(i),o.addAttributeAtRange(t,n,i)},c.prototype.removeLastListAttributeAtRange=function(t,n){var i;return null==n&&(n={}),i=this.blockList,this.eachBlockAtRange(t,(function(t,r,o){var s;if((s=t.getLastAttribute())&&e(s).listAttribute&&s!==n.exceptAttributeName)return i=i.editObjectAtIndex(o,(function(){return t.removeAttribute(s)}))})),new this.constructor(i)},c.prototype.removeLastTerminalAttributeAtRange=function(t){var n;return n=this.blockList,this.eachBlockAtRange(t,(function(t,i,r){var o;if((o=t.getLastAttribute())&&e(o).terminal)return n=n.editObjectAtIndex(r,(function(){return t.removeAttribute(o)}
2))})),new this.constructor(n)},c.prototype.removeBlockAttributesAtRange=function(t){var e;return e=this.blockList,this.eachBlockAtRange(t,(function(t,n,i){return t.hasAttributes()?e=e.editObjectAtIndex(i,(function(){return t.copyWithoutAttributes()})):void 0})),new this.constructor(e)},c.prototype.expandRangeToLineBreaksAndSplitBlocks=function(t){var e,i,r,o,s,a,u,c,l;return l=(a=t=n(t))[0],o=a[1],c=this.locationFromPosition(l),r=this.locationFromPosition(o),u=(e=this).getBlockAtIndex(c.index),null!=(c.offset=u.findLineBreakInDirectionFromPosition("backward",c.offset))&&(s=e.positionFromLocation(c),e=e.insertBlockBreakAtRange([s,s+1]),r.index+=1,r.offset-=e.getBlockAtIndex(c.index).getLength(),c.index+=1),c.offset=0,0===r.offset&&r.index>c.index?(r.index-=1,r.offset=e.getBlockAtIndex(r.index).getBlockBreakPosition()):("\n"===(i=e.getBlockAtIndex(r.index)).text.getStringAtRange([r.offset-1,r.offset])?r.offset-=1:r.offset=i.findLineBreakInDirectionFromPosition("forward",r.offset),r.offset!==i.getBlockBreakPosition()&&(s=e.positionFromLocation(r),e=e.insertBlockBreakAtRange([s,s+1]))),l=e.positionFromLocation(c),o=e.positionFromLocation(r),{document:e,range:t=n([l,o])}},c.prototype.convertLineBreaksToBlockBreaksInRange=function(t){var e,i,r;return i=(t=n(t))[0],r=this.getStringAtRange(t).slice(0,-1),e=this,r.replace(/.*?\n/g,(function(t){return i+=t.length,e=e.insertBlockBreakAtRange([i-1,i])})),{document:e,range:t}},c.prototype.consolidateBlocksAtRange=function(t){var e,i,r,o,s;return s=(r=t=n(t))[0],i=r[1],o=this.locationFromPosition(s).index,e=this.locationFromPosition(i).index,new this.constructor(this.blockList.consolidateFromIndexToIndex(o,e))},c.prototype.getDocumentAtRange=function(t){var e;return t=n(t),e=this.blockList.getSplittableListInRange(t).toArray(),new this.constructor(e)},c.prototype.getStringAtRange=function(t){var e,i;return(i=t=n(t))[i.length-1]!==this.getLength()&&(e=-1),this.getDocumentAtRange(t).toString().slice(0,e)},c.prototype.getBlockAtIndex=function(t){return this.blockList.getObjectAtIndex(t)},c.prototype.getBlockAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getBlockAtIndex(e)},c.prototype.getTextAtIndex=function(t){var e;return null!=(e=this.getBlockAtIndex(t))?e.text:void 0},c.prototype.getTextAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getTextAtIndex(e)},c.prototype.getPieceAtPosition=function(t){var e,n,i;return e=(i=this.locationFromPosition(t)).index,n=i.offset,this.getTextAtIndex(e).getPieceAtPosition(n)},c.prototype.getCharacterAtPosition=function(t){var e,n,i;return e=(i=this.locationFromPosition(t)).index,n=i.offset,this.getTextAtIndex(e).getStringAtRange([n,n+1])},c.prototype.getLength=function(){return this.blockList.getEndPosition()},c.prototype.getBlocks=function(){return this.blockList.toArray()},c.prototype.getBlockCount=function(){return this.blockList.length},c.prototype.getEditCount=function(){return this.editCount},c.prototype.eachBlock=function(t){return this.blockList.eachObject(t)},c.prototype.eachBlockAtRange=function(t,e){var i,r,o,s,a,u,c,l,p,h,d,f;if(d=(u=t=n(t))[0],o=u[1],h=this.locationFromPosition(d),r=this.locationFromPosition(o),h.index===r.index)return i=this.getBlockAtIndex(h.index),f=[h.offset,r.offset],e(i,f,h.index);for(p=[],a=s=c=h.index,l=r.index;l>=c?l>=s:s>=l;a=l>=c?++s:--s)(i=this.getBlockAtIndex(a))?(f=function(){switch(a){case h.index:return[h.offset,i.text.getLength()];case r.index:return[0,r.offset];default:return[0,i.text.getLength()]}}(),p.push(e(i,f,a))):p.push(void 0);return p},c.prototype.getCommonAttributesAtRange=function(t){var e,r,s;return r=(t=n(t))[0],i(t)?this.getCommonAttributesAtPosition(r):(s=[],e=[],this.eachBlockAtRange(t,(function(t,n){return n[0]!==n[1]?(s.push(t.text.getCommonAttributesAtRange(n)),e.push(l(t))):void 0})),o.Hash.fromCommonAttributesOfObjects(s).merge(o.Hash.fromCommonAttributesOfObjects(e)).toObject())},c.prototype.getCommonAttributesAtPosition=function(t){var e,n,i,r,s,a,c,p,h,d;if(s=(h=this.locationFromPosition(t)).index,p=h.offset,!(i=this.getBlockAtIndex(s)))return{};for(c in r=l(i),e=i.text.getAttributesAtPosition(p),n=i.text.getAttributesAtPosition(p-1),a=function(){var t,e;for(c in e=[],t=o.config.textAttributes)(d=t[c]).inheritable&&e.push(c);return e}(),n)((d=n[c])===e[c]||u.call(a,c)>=0)&&(r[c]=d);return r},c.prototype.getRangeOfCommonAttributeAtPosition=function(t,e){var i,r,o,s,a,u,c,l;return o=(a=this.locationFromPosition(e)).index,s=a.offset,l=(u=this.getTextAtIndex(o).getExpandedRangeForAttributeAtOffset(t,s))[0],r=u[1],c=this.positionFromLocation({index:o,offset:l}),i=this.positionFromLocation({index:o,offset:r}),n([c,i])},c.prototype.getBaseBlockAttributes=function(){var t,e,n,i,r,o,s;for(t=this.getBlockAtIndex(0).getAttributes(),n=i=1,s=this.getBlockCount();s>=1?s>i:i>s;n=s>=1?++i:--i)e=this.getBlockAtIndex(n).getAttributes(),o=Math.min(t.length,e.length),t=function(){var n,i,s;for(s=[],r=n=0,i=o;(i>=0?i>n:n>i)&&e[r]===t[r];r=i>=0?++n:--n)s.push(e[r]);return s}();return t},l=function(t){var e,n;return n={},(e=t.getLastAttribute())&&(n[e]=!0),n},c.prototype.getAttachmentById=function(t){var e,n,i,r;for(n=0,i=(r=this.getAttachments()).length;i>n;n++)if((e=r[n]).id===t)return e},c.prototype.getAttachmentPieces=function(){var t;return t=[],this.blockList.eachObject((function(e){var n;return n=e.text,t=t.concat(n.getAttachmentPieces())})),t},c.prototype.getAttachments=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.getAttachmentPieces()).length;e>t;t++)n=i[t],r.push(n.attachment);return r},c.prototype.getRangeOfAttachment=function(t){var e,i,r,o,s,a,u;for(o=0,i=e=0,r=(s=this.blockList.toArray()).length;r>e;i=++e){if(u=(a=s[i].text).getRangeOfAttachment(t))return n([o+u[0],o+u[1]]);o+=a.getLength()}},c.prototype.getLocationRangeOfAttachment=function(t){var e;return e=this.getRangeOfAttachment(t),this.locationRangeFromRange(e)},c.prototype.getAttachmentPieceForAttachment=function(t){var e,n,i,r;for(e=0,n=(r=this.getAttachmentPieces()).length;n>e;e++)if((i=r[e]).attachment===t)return i},c.prototype.findRangesForBlockAttribute=function(t){var e,n,i,r,o,s,a;for(o=0,s=[],n=0,i=(a=this.getBlocks()).length;i>n;n++)r=(e=a[n]).getLength(),e.hasAttribute(t)&&s.push([o,o+r]),o+=r;return s},c.prototype.findRangesForTextAttribute=function(t,e){var n,i,r,o,s,a,u,c,l,p;for(p=(null!=e?e:{}).withValue,a=0,u=[],c=[],o=function(e){return null!=p?e.getAttribute(t)===p:e.hasAttribute(t)},n=0,i=(l=this.getPieces()).length;i>n;n++)r=(s=l[n]).getLength(),o(s)&&(u[1]===a?u[1]=a+r:c.push(u=[a,a+r])),a+=r;return c},c.prototype.locationFromPosition=function(t){var e,n;return null!=(n=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t))).index?n:{index:(e=this.getBlocks()).length-1,offset:e[e.length-1].getLength()}},c.prototype.positionFromLocation=function(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)},c.prototype.locationRangeFromPosition=function(t){return n(this.locationFromPosition(t))},c.prototype.locationRangeFromRange=function(t){var e,i,r,o;
2if(t=n(t))return o=t[0],i=t[1],r=this.locationFromPosition(o),e=this.locationFromPosition(i),n([r,e])},c.prototype.rangeFromLocationRange=function(t){var e,r;return t=n(t),e=this.positionFromLocation(t[0]),i(t)||(r=this.positionFromLocation(t[1])),n([e,r])},c.prototype.isEqualTo=function(t){return this.blockList.isEqualTo(null!=t?t.blockList:void 0)},c.prototype.getTexts=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getBlocks()).length;n>e;e++)t=i[e],r.push(t.text);return r},c.prototype.getPieces=function(){var t,e,n,i,r;for(n=[],t=0,e=(i=this.getTexts()).length;e>t;t++)r=i[t],n.push.apply(n,r.getPieces());return n},c.prototype.getObjects=function(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())},c.prototype.toSerializableDocument=function(){var t;return t=[],this.blockList.eachObject((function(e){return t.push(e.copyWithText(e.text.toSerializableText()))})),new this.constructor(t)},c.prototype.toString=function(){return this.blockList.toString()},c.prototype.toJSON=function(){return this.blockList.toJSON()},c.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,r;for(r=[],e=0,n=(i=this.blockList.toArray()).length;n>e;e++)t=i[e],r.push(JSON.parse(t.text.toConsole()));return r}.call(this))},c}(o.Object)}.call(this),function(){o.LineBreakInsertion=function(){function t(t){var e;this.composition=t,this.document=this.composition.document,e=this.composition.getSelectedRange(),this.startPosition=e[0],this.endPosition=e[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}return t.prototype.shouldInsertBlockBreak=function(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?0!==this.startLocation.offset:this.breaksOnReturn&&"\n"!==this.nextCharacter},t.prototype.shouldBreakFormattedBlock=function(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&"\n"===this.nextCharacter||"\n"===this.previousCharacter)},t.prototype.shouldDecreaseListLevel=function(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()},t.prototype.shouldPrependListItem=function(){return this.block.isListItem()&&0===this.startLocation.offset&&!this.block.isEmpty()},t.prototype.shouldRemoveLastBlockAttribute=function(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()},t}()}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p=function(t,e){function n(){this.constructor=t}for(var i in e)h.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=o.normalizeRange,c=o.rangesAreEqual,u=o.rangeIsCollapsed,a=o.objectsAreEqual,t=o.arrayStartsWith,l=o.summarizeArrayChange,n=o.getAllAttributeNames,i=o.getBlockConfig,r=o.getTextConfig,e=o.extend,o.Composition=function(h){function d(){this.document=new o.Document,this.attachments=[],this.currentAttributes={},this.revision=0}return p(d,h),d.prototype.setDocument=function(t){var e;return t.isEqualTo(this.document)?void 0:(this.document=t,this.refreshAttachments(),this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidChangeDocument?e.compositionDidChangeDocument(t):void 0)},d.prototype.getSnapshot=function(){return{document:this.document,selectedRange:this.getSelectedRange()}},d.prototype.loadSnapshot=function(t){var e,n,i,r;return e=t.document,r=t.selectedRange,null!=(n=this.delegate)&&"function"==typeof n.compositionWillLoadSnapshot&&n.compositionWillLoadSnapshot(),this.setDocument(null!=e?e:new o.Document),this.setSelection(null!=r?r:[0,0]),null!=(i=this.delegate)&&"function"==typeof i.compositionDidLoadSnapshot?i.compositionDidLoadSnapshot():void 0},d.prototype.insertText=function(t,e){var n,i,r,o;return o=(null!=e?e:{updatePosition:!0}).updatePosition,i=this.getSelectedRange(),this.setDocument(this.document.insertTextAtRange(t,i)),n=(r=i[0])+t.getLength(),o&&this.setSelection(n),this.notifyDelegateOfInsertionAtRange([r,n])},d.prototype.insertBlock=function(t){var e;return null==t&&(t=new o.Block),e=new o.Document([t]),this.insertDocument(e)},d.prototype.insertDocument=function(t){var e,n,i;return null==t&&(t=new o.Document),n=this.getSelectedRange(),this.setDocument(this.document.insertDocumentAtRange(t,n)),e=(i=n[0])+t.getLength(),this.setSelection(e),this.notifyDelegateOfInsertionAtRange([i,e])},d.prototype.insertString=function(t,e){var n,i;return n=this.getCurrentTextAttributes(),i=o.Text.textForStringWithAttributes(t,n),this.insertText(i,e)},d.prototype.insertBlockBreak=function(){var t,e,n;return e=this.getSelectedRange(),this.setDocument(this.document.insertBlockBreakAtRange(e)),t=(n=e[0])+1,this.setSelection(t),this.notifyDelegateOfInsertionAtRange([n,t])},d.prototype.insertLineBreak=function(){var t,e;return(e=new o.LineBreakInsertion(this)).shouldDecreaseListLevel()?(this.decreaseListLevel(),this.setSelection(e.startPosition)):e.shouldPrependListItem()?(t=new o.Document([e.block.copyWithoutText()]),this.insertDocument(t)):e.shouldInsertBlockBreak()?this.insertBlockBreak():e.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():e.shouldBreakFormattedBlock()?this.breakFormattedBlock(e):this.insertString("\n")},d.prototype.insertHTML=function(t){var e,n,i,r;return e=o.Document.fromHTML(t),i=this.getSelectedRange(),this.setDocument(this.document.mergeDocumentAtRange(e,i)),n=(r=i[0])+e.getLength()-1,this.setSelection(n),this.notifyDelegateOfInsertionAtRange([r,n])},d.prototype.replaceHTML=function(t){var e,n,i;return e=o.Document.fromHTML(t).copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),i=this.document.rangeFromLocationRange(n),this.setDocument(e),this.setSelection(i)},d.prototype.insertFile=function(t){return this.insertFiles([t])},d.prototype.insertFiles=function(t){var e,n,i,r,s,a;for(n=[],r=0,s=t.length;s>r;r++)i=t[r],(null!=(a=this.delegate)?a.compositionShouldAcceptFile
2(i):void 0)&&(e=o.Attachment.attachmentForFile(i),n.push(e));return this.insertAttachments(n)},d.prototype.insertAttachment=function(t){return this.insertAttachments([t])},d.prototype.insertAttachments=function(t){var e,n,i,r,s,a,u,c,l;for(c=new o.Text,r=0,s=t.length;s>r;r++)l=(e=t[r]).getType(),a=null!=(u=o.config.attachments[l])?u.presentation:void 0,i=this.getCurrentTextAttributes(),a&&(i.presentation=a),n=o.Text.textForAttachmentWithAttributes(e,i),c=c.appendText(n);return this.insertText(c)},d.prototype.shouldManageDeletingInDirection=function(t){var e;if(e=this.getLocationRange(),u(e)){if("backward"===t&&0===e[0].offset)return!0;if(this.shouldManageMovingCursorInDirection(t))return!0}else if(e[0].index!==e[1].index)return!0;return!1},d.prototype.deleteInDirection=function(t,e){var n,i,r,o,s,a,c,l;return o=(null!=e?e:{}).length,s=this.getLocationRange(),a=this.getSelectedRange(),(c=u(a))?r="backward"===t&&0===s[0].offset:l=s[0].index!==s[1].index,!(r&&this.canDecreaseBlockAttributeLevel()&&(i=this.getBlock(),i.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(a[0]),i.isEmpty()))&&(c&&(a=this.getExpandedRangeInDirection(t,{length:o}),"backward"===t&&(n=this.getAttachmentAtRange(a))),n?(this.editAttachment(n),!1):(this.setDocument(this.document.removeTextAtRange(a)),this.setSelection(a[0]),!r&&!l&&void 0))},d.prototype.moveTextFromRange=function(t){var e;return e=this.getSelectedRange()[0],this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)},d.prototype.removeAttachment=function(t){var e;return(e=this.document.getRangeOfAttachment(t))?(this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])):void 0},d.prototype.removeLastBlockAttribute=function(){var t,e,n,i;return i=(n=this.getSelectedRange())[0],e=n[1],t=this.document.getBlockAtPosition(e),this.removeCurrentAttribute(t.getLastAttribute()),this.setSelection(i)}," ",d.prototype.insertPlaceholder=function(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")},d.prototype.selectPlaceholder=function(){return null!=this.placeholderPosition?(this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()):void 0},d.prototype.forgetPlaceholder=function(){return this.placeholderPosition=null},d.prototype.hasCurrentAttribute=function(t){var e;return null!=(e=this.currentAttributes[t])&&!1!==e},d.prototype.toggleCurrentAttribute=function(t){var e;return(e=!this.currentAttributes[t])?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)},d.prototype.canSetCurrentAttribute=function(t){return i(t)?this.canSetCurrentBlockAttribute(t):this.canSetCurrentTextAttribute(t)},d.prototype.canSetCurrentTextAttribute=function(){var t,e,n,i;if(t=this.getSelectedDocument()){for(e=0,n=(i=t.getAttachments()).length;n>e;e++)if(!i[e].hasContent())return!1;return!0}},d.prototype.canSetCurrentBlockAttribute=function(){var t;if(t=this.getBlock())return!t.isTerminalBlock()},d.prototype.setCurrentAttribute=function(t,e){return i(t)?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())},d.prototype.setTextAttribute=function(t,e){var n,i;if(n=this.getSelectedRange())return n[0]!==n[1]?this.setDocument(this.document.addAttributeAtRange(t,e,n)):"href"===t?(i=o.Text.textForStringWithAttributes(e,{href:e}),this.insertText(i)):void 0},d.prototype.setBlockAttribute=function(t,e){var n;if(n=this.getSelectedRange())return this.canSetCurrentAttribute(t)?(this.getBlock(),this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)):void 0},d.prototype.removeCurrentAttribute=function(t){return i(t)?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())},d.prototype.removeTextAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},d.prototype.removeBlockAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},d.prototype.canDecreaseNestingLevel=function(){var t;return(null!=(t=this.getBlock())?t.getNestingLevel():void 0)>0},d.prototype.canIncreaseNestingLevel=function(){var e,n,r;if(e=this.getBlock())return null!=(r=i(e.getLastNestableAttribute()))&&r.listAttribute?(n=this.getPreviousBlock())?t(n.getListItemAttributes(),e.getListItemAttributes()):void 0:e.getNestingLevel()>0},d.prototype.decreaseNestingLevel=function(){var t;if(t=this.getBlock())return this.setDocument(this.document.replaceBlock(t,t.decreaseNestingLevel()))},d.prototype.increaseNestingLevel=function(){var t;if(t=this.getBlock())return this.setDocument(this.document.replaceBlock(t,t.increaseNestingLevel()))},d.prototype.canDecreaseBlockAttributeLevel=function(){var t;return(null!=(t=this.getBlock())?t.getAttributeLevel():void 0)>0},d.prototype.decreaseBlockAttributeLevel=function(){var t,e;return(t=null!=(e=this.getBlock())?e.getLastAttribute():void 0)?this.removeCurrentAttribute(t):void 0},d.prototype.decreaseListLevel=function(){var t,e,n,i,r,o;for(o=this.getSelectedRange()[0],n=r=this.document.locationFromPosition(o).index,t=this.getBlock().getAttributeLevel();(e=this.document.getBlockAtIndex(n+1))&&e.isListItem()&&e.getAttributeLevel()>t;)n++;return o=this.document.positionFromLocation({index:r,offset:0}),i=this.document.positionFromLocation({index:n,offset:0}),this.setDocument(this.document.removeLastListAttributeAtRange([o,i]))},d.prototype.updateCurrentAttributes=function(){var t,e,i,r,o,s;if(s=this.getSelectedRange({ignoreLock:!0})){for(e=this.document.getCommonAttributesAtRange(s),i=0,r=(o=n()).length;r>i;i++)e[t=o[i]]||this.canSetCurrentAttribute(t)||(e[t]=!1);if(!a(e,this.currentAttributes))return this.currentAttributes=e,this.notifyDelegateOfCurrentAttributesChange()}},d.prototype.getCurrentAttributes=function(){return e.call({},this.currentAttributes)},d.prototype.getCurrentTextAttributes=function(){var t,e,n,i;for(e in t={},n=this.currentAttributes)!1!==(i=n[e])&&r(e)&&(t[e]=i);return t},d.prototype.freezeSelection=function(){return this.setCurrentAttribute("frozen",!0)},d.prototype.thawSelection=function(){return this.removeCurrentAttribute("frozen")},d.prototype.hasFrozenSelection=function(){return this.hasCurrentAttribute("frozen")},d.proxyMethod("getSelectionManager().getPointRange"),d.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),d.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),d.proxyMethod("getSelectionManager().locationIsCursorTarget"),d.proxyMethod("getSelectionManager().selectionIsExpanded"),d.proxyMethod("delegate?.getSelectionManager"),d.prototype.setSelection=function(t){var e,n;return e=this.document.locationRangeFromRange(t),null!=(n=this.delegate)?n.compositionDidRequestChangingSelectionToLocationRange(e):void 0},d.prototype.getSelectedRange=function(){var t;return(t=this.getLocationRange())?this.document.rangeFromLocationRange(t):void 0},d.prototype.setSelectedRange=function(t){var e;
2return e=this.document.locationRangeFromRange(t),this.getSelectionManager().setLocationRange(e)},d.prototype.getPosition=function(){var t;return(t=this.getLocationRange())?this.document.positionFromLocation(t[0]):void 0},d.prototype.getLocationRange=function(t){var e,n;return null!=(e=null!=(n=this.targetLocationRange)?n:this.getSelectionManager().getLocationRange(t))?e:s({index:0,offset:0})},d.prototype.withTargetLocationRange=function(t,e){var n;this.targetLocationRange=t;try{n=e()}finally{this.targetLocationRange=null}return n},d.prototype.withTargetRange=function(t,e){var n;return n=this.document.locationRangeFromRange(t),this.withTargetLocationRange(n,e)},d.prototype.withTargetDOMRange=function(t,e){var n;return n=this.createLocationRangeFromDOMRange(t,{strict:!1}),this.withTargetLocationRange(n,e)},d.prototype.getExpandedRangeInDirection=function(t,e){var n,i,r,o;return i=(null!=e?e:{}).length,o=(r=this.getSelectedRange())[0],n=r[1],"backward"===t?i?o-=i:o=this.translateUTF16PositionFromOffset(o,-1):i?n+=i:n=this.translateUTF16PositionFromOffset(n,1),s([o,n])},d.prototype.shouldManageMovingCursorInDirection=function(t){var e;return!!this.editingAttachment||(e=this.getExpandedRangeInDirection(t),null!=this.getAttachmentAtRange(e))},d.prototype.moveCursorInDirection=function(t){var e,n,i,r;return this.editingAttachment?i=this.document.getRangeOfAttachment(this.editingAttachment):(r=this.getSelectedRange(),i=this.getExpandedRangeInDirection(t),n=!c(r,i)),this.setSelectedRange("backward"===t?i[0]:i[1]),n&&(e=this.getAttachmentAtRange(i))?this.editAttachment(e):void 0},d.prototype.expandSelectionInDirection=function(t,e){var n,i;return n=(null!=e?e:{}).length,i=this.getExpandedRangeInDirection(t,{length:n}),this.setSelectedRange(i)},d.prototype.expandSelectionForEditing=function(){return this.hasCurrentAttribute("href")?this.expandSelectionAroundCommonAttribute("href"):void 0},d.prototype.expandSelectionAroundCommonAttribute=function(t){var e,n;return e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e),this.setSelectedRange(n)},d.prototype.selectionContainsAttachments=function(){var t;return(null!=(t=this.getSelectedAttachments())?t.length:void 0)>0},d.prototype.selectionIsInCursorTarget=function(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())},d.prototype.positionIsCursorTarget=function(t){var e;return(e=this.document.locationFromPosition(t))?this.locationIsCursorTarget(e):void 0},d.prototype.positionIsBlockBreak=function(t){var e;return null!=(e=this.document.getPieceAtPosition(t))?e.isBlockBreak():void 0},d.prototype.getSelectedDocument=function(){var t;return(t=this.getSelectedRange())?this.document.getDocumentAtRange(t):void 0},d.prototype.getSelectedAttachments=function(){var t;return null!=(t=this.getSelectedDocument())?t.getAttachments():void 0},d.prototype.getAttachments=function(){return this.attachments.slice(0)},d.prototype.refreshAttachments=function(){var t,e,n,i,r,o,s,a,u,c,p,h;for(n=this.document.getAttachments(),t=(a=l(this.attachments,n)).added,p=a.removed,this.attachments=n,i=0,o=p.length;o>i;i++)(e=p[i]).delegate=null,null!=(u=this.delegate)&&"function"==typeof u.compositionDidRemoveAttachment&&u.compositionDidRemoveAttachment(e);for(h=[],r=0,s=t.length;s>r;r++)(e=t[r]).delegate=this,h.push(null!=(c=this.delegate)&&"function"==typeof c.compositionDidAddAttachment?c.compositionDidAddAttachment(e):void 0);return h},d.prototype.attachmentDidChangeAttributes=function(t){var e;return this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidEditAttachment?e.compositionDidEditAttachment(t):void 0},d.prototype.attachmentDidChangePreviewURL=function(t){var e;return this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidChangeAttachmentPreviewURL?e.compositionDidChangeAttachmentPreviewURL(t):void 0},d.prototype.editAttachment=function(t,e){var n;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,null!=(n=this.delegate)&&"function"==typeof n.compositionDidStartEditingAttachment?n.compositionDidStartEditingAttachment(this.editingAttachment,e):void 0},d.prototype.stopEditingAttachment=function(){var t;if(this.editingAttachment)return null!=(t=this.delegate)&&"function"==typeof t.compositionDidStopEditingAttachment&&t.compositionDidStopEditingAttachment(this.editingAttachment),this.editingAttachment=null},d.prototype.updateAttributesForAttachment=function(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))},d.prototype.removeAttributeForAttachment=function(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))},d.prototype.breakFormattedBlock=function(t){var e,n,i,r,s;return n=t.document,e=t.block,s=[(r=t.startPosition)-1,r],e.getBlockBreakPosition()===t.startLocation.offset?(e.breaksOnReturn()&&"\n"===t.nextCharacter?r+=1:n=n.removeTextAtRange(s),s=[r,r]):"\n"===t.nextCharacter?"\n"===t.previousCharacter?s=[r-1,r+1]:(s=[r,r+1],r+=1):t.startLocation.offset-1!==0&&(r+=1),i=new o.Document([e.removeLastAttribute().copyWithoutText()]),this.setDocument(n.insertDocumentAtRange(i,s)),this.setSelection(r)},d.prototype.getPreviousBlock=function(){var t,e;return(e=this.getLocationRange())&&(t=e[0].index)>0?this.document.getBlockAtIndex(t-1):void 0},d.prototype.getBlock=function(){var t;return(t=this.getLocationRange())?this.document.getBlockAtIndex(t[0].index):void 0},d.prototype.getAttachmentAtRange=function(t){var e;return(e=this.document.getDocumentAtRange(t)).toString()===o.OBJECT_REPLACEMENT_CHARACTER+"\n"?e.getAttachments()[0]:void 0},d.prototype.notifyDelegateOfCurrentAttributesChange=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.compositionDidChangeCurrentAttributes?t.compositionDidChangeCurrentAttributes(this.currentAttributes):void 0},d.prototype.notifyDelegateOfInsertionAtRange=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionDidPerformInsertionAtRange?e.compositionDidPerformInsertionAtRange(t):void 0},d.prototype.translateUTF16PositionFromOffset=function(t,e){var n,i;return n=(i=this.document.toUTF16String()).offsetFromUCS2Offset(t),i.offsetToUCS2Offset(n+e)},d}(o.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.UndoManager=function(e){function n(t){this.composition=t,this.undoEntries=[],this.redoEntries=[]}var i;return t(n,e),n.prototype.recordUndoEntry=function(t,e){var n,r,o,s,a;return r=(s=null!=e?e:{}).context,n=s.consolidatable,o=this.undoEntries.slice(-1)[0],n&&i(o,t,r)?void 0:(a=this.createEntry({description:t,context:r}),this.undoEntries.push(a),this.redoEntries=[])},n.prototype.undo=function(){var t,e;return(e=this.undoEntries.pop())?(t=this.createEntry(e),this.redoEntries.push(t),this.composition.loadSnapsh
2ot(e.snapshot)):void 0},n.prototype.redo=function(){var t,e;return(t=this.redoEntries.pop())?(e=this.createEntry(t),this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)):void 0},n.prototype.canUndo=function(){return this.undoEntries.length>0},n.prototype.canRedo=function(){return this.redoEntries.length>0},n.prototype.createEntry=function(t){var e,n,i;return n=(i=null!=t?t:{}).description,e=i.context,{description:null!=n?n.toString():void 0,context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}},i=function(t,e,n){return(null!=t?t.description:void 0)===(null!=e?e.toString():void 0)&&(null!=t?t.context:void 0)===JSON.stringify(n)},n}(o.BasicObject)}.call(this),function(){var t;o.attachmentGalleryFilter=function(e){var n;return(n=new t(e)).perform(),n.getSnapshot()},t=function(){function t(t){this.document=t.document,this.selectedRange=t.selectedRange}var e;return e="attachmentGallery","presentation","gallery",t.prototype.perform=function(){return this.removeBlockAttribute(),this.applyBlockAttribute()},t.prototype.getSnapshot=function(){return{document:this.document,selectedRange:this.selectedRange}},t.prototype.removeBlockAttribute=function(){var t,n,i,r,o;for(o=[],t=0,n=(r=this.findRangesOfBlocks()).length;n>t;t++)i=r[t],o.push(this.document=this.document.removeAttributeAtRange(e,i));return o},t.prototype.applyBlockAttribute=function(){var t,n,i,r,o,s;for(i=0,s=[],t=0,n=(o=this.findRangesOfPieces()).length;n>t;t++)(r=o[t])[1]-r[0]>1&&(r[0]+=i,r[1]+=i,"\n"!==this.document.getCharacterAtPosition(r[1])&&(this.document=this.document.insertBlockBreakAtRange(r[1]),r[1]<this.selectedRange[1]&&this.moveSelectedRangeForward(),r[1]++,i++),0!==r[0]&&"\n"!==this.document.getCharacterAtPosition(r[0]-1)&&(this.document=this.document.insertBlockBreakAtRange(r[0]),r[0]<this.selectedRange[0]&&this.moveSelectedRangeForward(),r[0]++,i++),s.push(this.document=this.document.applyBlockAttributeAtRange(e,!0,r)));return s},t.prototype.findRangesOfBlocks=function(){return this.document.findRangesForBlockAttribute(e)},t.prototype.findRangesOfPieces=function(){return this.document.findRangesForTextAttribute("presentation",{withValue:"gallery"})},t.prototype.moveSelectedRangeForward=function(){return this.selectedRange[0]+=1,this.selectedRange[1]+=1},t}()}.call(this),function(){o.Editor=function(){function t(t,n,i){this.composition=t,this.selectionManager=n,this.element=i,this.insertFiles=function(t,e){return function(){return t.apply(e,arguments)}}(this.insertFiles,this),this.undoManager=new o.UndoManager(this.composition),this.filters=e.slice(0)}var e;return e=[o.attachmentGalleryFilter],t.prototype.loadDocument=function(t){return this.loadSnapshot({document:t,selectedRange:[0,0]})},t.prototype.loadHTML=function(t){return null==t&&(t=""),this.loadDocument(o.Document.fromHTML(t,{referenceElement:this.element}))},t.prototype.loadJSON=function(t){var e,n;return e=t.document,n=t.selectedRange,e=o.Document.fromJSON(e),this.loadSnapshot({document:e,selectedRange:n})},t.prototype.loadSnapshot=function(t){return this.undoManager=new o.UndoManager(this.composition),this.composition.loadSnapshot(t)},t.prototype.getDocument=function(){return this.composition.document},t.prototype.getSelectedDocument=function(){return this.composition.getSelectedDocument()},t.prototype.getSnapshot=function(){return this.composition.getSnapshot()},t.prototype.toJSON=function(){return this.getSnapshot()},t.prototype.deleteInDirection=function(t){return this.composition.deleteInDirection(t)},t.prototype.insertAttachment=function(t){return this.composition.insertAttachment(t)},t.prototype.insertAttachments=function(t){return this.composition.insertAttachments(t)},t.prototype.insertDocument=function(t){return this.composition.insertDocument(t)},t.prototype.insertFile=function(t){return this.composition.insertFile(t)},t.prototype.insertFiles=function(t){return this.composition.insertFiles(t)},t.prototype.insertHTML=function(t){return this.composition.insertHTML(t)},t.prototype.insertString=function(t){return this.composition.insertString(t)},t.prototype.insertText=function(t){return this.composition.insertText(t)},t.prototype.insertLineBreak=function(){return this.composition.insertLineBreak()},t.prototype.getSelectedRange=function(){return this.composition.getSelectedRange()},t.prototype.getPosition=function(){return this.composition.getPosition()},t.prototype.getClientRectAtPosition=function(t){var e;return e=this.getDocument().locationRangeFromRange([t,t+1]),this.selectionManager.getClientRectAtLocationRange(e)},t.prototype.expandSelectionInDirection=function(t){return this.composition.expandSelectionInDirection(t)},t.prototype.moveCursorInDirection=function(t){return this.composition.moveCursorInDirection(t)},t.prototype.setSelectedRange=function(t){return this.composition.setSelectedRange(t)}
2,t.prototype.activateAttribute=function(t,e){return null==e&&(e=!0),this.composition.setCurrentAttribute(t,e)},t.prototype.attributeIsActive=function(t){return this.composition.hasCurrentAttribute(t)},t.prototype.canActivateAttribute=function(t){return this.composition.canSetCurrentAttribute(t)},t.prototype.deactivateAttribute=function(t){return this.composition.removeCurrentAttribute(t)},t.prototype.canDecreaseNestingLevel=function(){return this.composition.canDecreaseNestingLevel()},t.prototype.canIncreaseNestingLevel=function(){return this.composition.canIncreaseNestingLevel()},t.prototype.decreaseNestingLevel=function(){return this.canDecreaseNestingLevel()?this.composition.decreaseNestingLevel():void 0},t.prototype.increaseNestingLevel=function(){return this.canIncreaseNestingLevel()?this.composition.increaseNestingLevel():void 0},t.prototype.canRedo=function(){return this.undoManager.canRedo()},t.prototype.canUndo=function(){return this.undoManager.canUndo()},t.prototype.recordUndoEntry=function(t,e){var n,i,r;return i=(r=null!=e?e:{}).context,n=r.consolidatable,this.undoManager.recordUndoEntry(t,{context:i,consolidatable:n})},t.prototype.redo=function(){return this.canRedo()?this.undoManager.redo():void 0},t.prototype.undo=function(){return this.canUndo()?this.undoManager.undo():void 0},t}()}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.ManagedAttachment=function(e){function n(t,e){var n;this.attachmentManager=t,this.attachment=e,n=this.attachment,this.id=n.id,this.file=n.file}return t(n,e),n.prototype.remove=function(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)},n.proxyMethod("attachment.getAttribute"),n.proxyMethod("attachment.hasAttribute"),n.proxyMethod("attachment.setAttribute"),n.proxyMethod("attachment.getAttributes"),n.proxyMethod("attachment.setAttributes"),n.proxyMethod("attachment.isPending"),n.proxyMethod("attachment.isPreviewable"),n.proxyMethod("attachment.getURL"),n.proxyMethod("attachment.getHref"),n.proxyMethod("attachment.getFilename"),n.proxyMethod("attachment.getFilesize"),n.proxyMethod("attachment.getFormattedFilesize"),n.proxyMethod("attachment.getExtension"),n.proxyMethod("attachment.getContentType"),n.proxyMethod("attachment.getFile"),n.proxyMethod("attachment.setFile"),n.proxyMethod("attachment.releaseFile"),n.proxyMethod("attachment.getUploadProgress"),n.proxyMethod("attachment.setUploadProgress"),n}(o.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.AttachmentManager=function(e){function n(t){var e,n,i;for(null==t&&(t=[]),this.managedAttachments={},n=0,i=t.length;i>n;n++)e=t[n],this.manageAttachment(e)}return t(n,e),n.prototype.getAttachments=function(){var t,e,n,i;for(e in i=[],n=this.managedAttachments)t=n[e],i.push(t);return i},n.prototype.manageAttachment=function(t){var e,n;return null!=(e=this.managedAttachments)[n=t.id]?e[n]:e[n]=new o.ManagedAttachment(this,t)},n.prototype.attachmentIsManaged=function(t){return t.id in this.managedAttachments},n.prototype.requestRemovalOfAttachment=function(t){var e;return this.attachmentIsManaged(t)&&null!=(e=this.delegate)&&"function"==typeof e.attachmentManagerDidRequestRemovalOfAttachment?e.attachmentManagerDidRequestRemovalOfAttachment(t):void 0},n.prototype.unmanageAttachment=function(t){var e;return e=this.managedAttachments[t.id],delete this.managedAttachments[t.id],e},n}(o.BasicObject)}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p;t=o.elementContainsNode,e=o.findChildIndexOfNode,r=o.nodeIsBlockStart,s=o.nodeIsBlockStartComment,i=o.nodeIsBlockContainer,a=o.nodeIsCursorTarget,u=o.nodeIsEmptyTextNode,c=o.nodeIsTextNode,n=o.nodeIsAttachmentElement,l=o.tagName,p=o.walkTree,o.LocationMapper=function(){function o(t){this.element=t}var h,d,f,g;return o.prototype.findLocationFromContainerAndOffset=function(n,i,o){var s,u,l,h,g,m,y;for(m=(null!=o?o:{strict:!0}).strict,u=0,l=!1,h={index:0,offset:0},(s=this.findAttachmentElementParentForNode(n))&&(n=s.parentNode,i=e(s)),y=p(this.element,{usingFilter:f});y.nextNode();){if((g=y.currentNode)===n&&c(n)){a(g)||(h.offset+=i);break}if(g.parentNode===n){if(u++===i)break}else if(!t(n,g)&&u>0)break;r(g,{strict:m})?(l&&h.index++,h.offset=0,l=!0):h.offset+=d(g)}return h},o.prototype.findContainerAndOffsetFromLocation=function(t){var n,o,s,u,l;if(0===t.index&&0===t.offset){for(n=this.element,u=0;n.firstChild;)if(n=n.firstChild,i(n)){u=1;break}return[n,u]}if(o=(l=this.findNodeAndOffsetFromLocation(t))[0],s=l[1],o){if(c(o))0===d(o)?(n=o.parentNode.parentNode,u=e(o.parentNode),a(o,{name:"right"})&&u++):(n=o,u=t.offset-s);else{if(n=o.parentNode,!r(o.previousSibling)&&!i(n))for(;o===n.lastChild&&(o=n,n=n.parentNode,!i(n)););u=e(o),0!==t.offset&&u++}return[n,u]}},o.prototype.findNodeAndOffsetFromLocation=function(t){var e,n,i,r,o,s,u,l;for(u=0,n=0,i=(l=this.getSignificantNodesForIndex(t.index)).length;i>n;n++){if(e=l[n],r=d(e),t.offset<=u+r)if(c(e)){if(o=e,s=u,t.offset===s&&a(o))break}else o||(o=e,s=u);if((u+=r)>t.offset)break}return[o,s]},o.prototype.findAttachmentElementParentForNode=function(t){for(;t&&t!==this.element;){if(n(t))return t;t=t.parentNode}},o.prototype.getSignificantNodesForIndex=function(t){var e,n,i,r,o;for(i=[],o=p(this.element,{usingFilter:h}),r=!1;o.nextNode();)if(n=o.currentNode,s(n)){if("undefined"!=typeof e&&null!==e?e++:e=0,e===t)r=!0;else if(r)break}else r&&i.push(n);return i},d=function(t){return t.nodeType===Node.TEXT_NODE?a(t)?0:t.textContent.length:"br"===l(t)||n(t)?1:0},h=function(t){return g(t)===NodeFilter.FILTER_ACCEPT?f(t):NodeFilter.FILTER_REJECT},g=function(t){return u(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},f=function(t){return n(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},o}()}.call(this),function(){var t,e,n=[].slice;t=o.getDOMRange,e=o.setDOMRange,o.PointMapper=function(){function i(){}return i.prototype.createDOMRangeFromPoint=function(n){var i,r,o,s,a,u,c,l;if(c=n.x,l=n.y,document.caretPositionFromPoint)return o=(a=document.caretPositionFromPoint(c,l)).offsetNode,r=a.offset,(i=document.createRange()).setStart(o,r),i;if(document.caretRangeFromPoint)return document.caretRangeFromPoint(c,l);if(document.body.createTextRange){s=t();try{(u=document.body.createTextRange()).moveToPoint(c,l),u.select()}catch(p){}return i=t(),e(s),i}},i.prototype.getClientRectsForDOMRange=function(t){var e;return[(e=n.call(t.getClientRects()))[0],e[e.length-1]]},i}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=o.getDOMRange,o.SelectionChangeObserver=function(i){function o(){this.run=e(this.run,this),this.update=e(this.update,this),this.selectionManagers=[]}var s;return n(o,i),o.prototype.start=function(){return this.started?void 0:(this.started=!0,"onselectionchange"in document?document.addEventListener("selectionchange",this.update,!0):this.run())},o.prototype.stop=function(){return this.started?(this.started=!1,document.removeEventListener("selectionchange",this.update,!0)):void 0},o.prototype.registerSelectionManager=function(t){return r.call(this.selectionManagers,t)<0?(this.selectionManagers.push(t),this.start()):void 0},o.prototype.unregisterSelectionManager=function(t){var e;return this.selectionManagers=function(){var n,i,r,o;for(o=[],n=0,i=(r=this.selectionManagers).length;i>n;n++)(e=r[n])!==t&&o.push(e);return o}.call(this),0===this.selectionManagers.length?this.stop():void 0},o.prototype.notifySelectionManagersOfSelectionChange=function(){var t,e,n,i,r;for(i=[],t=0,e=(n=this.selectionManagers).length;e>t;t++)r=n[t],i.push(r.selectionDidChange());return i},o.prototype.update=function(){var e;return e=t(),s(e,this.domRange)?void 0:(this.domRange=e,this.notifySelectionManagersOfSelectionChange())},o.prototype.reset=function(){return this.domRange=null,this.update()},o.prototype.run=function(){return this.started?(this.update(),requestAnimationFrame(this.run)):void 0},s=function(t,e){return(null!=t?t.startContainer:void 0)===(null!=e?e.startContainer:void 0)&&(null!=t?t.startOffset:void 0)===(null!=e?e.startOffset:void 0)&&(null!=t?t.endContainer:void 0)===(null!=e?e.endContainer:void 0)&&(null!=t?t.endOffset:void 0)===(null!=e?e.endOffset:void 0)},o}(o.BasicObject),null==o.selectionChangeObserver&&(o.selectionChangeObserver=new o.SelectionChangeObserver)}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p=function(t,e){return function(){return t.apply(e,arguments)}},h=function(t,e){function n(){this.constructor=t}for(var i in e)d.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},d={}.hasOwnProperty;n=o.getDOMSelection,e=o.getDOMRange,l=o.setDOMRange,t=o.elementContainsNode,s=o.nodeIsCursorTarget,r=o.innerElementIsActive,i=o.handleEvent,a=o.normalizeRange,u=o.rangeIsCollapsed,c=o.rangesAreEqual,o.SelectionManager=function(d){function f(t){this.element=t,this.selectionDidChange=p(this.selectionDidChange,this),this.didMouseDown=p(this.didMouseDown,this),this.locationMapper=new o.LocationMapper(this.element),this.pointMapper=new o.PointMapper,this.lockCount=0,i("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}return h(f,d),f.prototype.getLocationRange=function(t){var n;return null==t&&(t={}),!1===t.strict?this.createLocationRangeFromDOMRange(e(),{strict:!1}):t.ignoreLock?this.currentLocationRange:null!=(n=this.lockedLocationRange)?n:this.currentLocationRange},f.prototype.setLocationRange=function(t){var e;if(!this.lockedLocationRange)return t=a(t),(e=this.createDOMRangeFromLocationRange(t))?(l(e),this.updateCurrentLocationRange(t)):void 0},f.prototype.setLocationRangeFromPointRange=function(t){var e,n;return t=a(t),n=this.getLocationAtPoint(t[0]),e=this.getLocationAtPoint(t[1]),this.setLocationRange([n,e])},f.prototype.getClientRectAtLocationRange=function(t){var e;return(e=this.createDOMRangeFromLocationRange(t))?this.getClientRectsForDOMRange(e)[1]:void 0},f.prototype.locationIsCursorTarget=function(t){var e,n;return e=(n=this.findNodeAndOffsetFromLocation(t))[0],n[1],s(e)},f.prototype.lock=function(){return 0===this.lockCount++?(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange()):void 0},f.prototype.unlock=function(){var t;return 0===--this.lockCount&&(t=this.lockedLocationRange,this.lockedLocationRange=null,null!=t)?this.setLocationRange(t):void 0},f.prototype.clearSelection=function(){var t;return null!=(t=n())?t.removeAllRanges():void 0},f.prototype.selectionIsCollapsed=function(){var t;return!0===(null!=(t=e())?t.collapsed:void 0)},f.prototype.selectionIsExpanded=function(){return!this.selectionIsCollapsed()},f.prototype.createLocationRangeFromDOMRange=function(t,e){var n,i;if(null!=t&&this.domRangeWithinElement(t)&&(i=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset,e)))return t.collapsed||(n=this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset,e)),a([i,n])},f.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),f.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),f.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),f.proxyMethod("pointMapper.createDOMRangeFromPoint"),f.proxyMethod("pointMapper.getClientRectsForDOMRange"),f.prototype.didMouseDown=function(){return this.pauseTemporarily()},f.prototype.pauseTemporarily=function(){var e,n,r,o;return this.paused=!0,n=function(e){return function(){var n,i;for(e.paused=!1,clearTimeout(o),n=0,i=r.length;i>n;n++)r[n].destroy();return t(document,e.element)?e.selectionDidChange():void 0}}(this),o=setTimeout(n,200),r=function(){var t,r,o,s;for(s=[],t=0,r=(o=["mousemove","keydown"]).length;r>t;t++)e=o[t],s.push(i(e,{onElement:document,withCallback:n}));return s}()},f.prototype.selectionDidChange=function(){return this.paused||r(this.element)?void 0:this.updateCurrentLocationRange()},f.prototype.updateCurrentLocationRange=function(t){var n;return(null!=t?t:t=this.createLocationRangeFromDOMRange(e()))&&!c(t,this.currentLocationRange)?(this.currentLocationRange=t,null!=(n=this.delegate)&&"function"==typeof n.locationRangeDidChange?n.locationRangeDidChange(this.currentLocationRange.slice(0)):void 0):void 0},f.prototype.createDOMRangeFromLocationRange=function(t){var e,n,i,r;return i=this.findContainerAndOffsetFromLocation(t[0]),n=u(t)?i:null!=(r=this.findContainerAndOffsetFromLocation(t[1]))?r:i,null!=i&&null!=n?((e=document.createRange()).setStart.apply(e,i),e.setEnd.apply(e,n),e):void 0},f.prototype.getLocationAtPoint=function(t){var e,n;return(e=this.createDOMRangeFromPoint(t))&&null!=(n=this.createLocationRangeFromDOMRange(e))?n[0]:void 0},f.prototype.domRangeWithinElement=function(e){return e.collapsed?t(this.element,e.startContainer):t(this.element,e.startContainer)&&t(this.element,e.endContainer)},f}(o.BasicObject)}.call(this),function(){var t,e,n,i,r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty,a=[].slice;n=o.rangeIsCollapsed,i=o.rangesAreEqual,e=o.objectsAreEqual,t=o.getBlockConfig,o.EditorController=function(s){function u(t){var e,n;this.editorElement=t.editorElement,e=t.document,n=t.html,this.selectionManager=new o.SelectionManager(this.editorElement),this.selectionManager.delegate=this,this.composition=new o.Composition,this.composition.delegate=this,this.attachmentManager=new o.AttachmentManager(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=new(o["Level"+o.config.input.getLevel()+"InputController"])(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new o.CompositionController(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new o.ToolbarController(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new o.Editor(this.composition,this.selectionManager,this.editorElement),null!=e?this.editor.loadDocument(e):this.editor.loadHTML(n)}var c;return r(u,s),u.prototype.registerSelectionManager=function(){return o.selectionChangeObserver.registerSelectionManager(this.selectionManager)},u.prototype.unregisterSelectionManager=function(){return o.selectionChangeObserver.unregisterSelectionManager(this.selectionManager)},u.prototype.render=function(){return this.compositionController.render()},u.prototype.reparse=function(){return this.composition.replaceHTML(this.editorElement.innerHTML)},u.prototype.compositionDidChangeDocument=function(){return this.notifyEditorElement("document-change"),this.handlingInput?void 0:this.render()},u.prototype.compositionDidChangeCurrentAttributes=function(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})},u.prototype.compositionDidPerformInsertionAtRange=function(t){return this.pasting?this.pastedRange=t:void 0},u.prototype.compositionShouldAcceptFile=function(t){return this.notifyEditorElement("file-accept",{file:t})},u.prototype.compositionDidAddAttachment=function(t){var e;return e=this.attachmentManager.manageAttachment(t),this.notifyEditorElement("attachment-add",{attachment:e})},u.prototype.compositionDidEditAttachment=function(t){var e;return this.compositionController.rerenderViewForObject(t),e=this.attachmentManager.manageAttachment(t),this.notifyEditorElement("attachment-edit",{attachment:e}),this.notifyEditorElement("change")},u.prototype.compositionDidChangeAttachmentPreviewURL=function(t){return this.compositionController.invalidateViewForObject(t),this.notifyEditorElement("change")},u.prototype.compositionDidRemoveAttachment=function(t){var e;return e=this
2.attachmentManager.unmanageAttachment(t),this.notifyEditorElement("attachment-remove",{attachment:e})},u.prototype.compositionDidStartEditingAttachment=function(t,e){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(t),this.compositionController.installAttachmentEditorForAttachment(t,e),this.selectionManager.setLocationRange(this.attachmentLocationRange)},u.prototype.compositionDidStopEditingAttachment=function(){return this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null},u.prototype.compositionDidRequestChangingSelectionToLocationRange=function(t){return!this.loadingSnapshot||this.isFocused()?(this.requestedLocationRange=t,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()):void 0},u.prototype.compositionWillLoadSnapshot=function(){return this.loadingSnapshot=!0},u.prototype.compositionDidLoadSnapshot=function(){return this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1},u.prototype.getSelectionManager=function(){return this.selectionManager},u.proxyMethod("getSelectionManager().setLocationRange"),u.proxyMethod("getSelectionManager().getLocationRange"),u.prototype.attachmentManagerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},u.prototype.compositionControllerWillSyncDocumentView=function(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()},u.prototype.compositionControllerDidSyncDocumentView=function(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")},u.prototype.compositionControllerDidRender=function(){return null!=this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision},u.prototype.compositionControllerDidFocus=function(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")},u.prototype.compositionControllerDidBlur=function(){return this.notifyEditorElement("blur")},u.prototype.compositionControllerDidSelectAttachment=function(t,e){return this.toolbarController.hideDialog(),this.composition.editAttachment(t,e)},u.prototype.compositionControllerDidRequestDeselectingAttachment=function(t){var e,n;return e=null!=(n=this.attachmentLocationRange)?n:this.composition.document.getLocationRangeOfAttachment(t),this.selectionManager.setLocationRange(e[1])},u.prototype.compositionControllerWillUpdateAttachment=function(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})},u.prototype.compositionControllerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},u.prototype.inputControllerWillHandleInput=function(){return this.handlingInput=!0,this.requestedRender=!1},u.prototype.inputControllerDidRequestRender=function(){return this.requestedRender=!0},u.prototype.inputControllerDidHandleInput=function(){return this.handlingInput=!1,this.requestedRender?(this.requestedRender=!1,this.render()):void 0},u.prototype.inputControllerDidAllowUnhandledInput=function(){return this.notifyEditorElement("change")},u.prototype.inputControllerDidRequestReparse=function(){return this.reparse()},u.prototype.inputControllerWillPerformTyping=function(){return this.recordTypingUndoEntry()},u.prototype.inputControllerWillPerformFormatting=function(t){return this.recordFormattingUndoEntry(t)},u.prototype.inputControllerWillCutText=function(){return this.editor.recordUndoEntry("Cut")},u.prototype.inputControllerWillPaste=function(t){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:t})},u.prototype.inputControllerDidPaste=function(t){return t.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:t})},u.prototype.inputControllerWillMoveText=function(){return this.editor.recordUndoEntry("Move")},u.prototype.inputControllerWillAttachFiles=function(){return this.editor.recordUndoEntry("Drop Files")},u.prototype.inputControllerWillPerformUndo=function(){return this.editor.undo()},u.prototype.inputControllerWillPerformRedo=function(){return this.editor.redo()},u.prototype.inputControllerDidReceiveKeyboardCommand=function(t){return this.toolbarController.applyKeyboardCommand(t)},u.prototype.inputControllerDidStartDrag=function(){return this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()},u.prototype.inputControllerDidReceiveDragOverPoint=function(t){return this.selectionManager.setLocationRangeFromPointRange(t)},u.prototype.inputControllerDidCancelDrag=function(){return this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null},u.prototype.locationRangeDidChange=function(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!i(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")},u.prototype.toolbarDidClickButton=function(){return this.getLocationRange()?void 0:this.setLocationRange({index:0,offset:0})},u.prototype.toolbarDidInvokeAction=function(t){return this.invokeAction(t)},u.prototype.toolbarDidToggleAttribute=function(t){return this.recordFormattingUndoEntry(t),this.composition.toggleCurrentAttribute(t),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarDidUpdateAttribute=function(t,e){return this.recordFormattingUndoEntry(t),this.composition.setCurrentAttribute(t,e),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarDidRemoveAttribute=function(t){return this.recordFormattingUndoEntry(t),this.composition.removeCurrentAttribute(t),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarWillShowDialog=function(){return this.composition.expandSelectionForEditing(),this.freezeSelection()},u.prototype.toolbarDidShowDialog=function(t){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:t})},u.prototype.toolbarDidHideDialog=function(t){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:t})},u.prototype.freezeSelection=function(){return this.selectionFrozen?void 0:(this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render())},u.prototype.thawSelection=function(){return this.selectionFrozen?(this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()):void 0},u.prototype.actions={undo:{test:function(){return this.editor.canUndo()},perform:function(){return this.editor.undo()}},redo:{test:function(){return this.editor.canRedo()},perform:function(){return this.editor.redo()}},link:{test:function(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test:function(){return this.editor.canIncreaseNestingLevel()},perform:function(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test:function(){return this.editor.canDecreaseNestingLevel()},perform:function(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:function(){return!0},perform:function(){return o.config.input.pickFiles(this.editor.insertFiles)}}},u.prototype.canInvokeAction=function(t){var e,n;return!!this.actionIsExternal(t)||!!(null!=(e=this.actions[t])&&null!=(n=e.test)?n.c
2all(this):void 0)},u.prototype.invokeAction=function(t){var e,n;return this.actionIsExternal(t)?this.notifyEditorElement("action-invoke",{actionName:t}):null!=(e=this.actions[t])&&null!=(n=e.perform)?n.call(this):void 0},u.prototype.actionIsExternal=function(t){return/^x-./.test(t)},u.prototype.getCurrentActions=function(){var t,e;for(t in e={},this.actions)e[t]=this.canInvokeAction(t);return e},u.prototype.updateCurrentActions=function(){var t;return t=this.getCurrentActions(),e(t,this.currentActions)?void 0:(this.currentActions=t,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions}))},u.prototype.runEditorFilters=function(){var t,e,n,i,r,o,s,a;for(a=this.composition.getSnapshot(),n=0,i=(r=this.editor.filters).length;i>n;n++)e=r[n],t=a.document,s=a.selectedRange,null==(a=null!=(o=e.call(this.editor,a))?o:{}).document&&(a.document=t),null==a.selectedRange&&(a.selectedRange=s);return c(a,this.composition.getSnapshot())?void 0:this.composition.loadSnapshot(a)},c=function(t,e){return i(t.selectedRange,e.selectedRange)&&t.document.isEqualTo(e.document)},u.prototype.updateInputElement=function(){var t,e;return t=this.compositionController.getSerializableElement(),e=o.serializeToContentType(t,"text/html"),this.editorElement.setInputElementValue(e)},u.prototype.notifyEditorElement=function(t,e){switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(t,e)},u.prototype.removeAttachment=function(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()},u.prototype.recordFormattingUndoEntry=function(e){var i,r;return i=t(e),r=this.selectionManager.getLocationRange(),i||!n(r)?this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0}):void 0},u.prototype.recordTypingUndoEntry=function(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})},u.prototype.getUndoContext=function(){var t;return t=1<=arguments.length?a.call(arguments,0):[],[this.getLocationContext(),this.getTimeContext()].concat(a.call(t))},u.prototype.getLocationContext=function(){var t;return t=this.selectionManager.getLocationRange(),n(t)?t[0].index:t},u.prototype.getTimeContext=function(){return o.config.undoInterval>0?Math.floor((new Date).getTime()/o.config.undoInterval):0},u.prototype.isFocused=function(){var t;return this.editorElement===(null!=(t=this.editorElement.ownerDocument)?t.activeElement:void 0)},u.prototype.isFocusedInvisibly=function(){return this.isFocused()&&!this.getLocationRange()},u}(o.Controller)}.call(this),function(){var t,e,n,i,r,s,a,u,c,l,p,h,d,f,g,m,y=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=o.browser,s=o.makeElement,a=o.triggerEvent,i=o.handleEvent,r=o.handleEventOnce,n=o.findClosestElementFromNode,t=o.AttachmentView.attachmentSelector,o.registerElement("trix-editor",(f=0,c=function(t){return!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t?t.focus():void 0},g=function(t){return t.hasAttribute("contenteditable")?void 0:(t.setAttribute("contenteditable",""),r("focus",{onElement:t,withCallback:function(){return l(t)}}))},l=function(t){return h(t),m(t)},h=function(t){return("function"==typeof document.queryCommandSupported?document.queryCommandSupported("enableObjectResizing"):void 0)?(document.execCommand("enableObjectResizing",!1,!1),i("mscontrolselect",{onElement:t,preventDefault:!0})):void 0},m=function(){var t;return!("function"==typeof document.queryCommandSupported?document.queryCommandSupported("DefaultParagraphSeparator"):void 0)||"div"!==(t=o.config.blockAttributes.default.tagName)&&"p"!==t?void 0:document.execCommand("DefaultParagraphSeparator",!1,t)},u=function(t){return t.hasAttribute("role")?void 0:t.setAttribute("role","textbox")},d=function(t){var e;if(!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby"))return(e=function(){var e,n,i;return i=function(){var n,i,r,o;for(o=[],n=0,i=(r=t.labels).length;i>n;n++)(e=r[n]).contains(t)||o.push(e.textContent);return o}(),(n=i.join(" "))?t.setAttribute("aria-label",n):t.removeAttribute("aria-label")})(),i("focus",{onElement:t,withCallback:e})},p=e.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"},{defaultCSS:"%t {\n  display: block;\n}\n\n%t:empty:not(:focus)::before {\n  content: attr(placeholder);\n  color: graytext;\n  cursor: text;\n  pointer-events: none;\n}\n\n%t a[contenteditable=false] {\n  cursor: text;\n}\n\n%t img {\n  max-width: 100%;\n  height: auto;\n}\n\n%t "+t+" figcaption textarea {\n  resize: none;\n}\n\n%t "+t+" figcaption textarea.trix-autoresize-clone {\n  position: absolute;\n  left: -9999px;\n  max-height: 0px;\n}\n\n%t "+t+" figcaption[data-trix-placeholder]:empty::before {\n  content: attr(data-trix-placeholder);\n  color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n  display: "+p.display+" !important;\n  width: "+p.width+" !important;\n  padding: 0 !important;\n  margin: 0 !important;\n  border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n  vertical-align: top !important;\n  margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n  vertical-align: bottom !important;\n  margin-right: -1px !important;\n}",trixId:{get:function(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++f),this.trixId)}},labels:{get:function(){var t,e,i;return e=[],this.id&&this.ownerDocument&&e.push.apply(e,this.ownerDocument.querySelectorAll("label[for='"+this.id+"']")),(t=n(this,{matchingSelector:"label"}))&&((i=t.control)===this||null===i)&&e.push(t),e}},toolbarElement:{get:function(){var t,e,n;return this.hasAttribute("toolbar")?null!=(e=this.ownerDocument)?e.getElementById(this.getAttribute("toolbar")):void 0:this.parentNode?(n="trix-toolbar-"+this.trixId,this.setAttribute("toolbar",n),t=s("trix-toolbar",{id:n}),this.parentNode.insertBefore(t,this),t):void 0}},inputElement:{get:function(){var t,e,n;return this.hasAttribute("input")?null!=(n=this.ownerDocument)?n.getElementById(this.getAttribute("input")):void 0:this.parentNode?(e="trix-input-"+this.trixId,this.setAttribute("input",e),t=s("input",{type:"hidden",id:e}),this.parentNode.insertBefore(t,this.nextElementSibling),t):void 0}},editor:{get:function(){var t;return null!=(t=this.editorController)?t.editor:void 0}},name:{get:function(){var t;return null!=(t=this.inputElement)?t.name:void 0}},value:{get:function(){var t;return null!=(t=this.inputElement)?t.value:void 0},set:function(t){var e;return this.defaultValue=t,null!=(e=this.editor)?e.loadHTML(this.defaultValue):void 0}},notify:function(t,e){return this.editorController?a("trix-"+t,{onElement:this,attributes:e}):void 0},setInputElementValue:function(t){var e;return null!=(e=this.inputElement)?e.value=t:void 0},initialize:function(){return this.hasAttribute("data-trix-internal")?void 0:(g(this),u(this),d(this))},connect:function(){return this.hasAttribute("data-trix-internal")?void 0:(this.editorController||(a("trix-before-initialize",{onElement:this}),this.editorController=new o.EditorController({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(function(t){return function(){return a("trix-initialize",{onElement:t})}}(this))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),c(this))},disconnect:function(){var t;return null!=(t=this.editorController)&&t.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()},registerResetListener:function(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)},unregisterResetListener:function(){return window.removeEventListener("reset",this.resetListener,!1)},registerClickListener:function(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)},unregisterClickListener:function(){return window.removeEventListener("click",this.clickListener,!1)},resetBubbled:function(t){var e;if(!t.defaultPrevented&&t.target===(null!=(e=this.inputElement)?e.form:void 0))return this.reset()},clickBubbled:function(t){var e;if(!(t.defaultPrevented||this.contains(t.target)||!(e=n(t.target,{matchingSelector:"label"}))||y.call(this.labels,e)<0))return this.focus()},reset:function(){return this.value=this.defaultValue}}))}.call(this),function(){}.call(this)}).call(this),t.exports?t.exports=o:void 0===(r="function"===typeof(i=o)?i.call(e,n,e,t):i)||(t.exports=r)}.call(this)},2918:function(t,e,n){var i,r;
2(function(){(function(){(function(){this.Turbolinks={supported:null!=window.history.pushState&&null!=window.requestAnimationFrame&&null!=window.addEventListener,visit:function(t,e){return o.controller.visit(t,e)},clearCache:function(){return o.controller.clearCache()},setProgressBarDelay:function(t){return o.controller.setProgressBarDelay(t)}}}).call(this)}).call(this);var o=this.Turbolinks;(function(){(function(){var t,e,n,i=[].slice;o.copyObject=function(t){var e,n,i;for(e in n={},t)i=t[e],n[e]=i;return n},o.closest=function(e,n){return t.call(e,n)},t=function(){var t;return null!=(t=document.documentElement.closest)?t:function(t){var n;for(n=this;n;){if(n.nodeType===Node.ELEMENT_NODE&&e.call(n,t))return n;n=n.parentNode}}}(),o.defer=function(t){return setTimeout(t,1)},o.throttle=function(t){var e;return e=null,function(){var n;return n=1<=arguments.length?i.call(arguments,0):[],null!=e?e:e=requestAnimationFrame(function(i){return function(){return e=null,t.apply(i,n)}}(this))}},o.dispatch=function(t,e){var i,r,o,s,a,u;return u=(a=null!=e?e:{}
2).target,i=a.cancelable,r=a.data,(o=document.createEvent("Events")).initEvent(t,!0,!0===i),o.data=null!=r?r:{},o.cancelable&&!n&&(s=o.preventDefault,o.preventDefault=function(){return this.defaultPrevented||Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),s.call(this)}),(null!=u?u:document).dispatchEvent(o),o},n=function(){var t;return(t=document.createEvent("Events")).initEvent("test",!0,!0),t.preventDefault(),t.defaultPrevented}(),o.match=function(t,n){return e.call(t,n)},e=function(){var t,e,n,i;return null!=(e=null!=(n=null!=(i=(t=document.documentElement).matchesSelector)?i:t.webkitMatchesSelector)?n:t.msMatchesSelector)?e:t.mozMatchesSelector}(),o.uuid=function(){var t,e,n;for(n="",t=e=1;36>=e;t=++e)n+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return n}}).call(this),function(){o.Location=function(){function t(t){var e,n;null==t&&(t=""),(n=document.createElement("a")).href=t.toString(),this.absoluteURL=n.href,2>(e=n.hash.length)?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=n.hash.slice(1))}var e,n,i,r;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.requestURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=n(t),this.isEqualTo(t)||r(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},n=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return i(t,"/")?t:t+"/"},r=function(t,e){return t.slice(0,e.length)===e},i=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};o.HttpRequest=function(){function e(e,n,i){this.delegate=e,this.requestCanceled=t(this.requestCanceled,this),this.requestTimedOut=t(this.requestTimedOut,this),this.requestFailed=t(this.requestFailed,this),this.requestLoaded=t(this.requestLoaded,this),this.requestProgressed=t(this.requestProgressed,this),this.url=o.Location.wrap(n).requestURL,this.referrer=o.Location.wrap(i).absoluteURL,this.createXHR()}return e.NETWORK_FAILURE=0,e.TIMEOUT_FAILURE=-1,e.timeout=60,e.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},e.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},e.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},e.prototype.requestLoaded=function(){return this.endRequest(function(t){return function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}}(this))},e.prototype.requestFailed=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}}(this))},e.prototype.requestTimedOut=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}}(this))},e.prototype.requestCanceled=function(){return this.endRequest()},e.prototype.notifyApplicationBeforeRequestStart=function(){return o.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},e.prototype.notifyApplicationAfterRequestEnd=function(){return o.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},e.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},e.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},e.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},e.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},e}()}.call(this),function(){o.ProgressBar=function(){function t(){this.trickle=function(t,e){return function(){return t.apply(e,arguments)}}(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var e;return e=300,t.defaultCSS=".turbolinks-progress-bar {\n  position: fixed;\n  display: block;\n  top: 0;\n  left: 0;\n  height: 3px;\n  background: #0076ff;\n  z-index: 9999;\n  transition: width 300ms ease-out, opacity 150ms 150ms ease-in;\n  transform: translate3d(0, 0, 0);\n}",t.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},t.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement(function(t){return function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}}(this))):void 0},t.prototype.setValue=function(t){return this.value=t,this.refresh()},t.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},t.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},t.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,450)},t.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},t.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,e)},t.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},t.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},t.prototype.refresh=function(){return requestAnimationFrame(function(t){return function(){return t.progressElement.style.width=10+90*t.value+"%"}}(this))},t.prototype.createStylesheetElement=function(){var t;return(t=document.createElement("style")).type="text/css",t.textContent=this.constructor.defaultCSS,t},t.prototype.createProgressElement=function(){var t;return(t=document.createElement("div")).className="turbolinks-progress-bar",t},t}()}.call(this),function(){o.BrowserAdapter=function(){function t(t){this.controller=t,this.showProgressBar=function(t,e){return function(){return t.apply(e,arguments)}}(this.showProgressBar,this),this.progressBar=new o.ProgressBar}var e,n,i;return i=o.HttpRequest,e=i.NETWORK_FAILURE,n=i.TIMEOUT_FAILURE,t.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},t.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},t.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},t.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},t.prototype.visitRequestCompleted=function(t){return t.loadResponse()},t.prototype.visitRequestFailedWithStatusCode=function(t,i){switch(i){case e:case n:return this.reload();default:return t.loadResponse()}},t.prototype.visitRequestFinished=function(t){return this.hideProgressBar()},t.prototype.visitCompleted=function(t){return t.followRedirect()},t.prototype.pageInvalidated=function(){return this.reload()},t.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,this.controller.progressBarDelay)},t.prototype.showProgressBar=function(){return this.progressBar.show()},t.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},t.prototype.reload=function(){return window.location.reload()},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};o.History=function(){function e(e){this.delegate=e,this.onPageLoad=t(this.onPageLoad,this),this.onPopState=t(this.onPopState,this)}return e.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)},e.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1):void 0},e.prototype.push=function(t,e){return t=o.Location.wrap(t),this.update("push",t,e)},e.prototype.replace=function(t,e){return t=o.Location.wrap(t),this.update("replace",t,e)},e.prototype.onPopState=function(t){var e,n,i,r;return this.shouldHandlePopState()&&(r=null!=(n=t.state)?n.turbolinks:void 0)?(e=o.Location.wrap(window.location),i=r.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(e,i)):void 0},e.prototype.onPageLoad=function(t){return o.defer(function(t){return function(){return t.pageLoaded=!0}}(this))},e.prototype.shouldHandlePopState=function(){return this.pageIsLoaded()},e.prototype.pageIsLoaded=function(){return this.pageLoaded||"complete"===document.readyState},e.prototype.update=function(t,e,n){var i;return i={turbolinks:{restorationIdentifier:n}},history[t+"State"](i,null,e)},e}()}.call(this),function(){o.HeadDetails=function(){function t(t){var e,n,i,s,a;for(this.elements={},n=0,s=t.length;s>n;n++)(a=t[n]).nodeType===Node.ELEMENT_NODE&&(i=a.outerHTML,(null!=(e=this.elements)[i]?e[i]:e[i]={type:o(a),tracked:r(a),elements:[]}).elements.push(a))}var e,n,i,r,o;return t.fromHeadElement=function(t){var e;return new this(null!=(e=null!=t?t.childNodes:void 0)?e:[])},t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t;return function(){var e,n;for(t in n=[],e=this.elements)e[t].tracked&&n.push(t);return n}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var n,i,r,o,s,a;for(i in s=[],r=this.elements)a=(o=r[i]).type,n=o.elements,a!==t||e.hasElementWithKey(i)||s.push(n[0]);return s},t.prototype.getProvisionalElements=function(){var t,e,n,i,r,o,s;for(e in n=[],i=this.elements)s=(r=i[e]).type,o=r.tracked,t=r.elements,null!=s||o?t.length>1&&n.push.apply(n,t.slice(1)):n.push.apply(n,t);return n},t.prototype.getMetaValue=function(t){var e;return null!=(e=this.findMetaElementByName(t))?e.getAttribute("content"):void 0},t.prototype.findMetaElementByName=function(t){var n,i,r,o;for(r in n=void 0,o=this.elements)i=o[r].elements,e(i[0],t)&&(n=i[0]);return n},o=function(t){return n(t)?"script":i(t)?"stylesheet":void 0},r=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},n=function(t){return"script"===t.tagName.toLowerCase()},i=function(t){var e;return"style"===(e=t.tagName.toLowerCase())||"link"===e&&"stylesheet"===t.getAttribute("rel")},e=function(t,e){return"meta"===t.tagName.toLowerCase()&&t.getAttribute("name")===e},t}()}.call(this),function(){o.Snapshot=function(){function t(t,e){this.headDetails=t,this.bodyElement=e}return t.wrap=function(t){return t instanceof this?t:"string"==typeof t?this.fromHTMLString(t):this.fromHTMLElement(t)},t.fromHTMLString=function(t){var e;return(e=document.createElement("html")).innerHTML=t,this.fromHTMLElement(e)},t.fromHTMLElement=function(t){var e,n,i;return n=t.querySelector("head"),e=null!=(i=t.querySelector("body"))?i:document.createElement("body"),new this(o.HeadDetails.fromHeadElement(n),e)},t.prototype.clone=function(){return new this.constructor(this.headDetails,this.bodyElement.cloneNode(!0))},t.prototype.getRootLocation=function(){var t,e;return e=null!=(t=this.getSetting("root"))?t:"/",new o.Location(e)}
2,t.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},t.prototype.getElementForAnchor=function(t){try{return this.bodyElement.querySelector("[id='"+t+"'], a[name='"+t+"']")}catch(o){}},t.prototype.getPermanentElements=function(){return this.bodyElement.querySelectorAll("[id][data-turbolinks-permanent]")},t.prototype.getPermanentElementById=function(t){return this.bodyElement.querySelector("#"+t+"[data-turbolinks-permanent]")},t.prototype.getPermanentElementsPresentInSnapshot=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.getPermanentElements()).length;i>n;n++)e=r[n],t.getPermanentElementById(e.id)&&o.push(e);return o},t.prototype.findFirstAutofocusableElement=function(){return this.bodyElement.querySelector("[autofocus]")},t.prototype.hasAnchor=function(t){return null!=this.getElementForAnchor(t)},t.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},t.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},t.prototype.isVisitable=function(){return"reload"!==this.getSetting("visit-control")},t.prototype.getSetting=function(t){return this.headDetails.getMetaValue("turbolinks-"+t)},t}()}.call(this),function(){var t=[].slice;o.Renderer=function(){function e(){}var n;return e.render=function(){var e,n,i;return n=arguments[0],e=arguments[1],i=function(t,e,n){n.prototype=t.prototype;var i=new n,r=t.apply(i,e);return Object(r)===r?r:i}(this,3<=arguments.length?t.call(arguments,2):[],(function(){})),i.delegate=n,i.render(e),i},e.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},e.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},e.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:((e=document.createElement("script")).textContent=t.textContent,e.async=!1,n(e,t),e)},n=function(t,e){var n,i,r,o,s,a,u;for(a=[],n=0,i=(o=e.attributes).length;i>n;n++)r=(s=o[n]).name,u=s.value,a.push(t.setAttribute(r,u));return a},e}()}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;o.SnapshotRenderer=function(i){function r(t,e,n){this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=n,this.currentHeadDetails=this.currentSnapshot.headDetails,this.newHeadDetails=this.newSnapshot.headDetails,this.currentBody=this.currentSnapshot.bodyElement,this.newBody=this.newSnapshot.bodyElement}return n(r,i),r.prototype.render=function(t){return this.shouldRender()?(this.mergeHead(),this.renderView(function(e){return function(){return e.replaceBody(),e.isPreview||e.focusFirstAutofocusableElement(),t()}}(this))):this.invalidateView()},r.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},r.prototype.replaceBody=function(){var t;return t=this.relocateCurrentBodyPermanentElements(),this.activateNewBodyScriptElements(),this.assignNewBody(),this.replacePlaceholderElementsWithClonedPermanentElements(t)},r.prototype.shouldRender=function(){return this.newSnapshot.isVisitable()&&this.trackedElementsAreIdentical()},r.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},r.prototype.copyNewHeadStylesheetElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadStylesheetElements()).length;n>e;e++)t=i[e],r.push(document.head.appendChild(t));return r},r.prototype.copyNewHeadScriptElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadScriptElements()).length;n>e;e++)t=i[e],r.push(document.head.appendChild(this.createScriptElement(t)));return r},r.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getCurrentHeadProvisionalElements()).length;n>e;e++)t=i[e],r.push(document.head.removeChild(t));return r},r.prototype.copyNewHeadProvisionalElements=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getNewHeadProvisionalElements()).length;n>e;e++)t=i[e],r.push(document.head.appendChild(t));return r},r.prototype.relocateCurrentBodyPermanentElements=function(){var n,i,r,o,s,a,u;for(u=[],n=0,i=(a=this.getCurrentBodyPermanentElements()).length;i>n;
2n++)o=a[n],s=t(o),r=this.newSnapshot.getPermanentElementById(o.id),e(o,s.element),e(r,o),u.push(s);return u},r.prototype.replacePlaceholderElementsWithClonedPermanentElements=function(t){var n,i,r,o,s,a;for(a=[],r=0,o=t.length;o>r;r++)i=(s=t[r]).element,n=s.permanentElement.cloneNode(!0),a.push(e(i,n));return a},r.prototype.activateNewBodyScriptElements=function(){var t,n,i,r,o,s;for(s=[],n=0,r=(o=this.getNewBodyScriptElements()).length;r>n;n++)i=o[n],t=this.createScriptElement(i),s.push(e(i,t));return s},r.prototype.assignNewBody=function(){return document.body=this.newBody},r.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.newSnapshot.findFirstAutofocusableElement())?t.focus():void 0},r.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},r.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},r.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},r.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},r.prototype.getCurrentBodyPermanentElements=function(){return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot)},r.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},r}(o.Renderer),t=function(t){var e;return(e=document.createElement("meta")).setAttribute("name","turbolinks-permanent-placeholder"),e.setAttribute("content",t.id),{element:e,permanentElement:t}},e=function(t,e){var n;return(n=t.parentNode)?n.replaceChild(e,t):void 0}}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;o.ErrorRenderer=function(e){function n(t){var e;(e=document.createElement("html")).innerHTML=t,this.newHead=e.querySelector("head"),this.newBody=e.querySelector("body")}return t(n,e),n.prototype.render=function(t){return this.renderView(function(e){return function(){return e.replaceHeadAndBody(),e.activateBodyScriptElements(),t()}}(this))},n.prototype.replaceHeadAndBody=function(){var t,e;return e=document.head,t=document.body,e.parentNode.replaceChild(this.newHead,e),t.parentNode.replaceChild(this.newBody,t)},n.prototype.activateBodyScriptElements=function(){var t,e,n,i,r,o;for(o=[],e=0,n=(i=this.getScriptElements()).length;n>e;e++)r=i[e],t=this.createScriptElement(r),o.push(r.parentNode.replaceChild(t,r));return o},n.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},n}(o.Renderer)}.call(this),function(){o.View=function(){function t(t){this.delegate=t,this.htmlElement=document.documentElement}return t.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},t.prototype.getElementForAnchor=function(t){return this.getSnapshot().getElementForAnchor(t)},t.prototype.getSnapshot=function(){return o.Snapshot.fromHTMLElement(this.htmlElement)},t.prototype.render=function(t,e){var n,i,r;return r=t.snapshot,n=t.error,i=t.isPreview,this.markAsPreview(i),null!=r?this.renderSnapshot(r,i,e):this.renderError(n,e)},t.prototype.markAsPreview=function(t){return t?this.htmlElement.setAttribute("data-turbolinks-preview",""):this.htmlElement.removeAttribute("data-turbolinks-preview")},t.prototype.renderSnapshot=function(t,e,n){return o.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),o.Snapshot.wrap(t),e)},t.prototype.renderError=function(t,e){return o.ErrorRenderer.render(this.delegate,e,t)},t}()}.call(this),function(){o.ScrollManager=function(){function t(t){this.delegate=t,this.onScroll=function(t,e){return function(){return t.apply(e,arguments)}}(this.onScroll,this),this.onScroll=o.throttle(this.onScroll)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},t.prototype.scrollToElement=function(t){return t.scrollIntoView()},t.prototype.scrollToPosition=function(t){var e,n;return e=t.x,n=t.y,window.scrollTo(e,n)},t.prototype.onScroll=function(t){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},t.prototype.updatePosition=function(t){var e;
2return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},t}()}.call(this),function(){o.SnapshotCache=function(){function t(t){this.size=t,this.keys=[],this.snapshots={}}var e;return t.prototype.has=function(t){return e(t)in this.snapshots},t.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},t.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},t.prototype.read=function(t){var n;return n=e(t),this.snapshots[n]},t.prototype.write=function(t,n){var i;return i=e(t),this.snapshots[i]=n},t.prototype.touch=function(t){var n,i;return i=e(t),(n=this.keys.indexOf(i))>-1&&this.keys.splice(n,1),this.keys.unshift(i),this.trim()},t.prototype.trim=function(){var t,e,n,i,r;for(r=[],t=0,n=(i=this.keys.splice(this.size)).length;n>t;t++)e=i[t],r.push(delete this.snapshots[e]);return r},e=function(t){return o.Location.wrap(t).toCacheKey()},t}()}.call(this),function(){o.Visit=function(){function t(t,e,n){this.controller=t,this.action=n,this.performScroll=function(t,e){return function(){return t.apply(e,arguments)}}(this.performScroll,this),this.identifier=o.uuid(),this.location=o.Location.wrap(e),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var e;return t.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},t.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},t.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},t.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},t.prototype.changeHistory=function(){var t,n;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,n=e(t),this.controller[n](this.location,this.restorationIdentifier),this.historyChanged=!0)},t.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new o.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},t.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},t.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},t.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render((function(){var n;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(n=this.adapter).visitRendered&&n.visitRendered(this),t?void 0:this.complete()}))):void 0},t.prototype.loadResponse=function(){return null!=this.response?this.render((function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())})):void 0},t.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},t.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},t.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},t.prototype.requestCompletedWithResponse=function(t,e){return this.response=t,null!=e&&(this.redirectedToLocation=o.Location.wrap(e)),this.adapter.visitRequestCompleted(this)},t.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},t.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},t.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},t.prototype.scrollToRestoredPosition=function(){var t,e;return null!=(t=null!=(e=this.restorationData)?e.scrollPosition:void 0)?(this.controller.scrollToPosition(t),!0):void 0},t.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},t.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},t.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},t.prototype.getTimingMetrics=function(){return o.copyObject(this.timingMetrics)},e=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},t.prototype.shouldIssueRequest=function(){return"restore"!==this.action||!this.hasCachedSnapshot()},t.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},t.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame(function(e){return function(){return e.frame=null,t.call(e)}}(this))},t.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};o.Controller=function(){function e(){this.clickBubbled=t(this.clickBubbled,this),this.clickCaptured=t(this.clickCaptured,this),this.pageLoaded=t(this.pageLoaded,this),this.history=new o.History(this),this.view=new o.View(this),this.scrollManager=new o.ScrollManager(this),this.restorationData={},this.clearCache(),this.setProgressBarDelay(500)}return e.prototype.start=function(){return o.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},e.prototype.clearCache=function(){return this.cache=new o.SnapshotCache(10)},e.prototype.visit=function(t,e){var n,i;return null==e&&(e={}),t=o.Location.wrap(t),this.applicationAllowsVisitingLocation(t)?this.locationIsVisitable(t)?(n=null!=(i=e.action)?i:"advance",this.adapter.visitProposedToLocationWithAction(t,n)):window.location=t:void 0},e.prototype.startVisitToLocationWithAction=function(t,e,n){var i;return o.supported?(i=this.getRestorationDataForIdentifier(n),this.startVisit(t,e,{restorationData:i})):window.location=t},e.prototype.setProgressBarDelay=function(t){return this.progressBarDelay=t},e.prototype.startHistory=function(){return this.location=o.Location.wrap(window.location),this.restorationIdentifier=o.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.stopHistory=function(){return this.history.stop()},e.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=o.Location.wrap(t),this.history.push(this.location,this.restorationIdentifier)},e.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=o.Location.wrap(t),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.historyPoppedToLocationWithRestorationIdentifier=function(t,e){var n;return this.restorationIdentifier=e,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(t,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=o.Location.wrap(t)):this.adapter.pageInvalidated()},e.prototype.getCachedSnapshotForLocation=function(t){var e;return null!=(e=this.cache.get(t))?e.clone():void 0},e.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},e.prototype.cacheSnapshot=function(){var t,e;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),e=this.view.getSnapshot(),t=this.lastRenderedLocation,o.defer(function(n){return function(){return n.cache.put(t,e.clone())}}(this))):void 0},e.prototype.scrollToAnchor=function(t){var e;return(e=this.view.getElementForAnchor(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},e.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},e.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},e.prototype.scrollPositionChanged=function(t){return this.getCurrentRestorationData().scrollPosition=t},e.prototype.render=function(t,e){return this.view.render(t,e)},e.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},e.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},e.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},e.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},e.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},e.prototype.clickBubbled=function(t){var e,n,i;return this.enabled&&this.clickEventIsSignificant(t)&&(n=this.getVisitableLinkForNode(t.target))&&(i=this.getVisitableLocationForLink(n))&&this.applicationAllowsFollowingLinkToLocation(n,i)?(t.preventDefault(),e=this.getActionForLink(n),this.visit(i,{action:e})):void 0},e.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){return!this.notifyApplicationAfterClickingLinkToLocation(t,e).defaultPrevented},e.prototype.applicationAllowsVisitingLocation=function(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented},e.prototype.notifyApplicationAfterClickingLinkToLocation=function(t,e){return o.dispatch("turbolinks:click",{target:t,data:{url:e.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationBeforeVisitingLocation=function(t){return o.dispatch("turbolinks:before-visit",{data:{url:t.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationAfterVisitingLocation=function(t){return o.dispatch("turbolinks:visit",{data:{url:t.absoluteURL}})},e.prototype.notifyApplicationBeforeCachingSnapshot=function(){return o.dispatch("turbolinks:before-cache")},e.prototype.notifyApplicationBeforeRender=function(t){return o.dispatch("turbolinks:before-render",{data:{newBody:t}})},e.prototype.notifyApplicationAfterRender=function(){return o.dispatch("turbolinks:render")},e.prototype.notifyApplicationAfterPageLoad=function(t){return null==t&&(t={}),o.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:t}})},e.prototype.startVisit=function(t,e,n){var i;return null!=(i=this.currentVisit)&&i.cancel(),this.currentVisit=this.createVisit(t,e,n),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},e.prototype.createVisit=function(t,e,n){var i,r,s,a,u;return a=(r=null!=n?n:{}).restorationIdentifier,s=r.restorationData,i=r.historyChanged,(u=new o.Visit(this,t,e)).restorationIdentifier=null!=a?a:o.uuid(),u.restorationData=o.copyObject(s),u.historyChanged=i,u.referrer=this.location,u},e.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},e.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},e.prototype.getVisitableLinkForNode=function(t){return this.nodeIsVisitable(t)?o.closest(t,"a[href]:not([target]):not([download])"):void 0},e.prototype.getVisitableLocationForLink=function(t){var e;return e=new o.Location(t.getAttribute("href")),this.locationIsVisitable(e)?e:void 0},e.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},e.prototype.nodeIsVisitable=function(t){var e;return!(e=o.closest(t,"[data-turbolinks]"))||"false"!==e.getAttribute("data-turbolinks")},e.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},e.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},e.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},e}()}.call(this),function(){!function(){var t,e;if((t=e=document.currentScript)&&!e.hasAttribute("data-turbolinks-suppress-warning"))for(;t=t.parentNode;)if(t===document.body)return console.warn("You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!\n\nLoad your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\nFor more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements\n\n\u2014\u2014\nSuppress this warning by adding a `data-turbolinks-suppress-warning` attribute to: %s",e.outerHTML)}()}.call(this),function(){var t,e,n;o.start=function(){return e()?(null==o.controller&&(o.controller=t()),o.controller.start()):void 0},e=function(){return null==window.Turbolinks&&(window.Turbolinks=o),n()},t=function(){var t;return(t=new o.Controller).adapter=new o.BrowserAdapter(t),t},(n=function(){return window.Turbolinks===o})()&&o.start()}.call(this)}).call(this),t.exports?t.exports=o:void 0===(r="function"===typeof(i=o)?i.call(e,n,e,t):i)||(t.exports=r)}).call(this)}}]);
3//# sourceMappingURL=551-baa16828f517f470ac4a.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.