/*! For license information please see community.bundle.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.TFWeb=t(require("react"),require("react-dom")):e.TFWeb=t(e.React,e.ReactDOM)}(this,((e,t)=>(()=>{var n={2066:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),a=c(i),s=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==r(t)&&"function"!=typeof t?e:t}(this,Object.getPrototypeOf(t).call(this,e));return n.onDocMouseTouchMove=n.onDocMouseTouchMove.bind(n),n.onDocMouseTouchEnd=n.onDocMouseTouchEnd.bind(n),n.onImageLoad=n.onImageLoad.bind(n),n.onComponentMouseTouchDown=n.onComponentMouseTouchDown.bind(n),n.onComponentKeyDown=n.onComponentKeyDown.bind(n),n.onCropMouseTouchDown=n.onCropMouseTouchDown.bind(n),n.state={crop:n.nextCropState(n.props.crop),polygonId:n.getRandomInt(1,9e5)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+r(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){if(document.addEventListener("mousemove",this.onDocMouseTouchMove),document.addEventListener("touchmove",this.onDocMouseTouchMove),document.addEventListener("mouseup",this.onDocMouseTouchEnd),document.addEventListener("touchend",this.onDocMouseTouchEnd),document.addEventListener("touchcancel",this.onDocMouseTouchEnd),this.imageRef.complete||this.imageRef.readyState)if(0===this.imageRef.naturalWidth){var e=this.imageRef.src;this.imageRef.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.imageRef.src=e}else this.onImageLoad(this.imageRef)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(e.crop){var t=this.nextCropState(e.crop);t.aspect&&(t=this.ensureAspectDimensions(t,this.imageRef)),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onDocMouseTouchMove),document.removeEventListener("touchmove",this.onDocMouseTouchMove),document.removeEventListener("mouseup",this.onDocMouseTouchEnd),document.removeEventListener("touchend",this.onDocMouseTouchEnd),document.removeEventListener("touchcancel",this.onDocMouseTouchEnd)}},{key:"onDocMouseTouchMove",value:function(e){if(!this.props.disabled&&this.mouseDownOnCrop){e.preventDefault();var t=this.state.crop,n=this.evData,r=this.getClientPos(e);n.isResize&&t.aspect&&n.cropOffset&&(r.y=this.straightenYPath(r.x));var o=r.x-n.clientStartX;n.xDiffPc=o/n.imageWidth*100;var i=r.y-n.clientStartY;n.yDiffPc=i/n.imageHeight*100,n.isResize?this.resizeCrop():this.dragCrop(),this.cropInvalid=!1,this.props.onChange&&this.props.onChange(t,this.getPixelCrop(t)),this.setState({crop:t})}}},{key:"onCropMouseTouchDown",value:function(e){if(!this.props.disabled){e.preventDefault();var t=this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=e.target.dataset.ord,o="nw"===r||"w"===r||"sw"===r,i="nw"===r||"n"===r||"ne"===r,a=void 0;t.aspect&&(a=this.getElementOffset(this.cropSelectRef)),this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:o?t.x+t.width:t.x,cropStartY:i?t.y+t.height:t.y,xInversed:o,yInversed:i,xCrossOver:o,yCrossOver:i,startXCrossOver:o,startYCrossOver:i,isResize:e.target!==this.cropSelectRef,ord:r,cropOffset:a},this.mouseDownOnCrop=!0}}},{key:"onComponentMouseTouchDown",value:function(e){if((e.target===this.imageCopyRef||e.target===this.cropWrapperRef)&&!this.props.disabled){e.preventDefault();var t=!0===this.props.keepSelection?{}:this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=this.getElementOffset(this.imageRef),o=(n.x-r.left)/this.imageRef.width*100,i=(n.y-r.top)/this.imageRef.height*100;t.x=o,t.y=i,t.width=0,t.height=0,this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:t.x,cropStartY:t.y,xInversed:!1,yInversed:!1,xCrossOver:!1,yCrossOver:!1,startXCrossOver:!1,startYCrossOver:!1,isResize:!0,ord:"nw"},this.mouseDownOnCrop=!0,this.setState({newCropIsBeingDrawn:!0})}}},{key:"onComponentKeyDown",value:function(e){var n=this;if(!this.props.disabled){var r=e.which,o=this.state.crop,i=!1;o.width&&o.height&&(r===t.arrowKey.left?(o.x-=t.nudgeStep,i=!0):r===t.arrowKey.right?(o.x+=t.nudgeStep,i=!0):r===t.arrowKey.up?(o.y-=t.nudgeStep,i=!0):r===t.arrowKey.down&&(o.y+=t.nudgeStep,i=!0),i&&(e.preventDefault(),o.x=this.clamp(o.x,0,100-o.width),o.y=this.clamp(o.y,0,100-o.height),this.setState({crop:o},(function(){n.props.onChange&&n.props.onChange(o,n.getPixelCrop(o)),n.props.onComplete&&n.props.onComplete(o,n.getPixelCrop(o))}))))}}},{key:"onDocMouseTouchEnd",value:function(){if(!this.props.disabled&&this.mouseDownOnCrop){var e=this.state.crop;this.cropInvalid=this.isCropInvalid(e),this.mouseDownOnCrop=!1,this.props.onComplete&&this.props.onComplete(e,this.getPixelCrop(e)),this.setState({newCropIsBeingDrawn:!1})}}},{key:"getPixelCrop",value:function(e){return{x:Math.round(this.imageRef.naturalWidth*(e.x/100)),y:Math.round(this.imageRef.naturalHeight*(e.y/100)),width:Math.round(this.imageRef.naturalWidth*(e.width/100)),height:Math.round(this.imageRef.naturalHeight*(e.height/100))}}},{key:"getPolygonValues",value:function(e){var t=this.state.crop,n=[t.x,t.y],r=[t.x+t.width,t.y],o=[t.x,t.y+t.height],i=[t.x+t.width,t.y+t.height];return e?(n=this.arrayDividedBy100(n),r=this.arrayDividedBy100(r),o=this.arrayDividedBy100(o),i=this.arrayDividedBy100(i)):(n=this.arrayToPercent(n),r=this.arrayToPercent(r),o=this.arrayToPercent(o),i=this.arrayToPercent(i)),{top:{left:n,right:r},bottom:{left:o,right:i}}}},{key:"getCropStyle",value:function(){return{top:this.state.crop.y+"%",left:this.state.crop.x+"%",width:this.state.crop.width+"%",height:this.state.crop.height+"%"}}},{key:"getEllipseValues",value:function(e){var t=this.state.crop,n=t.width/2,r=t.height/2,o=t.x+n,i=t.y+r;return e?(n/=100,r/=100,o/=100,i/=100):(n+="%",r+="%",o+="%",i+="%"),{cx:o,cy:i,rx:n,ry:r}}},{key:"getPolygonClipPath",value:function(){var e=this.getPolygonValues(),t=e.top,n=e.bottom;return"polygon("+t.left+", "+t.right+", "+n.right+", "+n.left+")"}},{key:"getEllipseClipPath",value:function(){var e=this.getEllipseValues();return"ellipse("+e.rx+" "+e.ry+" at "+e.cx+" "+e.cy+")"}},{key:"getElementOffset",value:function(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+window.pageYOffset-n.clientTop,left:t.left+window.pageXOffset-n.clientLeft}}},{key:"getClientPos",value:function(e){var t=void 0,n=void 0;return e.touches?(t=e.touches[0].pageX,n=e.touches[0].pageY):(t=e.pageX,n=e.pageY),{x:t,y:n}}},{key:"getNewSize",value:function(){var e=this.state.crop,t=this.evData,n=t.imageWidth/t.imageHeight,r=t.cropStartWidth+t.xDiffPc;t.xCrossOver&&(r=Math.abs(r));var o=this.props.maxWidth;this.state.newCropIsBeingDrawn||(o=["nw","w","sw"].indexOf(t.inversedXOrd||t.ord)>-1?t.cropStartX:100-t.cropStartX,o=this.clamp(o,100,this.props.maxWidth)),r=this.clamp(r,this.props.minWidth||0,o);var i=void 0;i=e.aspect?r/e.aspect*n:t.cropStartHeight+t.yDiffPc,t.yCrossOver&&(i=Math.min(Math.abs(i),t.cropStartY));var a=this.props.maxHeight;return this.state.newCropIsBeingDrawn||(a=["nw","n","ne"].indexOf(t.inversedYOrd||t.ord)>-1?t.cropStartY:100-t.cropStartY,a=this.clamp(a,100,this.props.maxHeight)),i=this.clamp(i,this.props.minHeight||0,a),e.aspect&&(r=this.clamp(i*e.aspect/n,0,100)),{width:r,height:i}}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"getPolygonId",value:function(){return"ReactCropClipPolygon-"+this.state.polygonId}},{key:"dragCrop",value:function(){var e=this.state.crop,t=this.evData;e.x=this.clamp(t.cropStartX+t.xDiffPc,0,100-e.width),e.y=this.clamp(t.cropStartY+t.yDiffPc,0,100-e.height)}},{key:"resizeCrop",value:function(){var e=this.state.crop,n=this.evData,r=n.ord;n.xInversed&&(n.xDiffPc-=2*n.cropStartWidth),n.yInversed&&(n.yDiffPc-=2*n.cropStartHeight);var o=this.getNewSize(),i=n.cropStartX,a=n.cropStartY;n.xCrossOver&&(i=e.x+(e.width-o.width)),n.yCrossOver&&(a=!1===n.lastYCrossover?e.y-o.height:e.y+(e.height-o.height)),e.x=this.clamp(i,0,100-o.width),e.y=this.clamp(a,0,100-o.height),e.aspect||t.xyOrds.indexOf(r)>-1?(e.width=o.width,e.height=o.height):t.xOrds.indexOf(r)>-1?e.width=o.width:t.yOrds.indexOf(r)>-1&&(e.height=o.height),n.lastYCrossover=n.yCrossOver,this.crossOverCheck()}},{key:"straightenYPath",value:function(e){var t=this.evData,n=t.ord,r=t.cropOffset,o=t.cropStartWidth/100*t.imageWidth,i=t.cropStartHeight/100*t.imageHeight,a=void 0,s=void 0;return"nw"===n||"se"===n?(a=i/o,s=r.top-r.left*a):(a=-i/o,s=r.top+(i-r.left*a)),a*e+s}},{key:"onImageLoad",value:function(e){var t=this.state.crop;t.aspect&&(t=this.ensureAspectDimensions(t,e),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})),this.props.onImageLoaded&&this.props.onImageLoaded(t,e,this.getPixelCrop(t))}},{key:"arrayDividedBy100",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e/100})).join(t)}},{key:"arrayToPercent",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e+"%"})).join(t)}},{key:"createCropSelection",value:function(){var e=this,t=this.getCropStyle(),n=this.state.crop.aspect,r=this.props.ellipse;return a.default.createElement("div",{ref:function(t){e.cropSelectRef=t},style:t,className:"ReactCrop--crop-selection",onMouseDown:this.onCropMouseTouchDown,onTouchStart:this.onCropMouseTouchDown},a.default.createElement("div",{className:"ReactCrop--drag-bar ord-n","data-ord":"n"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-e","data-ord":"e"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-s","data-ord":"s"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-w","data-ord":"w"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-nw","data-ord":"nw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-n","data-ord":"n"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-ne","data-ord":"ne"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-e","data-ord":"e"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-se","data-ord":"se"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-s","data-ord":"s"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-sw","data-ord":"sw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-w","data-ord":"w"}))}},{key:"isCropInvalid",value:function(e){return!e.width||!e.height}},{key:"nextCropState",value:function(e){var n=(0,s.default)({},t.defaultCrop,e);return this.cropInvalid=this.isCropInvalid(n),n}},{key:"clamp",value:function(e,t,n){return Math.min(Math.max(e,t),n)}},{key:"crossOverCheck",value:function(){var e=this.evData;(!e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc>=0||e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc<=0)&&(e.xCrossOver=!e.xCrossOver),(!e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc>=0||e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc<=0)&&(e.yCrossOver=!e.yCrossOver);var t=e.xCrossOver!==e.startXCrossOver,n=e.yCrossOver!==e.startYCrossOver;e.inversedXOrd=!!t&&this.inverseOrd(e.ord),e.inversedYOrd=!!n&&this.inverseOrd(e.ord)}},{key:"inverseOrd",value:function(e){var t=void 0;return"n"===e?t="s":"ne"===e?t="sw":"e"===e?t="w":"se"===e?t="nw":"s"===e?t="n":"sw"===e?t="ne":"w"===e?t="e":"nw"===e&&(t="se"),t}},{key:"ensureAspectDimensions",value:function(e,t){var n=t.naturalWidth/t.naturalHeight,r=(0,s.default)({},e);return r.width?r.height=r.width/r.aspect*n:r.height&&(r.width=r.height*r.aspect/n),r.y+r.height>100&&(r.height=100-r.y,r.width=r.height*r.aspect/n),r.x+r.width>100&&(r.width=100-r.x,r.height=r.width/r.aspect*n),r}},{key:"renderSvg",value:function(){var e=void 0;if(this.props.ellipse)e=a.default.createElement("ellipse",this.getEllipseValues(!0));else{var t=this.getPolygonValues(!0),n=t.top,r=t.bottom;e=a.default.createElement("polygon",{points:n.left+", "+n.right+", "+r.right+", "+r.left})}return a.default.createElement("svg",{width:"0",height:"0",style:{position:"absolute"}},a.default.createElement("defs",null,a.default.createElement("clipPath",{id:this.getPolygonId(),clipPathUnits:"objectBoundingBox"},e)))}},{key:"render",value:function(){var e=this,t=void 0,n=void 0;this.cropInvalid||(t=this.createCropSelection(),n={WebkitClipPath:this.props.ellipse?this.getEllipseClipPath():this.getPolygonClipPath(),clipPath:'url("#'+this.getPolygonId()+'")'});var r=["ReactCrop"];return this.state.newCropIsBeingDrawn&&r.push("ReactCrop-new-crop"),this.state.crop.aspect&&r.push("ReactCrop-fixed-aspect"),this.props.ellipse&&r.push("ReactCrop-ellipse"),this.props.disabled&&r.push("ReactCrop--disabled"),a.default.createElement("div",{ref:function(t){e.componentRef=t},className:r.join(" "),onTouchStart:this.onComponentMouseTouchDown,onMouseDown:this.onComponentMouseTouchDown,tabIndex:"1",onKeyDown:this.onComponentKeyDown},this.renderSvg(),a.default.createElement("img",{ref:function(t){e.imageRef=t},crossOrigin:"anonymous",className:"ReactCrop--image",src:this.props.src,onLoad:function(t){e.onImageLoad(t.target)},alt:""}),a.default.createElement("div",{className:"ReactCrop--crop-wrapper",ref:function(t){e.cropWrapperRef=t}},a.default.createElement("img",{ref:function(t){e.imageCopyRef=t},className:"ReactCrop--image-copy",src:this.props.src,style:n,alt:""}),t),this.props.children)}}]),t}(i.Component);l.defaultProps={disabled:!1,maxWidth:100,maxHeight:100},l.xOrds=["e","w"],l.yOrds=["n","s"],l.xyOrds=["nw","ne","se","sw"],l.arrowKey={left:37,up:38,right:39,down:40},l.nudgeStep=.2,l.defaultCrop={x:0,y:0,width:0,height:0,aspect:!1},e.exports=l},function(e,t){e.exports=n(4639)},function(e,t){e.exports=n(2525)}])},1998:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n)||[],r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n)||[];return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var c=a[s];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},1857:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,n,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=r;var l=Array.isArray(n);return l===Array.isArray(e)?l?c.arrayMerge(e,n,c):function(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}(e,n,c):r(n,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var c=s;e.exports=c},590:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(403),a=n(490),s=n(2104),c=n(6207),l=n(4702),u=n(7077),f=n(462),p=n(6130),h=n(3941),d=n(2351),y=p("draft_tree_data_support"),m=y?c:s,v=h.List,b=h.Repeat,g={insertAtomicBlock:function(e,t,n){var o=e.getCurrentContent(),s=e.getSelection(),c=l.removeRange(o,s,"backward"),p=c.getSelectionAfter(),h=l.splitBlock(c,p),d=h.getSelectionAfter(),g=l.setBlockType(h,d,"atomic"),w=a.create({entity:t}),S={key:f(),type:"atomic",text:n,characterList:v(b(w,n.length))},E={key:f(),type:"unstyled"};y&&(S=r({},S,{nextSibling:E.key}),E=r({},E,{prevSibling:S.key}));var O=[new m(S),new m(E)],_=i.createFromArray(O),P=l.replaceWithFragment(g,d,_),k=P.merge({selectionBefore:s,selectionAfter:P.getSelectionAfter().set("hasFocus",!0)});return u.push(e,k,"insert-fragment")},moveAtomicBlock:function(e,t,n,r){var o,i=e.getCurrentContent(),a=e.getSelection();if("before"===r||"after"===r){var s=i.getBlockForKey("before"===r?n.getStartKey():n.getEndKey());o=d(i,t,s,r)}else{var c=l.removeRange(i,n,"backward"),f=c.getSelectionAfter(),p=c.getBlockForKey(f.getFocusKey());if(0===f.getStartOffset())o=d(c,t,p,"before");else if(f.getEndOffset()===p.getLength())o=d(c,t,p,"after");else{var h=l.splitBlock(c,f),y=h.getSelectionAfter(),m=h.getBlockForKey(y.getFocusKey());o=d(h,t,m,"before")}}var v=o.merge({selectionBefore:a,selectionAfter:o.getSelectionAfter().set("hasFocus",!0)});return u.push(e,v,"move-block")}};e.exports=g},403:(e,t,n)=>{"use strict";var r=n(3941).OrderedMap,o={createFromArray:function(e){return r(e.map((function(e){return[e.getKey(),e]})))}};e.exports=o},3593:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(9572),i=n(2023),a=n(3941),s=a.List,c=a.Repeat,l=a.Record,u=function(){return!0},f=l({start:null,end:null}),p=l({start:null,end:null,decoratorKey:null,leaves:null}),h={generate:function(e,t,n){var r=t.getLength();if(!r)return s.of(new p({start:0,end:0,decoratorKey:null,leaves:s.of(new f({start:0,end:0}))}));var i=[],a=n?n.getDecorations(t,e):s(c(null,r)),l=t.getCharacterList();return o(a,d,u,(function(e,t){var n,r,c,h;i.push(new p({start:e,end:t,decoratorKey:a.get(e),leaves:(n=l.slice(e,t).toList(),r=e,c=[],h=n.map((function(e){return e.getStyle()})).toList(),o(h,d,u,(function(e,t){c.push(new f({start:e+r,end:t+r}))})),s(c))}))})),s(i)},fromJS:function(e){var t=e.leaves,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["leaves"]);return new p(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n,{leaves:null!=t?s(Array.isArray(t)?t:i(t)).map((function(e){return f(e)})):null}))}};function d(e,t){return e===t}e.exports=h},490:(e,t,n)=>{"use strict";var r=n(3941),o=r.Map,i=r.OrderedSet,a=r.Record,s=i(),c={style:s,entity:null},l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.getStyle=function(){return this.get("style")},a.getEntity=function(){return this.get("entity")},a.hasStyle=function(e){return this.getStyle().includes(e)},r.applyStyle=function(e,t){var n=e.set("style",e.getStyle().add(t));return r.create(n)},r.removeStyle=function(e,t){var n=e.set("style",e.getStyle().remove(t));return r.create(n)},r.applyEntity=function(e,t){var n=e.getEntity()===t?e:e.set("entity",t);return r.create(n)},r.create=function(e){if(!e)return u;var t=o({style:s,entity:null}).merge(e),n=f.get(t);if(n)return n;var i=new r(t);return f=f.set(t,i),i},r.fromJS=function(e){var t=e.style,n=e.entity;return new r({style:Array.isArray(t)?i(t):t,entity:Array.isArray(n)?i(n):n})},r}(a(c)),u=new l,f=o([[o(c),u]]);l.EMPTY=u,e.exports=l},8938:(e,t,n)=>{"use strict";var r=n(3941).List,o=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_decorators",void 0),this._decorators=e.slice()}var t=e.prototype;return t.getDecorations=function(e,t){var n=Array(e.getText().length).fill(null);return this._decorators.forEach((function(r,o){var i=0;(0,r.strategy)(e,(function(e,t){(function(e,t,n){for(var r=t;r<n;r++)if(null!=e[r])return!1;return!0})(n,e,t)&&(function(e,t,n,r){for(var o=t;o<n;o++)e[o]=r}(n,e,t,o+"."+i),i++)}),t)})),r(n)},t.getComponentForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].component},t.getPropsForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].props},e}();e.exports=o},2104:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(3941),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,f=c(),p=function(e){var t,n;function i(t){return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e}(t))||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=i.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},i}(l({key:"",type:"unstyled",text:"",characterList:a(),depth:0,data:s()}));function h(e,t){return e.getStyle()===t.getStyle()}function d(e,t){return e.getEntity()===t.getEntity()}e.exports=p},6207:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(3941),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,f=c(),p={parent:null,characterList:a(),data:s(),depth:0,key:"",text:"",type:"unstyled",children:a(),prevSibling:null,nextSibling:null},h=function(e,t){return e.getStyle()===t.getStyle()},d=function(e,t){return e.getEntity()===t.getEntity()},y=function(e){var t,n;function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e}(t))||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=i.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.getChildKeys=function(){return this.get("children")},s.getParentKey=function(){return this.get("parent")},s.getPrevSiblingKey=function(){return this.get("prevSibling")},s.getNextSiblingKey=function(){return this.get("nextSibling")},s.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},i}(l(p));e.exports=y},5481:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(403),a=n(490),s=n(2104),c=n(6207),l=n(4688),u=n(4680),f=n(462),p=n(2023),h=n(6130),d=n(3941),y=n(2140),m=d.List,v=d.Record,b=d.Repeat,g=d.Map,w=d.OrderedMap,S=v({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),E=h("draft_tree_data_support")?c:s,O=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=o.prototype;return s.getEntityMap=function(){return l},s.getBlockMap=function(){return this.get("blockMap")},s.getSelectionBefore=function(){return this.get("selectionBefore")},s.getSelectionAfter=function(){return this.get("selectionAfter")},s.getBlockForKey=function(e){return this.getBlockMap().get(e)},s.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getBlockAfter=function(e){return this.getBlockMap().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlocksAsArray=function(){return this.getBlockMap().toArray()},s.getFirstBlock=function(){return this.getBlockMap().first()},s.getLastBlock=function(){return this.getBlockMap().last()},s.getPlainText=function(e){return this.getBlockMap().map((function(e){return e?e.getText():""})).join(e||"\n")},s.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},s.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,n){return l.__create(e,t,n),this},s.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},s.addEntity=function(e){return l.__add(e),this},s.getEntity=function(e){return l.__get(e)},s.getAllEntities=function(){return l.__getAll()},s.loadWithEntities=function(e){return l.__loadWithEntities(e)},o.createFromBlockArray=function(e,t){var n=Array.isArray(e)?e:e.contentBlocks,r=i.createFromArray(n),a=r.isEmpty()?new u:u.createEmpty(r.first().getKey());return new o({blockMap:r,entityMap:t||l,selectionBefore:a,selectionAfter:a})},o.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=e.split(t).map((function(e){return e=y(e),new E({key:f(),text:e,type:"unstyled",characterList:m(b(a.EMPTY,e.length))})}));return o.createFromBlockArray(n)},o.fromJS=function(e){return new o(r({},e,{blockMap:w(e.blockMap).map(o.createContentBlockFromJS),selectionBefore:new u(e.selectionBefore),selectionAfter:new u(e.selectionAfter)}))},o.createContentBlockFromJS=function(e){var t=e.characterList;return new E(r({},e,{data:g(e.data),characterList:null!=t?m((Array.isArray(t)?t:p(t)).map((function(e){return a.fromJS(e)}))):void 0}))},o}(S);e.exports=O},7286:(e,t,n)=>{"use strict";var r=n(490),o=n(3941).Map,i={add:function(e,t,n){return a(e,t,n,!0)},remove:function(e,t,n){return a(e,t,n,!1)}};function a(e,t,n,i){var a=e.getBlockMap(),s=t.getStartKey(),c=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),f=a.skipUntil((function(e,t){return t===s})).takeUntil((function(e,t){return t===l})).concat(o([[l,a.get(l)]])).map((function(e,t){var o,a;s===l?(o=c,a=u):(o=t===s?c:0,a=t===l?u:e.getLength());for(var f,p=e.getCharacterList();o<a;)f=p.get(o),p=p.set(o,i?r.applyStyle(f,n):r.removeStyle(f,n)),o++;return e.set("characterList",p)}));return e.merge({blockMap:a.merge(f),selectionBefore:t,selectionAfter:t})}e.exports=i},8057:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(5306),i=n(9704),a=n(2189),s=n(3941),c=n(7081),l=n(3946),u=s.Map,f={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},p=o.isBrowser("IE <= 11"),h=function(){function e(e){var t=this;r(this,"observer",void 0),r(this,"container",void 0),r(this,"mutations",void 0),r(this,"onCharData",void 0),this.container=e,this.mutations=u();var n=a(e);n.MutationObserver&&!p?this.observer=new n.MutationObserver((function(e){return t.registerMutations(e)})):this.onCharData=function(e){e.target instanceof Node||c(!1),t.registerMutation({type:"characterData",target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,f):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var t=this.mutations;return this.mutations=u(),t},t.registerMutations=function(e){for(var t=0;t<e.length;t++)this.registerMutation(e[t])},t.getMutationTextContent=function(e){var t=e.type,n=e.target,r=e.removedNodes;if("characterData"===t){if(""!==n.textContent)return p?n.textContent.replace("\n",""):n.textContent}else if("childList"===t){if(r&&r.length)return"";if(""!==n.textContent)return n.textContent}return null},t.registerMutation=function(e){var t=this.getMutationTextContent(e);if(null!=t){var n=l(i(e.target));this.mutations=this.mutations.set(n,t)}},e}();e.exports=h},7722:(e,t,n)=>{"use strict";var r=n(4639),o=n(5935),i=(0,n(3941).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:r.createElement("ul",{className:o("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:r.createElement("ol",{className:o("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:r.createElement("pre",{className:o("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=i},8742:e=>{"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},7704:(e,t,n)=>{"use strict";var r=n(590),o=n(403),i=n(490),a=n(8938),s=n(2104),c=n(5481),l=n(7722),u=n(8742),f=n(628),p=n(8610),h=n(4688),d=n(4702),y=n(7927),m=n(7077),v=n(72),b=n(1451),g=n(509),w=n(4680),S=n(1694),E=n(3702),O=n(462),_=n(6164),P=n(5452),k={Editor:f,EditorBlock:p,EditorState:m,CompositeDecorator:a,Entity:h,EntityInstance:y,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:s,ContentState:c,RawDraftContentState:b,SelectionState:w,AtomicBlockUtils:r,KeyBindingUtil:v,Modifier:d,RichUtils:g,DefaultDraftBlockRenderMap:l,DefaultDraftInlineStyle:u,convertFromHTML:n(9405),convertFromRaw:E,convertToRaw:S,genKey:O,getDefaultKeyBinding:_,getVisibleSelectionRect:P};e.exports=k},628:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var l=n(7722),u=n(8742),f=n(4495),p=n(3922),h=n(2006),d=n(5601),y=n(4359),m=n(9027),v=n(6512),b=n(7077),g=n(4639),w=n(5754),S=n(4234),E=n(5306),O=n(5935),_=n(462),P=n(6164),k=n(3020),j=n(6130),C=n(7081),T=n(5435),x=n(3946),R=E.isBrowser("IE"),D=!R,N={edit:d,composite:f,drag:h,cut:null,render:null},M=!1,I=function(e){function t(){return e.apply(this,arguments)||this}c(t,e);var n=t.prototype;return n.render=function(){return null},n.componentDidMount=function(){this._update()},n.componentDidUpdate=function(){this._update()},n._update=function(){var e=this.props.editor;e._latestEditorState=this.props.editorState,e._blockSelectEvents=!0},t}(g.Component),A=function(e){function t(t){var n;return s(a(n=e.call(this,t)||this),"_blockSelectEvents",void 0),s(a(n),"_clipboard",void 0),s(a(n),"_handler",void 0),s(a(n),"_dragCount",void 0),s(a(n),"_internalDrag",void 0),s(a(n),"_editorKey",void 0),s(a(n),"_placeholderAccessibilityID",void 0),s(a(n),"_latestEditorState",void 0),s(a(n),"_latestCommittedEditorState",void 0),s(a(n),"_pendingStateFromBeforeInput",void 0),s(a(n),"_onBeforeInput",void 0),s(a(n),"_onBlur",void 0),s(a(n),"_onCharacterData",void 0),s(a(n),"_onCompositionEnd",void 0),s(a(n),"_onCompositionStart",void 0),s(a(n),"_onCopy",void 0),s(a(n),"_onCut",void 0),s(a(n),"_onDragEnd",void 0),s(a(n),"_onDragOver",void 0),s(a(n),"_onDragStart",void 0),s(a(n),"_onDrop",void 0),s(a(n),"_onInput",void 0),s(a(n),"_onFocus",void 0),s(a(n),"_onKeyDown",void 0),s(a(n),"_onKeyPress",void 0),s(a(n),"_onKeyUp",void 0),s(a(n),"_onMouseDown",void 0),s(a(n),"_onMouseUp",void 0),s(a(n),"_onPaste",void 0),s(a(n),"_onSelect",void 0),s(a(n),"editor",void 0),s(a(n),"editorContainer",void 0),s(a(n),"focus",void 0),s(a(n),"blur",void 0),s(a(n),"setMode",void 0),s(a(n),"exitCurrentMode",void 0),s(a(n),"restoreEditorDOM",void 0),s(a(n),"setClipboard",void 0),s(a(n),"getClipboard",void 0),s(a(n),"getEditorKey",void 0),s(a(n),"update",void 0),s(a(n),"onDragEnter",void 0),s(a(n),"onDragLeave",void 0),s(a(n),"_handleEditorContainerRef",(function(e){n.editorContainer=e,n.editor=null!==e?e.firstChild:null})),s(a(n),"focus",(function(e){var t=n.props.editorState,r=t.getSelection().getHasFocus(),o=n.editor;if(o){var i=S.getScrollParent(o),a=e||k(i),s=a.x,c=a.y;T(o)||C(!1),o.focus(),i===window?window.scrollTo(s,c):w.setTop(i,c),r||n.update(b.forceSelection(t,t.getSelection()))}})),s(a(n),"blur",(function(){var e=n.editor;e&&(T(e)||C(!1),e.blur())})),s(a(n),"setMode",(function(e){var t=n.props,r=t.onPaste,o=t.onCut,a=t.onCopy,s=i({},N.edit);r&&(s.onPaste=r),o&&(s.onCut=o),a&&(s.onCopy=a);var c=i({},N,{edit:s});n._handler=c[e]})),s(a(n),"exitCurrentMode",(function(){n.setMode("edit")})),s(a(n),"restoreEditorDOM",(function(e){n.setState({contentsKey:n.state.contentsKey+1},(function(){n.focus(e)}))})),s(a(n),"setClipboard",(function(e){n._clipboard=e})),s(a(n),"getClipboard",(function(){return n._clipboard})),s(a(n),"update",(function(e){n._latestEditorState=e,n.props.onChange(e)})),s(a(n),"onDragEnter",(function(){n._dragCount++})),s(a(n),"onDragLeave",(function(){n._dragCount--,0===n._dragCount&&n.exitCurrentMode()})),n._blockSelectEvents=!1,n._clipboard=null,n._handler=null,n._dragCount=0,n._editorKey=t.editorKey||_(),n._placeholderAccessibilityID="placeholder-"+n._editorKey,n._latestEditorState=t.editorState,n._latestCommittedEditorState=t.editorState,n._onBeforeInput=n._buildHandler("onBeforeInput"),n._onBlur=n._buildHandler("onBlur"),n._onCharacterData=n._buildHandler("onCharacterData"),n._onCompositionEnd=n._buildHandler("onCompositionEnd"),n._onCompositionStart=n._buildHandler("onCompositionStart"),n._onCopy=n._buildHandler("onCopy"),n._onCut=n._buildHandler("onCut"),n._onDragEnd=n._buildHandler("onDragEnd"),n._onDragOver=n._buildHandler("onDragOver"),n._onDragStart=n._buildHandler("onDragStart"),n._onDrop=n._buildHandler("onDrop"),n._onInput=n._buildHandler("onInput"),n._onFocus=n._buildHandler("onFocus"),n._onKeyDown=n._buildHandler("onKeyDown"),n._onKeyPress=n._buildHandler("onKeyPress"),n._onKeyUp=n._buildHandler("onKeyUp"),n._onMouseDown=n._buildHandler("onMouseDown"),n._onMouseUp=n._buildHandler("onMouseUp"),n._onPaste=n._buildHandler("onPaste"),n._onSelect=n._buildHandler("onSelect"),n.getEditorKey=function(){return n._editorKey},n.state={contentsKey:0},n}c(t,e);var r=t.prototype;return r._buildHandler=function(e){var t=this;return function(n){if(!t.props.readOnly){var r=t._handler&&t._handler[e];r&&(y?y((function(){return r(t,n)})):r(t,n))}}},r._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},r._renderPlaceholder=function(){if(this._showPlaceholder()){var e={text:x(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return g.createElement(m,e)}return null},r._renderARIADescribedBy=function(){var e=this.props.ariaDescribedBy||"",t=this._showPlaceholder()?this._placeholderAccessibilityID:"";return e.replace("{{editor_id_placeholder}}",t)||void 0},r.render=function(){var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleFn,s=e.customStyleMap,c=e.editorState,l=e.preventScroll,f=e.readOnly,h=e.textAlignment,d=e.textDirectionality,y=O({"DraftEditor/root":!0,"DraftEditor/alignLeft":"left"===h,"DraftEditor/alignRight":"right"===h,"DraftEditor/alignCenter":"center"===h}),m=this.props.role||"textbox",v="combobox"===m?!!this.props.ariaExpanded:null,b={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,customStyleMap:i({},u,s),customStyleFn:a,editorKey:this._editorKey,editorState:c,preventScroll:l,textDirectionality:d};return g.createElement("div",{className:y},this._renderPlaceholder(),g.createElement("div",{className:O("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},g.createElement("div",{"aria-activedescendant":f?null:this.props.ariaActiveDescendantID,"aria-autocomplete":f?null:this.props.ariaAutoComplete,"aria-controls":f?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":f?null:v,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":f?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:O({notranslate:!f,"public/DraftEditor/content":!0}),contentEditable:!f,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:f?null:m,spellCheck:D&&this.props.spellCheck,style:{outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},g.createElement(I,{editor:this,editorState:c}),g.createElement(p,o({},b,{key:"contents"+this.state.contentsKey})))))},r.componentDidMount=function(){this._blockSelectEvents=!1,!M&&j("draft_ods_enabled")&&(M=!0,v.initODS()),this.setMode("edit"),R&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):n.g.execCommand("AutoUrlDetect",!1,!1))},r.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(g.Component);s(A,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:l,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:P,readOnly:!1,spellCheck:!1,stripPastedStyles:!1}),e.exports=A},8610:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i=n(8757),a=n(5044),s=n(4639),c=n(5754),l=n(4234),u=n(3172),f=n(1644),p=n(5935),h=n(6076),d=n(3020),y=n(448),m=n(7081),v=n(5435),b=n(3946),g=function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t},w=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"_node",void 0),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var w=r.prototype;return w.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||g(e.selection,e.block.getKey())&&e.forceSelection},w.componentDidMount=function(){if(!this.props.preventScroll){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this._node;if(null!=n){var r,o=l.getScrollParent(n),i=d(o);if(o===window){var a=h(n);(r=a.y+a.height-y().height)>0&&window.scrollTo(i.x,i.y+r+10)}else v(n)||m(!1),(r=n.offsetHeight+n.offsetTop-(o.offsetTop+o.offsetHeight+i.y))>0&&c.setTop(o,c.getTop(o)+r+10)}}}},w._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),r=t.getText(),c=this.props.tree.size-1,l=g(this.props.selection,n);return this.props.tree.map((function(p,h){var d=p.get("leaves");if(0===d.size)return null;var y=d.size-1,m=d.map((function(o,u){var f=a.encode(n,h,u),p=o.get("start"),d=o.get("end");return s.createElement(i,{key:f,offsetKey:f,block:t,start:p,selection:l?e.props.selection:null,forceSelection:e.props.forceSelection,text:r.slice(p,d),styleSet:t.getInlineStyleAt(p),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:h===c&&u===y})})).toArray(),v=p.get("decoratorKey");if(null==v)return m;if(!e.props.decorator)return m;var g=b(e.props.decorator),w=g.getComponentForKey(v);if(!w)return m;var S=g.getPropsForKey(v),E=a.encode(n,h,0),O=d.first().get("start"),_=d.last().get("end"),P=r.slice(O,_),k=t.getEntityAt(p.get("start")),j=f.getHTMLDirIfDifferent(u.getDirection(P),e.props.direction),C={contentState:e.props.contentState,decoratedText:P,dir:j,start:O,end:_,blockKey:n,entityKey:k,offsetKey:E};return s.createElement(w,o({},S,C,{key:E}),m)})).toArray()},w.render=function(){var e=this,t=this.props,n=t.direction,r=t.offsetKey,o=p({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===n,"public/DraftStyleDefault/rtl":"RTL"===n});return s.createElement("div",{"data-offset-key":r,className:o,ref:function(t){return e._node=t}},this._renderChildren())},r}(s.Component);e.exports=w},7045:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(9793),c=n(5044),l=n(4639),u=n(5754),f=n(4234),p=n(6076),h=n(3020),d=n(448),y=n(3941),m=n(7081),v=n(5435),b=(y.List,function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t}),g=function(e,t){var n=t.get(e.getType())||t.get("unstyled"),r=n.wrapper;return{Element:n.element||t.get("unstyled").element,wrapperTemplate:r}},w=function(e,t){var n=t(e);return n?{CustomComponent:n.component,customProps:n.props,customEditable:n.editable}:{}},S=function(e,t,n,r,o,a){var s={"data-block":!0,"data-editor":t,"data-offset-key":n,key:e.getKey(),ref:a},c=r(e);return c&&(s.className=c),void 0!==o.customEditable&&(s=i({},s,{contentEditable:o.customEditable,suppressContentEditableWarning:!0})),s},E=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return a(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"wrapperRef",l.createRef()),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var y=r.prototype;return y.shouldComponentUpdate=function(e){var t=this.props,n=t.block,r=t.direction,o=t.tree,i=!n.getChildKeys().isEmpty(),a=n!==e.block||o!==e.tree||r!==e.direction||b(e.selection,e.block.getKey())&&e.forceSelection;return i||a},y.componentDidMount=function(){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this.wrapperRef.current;if(n){var r,o=f.getScrollParent(n),i=h(o);if(o===window){var a=p(n);(r=a.y+a.height-d().height)>0&&window.scrollTo(i.x,i.y+r+10)}else{v(n)||m(!1);var s=n;(r=s.offsetHeight+s.offsetTop-(o.offsetHeight+i.y))>0&&u.setTop(o,u.getTop(o)+r+10)}}}},y.render=function(){var e=this,t=this.props,n=t.block,a=t.blockRenderMap,u=t.blockRendererFn,f=t.blockStyleFn,p=t.contentState,h=t.decorator,d=t.editorKey,y=t.editorState,m=t.customStyleFn,v=t.customStyleMap,E=t.direction,O=t.forceSelection,_=t.selection,P=t.tree,k=null;n.children.size&&(k=n.children.reduce((function(t,n){var o=c.encode(n,0,0),s=p.getBlockForKey(n),h=w(s,u),m=h.CustomComponent||r,v=g(s,a),b=v.Element,E=v.wrapperTemplate,O=S(s,d,o,f,h,null),_=i({},e.props,{tree:y.getBlockTree(n),blockProps:h.customProps,offsetKey:o,block:s});return t.push(l.createElement(b,O,l.createElement(m,_))),!E||function(e,t){var n=e.getNextSiblingKey();return!!n&&t.getBlockForKey(n).getType()===e.getType()}(s,p)||function(e,t,n){var r=[],o=!0,i=!1,a=void 0;try{for(var s,u=n.reverse()[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var f=s.value;if(f.type!==t)break;r.push(f)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}n.splice(n.indexOf(r[0]),r.length+1);var p=r.reverse(),h=p[0].key;n.push(l.cloneElement(e,{key:"".concat(h,"-wrap"),"data-offset-key":c.encode(h,0,0)},p))}(E,b,t),t}),[]));var j=n.getKey(),C=c.encode(j,0,0),T=w(n,u),x=T.CustomComponent,R=null!=x?l.createElement(x,o({},this.props,{tree:y.getBlockTree(j),blockProps:T.customProps,offsetKey:C,block:n})):l.createElement(s,{block:n,children:k,contentState:p,customStyleFn:m,customStyleMap:v,decorator:h,direction:E,forceSelection:O,hasSelection:b(_,j),selection:_,tree:P});if(n.getParentKey())return R;var D=g(n,a).Element,N=S(n,d,C,f,T,this.wrapperRef);return l.createElement(D,N,R)},r}(l.Component);e.exports=E},4495:(e,t,n)=>{"use strict";var r=n(8057),o=n(4702),i=n(5044),a=n(7077),s=n(9119),c=n(5306),l=n(8762),u=n(4489),f=n(9938),p=n(3522),h=n(3946),d=c.isBrowser("IE"),y=!1,m=!1,v=null,b={onCompositionStart:function(e){m=!0,function(e){v||(v=new r(u(e))).start()}(e)},onCompositionEnd:function(e){y=!1,m=!1,setTimeout((function(){y||b.resolveComposition(e)}),20)},onSelect:l,onKeyDown:function(e,t){if(!m)return b.resolveComposition(e),void e._onKeyDown(t);t.which!==s.RIGHT&&t.which!==s.LEFT||t.preventDefault()},onKeyPress:function(e,t){t.which===s.RETURN&&t.preventDefault()},resolveComposition:function(e){if(!m){var t=h(v).stopAndFlushMutations();v=null,y=!0;var n=a.set(e._latestEditorState,{inCompositionMode:!1});if(e.exitCurrentMode(),t.size){var r=n.getCurrentContent();t.forEach((function(e,t){var s=i.decode(t),c=s.blockKey,l=s.decoratorKey,u=s.leafKey,f=n.getBlockTree(c).getIn([l,"leaves",u]),h=f.start,d=f.end,y=n.getSelection().merge({anchorKey:c,focusKey:c,anchorOffset:h,focusOffset:d,isBackward:!1}),m=p(r,y),v=r.getBlockForKey(c).getInlineStyleAt(h);r=o.replaceText(r,y,e,v,m),n=a.set(n,{currentContent:r})}));var s=f(n,u(e)).selectionState;e.restoreEditorDOM();var c=d?a.forceSelection(n,s):a.acceptSelection(n,s);e.update(a.push(c,r,"insert-characters"))}else e.update(n)}}};e.exports=b},4337:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(8610),c=n(5044),l=n(4639),u=n(5935),f=n(7022),p=n(3946),h=function(e,t,n,r){return u({"public/DraftStyleDefault/unorderedListItem":"unordered-list-item"===e,"public/DraftStyleDefault/orderedListItem":"ordered-list-item"===e,"public/DraftStyleDefault/reset":n,"public/DraftStyleDefault/depth0":0===t,"public/DraftStyleDefault/depth1":1===t,"public/DraftStyleDefault/depth2":2===t,"public/DraftStyleDefault/depth3":3===t,"public/DraftStyleDefault/depth4":t>=4,"public/DraftStyleDefault/listLTR":"LTR"===r,"public/DraftStyleDefault/listRTL":"RTL"===r})},d=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},a.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleMap,u=e.customStyleFn,d=e.editorState,y=e.editorKey,m=e.preventScroll,v=e.textDirectionality,b=d.getCurrentContent(),g=d.getSelection(),w=d.mustForceSelection(),S=d.getDecorator(),E=p(d.getDirectionMap()),O=b.getBlocksAsArray(),_=[],P=null,k=null,j=0;j<O.length;j++){var C=O[j],T=C.getKey(),x=C.getType(),R=n(C),D=void 0,N=void 0,M=void 0;R&&(D=R.component,N=R.props,M=R.editable);var I=v||E.get(T),A=c.encode(T,0,0),L={contentState:b,block:C,blockProps:N,blockStyleFn:r,customStyleMap:a,customStyleFn:u,decorator:S,direction:I,forceSelection:w,offsetKey:A,preventScroll:m,selection:g,tree:d.getBlockTree(T)},B=t.get(x)||t.get("unstyled"),F=B.wrapper,U=B.element||t.get("unstyled").element,q=C.getDepth(),K="";r&&(K=r(C)),"li"===U&&(K=f(K,h(x,q,k!==F||null===P||q>P,I)));var V=D||s,z={className:K,"data-block":!0,"data-editor":y,"data-offset-key":A,key:T};void 0!==M&&(z=i({},z,{contentEditable:M,suppressContentEditableWarning:!0}));var W=l.createElement(U,z,l.createElement(V,o({},L,{key:T})));_.push({block:W,wrapperTemplate:F,key:T,offsetKey:A}),P=F?C.getDepth():null,k=F}for(var H=[],$=0;$<_.length;){var G=_[$];if(G.wrapperTemplate){var J=[];do{J.push(_[$].block),$++}while($<_.length&&_[$].wrapperTemplate===G.wrapperTemplate);var Q=l.cloneElement(G.wrapperTemplate,{key:G.key+"-wrap","data-offset-key":G.offsetKey},J);H.push(Q)}else H.push(G.block),$++}return l.createElement("div",{"data-contents":"true"},H)},r}(l.Component);e.exports=d},3922:(e,t,n)=>{"use strict";var r=n(6130)("draft_tree_data_support");e.exports=n(r?6086:4337)},6086:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i=n(7045),a=n(5044),s=n(4639),c=n(3946),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var l=r.prototype;return l.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},l.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,l=e.customStyleMap,u=e.customStyleFn,f=e.editorState,p=e.editorKey,h=e.textDirectionality,d=f.getCurrentContent(),y=f.getSelection(),m=f.mustForceSelection(),v=f.getDecorator(),b=c(f.getDirectionMap()),g=[],w=d.getBlocksAsArray()[0];w;){var S=w.getKey(),E={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,contentState:d,customStyleFn:u,customStyleMap:l,decorator:v,editorKey:p,editorState:f,forceSelection:m,selection:y,block:w,direction:h||b.get(S),tree:f.getBlockTree(S)},O=(t.get(w.getType())||t.get("unstyled")).wrapper;g.push({block:s.createElement(i,o({key:S},E)),wrapperTemplate:O,key:S,offsetKey:a.encode(S,0,0)});var _=w.getNextSiblingKey();w=_?d.getBlockForKey(_):null}for(var P=[],k=0;k<g.length;){var j=g[k];if(j.wrapperTemplate){var C=[];do{C.push(g[k].block),k++}while(k<g.length&&g[k].wrapperTemplate===j.wrapperTemplate);var T=s.cloneElement(j.wrapperTemplate,{key:j.key+"-wrap","data-offset-key":j.offsetKey},C);P.push(T)}else P.push(j.block),k++}return s.createElement("div",{"data-contents":"true"},P)},r}(s.Component);e.exports=l},1908:(e,t,n)=>{"use strict";var r=n(2525);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i=n(5044),a=n(4639),s=n(3172),c=n(1644),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.render=function(){var e=this.props,t=e.block,n=e.children,r=e.contentState,l=e.decorator,u=e.decoratorKey,f=e.direction,p=e.leafSet,h=e.text,d=t.getKey(),y=p.get("leaves"),m=l.getComponentForKey(u),v=l.getPropsForKey(u),b=i.encode(d,parseInt(u,10),0),g=h.slice(y.first().get("start"),y.last().get("end")),w=c.getHTMLDirIfDifferent(s.getDirection(g),f);return a.createElement(m,o({},v,{contentState:r,decoratedText:g,dir:w,key:b,entityKey:t.getEntityAt(p.get("start")),offsetKey:b}),n)},r}(a.Component);e.exports=l},2006:(e,t,n)=>{"use strict";var r=n(1045),o=n(4702),i=n(7077),a=n(9704),s=n(8681),c=n(5711),l=n(7546),u=n(2189),f=n(8231),p=n(3946),h={onDragEnd:function(e){e.exitCurrentMode(),d(e)},onDrop:function(e,t){var n=new r(t.nativeEvent.dataTransfer),u=e._latestEditorState,h=function(e,t){var n=null,r=null,o=s(e.currentTarget);if("function"==typeof o.caretRangeFromPoint){var i=o.caretRangeFromPoint(e.x,e.y);n=i.startContainer,r=i.startOffset}else{if(!e.rangeParent)return null;n=e.rangeParent,r=e.rangeOffset}n=p(n),r=p(r);var c=p(a(n));return l(t,c,r,c,r)}(t.nativeEvent,u);if(t.preventDefault(),e._dragCount=0,e.exitCurrentMode(),null!=h){var m=n.getFiles();if(m.length>0){if(e.props.handleDroppedFiles&&f(e.props.handleDroppedFiles(h,m)))return;c(m,(function(t){t&&e.update(y(u,h,t))}))}else{var v=e._internalDrag?"internal":"external";e.props.handleDrop&&f(e.props.handleDrop(h,n,v))||(e._internalDrag?e.update(function(e,t){var n=o.moveText(e.getCurrentContent(),e.getSelection(),t);return i.push(e,n,"insert-fragment")}(u,h)):e.update(y(u,h,n.getText()))),d(e)}}}};function d(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var n=new MouseEvent("mouseup",{view:u(t),bubbles:!0,cancelable:!0});t.dispatchEvent(n)}}function y(e,t,n){var r=o.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return i.push(e,r,"insert-fragment")}e.exports=h},5601:(e,t,n)=>{"use strict";var r=n(5306),o=n(7571),i=n(1014),a=n(3905),s=n(1435),c=n(548),l=n(6241),u=n(1301),f=n(2906),p=n(4089),h=n(8881),d=n(8257),y=n(8762),m=r.isBrowser("Chrome"),v=r.isBrowser("Firefox"),b=m||v?y:function(e){},g={onBeforeInput:o,onBlur:i,onCompositionStart:a,onCopy:s,onCut:c,onDragOver:l,onDragStart:u,onFocus:f,onInput:p,onKeyDown:h,onPaste:d,onSelect:y,onMouseUp:b,onKeyUp:b};e.exports=g},4359:(e,t,n)=>{"use strict";var r=n(1346).unstable_flushControlled;e.exports=r},8757:(e,t,n)=>{"use strict";var r=n(2525),o=n(6642),i=n(4639),a=n(7081),s=n(6959),c=n(2337).setDraftEditorSelection,l=function(e){var t,n;function l(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"leaf",void 0),t}n=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=l.prototype;return u._setSelection=function(){var e=this.props.selection;if(null!=e&&e.getHasFocus()){var t=this.props,n=t.block,r=t.start,o=t.text,i=n.getKey(),l=r+o.length;if(e.hasEdgeWithin(i,r,l)){var u=this.leaf;u||a(!1);var f,p=u.firstChild;p||a(!1),p.nodeType===Node.TEXT_NODE?f=p:s(p)?f=u:(f=p.firstChild)||a(!1),c(e,f,i,r,l)}}},u.shouldComponentUpdate=function(e){var t=this.leaf;return t||a(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},u.componentDidUpdate=function(){this._setSelection()},u.componentDidMount=function(){this._setSelection()},u.render=function(){var e=this,t=this.props.block,n=this.props.text;n.endsWith("\n")&&this.props.isLast&&(n+="\n");var a=this.props,s=a.customStyleMap,c=a.customStyleFn,l=a.offsetKey,u=a.styleSet,f=u.reduce((function(e,t){var n={},o=s[t];return void 0!==o&&e.textDecoration!==o.textDecoration&&(n.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),r(e,o,n)}),{});if(c){var p=c(u,t);f=r(f,p)}return i.createElement("span",{"data-offset-key":l,ref:function(t){return e.leaf=t},style:f},i.createElement(o,null,n))},l}(i.Component);e.exports=l},9793:(e,t,n)=>{"use strict";var r=n(1908),o=n(8757),i=n(5044),a=n(3941),s=n(4639),c=n(5935),l=(a.List,function(e){var t,n;function a(){return e.apply(this,arguments)||this}return n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.prototype.render=function(){var e=this.props,t=e.block,n=e.contentState,a=e.customStyleFn,l=e.customStyleMap,u=e.decorator,f=e.direction,p=e.forceSelection,h=e.hasSelection,d=e.selection,y=e.tree,m=t.getKey(),v=t.getText(),b=y.size-1,g=this.props.children||y.map((function(e,c){var y=e.get("decoratorKey"),g=e.get("leaves"),w=g.size-1,S=g.map((function(e,n){var r=i.encode(m,c,n),u=e.get("start"),f=e.get("end");return s.createElement(o,{key:r,offsetKey:r,block:t,start:u,selection:h?d:null,forceSelection:p,text:v.slice(u,f),styleSet:t.getInlineStyleAt(u),customStyleMap:l,customStyleFn:a,isLast:y===b&&n===w})})).toArray();return y&&u?s.createElement(r,{block:t,children:S,contentState:n,decorator:u,decoratorKey:y,direction:f,leafSet:e,text:v,key:c}):S})).toArray();return s.createElement("div",{"data-offset-key":i.encode(m,0,0),className:c({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===f,"public/DraftStyleDefault/rtl":"RTL"===f})},g)},a}(s.Component));e.exports=l},9027:(e,t,n)=>{"use strict";var r=n(4639),o=n(5935),i=function(e){var t,n;function i(){return e.apply(this,arguments)||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},a.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=o({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e});return r.createElement("div",{className:t},r.createElement("div",{className:o("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:{whiteSpace:"pre-wrap"}},this.props.text))},i}(r.Component);e.exports=i},6642:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(4639),a=n(5306),s=n(7081),c=n(9509),l=a.isBrowser("IE <= 11"),u=function(e){var t,n;function a(t){var n;return o(r(n=e.call(this,t)||this),"_forceFlag",void 0),o(r(n),"_node",void 0),n._forceFlag=!1,n}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=a.prototype;return u.shouldComponentUpdate=function(e){var t=this._node,n=""===e.children;c(t)||s(!1);var r=t;return n?!function(e){return l?"\n"===e.textContent:"BR"===e.tagName}(r):r.textContent!==e.children},u.componentDidMount=function(){this._forceFlag=!this._forceFlag},u.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},u.render=function(){var e,t=this;return""===this.props.children?this._forceFlag?(e=function(e){return t._node=e},l?i.createElement("span",{key:"A","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"A","data-text":"true",ref:e})):function(e){return l?i.createElement("span",{key:"B","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"B","data-text":"true",ref:e})}((function(e){return t._node=e})):i.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(e){return t._node=e}},this.props.children)},a}(i.Component);e.exports=u},6512:e=>{"use strict";e.exports={initODS:function(){},handleExtensionCausedError:function(){}}},4688:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(7927),i=n(3941),a=n(7081),s=n(5634),c=(0,i.Map)(),l=s();function u(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var f={getLastCreatedEntityKey:function(){return u("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),f.__getLastCreatedEntityKey()},create:function(e,t,n){return u("DraftEntity.create","contentState.createEntity"),f.__create(e,t,n)},add:function(e){return u("DraftEntity.add","contentState.addEntity"),f.__add(e)},get:function(e){return u("DraftEntity.get","contentState.getEntity"),f.__get(e)},__getAll:function(){return c},__loadWithEntities:function(e){c=e,l=s()},mergeData:function(e,t){return u("DraftEntity.mergeData","contentState.mergeEntityData"),f.__mergeData(e,t)},replaceData:function(e,t){return u("DraftEntity.replaceData","contentState.replaceEntityData"),f.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return l},__create:function(e,t,n){return f.__add(new o({type:e,mutability:t,data:n||{}}))},__add:function(e){return l=s(),c=c.set(l,e),l},__get:function(e){var t=c.get(e);return t||a(!1),t},__mergeData:function(e,t){var n=f.__get(e),o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n.getData(),t),i=n.set("data",o);return c=c.set(e,i),i},__replaceData:function(e,t){var n=f.__get(e).set("data",t);return c=c.set(e,n),n}};e.exports=f},7927:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.getType=function(){return this.get("type")},o.getMutability=function(){return this.get("mutability")},o.getData=function(){return this.get("data")},r}((0,n(3941).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}));e.exports=r},3688:e=>{"use strict";e.exports={getRemovalRange:function(e,t,n,r,o){var i=n.split(" ");i=i.map((function(e,t){if("forward"===o){if(t>0)return" "+e}else if(t<i.length-1)return e+" ";return e}));for(var a,s=r,c=null,l=null,u=0;u<i.length;u++){if(e<(a=s+i[u].length)&&s<t)null!==c||(c=s),l=a;else if(null!==c)break;s=a}var f=r+n.length,p=c===r,h=l===f;return(!p&&h||p&&!h)&&("forward"===o?l!==f&&l++:c!==r&&c--),{start:c,end:l}}}},3405:e=>{"use strict";e.exports={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}}},4702:(e,t,n)=>{"use strict";var r=n(490),o=n(7286),i=n(9717),a=n(8655),s=n(9845),c=n(3941),l=n(9657),u=n(3163),f=n(7081),p=n(2356),h=n(4511),d=n(4217),y=n(8124),m=c.OrderedSet,v={replaceText:function(e,t,n,o,i){var a=h(e,t),s=d(a,t),c=r.create({style:o||m(),entity:i||null});return u(s,s.getSelectionAfter(),n,c)},insertText:function(e,t,n,r,o){return t.isCollapsed()||f(!1),v.replaceText(e,t,n,r,o)},moveText:function(e,t,n){var r=s(e,t),o=v.removeRange(e,t,"backward");return v.replaceWithFragment(o,n,r)},replaceWithFragment:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",o=h(e,t),i=d(o,t);return l(i,i.getSelectionAfter(),n,r)},removeRange:function(e,t,n){var r,o,i,s;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),o=t.getFocusKey(),i=e.getBlockForKey(r),s=e.getBlockForKey(o);var c=t.getStartOffset(),l=t.getEndOffset(),u=i.getEntityAt(c),f=s.getEntityAt(l-1);if(r===o&&u&&u===f){var p=a(e.getEntityMap(),i,s,t,n);return d(e,p)}var y=h(e,t);return d(y,t)},splitBlock:function(e,t){var n=h(e,t),r=d(n,t);return y(r,r.getSelectionAfter())},applyInlineStyle:function(e,t,n){return o.add(e,t,n)},removeInlineStyle:function(e,t,n){return o.remove(e,t,n)},setBlockType:function(e,t,n){return p(e,t,(function(e){return e.merge({type:n,depth:0})}))},setBlockData:function(e,t,n){return p(e,t,(function(e){return e.merge({data:n})}))},mergeBlockData:function(e,t,n){return p(e,t,(function(e){return e.merge({data:e.getData().merge(n)})}))},applyEntity:function(e,t,n){var r=h(e,t);return i(r,t,n)}};e.exports=v},5044:e=>{"use strict";var t="-",n={encode:function(e,n,r){return e+t+n+t+r},decode:function(e){var n=e.split(t).reverse(),r=n[0],o=n[1];return{blockKey:n.slice(2).reverse().join(t),decoratorKey:parseInt(o,10),leafKey:parseInt(r,10)}}};e.exports=n},5252:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(2104),i=n(6207),a=n(9405),s=n(462),c=n(1539),l=n(6130),u=n(3941),f=n(2140),p=u.List,h=u.Repeat,d=l("draft_tree_data_support"),y=d?i:o,m={processHTML:function(e,t){return a(e,c,t)},processText:function(e,t,n){return e.reduce((function(e,o,i){o=f(o);var a=s(),c={key:a,type:n,text:o,characterList:p(h(t,o.length))};if(d&&0!==i){var l=i-1;c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},c,{prevSibling:(e[l]=e[l].merge({nextSibling:a})).getKey()})}return e.push(new y(c)),e}),[])}};e.exports=m},1111:(e,t,n)=>{"use strict";var r="['‘’]",o="\\s|(?![_])"+n(6156).getPunctuation(),i=new RegExp("^(?:"+o+")*(?:"+r+"|(?!"+o+").)*(?:(?!"+o+").)"),a=new RegExp("(?:(?!"+o+").)(?:"+r+"|(?!"+o+").)*(?:"+o+")*$");function s(e,t){var n=t?a.exec(e):i.exec(e);return n?n[0]:e}var c={getBackward:function(e){return s(e,!0)},getForward:function(e){return s(e,!1)}};e.exports=c},9532:e=>{"use strict";var t={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=t},2780:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(462),a=n(7081),s=function(e){if(!e||!e.type)return!1;var t=e.type;return"unordered-list-item"===t||"ordered-list-item"===t},c={fromRawTreeStateToRawState:function(e){var t=e.blocks,n=[];return Array.isArray(t)||a(!1),Array.isArray(t)&&t.length?(function(e,t){for(var o=[].concat(e).reverse();o.length;){var i=o.pop();u=void 0,u=r({},l=i),s(l)&&(u.depth=u.depth||0,function(e){Array.isArray(e.children)&&(e.children=e.children.map((function(t){return t.type===e.type?r({},t,{depth:(e.depth||0)+1}):t})))}(l),null!=l.children&&l.children.length>0)||(delete u.children,n.push(u));var c=i.children;Array.isArray(c)||a(!1),o=o.concat([].concat(c.reverse()))}var l,u}(t),e.blocks=n,r({},e,{blocks:n})):e},fromRawStateToRawTreeState:function(e){var t=[],n=[];return e.blocks.forEach((function(e){var o=s(e),a=e.depth||0,c=r({},e,{children:[]});if(o){var l=n[0];if(null==l&&0===a)t.push(c);else if(null==l||l.depth<a-1){var u={key:i(),text:"",depth:a-1,type:e.type,children:[],entityRanges:[],inlineStyleRanges:[]};n.unshift(u),1===a?t.push(u):null!=l&&l.children.push(u),u.children.push(c)}else if(l.depth===a-1)l.children.push(c);else{for(;null!=l&&l.depth>=a;)n.shift(),l=n[0];a>0?l.children.push(c):t.push(c)}}else t.push(c)})),r({},e,{blocks:t})}};e.exports=c},9067:(e,t,n)=>{"use strict";n(2264),e.exports={isValidBlock:function(e,t){var n=e.getKey(),r=e.getParentKey();if(null!=r&&!t.get(r).getChildKeys().includes(n))return!1;if(!e.getChildKeys().map((function(e){return t.get(e)})).every((function(e){return e.getParentKey()===n})))return!1;var o=e.getPrevSiblingKey();if(null!=o&&t.get(o).getNextSiblingKey()!==n)return!1;var i=e.getNextSiblingKey();return(null==i||t.get(i).getPrevSiblingKey()===n)&&!(null!==i&&null!==o&&o===i||""!=e.text&&e.getChildKeys().size>0)},isConnectedTree:function(e){var t=e.toArray().filter((function(e){return null==e.getParentKey()&&null==e.getPrevSiblingKey()}));if(1!==t.length)return!1;for(var n=0,r=t.shift().getKey(),o=[];null!=r;){var i=e.get(r),a=i.getChildKeys(),s=i.getNextSiblingKey();if(a.size>0){null!=s&&o.unshift(s);var c=a.map((function(t){return e.get(t)})).find((function(e){return null==e.getPrevSiblingKey()}));if(null==c)return!1;r=c.getKey()}else r=null!=i.getNextSiblingKey()?i.getNextSiblingKey():o.shift();n++}return n===e.size},isValidTree:function(e){var t=this;return!!e.toArray().every((function(n){return t.isValidBlock(n,e)}))&&this.isConnectedTree(e)}}},2461:(e,t,n)=>{"use strict";var r,o=n(2573),i=n(3941),a=n(3946),s=i.OrderedMap,c={getDirectionMap:function(e,t){r?r.reset():r=new o;var n=e.getBlockMap(),c=n.valueSeq().map((function(e){return a(r).getDirection(e.getText())})),l=s(n.keySeq().zip(c));return null!=t&&i.is(t,l)?t:l}};e.exports=c},7077:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(3593),a=n(5481),s=n(2461),c=n(4680),l=n(3941),u=l.OrderedSet,f=l.Record,p=l.Stack,h=l.OrderedMap,d=l.List,y=f({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:p(),selection:null,treeMap:null,undoStack:p()}),m=function(){t.createEmpty=function(e){return this.createWithText("",e)},t.createWithText=function(e,n){return t.createWithContent(a.createFromText(e),n)},t.createWithContent=function(e,n){if(0===e.getBlockMap().count())return t.createEmpty(n);var r=e.getBlockMap().first().getKey();return t.create({currentContent:e,undoStack:p(),redoStack:p(),decorator:n||null,selection:c.createEmpty(r)})},t.create=function(e){var n=e.currentContent,o=r({},e,{treeMap:b(n,e.decorator),directionMap:s.getDirectionMap(n)});return new t(new y(o))},t.fromJS=function(e){return new t(new y(r({},e,{directionMap:null!=e.directionMap?h(e.directionMap):e.directionMap,inlineStyleOverride:null!=e.inlineStyleOverride?u(e.inlineStyleOverride):e.inlineStyleOverride,nativelyRenderedContent:null!=e.nativelyRenderedContent?a.fromJS(e.nativelyRenderedContent):e.nativelyRenderedContent,redoStack:null!=e.redoStack?p(e.redoStack.map((function(e){return a.fromJS(e)}))):e.redoStack,selection:null!=e.selection?new c(e.selection):e.selection,treeMap:null!=e.treeMap?h(e.treeMap).map((function(e){return d(e).map((function(e){return i.fromJS(e)}))})):e.treeMap,undoStack:null!=e.undoStack?p(e.undoStack.map((function(e){return a.fromJS(e)}))):e.undoStack,currentContent:a.fromJS(e.currentContent)})))},t.set=function(e,n){return new t(e.getImmutable().withMutations((function(t){var r=t.get("decorator"),o=r;null===n.decorator?o=null:n.decorator&&(o=n.decorator);var a=n.currentContent||e.getCurrentContent();if(o!==r){var s,c=t.get("treeMap");return s=o&&r?function(e,t,n,r,o){return n.merge(t.toSeq().filter((function(t){return r.getDecorations(t,e)!==o.getDecorations(t,e)})).map((function(t){return i.generate(e,t,r)})))}(a,a.getBlockMap(),c,o,r):b(a,o),void t.merge({decorator:o,treeMap:s,nativelyRenderedContent:null})}a!==e.getCurrentContent()&&t.set("treeMap",function(e,t,n,r){var o=e.getCurrentContent().set("entityMap",n),a=o.getBlockMap();return e.getImmutable().get("treeMap").merge(t.toSeq().filter((function(e,t){return e!==a.get(t)})).map((function(e){return i.generate(o,e,r)})))}(e,a.getBlockMap(),a.getEntityMap(),o)),t.merge(n)})))};var e=t.prototype;function t(e){o(this,"_immutable",void 0),this._immutable=e}return e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(e,n){return t.set(e,{inlineStyleOverride:n})},e.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(null!=e)return e;var t=this.getCurrentContent(),n=this.getSelection();return n.isCollapsed()?function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r>0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):g(e,n)}(t,n):function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r<o.getLength()?o.getInlineStyleAt(r):r>0?o.getInlineStyleAt(r-1):g(e,n)}(t,n)},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(e,t){return v(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),v(e,t,!0)},t.moveSelectionToEnd=function(e){var n=e.getCurrentContent().getLastBlock(),r=n.getKey(),o=n.getLength();return t.acceptSelection(e,new c({anchorKey:r,anchorOffset:o,focusKey:r,focusOffset:o,isBackward:!1}))},t.moveFocusToEnd=function(e){var n=t.moveSelectionToEnd(e);return t.forceSelection(n,n.getSelection())},t.push=function(e,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.getCurrentContent()===n)return e;var i=s.getDirectionMap(n,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:n,directionMap:i,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:null});var a=e.getSelection(),c=e.getCurrentContent(),l=e.getUndoStack(),u=n;a!==c.getSelectionAfter()||function(e,t){return t!==e.getLastChangeType()||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}(e,r)?(l=l.push(c),u=u.set("selectionBefore",a)):"insert-characters"!==r&&"backspace-character"!==r&&"delete-character"!==r||(u=u.set("selectionBefore",c.getSelectionBefore()));var f=e.getInlineStyleOverride();-1===["adjust-depth","change-block-type","split-block"].indexOf(r)&&(f=null);var h={currentContent:u,directionMap:i,undoStack:l,redoStack:p(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:f};return t.set(e,h)},t.undo=function(e){if(!e.getAllowUndo())return e;var n=e.getUndoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:n.shift(),redoStack:e.getRedoStack().push(o),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:o.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var n=e.getRedoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:e.getUndoStack().push(o),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:r.getSelectionAfter()})},e.getImmutable=function(){return this._immutable},t}();function v(e,t,n){return m.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function b(e,t){return e.getBlockMap().map((function(n){return i.generate(e,n,t)})).toOrderedMap()}function g(e,t){var n=e.getBlockMap().reverse().skipUntil((function(e,n){return n===t})).skip(1).skipUntil((function(e,t){return e.getLength()})).first();return n?n.getInlineStyleAt(n.getLength()-1):u()}e.exports=m},72:(e,t,n)=>{"use strict";var r=n(5306),o=n(6731),i=r.isPlatform("Mac OS X"),a={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return i&&e.altKey},usesMacOSHeuristics:function(){return i},hasCommandModifier:function(e){return i?!!e.metaKey&&!e.altKey:a.isCtrlKeyCommand(e)},isSoftNewlineEvent:o};e.exports=a},1451:()=>{},509:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(798),a=n(3946),s={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some((function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()}))},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t,n){switch(t){case"bold":return s.toggleInlineStyle(e,"BOLD");case"italic":return s.toggleInlineStyle(e,"ITALIC");case"underline":return s.toggleInlineStyle(e,"UNDERLINE");case"code":return s.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return s.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return s.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t=e.getSelection();if(!t.isCollapsed()||t.getAnchorOffset()||t.getFocusOffset())return null;var n=e.getCurrentContent(),r=t.getStartKey(),i=n.getBlockBefore(r);if(i&&"atomic"===i.getType()){var a=n.getBlockMap().delete(i.getKey()),c=n.merge({blockMap:a,selectionAfter:t});if(c!==n)return o.push(e,c,"remove-range")}var l=s.tryToRemoveBlockStyle(e);return l?o.push(e,l,"change-block-type"):null},onDelete:function(e){var t=e.getSelection();if(!t.isCollapsed())return null;var n=e.getCurrentContent(),i=t.getStartKey(),a=n.getBlockForKey(i).getLength();if(t.getStartOffset()<a)return null;var s=n.getBlockAfter(i);if(!s||"atomic"!==s.getType())return null;var c=t.merge({focusKey:s.getKey(),focusOffset:s.getLength()}),l=r.removeRange(n,c,"forward");return l!==n?o.push(e,l,"remove-range"):null},onTab:function(e,t,n){var r=t.getSelection(),a=r.getAnchorKey();if(a!==r.getFocusKey())return t;var s=t.getCurrentContent(),c=s.getBlockForKey(a),l=c.getType();if("unordered-list-item"!==l&&"ordered-list-item"!==l)return t;e.preventDefault();var u=c.getDepth();if(!e.shiftKey&&u===n)return t;var f=i(s,r,e.shiftKey?-1:1,n);return o.push(t,f,"adjust-depth")},toggleBlockType:function(e,t){var n=e.getSelection(),i=n.getStartKey(),s=n.getEndKey(),c=e.getCurrentContent(),l=n;if(i!==s&&0===n.getEndOffset()){var u=a(c.getBlockBefore(s));s=u.getKey(),l=l.merge({anchorKey:i,anchorOffset:n.getStartOffset(),focusKey:s,focusOffset:u.getLength(),isBackward:!1})}if(c.getBlockMap().skipWhile((function(e,t){return t!==i})).reverse().skipWhile((function(e,t){return t!==s})).some((function(e){return"atomic"===e.getType()})))return e;var f=c.getBlockForKey(i).getType()===t?"unstyled":t;return o.push(e,r.setBlockType(c,l,f),"change-block-type")},toggleCode:function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=t.getFocusKey();return t.isCollapsed()||n!==r?s.toggleBlockType(e,"code-block"):s.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,t){var n=e.getSelection(),i=e.getCurrentInlineStyle();if(n.isCollapsed())return o.setInlineStyleOverride(e,i.has(t)?i.remove(t):i.add(t));var a,s=e.getCurrentContent();return a=i.has(t)?r.removeInlineStyle(s,n,t):r.applyInlineStyle(s,n,t),o.push(e,a,"change-inline-style")},toggleLink:function(e,t,n){var i=r.applyEntity(e.getCurrentContent(),t,n);return o.push(e,i,"apply-entity")},tryToRemoveBlockStyle:function(e){var t=e.getSelection(),n=t.getAnchorOffset();if(t.isCollapsed()&&0===n){var o=t.getAnchorKey(),i=e.getCurrentContent(),a=i.getBlockForKey(o).getType(),s=i.getBlockBefore(o);if("code-block"===a&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==a)return r.setBlockType(i,t,"unstyled")}return null}};e.exports=s},2633:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(9845),a=n(3946),s=null,c={cut:function(e){var t=e.getCurrentContent(),n=e.getSelection(),c=null;if(n.isCollapsed()){var l=n.getAnchorKey(),u=t.getBlockForKey(l).getLength();if(u===n.getAnchorOffset()){var f=t.getKeyAfter(l);if(null==f)return e;c=n.set("focusKey",f).set("focusOffset",0)}else c=n.set("focusOffset",u)}else c=n;c=a(c),s=i(t,c);var p=r.removeRange(t,c,"forward");return p===t?e:o.push(e,p,"remove-range")},paste:function(e){if(!s)return e;var t=r.replaceWithFragment(e.getCurrentContent(),e.getSelection(),s);return o.push(e,t,"insert-fragment")}};e.exports=c},4680:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},o.getAnchorKey=function(){return this.get("anchorKey")},o.getAnchorOffset=function(){return this.get("anchorOffset")},o.getFocusKey=function(){return this.get("focusKey")},o.getFocusOffset=function(){return this.get("focusOffset")},o.getIsBackward=function(){return this.get("isBackward")},o.getHasFocus=function(){return this.get("hasFocus")},o.hasEdgeWithin=function(e,t,n){var r=this.getAnchorKey(),o=this.getFocusKey();if(r===o&&r===e){var i=this.getStartOffset(),a=this.getEndOffset();return t<=i&&i<=n||t<=a&&a<=n}if(e!==r&&e!==o)return!1;var s=e===r?this.getAnchorOffset():this.getFocusOffset();return t<=s&&n>=s},o.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},o.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},o.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},o.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},o.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},r.createEmpty=function(e){return new r({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},r}((0,n(3941).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=r},798:e=>{"use strict";e.exports=function(e,t,n,r){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat([[i,a.get(i)]]).map((function(e){var t=e.getDepth()+n;return t=Math.max(0,Math.min(t,r)),e.set("depth",t)}));return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}},1655:(e,t,n)=>{"use strict";var r=n(490);e.exports=function(e,t,n,o){for(var i=t,a=e.getCharacterList();i<n;)a=a.set(i,r.applyEntity(a.get(i),o)),i++;return e.set("characterList",a)}},9717:(e,t,n)=>{"use strict";var r=n(1655),o=n(3941);e.exports=function(e,t,n){var i=e.getBlockMap(),a=t.getStartKey(),s=t.getStartOffset(),c=t.getEndKey(),l=t.getEndOffset(),u=i.skipUntil((function(e,t){return t===a})).takeUntil((function(e,t){return t===c})).toOrderedMap().merge(o.OrderedMap([[c,i.get(c)]])).map((function(e,t){var o=t===a?s:0,i=t===c?l:e.getLength();return r(e,o,i,n)}));return e.merge({blockMap:i.merge(u),selectionBefore:t,selectionAfter:t})}},1694:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(2104),i=n(6207),a=n(9532),s=n(7037),c=n(2e3),l=n(7081),u=function(e,t){return{key:e.getKey(),text:e.getText(),type:e.getType(),depth:e.getDepth(),inlineStyleRanges:c(e),entityRanges:s(e,t),data:e.getData().toObject()}};e.exports=function(e){var t={entityMap:{},blocks:[]};return t=function(e,t){var n=t.entityMap,s=[],c={},f={},p=0;return e.getBlockMap().forEach((function(e){e.findEntityRanges((function(e){return null!==e.getEntity()}),(function(t){var r=e.getEntityAt(t),o=a.stringify(r);f[o]||(f[o]=r,n[o]="".concat(p),p++)})),function(e,t,n,a){if(e instanceof o)n.push(u(e,t));else{e instanceof i||l(!1);var s=e.getParentKey(),c=a[e.getKey()]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},u(e,t),{children:[]});s?a[s].children.push(c):n.push(c)}}(e,n,s,c)})),{blocks:s,entityMap:n}}(e,t),t=function(e,t){var n=t.blocks,r=t.entityMap,o={};return Object.keys(r).forEach((function(t,n){var r=e.getEntity(a.unstringify(t));o[n]={type:r.getType(),mutability:r.getMutability(),data:r.getData()}})),{blocks:n,entityMap:o}}(e,t),t}},9405:(e,t,n)=>{"use strict";var r;function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(490),s=n(2104),c=n(6207),l=n(7722),u=n(4688),f=n(6831),p=n(5935),h=n(462),d=n(1539),y=n(6130),m=n(3941),v=m.List,b=m.Map,g=m.OrderedSet,w=n(285),S=n(6959),E=n(5435),O=n(132),_=y("draft_tree_data_support"),P=new RegExp("\r","g"),k=new RegExp("\n","g"),j=new RegExp("^\n","g"),C=new RegExp("&nbsp;","g"),T=new RegExp("&#13;?","g"),x=new RegExp("&#8203;?","g"),R=["bold","bolder","500","600","700","800","900"],D=["light","lighter","normal","100","200","300","400"],N=["className","href","rel","target","title"],M=["alt","className","height","src","width"],I=(i(r={},p("public/DraftStyleDefault/depth0"),0),i(r,p("public/DraftStyleDefault/depth1"),1),i(r,p("public/DraftStyleDefault/depth2"),2),i(r,p("public/DraftStyleDefault/depth3"),3),i(r,p("public/DraftStyleDefault/depth4"),4),r),A=b({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),L=function(e){return E(e)&&e.style.fontFamily.includes("monospace")?"CODE":null},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(I).some((function(n){e.classList.contains(n)&&(t=I[n])})),t},F=function(e){if(!w(e))return!1;var t=e;if(!t.href||"http:"!==t.protocol&&"https:"!==t.protocol&&"mailto:"!==t.protocol&&"tel:"!==t.protocol)return!1;try{return new f(t.href),!0}catch(e){return!1}},U=function(e){if(!O(e))return!1;var t=e;return!(!t.attributes.getNamedItem("src")||!t.attributes.getNamedItem("src").value)},q=function(e,t){if(!E(e))return t;var n=e,r=n.style.fontWeight,o=n.style.fontStyle,i=n.style.textDecoration;return t.withMutations((function(e){R.indexOf(r)>=0?e.add("BOLD"):D.indexOf(r)>=0&&e.remove("BOLD"),"italic"===o?e.add("ITALIC"):"normal"===o&&e.remove("ITALIC"),"underline"===i&&e.add("UNDERLINE"),"line-through"===i&&e.add("STRIKETHROUGH"),"none"===i&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}))},K=function(e){return"ul"===e||"ol"===e},V=function(){function e(e,t){i(this,"characterList",v()),i(this,"currentBlockType","unstyled"),i(this,"currentDepth",0),i(this,"currentEntity",null),i(this,"currentText",""),i(this,"wrapper",null),i(this,"blockConfigs",[]),i(this,"contentBlocks",[]),i(this,"entityMap",u),i(this,"blockTypeMap",void 0),i(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=e,this.disambiguate=t}var t=e.prototype;return t.clear=function(){this.characterList=v(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=u,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(e){var t;return this.contentBlocks=[],this.currentDepth=0,(t=this.blockConfigs).push.apply(t,this._toBlockConfigs([e],g())),this._trimCurrentText(),""!==this.currentText&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return 0===this.contentBlocks.length&&(_?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=o({key:e.key||h(),type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:v(),prevSibling:null,nextSibling:null,childConfigs:[]},e);return this.characterList=v(),this.currentBlockType="unstyled",this.currentText="",t},t._toBlockConfigs=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=o.nodeName.toLowerCase();if("body"===i||K(i)){this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var a=this.currentDepth,s=this.wrapper;K(i)&&(this.wrapper=i,K(s)&&this.currentDepth++),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),t)),this.currentDepth=a,this.wrapper=s}else{var c=this.blockTypeMap.get(i);if(void 0===c)if("#text"!==i)if("br"!==i)if(U(o))this._addImgNode(o,t);else if(F(o))this._addAnchorNode(o,n,t);else{var l=t;A.has(i)&&(l=l.add(A.get(i))),l=q(o,l);var u=L(o);null!=u&&(l=l.add(u)),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),l))}else this._addBreakNode(o,t);else this._addTextNode(o,t);else{this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var f=this.currentDepth,p=this.wrapper;if(this.wrapper="pre"===i?"pre":this.wrapper,"string"!=typeof c&&(c=this.disambiguate(i,this.wrapper)||c[0]||"unstyled"),!_&&E(o)&&("unordered-list-item"===c||"ordered-list-item"===c)){var d=o;this.currentDepth=B(d,this.currentDepth)}var y=h(),m=this._toBlockConfigs(Array.from(o.childNodes),t);this._trimCurrentText(),n.push(this._makeBlockConfig({key:y,childConfigs:m,type:c})),this.currentDepth=f,this.wrapper=p}}}return n},t._appendText=function(e,t){var n;this.currentText+=e;var r=a.create({style:t,entity:this.currentEntity});this.characterList=(n=this.characterList).push.apply(n,Array(e.length).fill(r))},t._trimCurrentText=function(){var e=this.currentText.length,t=e-this.currentText.trimLeft().length,n=this.currentText.trimRight().length,r=this.characterList.findEntry((function(e){return null!==e.getEntity()}));(t=void 0!==r?Math.min(t,r[0]):t)>(n=void 0!==(r=this.characterList.reverse().findEntry((function(e){return null!==e.getEntity()})))?Math.max(n,e-r[0]):n)?(this.currentText="",this.characterList=v()):(this.currentText=this.currentText.slice(t,n),this.characterList=this.characterList.slice(t,n))},t._addTextNode=function(e,t){var n=e.textContent;""===n.trim()&&"pre"!==this.wrapper&&(n=" "),"pre"!==this.wrapper&&(n=(n=n.replace(j,"")).replace(k," ")),this._appendText(n,t)},t._addBreakNode=function(e,t){S(e)&&this._appendText("\n",t)},t._addImgNode=function(e,t){if(O(e)){var n=e,r={};M.forEach((function(e){var t=n.getAttribute(e);t&&(r[e]=t)})),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",r),y("draftjs_fix_paste_for_img")?"presentation"!==n.getAttribute("role")&&this._appendText("📷",t):this._appendText("📷",t),this.currentEntity=null}},t._addAnchorNode=function(e,t,n){if(w(e)){var r=e,o={};N.forEach((function(e){var t=r.getAttribute(e);t&&(o[e]=t)})),o.url=new f(r.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",o||{}),t.push.apply(t,this._toBlockConfigs(Array.from(e.childNodes),n)),this.currentEntity=null}},t._toContentBlocks=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.length-1,r=0;r<=n;r++){var i=e[r];i.parent=t,i.prevSibling=r>0?e[r-1].key:null,i.nextSibling=r<n?e[r+1].key:null,i.children=v(i.childConfigs.map((function(e){return e.key}))),this.contentBlocks.push(new c(o({},i))),this._toContentBlocks(i.childConfigs,i.key)}},t._hoistContainersInBlockConfigs=function(e){var t=this;return v(e).flatMap((function(e){return"unstyled"!==e.type||""!==e.text?[e]:t._hoistContainersInBlockConfigs(e.childConfigs)}))},t._toFlatContentBlocks=function(e){var t=this;this._hoistContainersInBlockConfigs(e).forEach((function(e){var n=t._extractTextFromBlockConfigs(e.childConfigs),r=n.text,i=n.characterList;t.contentBlocks.push(new s(o({},e,{text:e.text+r,characterList:e.characterList.concat(i)})))}))},t._extractTextFromBlockConfigs=function(e){for(var t=e.length-1,n="",r=v(),o=0;o<=t;o++){var i=e[o];n+=i.text,r=r.concat(i.characterList),""!==n&&"unstyled"!==i.type&&(n+="\n",r=r.push(r.last()));var a=this._extractTextFromBlockConfigs(i.childConfigs);n+=a.text,r=r.concat(a.characterList)}return{text:n,characterList:r}},e}();e.exports=function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:d)(e=e.trim().replace(P,"").replace(C," ").replace(T,"").replace(x,""));if(!n)return null;var r=function(e){var t={};return e.mapKeys((function(e,n){var r=[n.element];void 0!==n.aliasedElements&&r.push.apply(r,n.aliasedElements),r.forEach((function(n){void 0===t[n]?t[n]=e:"string"==typeof t[n]?t[n]=[t[n],e]:t[n].push(e)}))})),b(t)}(t);return new V(r,(function(e,t){return"li"===e?"ol"===t?"ordered-list-item":"unordered-list-item":null})).addDOMNode(n).getContentBlocks()}},3702:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(2104),a=n(6207),s=n(5481),c=n(4688),l=n(2780),u=(n(9067),n(4680)),f=n(7157),p=n(9398),h=n(1239),d=n(462),y=n(6130),m=n(3941),v=n(7081),b=y("draft_tree_data_support"),g=m.List,w=m.Map,S=m.OrderedMap,E=function(e,t){var n=e.key,r=e.type,o=e.data;return{text:e.text,depth:e.depth||0,type:r||"unstyled",key:n||d(),data:w(o),characterList:O(e,t)}},O=function(e,t){var n=e.text,o=e.entityRanges,i=e.inlineStyleRanges,a=o||[];return f(h(n,i||[]),p(n,a.filter((function(e){return t.hasOwnProperty(e.key)})).map((function(e){return r({},e,{key:t[e.key]})}))))},_=function(e){return r({},e,{key:e.key||d()})},P=function(e,t,n){var o=t.map((function(e){return r({},e,{parentRef:n})}));return e.concat(o.reverse())};e.exports=function(e){Array.isArray(e.blocks)||v(!1);var t=function(e){var t=e.entityMap,n={};return Object.keys(t).forEach((function(e){var r=t[e],o=r.type,i=r.mutability,a=r.data;n[e]=c.__create(o,i,a||{})})),n}(e),n=function(e,t){var n=e.blocks.find((function(e){return Array.isArray(e.children)&&e.children.length>0})),o=b&&!n?l.fromRawStateToRawTreeState(e).blocks:e.blocks;if(!b)return function(e,t){return S(e.map((function(e){var n=new i(E(e,t));return[n.getKey(),n]})))}(n?l.fromRawTreeStateToRawState(e).blocks:o,t);var s=function(e,t){return e.map(_).reduce((function(n,o,i){Array.isArray(o.children)||v(!1);var s=o.children.map(_),c=new a(r({},E(o,t),{prevSibling:0===i?null:e[i-1].key,nextSibling:i===e.length-1?null:e[i+1].key,children:g(s.map((function(e){return e.key})))}));n=n.set(c.getKey(),c);for(var l=P([],s,c);l.length>0;){var u=l.pop(),f=u.parentRef,p=f.getChildKeys(),h=p.indexOf(u.key),d=Array.isArray(u.children);if(!d){d||v(!1);break}var y=u.children.map(_),m=new a(r({},E(u,t),{parent:f.getKey(),children:g(y.map((function(e){return e.key}))),prevSibling:0===h?null:p.get(h-1),nextSibling:h===p.size-1?null:p.get(h+1)}));n=n.set(m.getKey(),m),l=P(l,y,m)}return n}),S())}(o,t);return s}(e,t),o=n.isEmpty()?new u:u.createEmpty(n.first().getKey());return new s({blockMap:n,entityMap:t,selectionBefore:o,selectionAfter:o})}},7157:(e,t,n)=>{"use strict";var r=n(490),o=n(3941).List;e.exports=function(e,t){var n=e.map((function(e,n){var o=t[n];return r.create({style:e,entity:o})}));return o(n)}},9398:(e,t,n)=>{"use strict";var r=n(7027).substr;e.exports=function(e,t){var n=Array(e.length).fill(null);return t&&t.forEach((function(t){for(var o=r(e,0,t.offset).length,i=o+r(e,t.offset,t.length).length,a=o;a<i;a++)n[a]=t.key})),n}},1239:(e,t,n)=>{"use strict";var r=n(7027),o=n(3941).OrderedSet,i=r.substr,a=o();e.exports=function(e,t){var n=Array(e.length).fill(a);return t&&t.forEach((function(t){for(var r=i(e,0,t.offset).length,o=r+i(e,t.offset,t.length).length;r<o;)n[r]=n[r].add(t.style),r++})),n}},4249:e=>{"use strict";e.exports={notEmptyKey:function(e){return null!=e&&""!=e}}},7571:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(5306),a=n(3522),s=n(8231),c=n(8727),l=n(3946),u=n(1574),f=i.isBrowser("Firefox");function p(e,t,n,i,a){var s=r.replaceText(e.getCurrentContent(),e.getSelection(),t,n,i);return o.push(e,s,"insert-characters",a)}e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e._latestEditorState,r=t.data;if(r)if(e.props.handleBeforeInput&&s(e.props.handleBeforeInput(r,n,t.timeStamp)))t.preventDefault();else{var i=n.getSelection(),h=i.getStartOffset(),d=i.getAnchorKey();if(!i.isCollapsed())return t.preventDefault(),void e.update(p(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!0));var y,m=p(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!1),v=!1;if(v||(v=c(e._latestCommittedEditorState)),!v){var b=n.getBlockTree(d),g=m.getBlockTree(d);v=b.size!==g.size||b.zip(g).some((function(e){var t=e[0],n=e[1],o=t.get("start"),i=o+(o>=h?r.length:0),a=t.get("end"),s=a+(a>=h?r.length:0),c=n.get("start"),l=n.get("end"),u=n.get("decoratorKey");return t.get("decoratorKey")!==u||t.get("leaves").size!==n.get("leaves").size||i!==c||s!==l||null!=u&&l-c!=a-o}))}if(v||(y=r,v=f&&("'"==y||"/"==y)),v||(v=l(m.getDirectionMap()).get(d)!==l(n.getDirectionMap()).get(d)),v)return t.preventDefault(),m=o.set(m,{forceSelection:!0}),void e.update(m);m=o.set(m,{nativelyRenderedContent:m.getCurrentContent()}),e._pendingStateFromBeforeInput=m,u((function(){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)}))}}},1014:(e,t,n)=>{"use strict";var r=n(7077),o=n(1089),i=n(2402);e.exports=function(e,t){var n=t.currentTarget.ownerDocument;if(!Boolean(e.props.preserveSelectionOnBlur)&&i(n)===n.body){var a=n.defaultView.getSelection(),s=e.editor;1===a.rangeCount&&o(s,a.anchorNode)&&o(s,a.focusNode)&&a.removeAllRanges()}var c=e._latestEditorState,l=c.getSelection();if(l.getHasFocus()){var u=l.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(r.acceptSelection(c,u))}}},3905:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e,t){e.setMode("composite"),e.update(r.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}},1435:(e,t,n)=>{"use strict";var r=n(1295);e.exports=function(e,t){e._latestEditorState.getSelection().isCollapsed()?t.preventDefault():e.setClipboard(r(e._latestEditorState))}},548:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(4234),a=n(1295),s=n(3020),c=n(9404);e.exports=function(e,t){var n,l=e._latestEditorState,u=l.getSelection(),f=t.target;if(u.isCollapsed())t.preventDefault();else{if(c(f)){var p=f;n=s(i.getScrollParent(p))}var h=a(l);e.setClipboard(h),e.setMode("cut"),setTimeout((function(){e.restoreEditorDOM(n),e.exitCurrentMode(),e.update(function(e){var t=r.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return o.push(e,t,"remove-range")}(l))}),0)}}},6241:e=>{"use strict";e.exports=function(e,t){e.setMode("drag"),t.preventDefault()}},1301:e=>{"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},2906:(e,t,n)=>{"use strict";var r=n(7077),o=n(5306);e.exports=function(e,t){var n=e._latestEditorState,i=n.getSelection();if(!i.getHasFocus()){var a=i.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),o.isBrowser("Chrome < 60.0.3081.0")?e.update(r.forceSelection(n,a)):e.update(r.acceptSelection(n,a))}}},4089:(e,t,n)=>{"use strict";var r=n(4702),o=n(5044),i=n(7077),a=n(5306),s=n(4249).notEmptyKey,c=n(9704),l=n(8281),u=n(3946),f=a.isEngine("Gecko");e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e.editor.ownerDocument.defaultView.getSelection(),a=n.anchorNode,p=n.isCollapsed,h=(null==a?void 0:a.nodeType)!==Node.TEXT_NODE&&(null==a?void 0:a.nodeType)!==Node.ELEMENT_NODE;if(null!=a&&!h){if(a.nodeType===Node.TEXT_NODE&&(null!==a.previousSibling||null!==a.nextSibling)){var d=a.parentNode;if(null==d)return;a.nodeValue=d.textContent;for(var y=d.firstChild;null!=y;y=y.nextSibling)y!==a&&d.removeChild(y)}var m=a.textContent,v=e._latestEditorState,b=u(c(a)),g=o.decode(b),w=g.blockKey,S=g.decoratorKey,E=g.leafKey,O=v.getBlockTree(w).getIn([S,"leaves",E]),_=O.start,P=O.end,k=v.getCurrentContent(),j=k.getBlockForKey(w),C=j.getText().slice(_,P);if(m.endsWith("\n\n")&&(m=m.slice(0,-1)),m!==C){var T,x,R,D,N=v.getSelection(),M=N.merge({anchorOffset:_,focusOffset:P,isBackward:!1}),I=j.getEntityAt(_),A=s(I)?k.getEntity(I):null,L="MUTABLE"===(null!=A?A.getMutability():null),B=L?"spellcheck-change":"apply-entity",F=r.replaceText(k,M,m,j.getInlineStyleAt(_),L?j.getEntityAt(_):null);if(f)T=n.anchorOffset,x=n.focusOffset,D=(R=_+Math.min(T,x))+Math.abs(T-x),T=R,x=D;else{var U=m.length-C.length;R=N.getStartOffset(),D=N.getEndOffset(),T=p?D+U:R,x=D+U}var q=F.merge({selectionBefore:k.getSelectionAfter(),selectionAfter:N.merge({anchorOffset:T,focusOffset:x})});e.update(i.push(v,q,B))}else{var K=t.nativeEvent.inputType;if(K){var V=function(e,t){return"deleteContentBackward"===e?l(t):t}(K,v);if(V!==v)return e.restoreEditorDOM(),void e.update(V)}}}}},8881:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(72),a=n(9119),s=n(2633),c=n(5306),l=n(8231),u=n(1473),f=n(1525),p=n(147),h=n(7587),d=n(8646),y=n(9728),m=n(8281),v=n(4022),b=n(5803),g=n(3973),w=i.isOptionKeyCommand,S=c.isBrowser("Chrome");e.exports=function(e,t){var n=t.which,i=e._latestEditorState;function c(n){var r=e.props[n];return!!r&&(r(t),!0)}switch(n){case a.RETURN:if(t.preventDefault(),e.props.handleReturn&&l(e.props.handleReturn(t,i)))return;break;case a.ESC:if(t.preventDefault(),c("onEscape"))return;break;case a.TAB:if(c("onTab"))return;break;case a.UP:if(c("onUpArrow"))return;break;case a.RIGHT:if(c("onRightArrow"))return;break;case a.DOWN:if(c("onDownArrow"))return;break;case a.LEFT:if(c("onLeftArrow"))return;break;case a.SPACE:S&&w(t)&&t.preventDefault()}var E=e.props.keyBindingFn(t);if(null!=E&&""!==E)if("undo"!==E){if(t.preventDefault(),!e.props.handleKeyCommand||!l(e.props.handleKeyCommand(E,i,t.timeStamp))){var O=function(e,t,n){switch(e){case"redo":return o.redo(t);case"delete":return v(t);case"delete-word":return p(t);case"backspace":return m(t);case"backspace-word":return f(t);case"backspace-to-start-of-line":return u(t,n);case"split-block":return h(t);case"transpose-characters":return b(t);case"move-selection-to-start-of-block":return y(t);case"move-selection-to-end-of-block":return d(t);case"secondary-cut":return s.cut(t);case"secondary-paste":return s.paste(t);default:return t}}(E,i,t);O!==i&&e.update(O)}}else g(t,i,e.update);else if(n===a.SPACE&&S&&w(t)){var _=r.replaceText(i.getCurrentContent(),i.getSelection()," ");e.update(o.push(i,_,"insert-characters"))}}},8257:(e,t,n)=>{"use strict";var r=n(403),o=n(490),i=n(1045),a=n(4702),s=n(5252),c=n(7077),l=n(509),u=n(3522),f=n(5711),p=n(8231),h=n(5264);function d(e,t,n){var r=a.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return c.push(e,r.set("entityMap",n),"insert-fragment")}e.exports=function(e,t){t.preventDefault();var n=new i(t.clipboardData);if(!n.isRichText()){var y=n.getFiles(),m=n.getText();if(y.length>0){if(e.props.handlePastedFiles&&p(e.props.handlePastedFiles(y)))return;return void f(y,(function(t){if(t=t||m){var n=e._latestEditorState,i=h(t),f=o.create({style:n.getCurrentInlineStyle(),entity:u(n.getCurrentContent(),n.getSelection())}),p=l.getCurrentBlockType(n),d=s.processText(i,f,p),y=r.createFromArray(d),v=a.replaceWithFragment(n.getCurrentContent(),n.getSelection(),y);e.update(c.push(n,v,"insert-fragment"))}}))}}var v=[],b=n.getText(),g=n.getHTML(),w=e._latestEditorState;if(e.props.formatPastedText){var S=e.props.formatPastedText(b,g);b=S.text,g=S.html}if(!e.props.handlePastedText||!p(e.props.handlePastedText(b,g,w))){if(b&&(v=h(b)),!e.props.stripPastedStyles){var E,O=e.getClipboard();if(!e.props.formatPastedText&&n.isRichText()&&O){if(-1!==(null===(E=g)||void 0===E?void 0:E.indexOf(e.getEditorKey()))||1===v.length&&1===O.size&&O.first().getText()===b)return void e.update(d(e._latestEditorState,O))}else if(O&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&function(e,t){return e.length===t.size&&t.valueSeq().every((function(t,n){return t.getText()===e[n]}))}(v,O))return void e.update(d(e._latestEditorState,O));if(g){var _=s.processHTML(g,e.props.blockRenderMap);if(_){var P=_.contentBlocks,k=_.entityMap;if(P){var j=r.createFromArray(P);return void e.update(d(e._latestEditorState,j,k))}}}e.setClipboard(null)}if(v.length){var C=o.create({style:w.getCurrentInlineStyle(),entity:u(w.getCurrentContent(),w.getSelection())}),T=l.getCurrentBlockType(w),x=s.processText(v,C,T),R=r.createFromArray(x);e.update(d(e._latestEditorState,R))}}}},8762:(e,t,n)=>{"use strict";var r=n(3405),o=n(7077),i=n(4489),a=n(9938);e.exports=function(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState.getSelection();r.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:(new Error).stack}),selectionState:JSON.stringify(t.toJS())})}}else{var n=e.props.editorState,s=a(n,i(e)),c=s.selectionState;c!==n.getSelection()&&(n=s.needsRecovery?o.forceSelection(n,c):o.acceptSelection(n,c),e.update(n))}}},7037:(e,t,n)=>{"use strict";var r=n(9532),o=n(7027).strlen;e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return!!e.getEntity()}),(function(i,a){var s=e.getText(),c=e.getEntityAt(i);n.push({offset:o(s.slice(0,i)),length:o(s.slice(i,a)),key:Number(t[r.stringify(c)])})})),n}},2e3:(e,t,n)=>{"use strict";var r=n(7027),o=n(9572),i=function(e,t){return e===t},a=function(e){return!!e},s=[];e.exports=function(e){var t=e.getCharacterList().map((function(e){return e.getStyle()})).toList(),n=t.flatten().toSet().map((function(n){return function(e,t,n){var s=[],c=t.map((function(e){return e.has(n)})).toList();return o(c,i,a,(function(t,o){var i=e.getText();s.push({offset:r.strlen(i.slice(0,t)),length:r.strlen(i.slice(t,o)),style:n})})),s}(e,t,n)}));return Array.prototype.concat.apply(s,n.toJS())}},6078:(e,t,n)=>{"use strict";var r=n(7027),o=n(8681),i=n(5215),a=n(7081);function s(e,t){for(var n=1/0,r=1/0,o=-1/0,i=-1/0,a=0;a<e.length;a++){var s=e[a];0!==s.width&&1!==s.width&&(n=Math.min(n,s.top),r=Math.min(r,s.bottom),o=Math.max(o,s.top),i=Math.max(i,s.bottom))}return o<=r&&o-n<t&&i-r<t}function c(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}e.exports=function(e){e.collapsed||a(!1);var t=(e=e.cloneRange()).startContainer;1!==t.nodeType&&(t=t.parentNode);var n=function(e){var t=getComputedStyle(e),n=o(e),r=n.createElement("div");r.style.fontFamily=t.fontFamily,r.style.fontSize=t.fontSize,r.style.fontStyle=t.fontStyle,r.style.fontWeight=t.fontWeight,r.style.lineHeight=t.lineHeight,r.style.position="absolute",r.textContent="M";var i=n.body;i||a(!1),i.appendChild(r);var s=r.getBoundingClientRect();return i.removeChild(r),s.height}(t),l=e.endContainer,u=e.endOffset;for(e.setStart(e.startContainer,0);s(i(e),n)&&(l=e.startContainer,u=e.startOffset,l.parentNode||a(!1),e.setStartBefore(l),1!==l.nodeType||"inline"===getComputedStyle(l).display););for(var f=l,p=u-1;;){for(var h=f.nodeValue,d=p;d>=0;d--)if(!(null!=h&&d>0&&r.isSurrogatePair(h,d-1))){if(e.setStart(f,d),!s(i(e),n))break;l=f,u=d}if(-1===d||0===f.childNodes.length)break;p=c(f=f.childNodes[d])}return e.setStart(l,u),e}},9704:(e,t,n)=>{"use strict";var r=n(8681),o=n(2946);e.exports=function(e){for(var t=e;t&&t!==r(e).documentElement;){var n=o(t);if(null!=n)return n;t=t.parentNode}return null}},9572:e=>{"use strict";e.exports=function(e,t,n,r){if(e.size){var o=0;e.reduce((function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i})),n(e.last())&&r(o,e.count())}}},462:e=>{"use strict";var t={},n=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||t.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*n).toString(32);return t[e]=!0,e}},8655:(e,t,n)=>{"use strict";var r=n(3688),o=n(876),i=n(7081);function a(e,t,n,a,s,c,l){var u=n.getStartOffset(),f=n.getEndOffset(),p=e.__get(s).getMutability(),h=l?u:f;if("MUTABLE"===p)return n;var d=o(t,s).filter((function(e){return h<=e.end&&h>=e.start}));1!=d.length&&i(!1);var y=d[0];if("IMMUTABLE"===p)return n.merge({anchorOffset:y.start,focusOffset:y.end,isBackward:!1});c||(l?f=y.end:u=y.start);var m=r.getRemovalRange(u,f,t.getText().slice(y.start,y.end),y.start,a);return n.merge({anchorOffset:m.start,focusOffset:m.end,isBackward:!1})}e.exports=function(e,t,n,r,o){var i=r.getStartOffset(),s=r.getEndOffset(),c=t.getEntityAt(i),l=n.getEntityAt(s-1);if(!c&&!l)return r;var u=r;if(c&&c===l)u=a(e,t,u,o,c,!0,!0);else if(c&&l){var f=a(e,t,u,o,c,!1,!0),p=a(e,n,u,o,l,!1,!1);u=u.merge({anchorOffset:f.getAnchorOffset(),focusOffset:p.getFocusOffset(),isBackward:!1})}else if(c){var h=a(e,t,u,o,c,!1,!0);u=u.merge({anchorOffset:h.getStartOffset(),isBackward:!1})}else if(l){var d=a(e,n,u,o,l,!1,!1);u=u.merge({focusOffset:d.getEndOffset(),isBackward:!1})}return u}},4489:(e,t,n)=>{"use strict";var r=n(7081),o=n(5435);e.exports=function(e){var t=e.editorContainer;return t||r(!1),o(t.firstChild)||r(!1),t.firstChild}},9845:(e,t,n)=>{"use strict";var r=n(8290),o=n(4511);e.exports=function(e,t){var n=t.getStartKey(),i=t.getStartOffset(),a=t.getEndKey(),s=t.getEndOffset(),c=o(e,t).getBlockMap(),l=c.keySeq(),u=l.indexOf(n),f=l.indexOf(a)+1;return r(c.slice(u,f).map((function(e,t){var r=e.getText(),o=e.getCharacterList();return n===a?e.merge({text:r.slice(i,s),characterList:o.slice(i,s)}):t===n?e.merge({text:r.slice(i),characterList:o.slice(i)}):t===a?e.merge({text:r.slice(0,s),characterList:o.slice(0,s)}):e})))}},8681:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},6164:(e,t,n)=>{"use strict";var r=n(72),o=n(9119),i=n(5306),a=i.isPlatform("Mac OS X"),s=a&&i.isBrowser("Firefox < 29"),c=r.hasCommandModifier,l=r.isCtrlKeyCommand;function u(e){return a&&e.altKey||l(e)}e.exports=function(e){switch(e.keyCode){case 66:return c(e)?"bold":null;case 68:return l(e)?"delete":null;case 72:return l(e)?"backspace":null;case 73:return c(e)?"italic":null;case 74:return c(e)?"code":null;case 75:return a&&l(e)?"secondary-cut":null;case 77:case 79:return l(e)?"split-block":null;case 84:return a&&l(e)?"transpose-characters":null;case 85:return c(e)?"underline":null;case 87:return a&&l(e)?"backspace-word":null;case 89:return l(e)?a?"secondary-paste":"redo":null;case 90:return function(e){return c(e)?e.shiftKey?"redo":"undo":null}(e)||null;case o.RETURN:return"split-block";case o.DELETE:return function(e){return!a&&e.shiftKey?null:u(e)?"delete-word":"delete"}(e);case o.BACKSPACE:return function(e){return c(e)&&a?"backspace-to-start-of-line":u(e)?"backspace-word":"backspace"}(e);case o.LEFT:return s&&c(e)?"move-selection-to-start-of-block":null;case o.RIGHT:return s&&c(e)?"move-selection-to-end-of-block":null;default:return null}}},9938:(e,t,n)=>{"use strict";var r=n(6764);e.exports=function(e,t){var n=t.ownerDocument.defaultView.getSelection(),o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,s=n.focusOffset;return 0===n.rangeCount||null==o||null==a?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:r(e,t,o,i,a,s)}},6764:(e,t,n)=>{"use strict";var r=n(9704),o=n(2946),i=n(7546),a=n(7081),s=n(9509),c=n(3946);function l(e,t,n){var i=t,l=r(i);if(null!=l||e&&(e===i||e.firstChild===i)||a(!1),e===i&&(i=i.firstChild,s(i)||a(!1),"true"!==i.getAttribute("data-contents")&&a(!1),n>0&&(n=i.childNodes.length)),0===n){var f=null;if(null!=l)f=l;else{var p=function(e){for(;e.firstChild&&(s(e.firstChild)&&"true"===e.firstChild.getAttribute("data-blocks")||o(e.firstChild));)e=e.firstChild;return e}(i);f=c(o(p))}return{key:f,offset:0}}var h=i.childNodes[n-1],d=null,y=null;if(o(h)){var m=function(e){for(;e.lastChild&&(s(e.lastChild)&&"true"===e.lastChild.getAttribute("data-blocks")||o(e.lastChild));)e=e.lastChild;return e}(h);d=c(o(m)),y=u(m)}else d=c(l),y=u(h);return{key:d,offset:y}}function u(e){var t=e.textContent;return"\n"===t?0:t.length}e.exports=function(e,t,n,o,a,s){var u=n.nodeType===Node.TEXT_NODE,f=a.nodeType===Node.TEXT_NODE;if(u&&f)return{selectionState:i(e,c(r(n)),o,c(r(a)),s),needsRecovery:!1};var p=null,h=null,d=!0;return u?(p={key:c(r(n)),offset:o},h=l(t,a,s)):f?(h={key:c(r(a)),offset:s},p=l(t,n,o)):(p=l(t,n,o),h=l(t,a,s),n===a&&o===s&&(d=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:i(e,p.key,p.offset,h.key,h.offset),needsRecovery:d}}},3522:(e,t,n)=>{"use strict";var r=n(4249).notEmptyKey;function o(e,t){return r(t)&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var n;if(t.isCollapsed()){var r=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(n=e.getBlockForKey(r).getEntityAt(i-1))!==e.getBlockForKey(r).getEntityAt(i)?null:o(e.getEntityMap(),n):null}var a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a);return n=s===c.getLength()?null:c.getEntityAt(s),o(e.getEntityMap(),n)}},1295:(e,t,n)=>{"use strict";var r=n(9845);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:r(e.getCurrentContent(),t)}},1023:(e,t,n)=>{"use strict";var r=n(6207);e.exports=function(e,t){if(!(e instanceof r))return null;var n=e.getNextSiblingKey();if(n)return n;var o=e.getParentKey();if(!o)return null;for(var i=t.get(o);i&&!i.getNextSiblingKey();){var a=i.getParentKey();i=a?t.get(a):null}return i?i.getNextSiblingKey():null}},2023:e=>{"use strict";e.exports=function(e){return Object.keys(e).map((function(t){return e[t]}))}},3683:(e,t,n)=>{"use strict";var r=n(5215);e.exports=function(e){var t=r(e),n=0,o=0,i=0,a=0;if(t.length){if(t.length>1&&0===t[0].width){var s=t[1];n=s.top,o=s.right,i=s.bottom,a=s.left}else{var c=t[0];n=c.top,o=c.right,i=c.bottom,a=c.left}for(var l=1;l<t.length;l++){var u=t[l];0!==u.height&&0!==u.width&&(n=Math.min(n,u.top),o=Math.max(o,u.right),i=Math.max(i,u.bottom),a=Math.min(a,u.left))}}return{top:n,right:o,bottom:i,left:a,width:o-a,height:i-n}}},5215:(e,t,n)=>{"use strict";var r=n(5306),o=n(7081),i=r.isBrowser("Chrome")?function(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;null!=r;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var a,s=Array.from(t.getClientRects());if(n.push(s),i)return n.reverse(),(a=[]).concat.apply(a,n);t.setEndBefore(r)}o(!1)}:function(e){return Array.from(e.getClientRects())};e.exports=i},876:(e,t,n)=>{"use strict";var r=n(7081);e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return e.getEntity()===t}),(function(e,t){n.push({start:e,end:t})})),n.length||r(!1),n}},1539:(e,t,n)=>{"use strict";var r=n(5306),o=n(7081),i=r.isBrowser("IE <= 9");e.exports=function(e){var t,n=null;return!i&&document.implementation&&document.implementation.createHTMLDocument&&((t=document.implementation.createHTMLDocument("foo")).documentElement||o(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}},2946:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function e(t){if(r(t)){var n=t,o=n.getAttribute("data-offset-key");if(o)return o;for(var i=0;i<n.childNodes.length;i++){var a=e(n.childNodes[i]);if(a)return a}}return null}},5711:(e,t,n)=>{"use strict";var r=n(7081),o=/\.textClipping$/,i={"text/plain":!0,"text/html":!0,"text/rtf":!0};e.exports=function(e,t){var a=0,s=[];e.forEach((function(c){!function(e,t){if(!n.g.FileReader||e.type&&!(e.type in i))t("");else{if(""===e.type){var a="";return o.test(e.name)&&(a=e.name.replace(o,"")),void t(a)}var s=new FileReader;s.onload=function(){var e=s.result;"string"!=typeof e&&r(!1),t(e)},s.onerror=function(){t("")},s.readAsText(e)}}(c,(function(n){a++,n&&s.push(n.slice(0,5e3)),a==e.length&&t(s.join("\r"))}))}))}},7546:(e,t,n)=>{"use strict";var r=n(5044),o=n(3946);e.exports=function(e,t,n,i,a){var s=o(e.getSelection());if(!t||!i)return s;var c=r.decode(t),l=c.blockKey,u=e.getBlockTree(l),f=u&&u.getIn([c.decoratorKey,"leaves",c.leafKey]),p=r.decode(i),h=p.blockKey,d=e.getBlockTree(h),y=d&&d.getIn([p.decoratorKey,"leaves",p.leafKey]);if(!f||!y)return s;var m=f.get("start"),v=y.get("start"),b=f?m+n:null,g=y?v+a:null;if(s.getAnchorKey()===l&&s.getAnchorOffset()===b&&s.getFocusKey()===h&&s.getFocusOffset()===g)return s;var w=!1;if(l===h){var S=f.get("end"),E=y.get("end");w=v===m&&E===S?a<n:v<m}else w=e.getCurrentContent().getBlockMap().keySeq().skipUntil((function(e){return e===l||e===h})).first()===h;return s.merge({anchorKey:l,anchorOffset:b,focusKey:h,focusOffset:g,isBackward:w})}},5452:(e,t,n)=>{"use strict";var r=n(3683);e.exports=function(e){var t=e.getSelection();if(!t.rangeCount)return null;var n=t.getRangeAt(0),o=r(n),i=o.top,a=o.right,s=o.bottom,c=o.left;return 0===i&&0===a&&0===s&&0===c?null:o}},2189:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}},6130:e=>{"use strict";e.exports=function(e){return!("undefined"==typeof window||!window.__DRAFT_GKX||!window.__DRAFT_GKX[e])}},9657:(e,t,n)=>{"use strict";var r=n(403),o=n(6207),i=n(3941),a=n(2882),s=n(7081),c=n(8290),l=i.List;e.exports=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA";t.isCollapsed()||s(!1);var u=e.getBlockMap(),f=c(n),p=t.getStartKey(),h=t.getStartOffset(),d=u.get(p);return d instanceof o&&(d.getChildKeys().isEmpty()||s(!1)),1===f.size?function(e,t,n,r,o,i){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"REPLACE_WITH_NEW_DATA",c=n.get(o),l=c.getText(),u=c.getCharacterList(),f=o,p=i+r.getText().length,h=null;switch(s){case"MERGE_OLD_DATA_TO_NEW_DATA":h=r.getData().merge(c.getData());break;case"REPLACE_WITH_NEW_DATA":h=r.getData()}var d=c.getType();l&&"unstyled"===d&&(d=r.getType());var y=c.merge({text:l.slice(0,i)+r.getText()+l.slice(i),characterList:a(u,r.getCharacterList(),i),type:d,data:h});return e.merge({blockMap:n.set(o,y),selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:p,focusKey:f,focusOffset:p,isBackward:!1})})}(e,t,u,f.first(),p,h,i):function(e,t,n,i,a,s){var c=n.first()instanceof o,u=[],f=i.size,p=n.get(a),h=i.first(),d=i.last(),y=d.getLength(),m=d.getKey(),v=c&&(!p.getChildKeys().isEmpty()||!h.getChildKeys().isEmpty());n.forEach((function(e,t){t===a?(v?u.push(e):u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.slice(0,t),a=o.slice(0,t),s=n.first();return e.merge({text:i+s.getText(),characterList:a.concat(s.getCharacterList()),type:i?e.getType():s.getType(),data:s.getData()})}(e,s,i)),i.slice(v?0:1,f-1).forEach((function(e){return u.push(e)})),u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.length,a=r.slice(t,i),s=o.slice(t,i),c=n.last();return c.merge({text:c.getText()+a,characterList:c.getCharacterList().concat(s),data:c.getData()})}(e,s,i))):u.push(e)}));var b=r.createFromArray(u);return c&&(b=function(e,t,n,r){return e.withMutations((function(t){var o=n.getKey(),i=r.getKey(),a=n.getNextSiblingKey(),s=n.getParentKey(),c=function(e,t){var n=e.getKey(),r=e,o=[];for(t.get(n)&&o.push(n);r&&r.getNextSiblingKey();){var i=r.getNextSiblingKey();if(!i)break;o.push(i),r=t.get(i)}return o}(r,e),u=c[c.length-1];if(t.get(i)?(t.setIn([o,"nextSibling"],i),t.setIn([i,"prevSibling"],o)):(t.setIn([o,"nextSibling"],r.getNextSiblingKey()),t.setIn([r.getNextSiblingKey(),"prevSibling"],o)),t.setIn([u,"nextSibling"],a),a&&t.setIn([a,"prevSibling"],u),c.forEach((function(e){return t.setIn([e,"parent"],s)})),s){var f=e.get(s).getChildKeys(),p=f.indexOf(o)+1,h=f.toArray();h.splice.apply(h,[p,0].concat(c)),t.setIn([s,"children"],l(h))}}))}(b,0,p,h)),e.merge({blockMap:b,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:y,focusKey:m,focusOffset:y,isBackward:!1})})}(e,t,u,f,p,h)}},2882:e=>{"use strict";e.exports=function(e,t,n){var r=e;if(n===r.count())t.forEach((function(e){r=r.push(e)}));else if(0===n)t.reverse().forEach((function(e){r=r.unshift(e)}));else{var o=r.slice(0,n),i=r.slice(n);r=o.concat(t,i).toList()}return r}},3163:(e,t,n)=>{"use strict";var r=n(3941),o=n(2882),i=n(7081),a=r.Repeat;e.exports=function(e,t,n,r){t.isCollapsed()||i(!1);var s=null;if(null!=n&&(s=n.length),null==s||0===s)return e;var c=e.getBlockMap(),l=t.getStartKey(),u=t.getStartOffset(),f=c.get(l),p=f.getText(),h=f.merge({text:p.slice(0,u)+n+p.slice(u,f.getLength()),characterList:o(f.getCharacterList(),a(r,s).toList(),u)}),d=u+s;return e.merge({blockMap:c.set(l,h),selectionAfter:t.merge({anchorOffset:d,focusOffset:d})})}},9509:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&e.nodeType===Node.ELEMENT_NODE}},8231:e=>{"use strict";e.exports=function(e){return"handled"===e||!0===e}},285:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"A"===e.nodeName}},6959:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"BR"===e.nodeName}},5435:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&(e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement)}},132:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"IMG"===e.nodeName}},9404:e=>{"use strict";e.exports=function(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}},8727:e=>{"use strict";e.exports=function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),o=t.getStartOffset(),i=!1;return r.some((function(e){return o===e.get("start")?(i=!0,!0):o<e.get("end")&&e.get("leaves").some((function(e){var t=e.get("start");return o===t&&(i=!0,!0)}))})),i}},6731:(e,t,n)=>{"use strict";var r=n(9119);e.exports=function(e){return e.which===r.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}},1473:(e,t,n)=>{"use strict";var r=n(7077),o=n(6078),i=n(6764),a=n(3021),s=n(9416);e.exports=function(e,t){var n=s(e,(function(e){var n=e.getSelection();if(n.isCollapsed()&&0===n.getAnchorOffset())return a(e,1);var r=t.currentTarget.ownerDocument.defaultView.getSelection().getRangeAt(0);return r=o(r),i(e,null,r.endContainer,r.endOffset,r.startContainer,r.startOffset).selectionState}),"backward");return n===e.getCurrentContent()?e:r.push(e,n,"remove-range")}},1525:(e,t,n)=>{"use strict";var r=n(1111),o=n(7077),i=n(3021),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset();if(0===n)return i(e,1);var o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(0,n),s=r.getBackward(a);return i(e,s.length||1)}),"backward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},147:(e,t,n)=>{"use strict";var r=n(1111),o=n(7077),i=n(2645),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset(),o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(n),s=r.getForward(a);return i(e,s.length||1)}),"forward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},7587:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077);e.exports=function(e){var t=r.splitBlock(e.getCurrentContent(),e.getSelection());return o.push(e,t,"split-block")}},8646:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e){var t=e.getSelection(),n=t.getEndKey(),o=e.getCurrentContent().getBlockForKey(n).getLength();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:o,focusKey:n,focusOffset:o,isBackward:!1}),forceSelection:!0})}},9728:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e){var t=e.getSelection(),n=t.getStartKey();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}},8281:(e,t,n)=>{"use strict";var r=n(7077),o=n(7027),i=n(3021),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a-1];return i(e,s?o.getUTF16Length(s,0):1)}),"backward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}},4022:(e,t,n)=>{"use strict";var r=n(7077),o=n(7027),i=n(2645),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a];return i(e,s?o.getUTF16Length(s,0):1)}),"forward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}},5803:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(9845);e.exports=function(e){var t=e.getSelection();if(!t.isCollapsed())return e;var n=t.getAnchorOffset();if(0===n)return e;var a,s,c=t.getAnchorKey(),l=e.getCurrentContent(),u=l.getBlockForKey(c).getLength();if(u<=1)return e;n===u?(a=t.set("anchorOffset",n-1),s=t):s=(a=t.set("focusOffset",n+1)).set("anchorOffset",n+1);var f=i(l,a),p=r.removeRange(l,a,"backward"),h=p.getSelectionAfter(),d=h.getAnchorOffset()-1,y=h.merge({anchorOffset:d,focusOffset:d}),m=r.replaceWithFragment(p,y,f),v=o.push(e,m,"insert-fragment");return o.acceptSelection(v,s)}},3973:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e,t,n){var o=r.undo(t);if("spellcheck-change"!==t.getLastChangeType())e.preventDefault(),t.getNativelyRenderedContent()?(n(r.set(t,{nativelyRenderedContent:null})),setTimeout((function(){n(o)}),0)):n(o);else{var i=o.getCurrentContent();n(r.set(o,{nativelyRenderedContent:i}))}}},2356:(e,t,n)=>{"use strict";var r=n(3941).Map;e.exports=function(e,t,n){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat(r([[i,a.get(i)]])).map(n);return e.merge({blockMap:a.merge(s),selectionBefore:t,selectionAfter:t})}},2351:(e,t,n)=>{"use strict";var r=n(6207),o=n(1023),i=n(3941),a=n(7081),s=i.OrderedMap,c=i.List,l=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},u=function(e,t,n,r,o){if(!o)return e;var i="after"===r,a=t.getKey(),s=n.getKey(),u=t.getParentKey(),f=t.getNextSiblingKey(),p=t.getPrevSiblingKey(),h=n.getParentKey(),d=i?n.getNextSiblingKey():s,y=i?s:n.getPrevSiblingKey();return e.withMutations((function(e){l(u,e,(function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(a))})})),l(p,e,(function(e){return e.merge({nextSibling:f})})),l(f,e,(function(e){return e.merge({prevSibling:p})})),l(d,e,(function(e){return e.merge({prevSibling:a})})),l(y,e,(function(e){return e.merge({nextSibling:a})})),l(h,e,(function(e){var t=e.getChildKeys(),n=t.indexOf(s),r=i?n+1:0!==n?n-1:0,o=t.toArray();return o.splice(r,0,a),e.merge({children:c(o)})})),l(a,e,(function(e){return e.merge({nextSibling:d,prevSibling:y,parent:h})}))}))};e.exports=function(e,t,n,i){"replace"===i&&a(!1);var c=n.getKey(),l=t.getKey();l===c&&a(!1);var f=e.getBlockMap(),p=t instanceof r,h=[t],d=f.delete(l);p&&(h=[],d=f.withMutations((function(e){var n=t.getNextSiblingKey(),r=o(t,e);e.toSeq().skipUntil((function(e){return e.getKey()===l})).takeWhile((function(e){var t=e.getKey(),o=t===l,i=n&&t!==n,a=!n&&e.getParentKey()&&(!r||t!==r);return!!(o||i||a)})).forEach((function(t){h.push(t),e.delete(t.getKey())}))})));var y=d.toSeq().takeUntil((function(e){return e===n})),m=d.toSeq().skipUntil((function(e){return e===n})).skip(1),v=h.map((function(e){return[e.getKey(),e]})),b=s();if("before"===i){var g=e.getBlockBefore(c);g&&g.getKey()===t.getKey()&&a(!1),b=y.concat([].concat(v,[[c,n]]),m).toOrderedMap()}else if("after"===i){var w=e.getBlockAfter(c);w&&w.getKey()===l&&a(!1),b=y.concat([[c,n]].concat(v),m).toOrderedMap()}return e.merge({blockMap:u(b,t,n,i,p),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:l,focusKey:l})})}},3021:(e,t,n)=>{"use strict";n(2264),e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),o=n.getStartKey(),i=n.getStartOffset(),a=o,s=0;if(t>i){var c=r.getKeyBefore(o);null==c?a=o:(a=c,s=r.getBlockForKey(c).getText().length)}else s=i-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}},2645:(e,t,n)=>{"use strict";n(2264),e.exports=function(e,t){var n,r=e.getSelection(),o=r.getStartKey(),i=r.getStartOffset(),a=e.getCurrentContent(),s=o;return t>a.getBlockForKey(o).getText().length-i?(s=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:s,focusOffset:n})}},8290:(e,t,n)=>{"use strict";var r=n(6207),o=n(462),i=n(3941).OrderedMap;e.exports=function(e){return e.first()instanceof r?function(e){var t,n={};return i(e.withMutations((function(e){e.forEach((function(r,i){var a=r.getKey(),s=r.getNextSiblingKey(),c=r.getPrevSiblingKey(),l=r.getChildKeys(),u=r.getParentKey(),f=o();if(n[a]=f,s&&(e.get(s)?e.setIn([s,"prevSibling"],f):e.setIn([a,"nextSibling"],null)),c&&(e.get(c)?e.setIn([c,"nextSibling"],f):e.setIn([a,"prevSibling"],null)),u&&e.get(u)){var p=e.get(u).getChildKeys();e.setIn([u,"children"],p.set(p.indexOf(r.getKey()),f))}else e.setIn([a,"parent"],null),t&&(e.setIn([t.getKey(),"nextSibling"],f),e.setIn([a,"prevSibling"],n[t.getKey()])),t=e.get(a);l.forEach((function(t){e.get(t)?e.setIn([t,"parent"],f):e.setIn([a,"children"],r.getChildKeys().filter((function(e){return e!==t})))}))}))})).toArray().map((function(e){return[n[e.getKey()],e.set("key",n[e.getKey()])]})))}(e):function(e){return i(e.toArray().map((function(e){var t=o();return[t,e.set("key",t)]})))}(e)}},4511:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(7081);function a(e,t,n){var a=t.getCharacterList(),s=n>0?a.get(n-1):void 0,c=n<a.count()?a.get(n):void 0,l=s?s.getEntity():void 0,u=c?c.getEntity():void 0;if(u&&u===l&&"MUTABLE"!==e.__get(u).getMutability()){for(var f,p=function(e,t,n){var r;return o(e,(function(e,t){return e.getEntity()===t.getEntity()}),(function(e){return e.getEntity()===t}),(function(e,t){e<=n&&t>=n&&(r={start:e,end:t})})),"object"!=typeof r&&i(!1),r}(a,u,n),h=p.start,d=p.end;h<d;)f=a.get(h),a=a.set(h,r.applyEntity(f,null)),h++;return t.set("characterList",a)}return t}e.exports=function(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),o={},i=t.getStartKey(),s=t.getStartOffset(),c=n.get(i),l=a(r,c,s);l!==c&&(o[i]=l);var u=t.getEndKey(),f=t.getEndOffset(),p=n.get(u);i===u&&(p=l);var h=a(r,p,f);return h!==p&&(o[u]=h),Object.keys(o).length?e.merge({blockMap:n.merge(o),selectionAfter:t}):e.set("selectionAfter",t)}},4217:(e,t,n)=>{"use strict";var r=n(6207),o=n(1023),i=n(3941),a=(i.List,i.Map),s=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},c=function(e,t){var n=[];if(!e)return n;for(var r=t.get(e);r&&r.getParentKey();){var o=r.getParentKey();o&&n.push(o),r=o?t.get(o):null}return n},l=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getNextSiblingKey();r&&!t.get(r);)r=n.get(r).getNextSiblingKey()||null;return r},u=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getPrevSiblingKey();r&&!t.get(r);)r=n.get(r).getPrevSiblingKey()||null;return r};e.exports=function(e,t){if(t.isCollapsed())return e;var n,i=e.getBlockMap(),f=t.getStartKey(),p=t.getStartOffset(),h=t.getEndKey(),d=t.getEndOffset(),y=i.get(f),m=i.get(h),v=y instanceof r,b=[];if(v){var g=m.getChildKeys(),w=c(h,i);m.getNextSiblingKey()&&(b=b.concat(w)),g.isEmpty()||(b=b.concat(w.concat([h]))),b=b.concat(c(o(m,i),i))}n=y===m?function(e,t,n){if(0===t)for(;t<n;)e=e.shift(),t++;else if(n===e.count())for(;n>t;)e=e.pop(),n--;else{var r=e.slice(0,t),o=e.slice(n);e=r.concat(o).toList()}return e}(y.getCharacterList(),p,d):y.getCharacterList().slice(0,p).concat(m.getCharacterList().slice(d));var S=y.merge({text:y.getText().slice(0,p)+m.getText().slice(d),characterList:n}),E=v&&0===p&&0===d&&m.getParentKey()===f&&null==m.getPrevSiblingKey()?a([[f,null]]):i.toSeq().skipUntil((function(e,t){return t===f})).takeUntil((function(e,t){return t===h})).filter((function(e,t){return-1===b.indexOf(t)})).concat(a([[h,null]])).map((function(e,t){return t===f?S:null})),O=i.merge(E).filter((function(e){return!!e}));return v&&y!==m&&(O=function(e,t,n,r){return e.withMutations((function(i){if(s(t.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),s(n.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),c(t.getKey(),r).forEach((function(e){return s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),s(t.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:t.getPrevSiblingKey()})})),s(t.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r)})})),s(n.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:u(e,i,r)})})),s(n.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:n.getNextSiblingKey()})})),c(n.getKey(),r).forEach((function(e){s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),function(e,t){var n=[];if(!e)return n;for(var r=o(e,t);r&&t.get(r);){var i=t.get(r);n.push(r),r=i.getParentKey()?o(i,t):null}return n}(n,r).forEach((function(e){return s(e,i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),null==e.get(t.getKey())&&null!=e.get(n.getKey())&&n.getParentKey()===t.getKey()&&null==n.getPrevSiblingKey()){var a=t.getPrevSiblingKey();s(n.getKey(),i,(function(e){return e.merge({prevSibling:a})})),s(a,i,(function(e){return e.merge({nextSibling:n.getKey()})}));var f=a?e.get(a):null,p=f?f.getParentKey():null;if(t.getChildKeys().forEach((function(e){s(e,i,(function(e){return e.merge({parent:p})}))})),null!=p){var h=e.get(p);s(p,i,(function(e){return e.merge({children:h.getChildKeys().concat(t.getChildKeys())})}))}s(t.getChildKeys().find((function(t){return null===e.get(t).getNextSiblingKey()})),i,(function(e){return e.merge({nextSibling:t.getNextSiblingKey()})}))}}))}(O,y,m,i)),e.merge({blockMap:O,selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:p,focusKey:f,focusOffset:p,isBackward:!1})})}},9416:(e,t,n)=>{"use strict";var r=n(4702),o=n(6130)("draft_tree_data_support");e.exports=function(e,t,n){var i=e.getSelection(),a=e.getCurrentContent(),s=i,c=i.getAnchorKey(),l=i.getFocusKey(),u=a.getBlockForKey(c);if(o&&"forward"===n&&c!==l)return a;if(i.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return a;if(o&&i.getAnchorOffset()===a.getBlockForKey(c).getLength()){var f=a.getBlockForKey(u.nextSibling);if(!f||0===f.getLength())return a}}else if(e.isSelectionAtStartOfContent())return a;if((s=t(e))===i)return a}return r.removeRange(a,s,n)}},2140:e=>{"use strict";var t=new RegExp("\r","g");e.exports=function(e){return e.replace(t,"")}},2337:(e,t,n)=>{"use strict";var r=n(6512),o=n(3405),i=n(5306),a=n(1089),s=n(2402),c=n(8681),l=n(7081),u=n(9509),f=i.isBrowser("IE");function p(e,t){if(!e)return"[empty]";var n=h(e,t);return n.nodeType===Node.TEXT_NODE?n.textContent:(u(n)||l(!1),n.outerHTML)}function h(e,t){var n=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE){var r=e.textContent.length;return c(e).createTextNode("[text "+r+(n.length?" | "+n.join(", "):"")+"]")}var o=e.cloneNode();1===o.nodeType&&n.length&&o.setAttribute("data-labels",n.join(", "));for(var i=e.childNodes,a=0;a<i.length;a++)o.appendChild(h(i[a],t));return o}function d(e,t){for(var n=e,r=n;n;){if(u(n)&&r.hasAttribute("contenteditable"))return p(n,t);r=n=n.parentNode}return"Could not find contentEditable parent of node"}function y(e){return null===e.nodeValue?e.childNodes.length:e.nodeValue.length}function m(e,t,n,r){var i=s();if(e.extend&&null!=t&&a(i,t)){n>y(t)&&o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var c=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,n)}catch(a){throw o.logSelectionStateFailure({anonymizedDom:d(t,(function(t){var n=[];return t===i&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n})),extraParams:JSON.stringify({activeElementName:i?i.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:c,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:a?""+a:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),a}}else if(t&&e.rangeCount>0){var l=e.getRangeAt(0);l.setEnd(t,n),e.addRange(l.cloneRange())}}function v(e,t,n,i){var a=c(t).createRange();if(n>y(t)&&(o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(i.toJS())}),r.handleExtensionCausedError()),a.setStart(t,n),f)try{e.addRange(a)}catch(e){}else e.addRange(a)}e.exports={setDraftEditorSelection:function(e,t,n,r,o){var i=c(t);if(a(i.documentElement,t)){var s=i.defaultView.getSelection(),l=e.getAnchorKey(),u=e.getAnchorOffset(),f=e.getFocusKey(),p=e.getFocusOffset(),h=e.getIsBackward();if(!s.extend&&h){var d=l,y=u;l=f,u=p,f=d,p=y,h=!1}var b=l===n&&r<=u&&o>=u,g=f===n&&r<=p&&o>=p;if(b&&g)return s.removeAllRanges(),v(s,t,u-r,e),void m(s,t,p-r,e);if(h){if(g&&(s.removeAllRanges(),v(s,t,p-r,e)),b){var w=s.focusNode,S=s.focusOffset;s.removeAllRanges(),v(s,t,u-r,e),m(s,w,S,e)}}else b&&(s.removeAllRanges(),v(s,t,u-r,e)),g&&m(s,t,p-r,e)}},addFocusToSelection:m}},8124:(e,t,n)=>{"use strict";var r=n(6207),o=n(462),i=n(3941),a=n(7081),s=n(2356),c=i.List,l=i.Map,u=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}};e.exports=function(e,t){t.isCollapsed()||a(!1);var n=t.getAnchorKey(),i=e.getBlockMap(),f=i.get(n),p=f.getText();if(!p){var h=f.getType();if("unordered-list-item"===h||"ordered-list-item"===h)return s(e,t,(function(e){return e.merge({type:"unstyled",depth:0})}))}var d=t.getAnchorOffset(),y=f.getCharacterList(),m=o(),v=f instanceof r,b=f.merge({text:p.slice(0,d),characterList:y.slice(0,d)}),g=b.merge({key:m,text:p.slice(d),characterList:y.slice(d),data:l()}),w=i.toSeq().takeUntil((function(e){return e===f})),S=i.toSeq().skipUntil((function(e){return e===f})).rest(),E=w.concat([[n,b],[m,g]],S).toOrderedMap();return v&&(f.getChildKeys().isEmpty()||a(!1),E=function(e,t,n){return e.withMutations((function(e){var r=t.getKey(),o=n.getKey();u(t.getParentKey(),e,(function(e){var t=e.getChildKeys(),n=t.indexOf(r)+1,i=t.toArray();return i.splice(n,0,o),e.merge({children:c(i)})})),u(t.getNextSiblingKey(),e,(function(e){return e.merge({prevSibling:o})})),u(r,e,(function(e){return e.merge({nextSibling:o})})),u(o,e,(function(e){return e.merge({prevSibling:r})}))}))}(E,b,g)),e.merge({blockMap:E,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:0,focusKey:m,focusOffset:0,isBackward:!1})})}},5264:e=>{"use strict";var t=/\r\n?|\n/g;e.exports=function(e){return e.split(t)}},5634:e=>{"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}},3941:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:$(e)}function r(e){return s(e)?e:G(e)}function o(e){return c(e)?e:J(e)}function i(e){return a(e)&&!l(e)?e:Q(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",m=5,v=1<<m,b=v-1,g={},w={value:!1},S={value:!1};function E(e){return e.value=!1,e}function O(e){e&&(e.value=!0)}function _(){}function P(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function k(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function j(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?k(e)+t:t}function C(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function x(e,t){return D(e,t,0)}function R(e,t){return D(e,t,t)}function D(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var N=0,M=1,I=2,A="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=A||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function K(e){return!!W(e)}function V(e){return e&&"function"==typeof e.next}function z(e){var t=W(e);return t&&t.call(e)}function W(e){var t=e&&(A&&e[A]||e[L]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function $(e){return null==e?ae():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function G(e){return null==e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function J(e){return null==e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():ce(e)}function Q(e){return(null==e?ae():a(e)?s(e)?e.entrySeq():e:ce(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=N,F.VALUES=M,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t($,n),$.of=function(){return $(arguments)},$.prototype.toSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq {","}")},$.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},$.prototype.__iterate=function(e,t){return ue(this,e,t,!0)},$.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(G,$),G.prototype.toKeyedSeq=function(){return this},t(J,$),J.of=function(){return J(arguments)},J.prototype.toIndexedSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq [","]")},J.prototype.__iterate=function(e,t){return ue(this,e,t,!1)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(Q,$),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},$.isSeq=ie,$.Keyed=G,$.Set=Q,$.Indexed=J;var Y,X,Z,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[ee])}function ae(){return Y||(Y=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():K(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ce(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return H(e)?new te(e):V(e)?new oe(e):K(e)?new re(e):void 0}function ue(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function fe(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new F((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:U(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function pe(e,t){return t?he(t,e,"",{"":e}):de(e)}function he(e,t,n,r){return Array.isArray(t)?e.call(r,n,J(t).map((function(n,r){return he(e,n,r,t)}))):ye(t)?e.call(r,n,G(t).map((function(n,r){return he(e,n,r,t)}))):t}function de(e){return Array.isArray(e)?J(e).map(de).toList():ye(e)?G(e).map(de).toMap():e}function ye(e){return e&&(e.constructor===Object||void 0===e.constructor)}function me(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ve(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&me(o[1],e)&&(n||me(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate((function(t,r){if(n?!e.has(t):o?!me(t,e.get(r,g)):!me(e.get(r,g),t))return f=!1,!1}));return f&&e.size===p}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function ge(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Z)return Z;Z=this}}function Se(){throw TypeError("Abstract")}function Ee(){}function Oe(){}function _e(){}$.prototype[ee]=!0,t(te,J),te.prototype.get=function(e,t){return this.has(e)?this._array[j(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?{value:void 0,done:!0}:U(e,o,n[t?r-o++:o++])}))},t(ne,G),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new F((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:U(e,a,n[a])}))},ne.prototype[d]=!0,t(re,J),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=z(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=z(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,J),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(be,J),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return me(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new be(this._value,R(t,n)-x(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return me(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return me(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},be.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):{value:void 0,done:!0}}))},be.prototype.equals=function(e){return e instanceof be?me(this._value,e._value):ve(e)},t(we,J),we.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},we.prototype.get=function(e,t){return this.has(e)?this._start+j(this,e)*this._step:t},we.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},we.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=x(e,this.size),(t=R(t,this.size))<=e?new we(0,0):new we(this.get(e,this._end),this.get(t,this._end),this._step))},we.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},we.prototype.lastIndexOf=function(e){return this.indexOf(e)},we.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},we.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new F((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:U(e,i++,a)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:ve(this,e)},t(Se,n),t(Ee,Se),t(Oe,Se),t(_e,Se),Se.Keyed=Ee,Se.Indexed=Oe,Se.Set=_e;var Pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function je(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Ie?function(e){var t=Be[e];return void 0===t&&(t=Ce(e),Le===Ae&&(Le=0,Be={}),Le++,Be[e]=t),t}(e):Ce(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(De&&void 0!==(t=Re.get(e)))return t;if(void 0!==(t=e[Me]))return t;if(!xe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Me]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Ne,1073741824&Ne&&(Ne=0),De)Re.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(xe)Object.defineProperty(e,Me,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Me]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Me]=t}}return t}(e);if("function"==typeof e.toString)return Ce(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Ce(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}var Te=Object.isExtensible,xe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var Re,De="function"==typeof WeakMap;De&&(Re=new WeakMap);var Ne=0,Me="__immutablehash__";"function"==typeof Symbol&&(Me=Symbol(Me));var Ie=16,Ae=255,Le=0,Be={};function Fe(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?et():qe(e)&&!u(e)?e:et().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function qe(e){return!(!e||!e[Ve])}t(Ue,Ee),Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return tt(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,g,(function(){return t}))},Ue.prototype.remove=function(e){return tt(this,e,g)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return g}))},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=lt(this,an(e),t,n);return r===g?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):et()},Ue.prototype.merge=function(){return it(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){return it(this,t,e.call(arguments,1))},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ue.prototype.mergeDeep=function(){return it(this,at,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return it(this,st(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ue.prototype.sort=function(e){return Dt(Gt(this,e))},Ue.prototype.sortBy=function(e,t){return Dt(Gt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Qe(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Ke,Ve="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function We(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function $e(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Qe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Xe(e._root)}function Ye(e,t){return U(e,t[0],t[1])}function Xe(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function et(){return Ke||(Ke=Ze(0))}function tt(e,t,n){var r,o;if(e._root){var i=E(w),a=E(S);if(r=nt(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===g?-1:1:0)}else{if(n===g)return e;o=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):et()}function nt(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===g?e:(O(s),O(a),new Je(t,r,[o,i]))}function rt(e){return e.constructor===Je||e.constructor===Ge}function ot(e,t,n,r,o){if(e.keyHash===r)return new Ge(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&b,s=(0===n?r:r>>>n)&b;return new He(t,1<<a|1<<s,a===s?[ot(e,t,n+m,r,o)]:(i=new Je(t,r,o),a<s?[e,i]:[i,e]))}function it(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return pe(e)}))),o.push(c)}return ct(e,t,o)}function at(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):me(e,t)?e:t}function st(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return me(t,o)?t:o}}function ct(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,g,(function(e){return e===g?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function lt(e,t,n,r){var o=e===g,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}ge(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?g:e.get(c,g),u=lt(l,t,n,r);return u===l?e:u===g?e.remove(c):(o?et():e).set(c,u)}function ut(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function ft(e,t,n,r){var o=r?e:P(e);return o[t]=n,o}ze[Ve]=!0,ze[y]=ze.remove,ze.removeIn=ze.deleteIn,We.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},We.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===g,c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(O(a),(s||!f)&&O(i),!s||1!==c.length){if(!f&&!s&&c.length>=pt)return function(e,t,n,r){e||(e=new _);for(var o=new Je(e,je(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var p=e&&e===this.ownerID,h=p?c:P(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new We(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=1<<((0===e?t:t>>>e)&b),i=this.bitmap;return 0==(i&o)?r:this.nodes[ut(i&o-1)].get(e+m,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&b,c=1<<s,l=this.bitmap,u=0!=(l&c);if(!u&&o===g)return this;var f=ut(l&c-1),p=this.nodes,h=u?p[f]:void 0,d=nt(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!u&&d&&p.length>=ht)return function(e,t,n,r,o){for(var i=0,a=new Array(v),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new $e(e,i+1,a)}(e,p,l,s,d);if(u&&!d&&2===p.length&&rt(p[1^f]))return p[1^f];if(u&&d&&1===p.length&&rt(d))return d;var y=e&&e===this.ownerID,w=u?d?l:l^c:l|c,S=u?d?ft(p,f,d,y):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(p,f,y):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(p,f,d,y);return y?(this.bitmap=w,this.nodes=S,this):new He(e,w,S)},$e.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=(0===e?t:t>>>e)&b,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},$e.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&b,c=o===g,l=this.nodes,u=l[s];if(c&&!u)return this;var f=nt(u,e,t+m,n,r,o,i,a);if(f===u)return this;var p=this.count;if(u){if(!f&&--p<dt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new He(e,o,a)}(e,l,p,s)}else p++;var h=e&&e===this.ownerID,d=ft(l,s,f,h);return h?(this.count=p,this.nodes=d,this):new $e(e,p,d)},Ge.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},Ge.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=o===g;if(n!==this.keyHash)return s?this:(O(a),O(i),ot(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(O(a),(s||!f)&&O(i),s&&2===u)return new Je(e,this.keyHash,c[1^l]);var p=e&&e===this.ownerID,h=p?c:P(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ge(e,this.keyHash,h)},Je.prototype.get=function(e,t,n,r){return me(n,this.entry[0])?this.entry[1]:r},Je.prototype.update=function(e,t,n,r,o,i,a){var s=o===g,c=me(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(O(a),s?void O(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Je(e,this.keyHash,[r,o]):(O(i),ot(this,e,t,je(r),[r,o])))},We.prototype.iterate=Ge.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=$e.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Je.prototype.iterate=function(e,t){return e(this.entry)},t(Qe,F),Qe.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ye(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return Ye(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ye(e,i.entry);t=this._stack=Xe(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var pt=v/4,ht=v/2,dt=v/4;function yt(e){var t=Pt();if(null==e)return t;if(mt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Fe(r),r>0&&r<v?_t(0,r,m,null,new gt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function mt(e){return!(!e||!e[vt])}t(yt,Oe),yt.of=function(){return this(arguments)},yt.prototype.toString=function(){return this.__toString("List [","]")},yt.prototype.get=function(e,t){if((e=j(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&b]}return t},yt.prototype.set=function(e,t){return function(e,t,n){if((t=j(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Tt(e,t).set(0,n):Tt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=E(S);return t>=Rt(e._capacity)?r=kt(r,e.__ownerID,0,t,n,i):o=kt(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):_t(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},yt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},yt.prototype.insert=function(e,t){return this.splice(e,0,t)},yt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Pt()},yt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Tt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},yt.prototype.pop=function(){return Tt(this,0,-1)},yt.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Tt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},yt.prototype.shift=function(){return Tt(this,1)},yt.prototype.merge=function(){return xt(this,void 0,arguments)},yt.prototype.mergeWith=function(t){return xt(this,t,e.call(arguments,1))},yt.prototype.mergeDeep=function(){return xt(this,at,arguments)},yt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return xt(this,st(t),n)},yt.prototype.setSize=function(e){return Tt(this,0,e)},yt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:Tt(this,x(e,n),R(t,n))},yt.prototype.__iterator=function(e,t){var n=0,r=Ot(this,t);return new F((function(){var t=r();return t===Et?{value:void 0,done:!0}:U(e,n++,t)}))},yt.prototype.__iterate=function(e,t){for(var n,r=0,o=Ot(this,t);(n=o())!==Et&&!1!==e(n,r++,this););return r},yt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_t(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},yt.isList=mt;var vt="@@__IMMUTABLE_LIST__@@",bt=yt.prototype;function gt(e,t){this.array=e,this.ownerID=t}bt[vt]=!0,bt[y]=bt.remove,bt.setIn=ze.setIn,bt.deleteIn=bt.removeIn=ze.removeIn,bt.update=ze.update,bt.updateIn=ze.updateIn,bt.mergeIn=ze.mergeIn,bt.mergeDeepIn=ze.mergeDeepIn,bt.withMutations=ze.withMutations,bt.asMutable=ze.asMutable,bt.asImmutable=ze.asImmutable,bt.wasAltered=ze.wasAltered,gt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&b;if(r>=this.array.length)return new gt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=jt(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},gt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&b;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=jt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var wt,St,Et={};function Ot(e,t){var n=e._origin,r=e._capacity,o=Rt(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>v&&(l=v),function(){if(c===l)return Et;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>v&&(u=v),function(){for(;;){if(s){var e=s();if(e!==Et)return e;s=null}if(l===u)return Et;var n=t?--u:l++;s=a(c&&c[n],o-m,i+(n<<o))}}}(e,s,c)}}function _t(e,t,n,r,o,i,a){var s=Object.create(bt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function Pt(){return wt||(wt=_t(0,0,m))}function kt(e,t,n,r,o,i){var a,s=r>>>n&b,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=kt(l,t,n-m,r,o,i);return u===l?e:((a=jt(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(O(i),a=jt(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function jt(e,t){return t&&e&&t===e.ownerID?e:new gt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Rt(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&b],r-=m;return n}}function Tt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new gt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=m);u&&(a+=u,o+=u,s+=u,i+=u);for(var f=Rt(i),p=Rt(s);p>=1<<c+m;)l=new gt(l&&l.array.length?[l]:[],r),c+=m;var h=e._tail,d=p<f?Ct(e,s-1):p>f?new gt([],r):h;if(h&&p>f&&a<i&&h.array.length){for(var y=l=jt(l,r),v=c;v>m;v-=m){var g=f>>>v&b;y=y.array[g]=jt(y.array[g],r)}y.array[f>>>m&b]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=p)a-=p,s-=p,c=m,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p<f){for(u=0;l;){var w=a>>>c&b;if(w!==p>>>c&b)break;w&&(u+=(1<<c)*w),c-=m,l=l.array[w]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&p<f&&(l=l.removeAfter(r,c,p-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):_t(a,s,c,l,d)}function xt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return pe(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),ct(e,t,r)}function Rt(e){return e<v?0:e-1>>>m<<m}function Dt(e){return null==e?It():Nt(e)?e:It().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Nt(e){return qe(e)&&u(e)}function Mt(e,t,n,r){var o=Object.create(Dt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return St||(St=Mt(et(),Pt()))}function At(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=v&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Lt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Bt(e){this._iter=e,this.size=e.size}function Ft(e){this._iter=e,this.size=e.size}function Ut(e){this._iter=e,this.size=e.size}function qt(e){var t=nn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=rn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===I){var r=e.__iterator(t,n);return new F((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===M?N:M,n)},t}function Kt(e,t,n){var r=nn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,g);return i===g?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(I,o);return new F((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return U(r,s,t.call(n,a[1],s,e),o)}))},r}function Vt(e,t){var n=nn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=qt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=rn,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function zt(e,t,n,r){var o=nn(e);return r&&(o.has=function(r){var o=e.get(r,g);return o!==g&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,g);return i!==g&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(I,i),s=0;return new F((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return U(o,r?l:s++,u,i)}}))},o}function Wt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),T(t,n,o))return e;var i=x(t,o),a=R(n,o);if(i!=i||a!=a)return Wt(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=nn(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ie(e)&&s>=0&&(l.get=function(t,n){return(t=j(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new F((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:U(t,c-1,t===N?void 0:e.value[1],e)}))},l}function Ht(e,t,n,r){var o=nn(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(I,i),c=!0,l=0;return new F((function(){var e,i,u;do{if((e=s.next()).done)return r||o===M?e:U(o,l++,o===N?void 0:e.value[1],e);var f=e.value;i=f[0],u=f[1],c&&(c=t.call(n,u,i,a))}while(c);return o===I?e:U(o,i,u,e)}))},o}function $t(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new F((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(r===I&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:U(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function Gt(e,t,n){t||(t=on);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?G(i):c(e)?J(i):Q(i)}function Jt(e,t,n){if(t||(t=on),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Qt(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Qt(t,e,n)?n:e}))}function Qt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function Yt(e,t,r){var o=nn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),z(o?e.reverse():e)})),a=0,s=!1;return new F((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:U(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Xt(e,t){return ie(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function en(e){return Fe(e.size),k(e)}function tn(e){return s(e)?r:c(e)?o:i}function nn(e){return Object.create((s(e)?G:c(e)?J:Q).prototype)}function rn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):$.prototype.cacheResult.call(this)}function on(e,t){return e>t?1:e<t?-1:0}function an(e){var t=z(e);if(!t){if(!H(e))throw new TypeError("Expected iterable or array-like: "+e);t=z(n(e))}return t}function sn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(fn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(cn);return o.constructor=r,r}t(Dt,Ue),Dt.of=function(){return this(arguments)},Dt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Dt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Dt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Dt.prototype.set=function(e,t){return At(this,e,t)},Dt.prototype.remove=function(e){return At(this,e,g)},Dt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Dt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Dt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Dt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Dt.isOrderedMap=Nt,Dt.prototype[d]=!0,Dt.prototype[y]=Dt.prototype.remove,t(Lt,G),Lt.prototype.get=function(e,t){return this._iter.get(e,t)},Lt.prototype.has=function(e){return this._iter.has(e)},Lt.prototype.valueSeq=function(){return this._iter.valueSeq()},Lt.prototype.reverse=function(){var e=this,t=Vt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Lt.prototype.map=function(e,t){var n=this,r=Kt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Lt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?en(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Lt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?en(this):0;return new F((function(){var o=n.next();return o.done?o:U(e,t?--r:r++,o.value,o)}))},Lt.prototype[d]=!0,t(Bt,J),Bt.prototype.includes=function(e){return this._iter.includes(e)},Bt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Bt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value,t)}))},t(Ft,Q),Ft.prototype.has=function(e){return this._iter.includes(e)},Ft.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Ft.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){var t=n.next();return t.done?t:U(e,t.value,t.value,t)}))},t(Ut,G),Ut.prototype.entrySeq=function(){return this._iter.toSeq()},Ut.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},Ut.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return U(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Bt.prototype.cacheResult=Lt.prototype.cacheResult=Ft.prototype.cacheResult=Ut.prototype.cacheResult=rn,t(sn,Ee),sn.prototype.toString=function(){return this.__toString(un(this)+" {","}")},sn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},sn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},sn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=ln(this,et()))},sn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:ln(this,n)},sn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:ln(this,t)},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},sn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},sn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?ln(this,t,e):(this.__ownerID=e,this._map=t,this)};var cn=sn.prototype;function ln(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function fn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function pn(e){return null==e?gn():hn(e)&&!u(e)?e:gn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function hn(e){return!(!e||!e[yn])}cn[y]=cn.remove,cn.deleteIn=cn.removeIn=ze.removeIn,cn.merge=ze.merge,cn.mergeWith=ze.mergeWith,cn.mergeIn=ze.mergeIn,cn.mergeDeep=ze.mergeDeep,cn.mergeDeepWith=ze.mergeDeepWith,cn.mergeDeepIn=ze.mergeDeepIn,cn.setIn=ze.setIn,cn.update=ze.update,cn.updateIn=ze.updateIn,cn.withMutations=ze.withMutations,cn.asMutable=ze.asMutable,cn.asImmutable=ze.asImmutable,t(pn,_e),pn.of=function(){return this(arguments)},pn.fromKeys=function(e){return this(r(e).keySeq())},pn.prototype.toString=function(){return this.__toString("Set {","}")},pn.prototype.has=function(e){return this._map.has(e)},pn.prototype.add=function(e){return vn(this,this._map.set(e,!0))},pn.prototype.remove=function(e){return vn(this,this._map.remove(e))},pn.prototype.clear=function(){return vn(this,this._map.clear())},pn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},pn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},pn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},pn.prototype.merge=function(){return this.union.apply(this,arguments)},pn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},pn.prototype.sort=function(e){return wn(Gt(this,e))},pn.prototype.sortBy=function(e,t){return wn(Gt(this,t,e))},pn.prototype.wasAltered=function(){return this._map.wasAltered()},pn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},pn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},pn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},pn.isSet=hn;var dn,yn="@@__IMMUTABLE_SET__@@",mn=pn.prototype;function vn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function bn(e,t){var n=Object.create(mn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function gn(){return dn||(dn=bn(et()))}function wn(e){return null==e?Pn():Sn(e)?e:Pn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function Sn(e){return hn(e)&&u(e)}mn[yn]=!0,mn[y]=mn.remove,mn.mergeDeep=mn.merge,mn.mergeDeepWith=mn.mergeWith,mn.withMutations=ze.withMutations,mn.asMutable=ze.asMutable,mn.asImmutable=ze.asImmutable,mn.__empty=gn,mn.__make=bn,t(wn,pn),wn.of=function(){return this(arguments)},wn.fromKeys=function(e){return this(r(e).keySeq())},wn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},wn.isOrderedSet=Sn;var En,On=wn.prototype;function _n(e,t){var n=Object.create(On);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Pn(){return En||(En=_n(It()))}function kn(e){return null==e?Dn():jn(e)?e:Dn().unshiftAll(e)}function jn(e){return!(!e||!e[Tn])}On[d]=!0,On.__empty=Pn,On.__make=_n,t(kn,Oe),kn.of=function(){return this(arguments)},kn.prototype.toString=function(){return this.__toString("Stack [","]")},kn.prototype.get=function(e,t){var n=this._head;for(e=j(this,e);n&&e--;)n=n.next;return n?n.value:t},kn.prototype.peek=function(){return this._head&&this._head.value},kn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Rn(e,t)},kn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Fe(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Rn(t,n)},kn.prototype.pop=function(){return this.slice(1)},kn.prototype.unshift=function(){return this.push.apply(this,arguments)},kn.prototype.unshiftAll=function(e){return this.pushAll(e)},kn.prototype.shift=function(){return this.pop.apply(this,arguments)},kn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Dn()},kn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=x(e,this.size);if(R(t,this.size)!==this.size)return Oe.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Rn(r,o)},kn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Rn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},kn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},kn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return{value:void 0,done:!0}}))},kn.isStack=jn;var Cn,Tn="@@__IMMUTABLE_STACK__@@",xn=kn.prototype;function Rn(e,t,n,r){var o=Object.create(xn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Dn(){return Cn||(Cn=Rn(0))}function Nn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}xn[Tn]=!0,xn.withMutations=ze.withMutations,xn.asMutable=ze.asMutable,xn.asImmutable=ze.asImmutable,xn.wasAltered=ze.wasAltered,n.Iterator=F,Nn(n,{toArray:function(){Fe(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Bt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Lt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Fe(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Dt(this.toKeyedSeq())},toOrderedSet:function(){return wn(s(this)?this.valueSeq():this)},toSet:function(){return pn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Ft(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return kn(s(this)?this.valueSeq():this)},toList:function(){return yt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Xt(this,function(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?se(e):ce(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new te(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return me(t,e)}))},entries:function(){return this.__iterator(I)},every:function(e,t){Fe(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Xt(this,zt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return Fe(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Fe(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(N)},map:function(e,t){return Xt(this,Kt(this,e,t))},reduce:function(e,t,n){var r,o;return Fe(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xt(this,Vt(this,!0))},slice:function(e,t){return Xt(this,Wt(this,e,t,!0))},some:function(e,t){return!this.every(Bn(e),t)},sort:function(e){return Xt(this,Gt(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return k(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return ve(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(Ln).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Bn(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(C)},flatMap:function(e,t){return Xt(this,function(e,t,n){var r=tn(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Xt(this,$t(this,e,!0))},fromEntrySeq:function(){return new Ut(this)},get:function(e,t){return this.find((function(t,n){return me(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=an(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Dt():Ue()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=tn(e);return o.map((function(t){return Xt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return Jt(this,e)},maxBy:function(e,t){return Jt(this,t,e)},min:function(e){return Jt(this,e?Fn(e):Kn)},minBy:function(e,t){return Jt(this,t?Fn(t):Kn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Xt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Bn(e),t)},sortBy:function(e,t){return Xt(this,Gt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Xt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Xt(this,function(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(I,o),s=!0;return new F((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?r===I?e:U(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Bn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=Pe(t,3432918353),t=Pe(t<<15|t>>>-15,461845907),t=Pe(t<<13|t>>>-13,5),t=Pe((t=(t+3864292196|0)^e)^t>>>16,2246822507),ke((t=Pe(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Vn(je(e),je(t))|0}:function(e,t){r=r+Vn(je(e),je(t))|0}:t?function(e){r=31*r+je(e)|0}:function(e){r=r+je(e)|0}),r)}(this))}});var Mn=n.prototype;Mn[f]=!0,Mn[B]=Mn.values,Mn.__toJS=Mn.toArray,Mn.__toStringMapper=Un,Mn.inspect=Mn.toSource=function(){return this.toString()},Mn.chain=Mn.flatMap,Mn.contains=Mn.includes,function(){try{Object.defineProperty(Mn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),Nn(r,{flip:function(){return Xt(this,qt(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey((function(t){return me(t,e)}))},lastKeyOf:function(e){return this.findLastKey((function(t){return me(t,e)}))},mapEntries:function(e,t){var n=this,r=0;return Xt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Xt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var In=r.prototype;function An(e,t){return t}function Ln(e,t){return[t,e]}function Bn(e){return function(){return!e.apply(this,arguments)}}function Fn(e){return function(){return-e.apply(this,arguments)}}function Un(e){return"string"==typeof e?JSON.stringify(e):e}function qn(){return P(arguments)}function Kn(e,t){return e<t?1:e>t?-1:0}function Vn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[p]=!0,In[B]=Mn.entries,In.__toJS=Mn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Un(e)},Nn(o,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(e,t){return Xt(this,zt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return Xt(this,Vt(this,!1))},slice:function(e,t){return Xt(this,Wt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=x(e,e<0?this.count():this.size);var r=this.slice(0,e);return Xt(this,1===n?r:r.concat(P(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return Xt(this,$t(this,e,!1))},get:function(e,t){return(e=j(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=j(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Xt(this,function(e,t){var n=nn(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new F((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?U(n,a++,t):U(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(P(arguments)),t=Yt(this.toSeq(),J.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Xt(this,n)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!1))},zip:function(){return Xt(this,Yt(this,qn,[this].concat(P(arguments))))},zipWith:function(e){var t=P(arguments);return t[0]=this,Xt(this,Yt(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Nn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Mn.includes,Nn(G,r.prototype),Nn(J,o.prototype),Nn(Q,i.prototype),Nn(Ee,r.prototype),Nn(Oe,o.prototype),Nn(_e,i.prototype),{Iterable:n,Seq:$,Collection:Se,Map:Ue,OrderedMap:Dt,List:yt,Stack:kn,Set:pn,OrderedSet:wn,Record:sn,Range:we,Repeat:be,is:me,fromJS:pe}}()},1045:(e,t,n)=>{"use strict";var r=n(1651),o=n(3682),i=n(3743),a=new RegExp("\r\n","g"),s={"text/rtf":1,"text/html":1};function c(e){if("file"==e.kind)return e.getAsFile()}var l=function(){function e(e){this.data=e,this.types=e.types?o(e.types):[]}var t=e.prototype;return t.isRichText=function(){return!(!this.getHTML()||!this.getText())||!this.isImage()&&this.types.some((function(e){return s[e]}))},t.getText=function(){var e;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(e=this.data.getData("text/plain")):e=this.data.getData("Text")),e?e.replace(a,"\n"):null},t.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},t.isLink=function(){return this.types.some((function(e){return-1!=e.indexOf("Url")||-1!=e.indexOf("text/uri-list")||e.indexOf("text/x-moz-url")}))},t.getLink=function(){return this.data.getData?-1!=this.types.indexOf("text/x-moz-url")?this.data.getData("text/x-moz-url").split("\n")[0]:-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url"):null},t.isImage=function(){var e=this.types.some((function(e){return-1!=e.indexOf("application/x-moz-file")}));if(e)return!0;for(var t=this.getFiles(),n=0;n<t.length;n++){var o=t[n].type;if(!r.isImage(o))return!1}return!0},t.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},t.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(c).filter(i.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},t.hasFiles=function(){return this.getFiles().length>0},e}();e.exports=l},9119:e=>{"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},1651:e=>{"use strict";var t={isImage:function(e){return"image"===n(e)[0]},isJpeg:function(e){var r=n(e);return t.isImage(e)&&("jpeg"===r[1]||"pjpeg"===r[1])}};function n(e){return e.split("/")}e.exports=t},5754:e=>{"use strict";function t(e,t){return!!t&&(e===t.documentElement||e===t.body)}var n={getTop:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollTop||n.documentElement.scrollTop:e.scrollTop},setTop:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollTop=r.documentElement.scrollTop=n:e.scrollTop=n},getLeft:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollLeft||n.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollLeft=r.documentElement.scrollLeft=n:e.scrollLeft=n}};e.exports=n},4234:(e,t,n)=>{"use strict";function r(e,t){var n=o.get(e,t);return"auto"===n||"scroll"===n}var o={get:n(1838),getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=o},6156:e=>{"use strict";e.exports={getPunctuation:function(){return"[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟：-？！-／［-｀｛-･⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]"}}},6831:e=>{"use strict";var t=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_uri",void 0),this._uri=e}return e.prototype.toString=function(){return this._uri},e}();e.exports=t},3172:(e,t,n)=>{"use strict";var r=n(1644),o=n(7081),i="֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",a="؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾",s=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃǄ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ﬀ-ﬆﬓ-ﬗＡ-Ｚａ-ｚｦ-ｯｰｱ-ﾝﾞ-ﾟﾠ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ"+i+a+"]"),c=new RegExp("["+i+a+"]");function l(e){var t=s.exec(e);return null==t?null:t[0]}function u(e){var t=l(e);return null==t?r.NEUTRAL:c.exec(t)?r.RTL:r.LTR}function f(e,t){if(t=t||r.NEUTRAL,!e.length)return t;var n=u(e);return n===r.NEUTRAL?t:n}function p(e,t){return t||(t=r.getGlobalDir()),r.isStrong(t)||o(!1),f(e,t)}var h={firstStrongChar:l,firstStrongCharDir:u,resolveBlockDir:f,getDirection:p,isDirectionLTR:function(e,t){return p(e,t)===r.LTR},isDirectionRTL:function(e,t){return p(e,t)===r.RTL}};e.exports=h},1644:(e,t,n)=>{"use strict";var r=n(7081),o="LTR",i="RTL",a=null;function s(e){return e===o||e===i}function c(e){return s(e)||r(!1),e===o?"ltr":"rtl"}function l(e){a=e}var u={NEUTRAL:"NEUTRAL",LTR:o,RTL:i,isStrong:s,getHTMLDir:c,getHTMLDirIfDifferent:function(e,t){return s(e)||r(!1),s(t)||r(!1),e===t?null:c(e)},setGlobalDir:l,initGlobalDir:function(){l(o)},getGlobalDir:function(){return a||this.initGlobalDir(),a||r(!1),a}};e.exports=u},2573:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(3172),i=n(1644),a=n(7081),s=function(){function e(e){r(this,"_defaultDir",void 0),r(this,"_lastDir",void 0),e?i.isStrong(e)||a(!1):e=i.getGlobalDir(),this._defaultDir=e,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}();e.exports=s},7027:(e,t,n)=>{"use strict";var r=n(7081),o=55296,i=57343,a=/[\uD800-\uDFFF]/;function s(e){return o<=e&&e<=i}function c(e){return a.test(e)}function l(e,t){return 1+s(e.charCodeAt(t))}function u(e,t,n){if(t=t||0,n=void 0===n?1/0:n||0,!c(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var o=0;if(t>0){for(;t>0&&o<r;t--)o+=l(e,o);if(o>=r)return""}else if(t<0){for(o=r;t<0&&0<o;t++)o-=l(e,o-1);o<0&&(o=0)}var i=r;if(n<r)for(i=o;n>0&&i<r;n--)i+=l(e,i);return e.substring(o,i)}var f={getCodePoints:function(e){for(var t=[],n=0;n<e.length;n+=l(e,n))t.push(e.codePointAt(n));return t},getUTF16Length:l,hasSurrogateUnit:c,isCodeUnitInSurrogateRange:s,isSurrogatePair:function(e,t){if(0<=t&&t<e.length||r(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),a=e.charCodeAt(t+1);return o<=n&&n<=56319&&56320<=a&&a<=i},strlen:function(e){if(!c(e))return e.length;for(var t=0,n=0;n<e.length;n+=l(e,n))t++;return t},substring:function(e,t,n){(t=t||0)<0&&(t=0),(n=void 0===n?1/0:n||0)<0&&(n=0);var r=Math.abs(n-t);return u(e,t=t<n?t:n,r)},substr:u};e.exports=f},5306:(e,t,n)=>{"use strict";var r=n(9483),o=n(5348),i=n(5185),a=n(9951);function s(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return!!t&&(i=r?r(i):i,o.contains(i,t))}function c(e){return"Windows"===r.platformName?e.replace(/^\s*NT/,""):e}var l={isBrowser:function(e){return s(r.browserName,r.browserFullVersion,e)},isBrowserArchitecture:function(e){return s(r.browserArchitecture,null,e)},isDevice:function(e){return s(r.deviceName,null,e)},isEngine:function(e){return s(r.engineName,r.engineVersion,e)},isPlatform:function(e){return s(r.platformName,r.platformFullVersion,e,c)},isPlatformArchitecture:function(e){return s(r.platformArchitecture,null,e)}};e.exports=i(l,a)},9483:(e,t,n)=>{"use strict";var r,o="Unknown",i=(new(n(2989))).getResult(),a=function(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}(i.browser.version),s={browserArchitecture:i.cpu.architecture||o,browserFullVersion:i.browser.version||o,browserMinorVersion:a.minor||o,browserName:i.browser.name||o,browserVersion:i.browser.major||o,deviceName:i.device.model||o,engineName:i.engine.name||o,engineVersion:i.engine.version||o,platformArchitecture:i.cpu.architecture||o,platformName:(r=i.os.name,{"Mac OS":"Mac OS X"}[r]||r||o),platformVersion:i.os.version||o,platformFullVersion:i.os.version||o};e.exports=s},5348:(e,t,n)=>{"use strict";var r=n(7081),o=/\./,i=/\|\|/,a=/\s+\-\s+/,s=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,c=/^(\d*)(.*)/;function l(e,t){if(""===(e=e.trim()))return!0;var n,r=t.split(o),i=p(e),a=i.modifier,s=i.rangeComponents;switch(a){case"<":return u(r,s);case"<=":return-1===(n=b(r,s))||0===n;case">=":return f(r,s);case">":return 1===b(r,s);case"~":case"~>":return function(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var o=r.length-1,i=parseInt(r[o],10);return h(i)&&(r[o]=i+1+""),f(e,n)&&u(e,r)}(r,s);default:return function(e,t){return 0===b(e,t)}(r,s)}}function u(e,t){return-1===b(e,t)}function f(e,t){var n=b(e,t);return 1===n||0===n}function p(e){var t=e.split(o),n=t[0].match(s);return n||r(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function h(e){return!isNaN(e)&&isFinite(e)}function d(e){return!p(e).modifier}function y(e,t){for(var n=e.length;n<t;n++)e[n]="0"}function m(e,t){var n=e.match(c)[1],r=t.match(c)[1],o=parseInt(n,10),i=parseInt(r,10);return h(o)&&h(i)&&o!==i?v(o,i):v(e,t)}function v(e,t){return typeof e!=typeof t&&r(!1),e>t?1:e<t?-1:0}function b(e,t){for(var n=function(e,t){y(e=e.slice(),(t=t.slice()).length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]="0","*"===r[0]&&n===t.length-1))for(var o=n;o<e.length;o++)e[o]="0"}return y(t,e.length),[e,t]}(e,t),r=n[0],o=n[1],i=0;i<o.length;i++){var a=m(r[i],o[i]);if(a)return a}return 0}var g={contains:function(e,t){return function(e,t){var n=e.split(i);return n.length>1?n.some((function(e){return g.contains(e,t)})):function(e,t){var n=e.split(a);if(n.length>0&&n.length<=2||r(!1),1===n.length)return l(n[0],t);var o=n[0],i=n[1];return d(o)&&d(i)||r(!1),l(">="+o,t)&&l("<="+i,t)}(e=n[0].trim(),t)}(e.trim(),t.trim())}};e.exports=g},1515:e=>{"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,(function(e,t){return t.toUpperCase()}))}},1089:(e,t,n)=>{"use strict";var r=n(4707);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},3682:(e,t,n)=>{"use strict";var r=n(7081);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},5935:e=>{"use strict";function t(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter((function(t){return e[t]})).map(t).join(" "):Array.prototype.map.call(arguments,t).join(" ")}},3743:e=>{"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},2402:e=>{"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},9914:e=>{"use strict";var t="undefined"!=typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;e.exports=function(e){return(e=e||document).scrollingElement?e.scrollingElement:t||"CSS1Compat"!==e.compatMode?e.body:e.documentElement}},6076:(e,t,n)=>{"use strict";var r=n(2430);e.exports=function(e){var t=r(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}},2430:(e,t,n)=>{"use strict";var r=n(1089);e.exports=function(e){var t=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!r(t,e))return{left:0,right:0,top:0,bottom:0};var n=e.getBoundingClientRect();return{left:Math.round(n.left)-t.clientLeft,right:Math.round(n.right)-t.clientLeft,top:Math.round(n.top)-t.clientTop,bottom:Math.round(n.bottom)-t.clientTop}}},3020:(e,t,n)=>{"use strict";var r=n(9914),o=n(3338);e.exports=function(e){var t=r(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=o(e),i=e===t?e.ownerDocument.documentElement:e,a=e.scrollWidth-i.clientWidth,s=e.scrollHeight-i.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,s)),n}},1838:(e,t,n)=>{"use strict";var r=n(1515),o=n(8722);function i(e){return null==e?e:String(e)}e.exports=function(e,t){var n;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null)))return i(n.getPropertyValue(o(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null))return i(n.getPropertyValue(o(t)));if("display"===t)return"none"}return e.currentStyle?i("float"===t?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[r(t)]):i(e.style&&e.style[r(t)])}},3338:e=>{"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},448:e=>{"use strict";function t(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function n(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function r(){return{width:window.innerWidth||t(),height:window.innerHeight||n()}}r.withoutScrollbars=function(){return{width:t(),height:n()}},e.exports=r},8722:e=>{"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},7081:e=>{"use strict";e.exports=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return String(r[a++])})))).name="Invariant Violation"}throw i.framesToPop=1,i}}},6447:e=>{"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},4707:(e,t,n)=>{"use strict";var r=n(6447);e.exports=function(e){return r(e)&&3==e.nodeType}},7022:e=>{"use strict";e.exports=function(e){var t=e||"",n=arguments.length;if(n>1)for(var r=1;r<n;r++){var o=arguments[r];o&&(t=(t?t+" ":"")+o)}return t}},5185:e=>{"use strict";var t=Object.prototype.hasOwnProperty;e.exports=function(e,n,r){if(!e)return null;var o={};for(var i in e)t.call(e,i)&&(o[i]=n.call(r,e[i],i,e));return o}},9951:e=>{"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},3946:e=>{"use strict";e.exports=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")}},1574:(e,t,n)=>{"use strict";n(8132),e.exports=n.g.setImmediate},2264:(e,t,n)=>{"use strict";var r=n(3743);e.exports=r},7728:e=>{"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),i=0;i<r.length;i++){var a=r[i],s=e[a];(o?-1!==t.indexOf(a):t(a,s,e))&&(n[a]=s)}return n}},5839:e=>{"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,c=s&&s(Object);e.exports=function e(l,u,f){if("string"!=typeof u){if(c){var p=s(u);p&&p!==c&&e(l,p,f)}var h=o(u);i&&(h=h.concat(i(u)));for(var d=0;d<h.length;++d){var y=h[d];if(!(t[y]||n[y]||f&&f[y])){var m=a(u,y);try{r(l,y,m)}catch(e){}}}return l}return l}},46:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:$(e)}function r(e){return s(e)?e:G(e)}function o(e){return c(e)?e:J(e)}function i(e){return a(e)&&!l(e)?e:Q(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",m=5,v=1<<m,b=v-1,g={},w={value:!1},S={value:!1};function E(e){return e.value=!1,e}function O(e){e&&(e.value=!0)}function _(){}function P(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function k(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function j(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?k(e)+t:t}function C(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function x(e,t){return D(e,t,0)}function R(e,t){return D(e,t,t)}function D(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var N=0,M=1,I=2,A="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=A||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function K(e){return!!W(e)}function V(e){return e&&"function"==typeof e.next}function z(e){var t=W(e);return t&&t.call(e)}function W(e){var t=e&&(A&&e[A]||e[L]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function $(e){return null==e?ae():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function G(e){return null==e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function J(e){return null==e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():ce(e)}function Q(e){return(null==e?ae():a(e)?s(e)?e.entrySeq():e:ce(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=N,F.VALUES=M,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t($,n),$.of=function(){return $(arguments)},$.prototype.toSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq {","}")},$.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},$.prototype.__iterate=function(e,t){return ue(this,e,t,!0)},$.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(G,$),G.prototype.toKeyedSeq=function(){return this},t(J,$),J.of=function(){return J(arguments)},J.prototype.toIndexedSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq [","]")},J.prototype.__iterate=function(e,t){return ue(this,e,t,!1)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(Q,$),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},$.isSeq=ie,$.Keyed=G,$.Set=Q,$.Indexed=J;var Y,X,Z,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[ee])}function ae(){return Y||(Y=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():K(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ce(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return H(e)?new te(e):V(e)?new oe(e):K(e)?new re(e):void 0}function ue(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function fe(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new F((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:U(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function pe(e,t){return t?he(t,e,"",{"":e}):de(e)}function he(e,t,n,r){return Array.isArray(t)?e.call(r,n,J(t).map((function(n,r){return he(e,n,r,t)}))):ye(t)?e.call(r,n,G(t).map((function(n,r){return he(e,n,r,t)}))):t}function de(e){return Array.isArray(e)?J(e).map(de).toList():ye(e)?G(e).map(de).toMap():e}function ye(e){return e&&(e.constructor===Object||void 0===e.constructor)}function me(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ve(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&me(o[1],e)&&(n||me(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate((function(t,r){if(n?!e.has(t):o?!me(t,e.get(r,g)):!me(e.get(r,g),t))return f=!1,!1}));return f&&e.size===p}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function ge(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Z)return Z;Z=this}}function Se(){throw TypeError("Abstract")}function Ee(){}function Oe(){}function _e(){}$.prototype[ee]=!0,t(te,J),te.prototype.get=function(e,t){return this.has(e)?this._array[j(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?{value:void 0,done:!0}:U(e,o,n[t?r-o++:o++])}))},t(ne,G),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new F((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:U(e,a,n[a])}))},ne.prototype[d]=!0,t(re,J),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=z(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=z(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,J),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(be,J),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return me(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new be(this._value,R(t,n)-x(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return me(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return me(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},be.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):{value:void 0,done:!0}}))},be.prototype.equals=function(e){return e instanceof be?me(this._value,e._value):ve(e)},t(we,J),we.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},we.prototype.get=function(e,t){return this.has(e)?this._start+j(this,e)*this._step:t},we.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},we.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=x(e,this.size),(t=R(t,this.size))<=e?new we(0,0):new we(this.get(e,this._end),this.get(t,this._end),this._step))},we.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},we.prototype.lastIndexOf=function(e){return this.indexOf(e)},we.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},we.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new F((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:U(e,i++,a)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:ve(this,e)},t(Se,n),t(Ee,Se),t(Oe,Se),t(_e,Se),Se.Keyed=Ee,Se.Indexed=Oe,Se.Set=_e;var Pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function je(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Ie?function(e){var t=Be[e];return void 0===t&&(t=Ce(e),Le===Ae&&(Le=0,Be={}),Le++,Be[e]=t),t}(e):Ce(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(De&&void 0!==(t=Re.get(e)))return t;if(void 0!==(t=e[Me]))return t;if(!xe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Me]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Ne,1073741824&Ne&&(Ne=0),De)Re.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(xe)Object.defineProperty(e,Me,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Me]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Me]=t}}return t}(e);if("function"==typeof e.toString)return Ce(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Ce(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}var Te=Object.isExtensible,xe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var Re,De="function"==typeof WeakMap;De&&(Re=new WeakMap);var Ne=0,Me="__immutablehash__";"function"==typeof Symbol&&(Me=Symbol(Me));var Ie=16,Ae=255,Le=0,Be={};function Fe(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?et():qe(e)&&!u(e)?e:et().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function qe(e){return!(!e||!e[Ve])}t(Ue,Ee),Ue.of=function(){var t=e.call(arguments,0);return et().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return tt(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,g,(function(){return t}))},Ue.prototype.remove=function(e){return tt(this,e,g)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return g}))},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=lt(this,an(e),t,n);return r===g?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):et()},Ue.prototype.merge=function(){return it(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){return it(this,t,e.call(arguments,1))},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ue.prototype.mergeDeep=function(){return it(this,at,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return it(this,st(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ue.prototype.sort=function(e){return Dt(Gt(this,e))},Ue.prototype.sortBy=function(e,t){return Dt(Gt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Qe(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Ke,Ve="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function We(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function $e(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Qe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Xe(e._root)}function Ye(e,t){return U(e,t[0],t[1])}function Xe(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function et(){return Ke||(Ke=Ze(0))}function tt(e,t,n){var r,o;if(e._root){var i=E(w),a=E(S);if(r=nt(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===g?-1:1:0)}else{if(n===g)return e;o=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):et()}function nt(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===g?e:(O(s),O(a),new Je(t,r,[o,i]))}function rt(e){return e.constructor===Je||e.constructor===Ge}function ot(e,t,n,r,o){if(e.keyHash===r)return new Ge(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&b,s=(0===n?r:r>>>n)&b;return new He(t,1<<a|1<<s,a===s?[ot(e,t,n+m,r,o)]:(i=new Je(t,r,o),a<s?[e,i]:[i,e]))}function it(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return pe(e)}))),o.push(c)}return ct(e,t,o)}function at(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):me(e,t)?e:t}function st(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return me(t,o)?t:o}}function ct(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,g,(function(e){return e===g?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function lt(e,t,n,r){var o=e===g,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}ge(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?g:e.get(c,g),u=lt(l,t,n,r);return u===l?e:u===g?e.remove(c):(o?et():e).set(c,u)}function ut(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function ft(e,t,n,r){var o=r?e:P(e);return o[t]=n,o}ze[Ve]=!0,ze[y]=ze.remove,ze.removeIn=ze.deleteIn,We.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},We.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===g,c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(O(a),(s||!f)&&O(i),!s||1!==c.length){if(!f&&!s&&c.length>=pt)return function(e,t,n,r){e||(e=new _);for(var o=new Je(e,je(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var p=e&&e===this.ownerID,h=p?c:P(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new We(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=1<<((0===e?t:t>>>e)&b),i=this.bitmap;return 0==(i&o)?r:this.nodes[ut(i&o-1)].get(e+m,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&b,c=1<<s,l=this.bitmap,u=0!=(l&c);if(!u&&o===g)return this;var f=ut(l&c-1),p=this.nodes,h=u?p[f]:void 0,d=nt(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!u&&d&&p.length>=ht)return function(e,t,n,r,o){for(var i=0,a=new Array(v),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new $e(e,i+1,a)}(e,p,l,s,d);if(u&&!d&&2===p.length&&rt(p[1^f]))return p[1^f];if(u&&d&&1===p.length&&rt(d))return d;var y=e&&e===this.ownerID,w=u?d?l:l^c:l|c,S=u?d?ft(p,f,d,y):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(p,f,y):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(p,f,d,y);return y?(this.bitmap=w,this.nodes=S,this):new He(e,w,S)},$e.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=(0===e?t:t>>>e)&b,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},$e.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&b,c=o===g,l=this.nodes,u=l[s];if(c&&!u)return this;var f=nt(u,e,t+m,n,r,o,i,a);if(f===u)return this;var p=this.count;if(u){if(!f&&--p<dt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new He(e,o,a)}(e,l,p,s)}else p++;var h=e&&e===this.ownerID,d=ft(l,s,f,h);return h?(this.count=p,this.nodes=d,this):new $e(e,p,d)},Ge.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},Ge.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=o===g;if(n!==this.keyHash)return s?this:(O(a),O(i),ot(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(O(a),(s||!f)&&O(i),s&&2===u)return new Je(e,this.keyHash,c[1^l]);var p=e&&e===this.ownerID,h=p?c:P(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ge(e,this.keyHash,h)},Je.prototype.get=function(e,t,n,r){return me(n,this.entry[0])?this.entry[1]:r},Je.prototype.update=function(e,t,n,r,o,i,a){var s=o===g,c=me(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(O(a),s?void O(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Je(e,this.keyHash,[r,o]):(O(i),ot(this,e,t,je(r),[r,o])))},We.prototype.iterate=Ge.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=$e.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Je.prototype.iterate=function(e,t){return e(this.entry)},t(Qe,F),Qe.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ye(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return Ye(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ye(e,i.entry);t=this._stack=Xe(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var pt=v/4,ht=v/2,dt=v/4;function yt(e){var t=Pt();if(null==e)return t;if(mt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Fe(r),r>0&&r<v?_t(0,r,m,null,new gt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function mt(e){return!(!e||!e[vt])}t(yt,Oe),yt.of=function(){return this(arguments)},yt.prototype.toString=function(){return this.__toString("List [","]")},yt.prototype.get=function(e,t){if((e=j(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&b]}return t},yt.prototype.set=function(e,t){return function(e,t,n){if((t=j(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Tt(e,t).set(0,n):Tt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=E(S);return t>=Rt(e._capacity)?r=kt(r,e.__ownerID,0,t,n,i):o=kt(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):_t(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},yt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},yt.prototype.insert=function(e,t){return this.splice(e,0,t)},yt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Pt()},yt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Tt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},yt.prototype.pop=function(){return Tt(this,0,-1)},yt.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Tt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},yt.prototype.shift=function(){return Tt(this,1)},yt.prototype.merge=function(){return xt(this,void 0,arguments)},yt.prototype.mergeWith=function(t){return xt(this,t,e.call(arguments,1))},yt.prototype.mergeDeep=function(){return xt(this,at,arguments)},yt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return xt(this,st(t),n)},yt.prototype.setSize=function(e){return Tt(this,0,e)},yt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:Tt(this,x(e,n),R(t,n))},yt.prototype.__iterator=function(e,t){var n=0,r=Ot(this,t);return new F((function(){var t=r();return t===Et?{value:void 0,done:!0}:U(e,n++,t)}))},yt.prototype.__iterate=function(e,t){for(var n,r=0,o=Ot(this,t);(n=o())!==Et&&!1!==e(n,r++,this););return r},yt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_t(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},yt.isList=mt;var vt="@@__IMMUTABLE_LIST__@@",bt=yt.prototype;function gt(e,t){this.array=e,this.ownerID=t}bt[vt]=!0,bt[y]=bt.remove,bt.setIn=ze.setIn,bt.deleteIn=bt.removeIn=ze.removeIn,bt.update=ze.update,bt.updateIn=ze.updateIn,bt.mergeIn=ze.mergeIn,bt.mergeDeepIn=ze.mergeDeepIn,bt.withMutations=ze.withMutations,bt.asMutable=ze.asMutable,bt.asImmutable=ze.asImmutable,bt.wasAltered=ze.wasAltered,gt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&b;if(r>=this.array.length)return new gt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=jt(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},gt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&b;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=jt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var wt,St,Et={};function Ot(e,t){var n=e._origin,r=e._capacity,o=Rt(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>v&&(l=v),function(){if(c===l)return Et;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>v&&(u=v),function(){for(;;){if(s){var e=s();if(e!==Et)return e;s=null}if(l===u)return Et;var n=t?--u:l++;s=a(c&&c[n],o-m,i+(n<<o))}}}(e,s,c)}}function _t(e,t,n,r,o,i,a){var s=Object.create(bt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function Pt(){return wt||(wt=_t(0,0,m))}function kt(e,t,n,r,o,i){var a,s=r>>>n&b,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=kt(l,t,n-m,r,o,i);return u===l?e:((a=jt(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(O(i),a=jt(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function jt(e,t){return t&&e&&t===e.ownerID?e:new gt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Rt(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&b],r-=m;return n}}function Tt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new gt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=m);u&&(a+=u,o+=u,s+=u,i+=u);for(var f=Rt(i),p=Rt(s);p>=1<<c+m;)l=new gt(l&&l.array.length?[l]:[],r),c+=m;var h=e._tail,d=p<f?Ct(e,s-1):p>f?new gt([],r):h;if(h&&p>f&&a<i&&h.array.length){for(var y=l=jt(l,r),v=c;v>m;v-=m){var g=f>>>v&b;y=y.array[g]=jt(y.array[g],r)}y.array[f>>>m&b]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=p)a-=p,s-=p,c=m,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p<f){for(u=0;l;){var w=a>>>c&b;if(w!==p>>>c&b)break;w&&(u+=(1<<c)*w),c-=m,l=l.array[w]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&p<f&&(l=l.removeAfter(r,c,p-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):_t(a,s,c,l,d)}function xt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return pe(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),ct(e,t,r)}function Rt(e){return e<v?0:e-1>>>m<<m}function Dt(e){return null==e?It():Nt(e)?e:It().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Nt(e){return qe(e)&&u(e)}function Mt(e,t,n,r){var o=Object.create(Dt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return St||(St=Mt(et(),Pt()))}function At(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=v&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Lt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Bt(e){this._iter=e,this.size=e.size}function Ft(e){this._iter=e,this.size=e.size}function Ut(e){this._iter=e,this.size=e.size}function qt(e){var t=nn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=rn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===I){var r=e.__iterator(t,n);return new F((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===M?N:M,n)},t}function Kt(e,t,n){var r=nn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,g);return i===g?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(I,o);return new F((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return U(r,s,t.call(n,a[1],s,e),o)}))},r}function Vt(e,t){var n=nn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=qt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=rn,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function zt(e,t,n,r){var o=nn(e);return r&&(o.has=function(r){var o=e.get(r,g);return o!==g&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,g);return i!==g&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(I,i),s=0;return new F((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return U(o,r?l:s++,u,i)}}))},o}function Wt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),T(t,n,o))return e;var i=x(t,o),a=R(n,o);if(i!=i||a!=a)return Wt(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=nn(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ie(e)&&s>=0&&(l.get=function(t,n){return(t=j(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new F((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:U(t,c-1,t===N?void 0:e.value[1],e)}))},l}function Ht(e,t,n,r){var o=nn(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(I,i),c=!0,l=0;return new F((function(){var e,i,u;do{if((e=s.next()).done)return r||o===M?e:U(o,l++,o===N?void 0:e.value[1],e);var f=e.value;i=f[0],u=f[1],c&&(c=t.call(n,u,i,a))}while(c);return o===I?e:U(o,i,u,e)}))},o}function $t(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new F((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(r===I&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:U(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function Gt(e,t,n){t||(t=on);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?G(i):c(e)?J(i):Q(i)}function Jt(e,t,n){if(t||(t=on),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Qt(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Qt(t,e,n)?n:e}))}function Qt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function Yt(e,t,r){var o=nn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),z(o?e.reverse():e)})),a=0,s=!1;return new F((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:U(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Xt(e,t){return ie(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function en(e){return Fe(e.size),k(e)}function tn(e){return s(e)?r:c(e)?o:i}function nn(e){return Object.create((s(e)?G:c(e)?J:Q).prototype)}function rn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):$.prototype.cacheResult.call(this)}function on(e,t){return e>t?1:e<t?-1:0}function an(e){var t=z(e);if(!t){if(!H(e))throw new TypeError("Expected iterable or array-like: "+e);t=z(n(e))}return t}function sn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(fn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(cn);return o.constructor=r,r}t(Dt,Ue),Dt.of=function(){return this(arguments)},Dt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Dt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Dt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Dt.prototype.set=function(e,t){return At(this,e,t)},Dt.prototype.remove=function(e){return At(this,e,g)},Dt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Dt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Dt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Dt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Dt.isOrderedMap=Nt,Dt.prototype[d]=!0,Dt.prototype[y]=Dt.prototype.remove,t(Lt,G),Lt.prototype.get=function(e,t){return this._iter.get(e,t)},Lt.prototype.has=function(e){return this._iter.has(e)},Lt.prototype.valueSeq=function(){return this._iter.valueSeq()},Lt.prototype.reverse=function(){var e=this,t=Vt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Lt.prototype.map=function(e,t){var n=this,r=Kt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Lt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?en(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Lt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?en(this):0;return new F((function(){var o=n.next();return o.done?o:U(e,t?--r:r++,o.value,o)}))},Lt.prototype[d]=!0,t(Bt,J),Bt.prototype.includes=function(e){return this._iter.includes(e)},Bt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Bt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value,t)}))},t(Ft,Q),Ft.prototype.has=function(e){return this._iter.includes(e)},Ft.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Ft.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){var t=n.next();return t.done?t:U(e,t.value,t.value,t)}))},t(Ut,G),Ut.prototype.entrySeq=function(){return this._iter.toSeq()},Ut.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},Ut.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return U(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Bt.prototype.cacheResult=Lt.prototype.cacheResult=Ft.prototype.cacheResult=Ut.prototype.cacheResult=rn,t(sn,Ee),sn.prototype.toString=function(){return this.__toString(un(this)+" {","}")},sn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},sn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},sn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=ln(this,et()))},sn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:ln(this,n)},sn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:ln(this,t)},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},sn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},sn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?ln(this,t,e):(this.__ownerID=e,this._map=t,this)};var cn=sn.prototype;function ln(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function fn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function pn(e){return null==e?gn():hn(e)&&!u(e)?e:gn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function hn(e){return!(!e||!e[yn])}cn[y]=cn.remove,cn.deleteIn=cn.removeIn=ze.removeIn,cn.merge=ze.merge,cn.mergeWith=ze.mergeWith,cn.mergeIn=ze.mergeIn,cn.mergeDeep=ze.mergeDeep,cn.mergeDeepWith=ze.mergeDeepWith,cn.mergeDeepIn=ze.mergeDeepIn,cn.setIn=ze.setIn,cn.update=ze.update,cn.updateIn=ze.updateIn,cn.withMutations=ze.withMutations,cn.asMutable=ze.asMutable,cn.asImmutable=ze.asImmutable,t(pn,_e),pn.of=function(){return this(arguments)},pn.fromKeys=function(e){return this(r(e).keySeq())},pn.prototype.toString=function(){return this.__toString("Set {","}")},pn.prototype.has=function(e){return this._map.has(e)},pn.prototype.add=function(e){return vn(this,this._map.set(e,!0))},pn.prototype.remove=function(e){return vn(this,this._map.remove(e))},pn.prototype.clear=function(){return vn(this,this._map.clear())},pn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},pn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},pn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},pn.prototype.merge=function(){return this.union.apply(this,arguments)},pn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},pn.prototype.sort=function(e){return wn(Gt(this,e))},pn.prototype.sortBy=function(e,t){return wn(Gt(this,t,e))},pn.prototype.wasAltered=function(){return this._map.wasAltered()},pn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},pn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},pn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},pn.isSet=hn;var dn,yn="@@__IMMUTABLE_SET__@@",mn=pn.prototype;function vn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function bn(e,t){var n=Object.create(mn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function gn(){return dn||(dn=bn(et()))}function wn(e){return null==e?Pn():Sn(e)?e:Pn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function Sn(e){return hn(e)&&u(e)}mn[yn]=!0,mn[y]=mn.remove,mn.mergeDeep=mn.merge,mn.mergeDeepWith=mn.mergeWith,mn.withMutations=ze.withMutations,mn.asMutable=ze.asMutable,mn.asImmutable=ze.asImmutable,mn.__empty=gn,mn.__make=bn,t(wn,pn),wn.of=function(){return this(arguments)},wn.fromKeys=function(e){return this(r(e).keySeq())},wn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},wn.isOrderedSet=Sn;var En,On=wn.prototype;function _n(e,t){var n=Object.create(On);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Pn(){return En||(En=_n(It()))}function kn(e){return null==e?Dn():jn(e)?e:Dn().unshiftAll(e)}function jn(e){return!(!e||!e[Tn])}On[d]=!0,On.__empty=Pn,On.__make=_n,t(kn,Oe),kn.of=function(){return this(arguments)},kn.prototype.toString=function(){return this.__toString("Stack [","]")},kn.prototype.get=function(e,t){var n=this._head;for(e=j(this,e);n&&e--;)n=n.next;return n?n.value:t},kn.prototype.peek=function(){return this._head&&this._head.value},kn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Rn(e,t)},kn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Fe(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Rn(t,n)},kn.prototype.pop=function(){return this.slice(1)},kn.prototype.unshift=function(){return this.push.apply(this,arguments)},kn.prototype.unshiftAll=function(e){return this.pushAll(e)},kn.prototype.shift=function(){return this.pop.apply(this,arguments)},kn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Dn()},kn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=x(e,this.size);if(R(t,this.size)!==this.size)return Oe.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Rn(r,o)},kn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Rn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},kn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},kn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return{value:void 0,done:!0}}))},kn.isStack=jn;var Cn,Tn="@@__IMMUTABLE_STACK__@@",xn=kn.prototype;function Rn(e,t,n,r){var o=Object.create(xn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Dn(){return Cn||(Cn=Rn(0))}function Nn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}xn[Tn]=!0,xn.withMutations=ze.withMutations,xn.asMutable=ze.asMutable,xn.asImmutable=ze.asImmutable,xn.wasAltered=ze.wasAltered,n.Iterator=F,Nn(n,{toArray:function(){Fe(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Bt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Lt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Fe(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Dt(this.toKeyedSeq())},toOrderedSet:function(){return wn(s(this)?this.valueSeq():this)},toSet:function(){return pn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Ft(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return kn(s(this)?this.valueSeq():this)},toList:function(){return yt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Xt(this,function(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?se(e):ce(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new te(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return me(t,e)}))},entries:function(){return this.__iterator(I)},every:function(e,t){Fe(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Xt(this,zt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Fe(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Fe(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(N)},map:function(e,t){return Xt(this,Kt(this,e,t))},reduce:function(e,t,n){var r,o;return Fe(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xt(this,Vt(this,!0))},slice:function(e,t){return Xt(this,Wt(this,e,t,!0))},some:function(e,t){return!this.every(Bn(e),t)},sort:function(e){return Xt(this,Gt(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return k(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return ve(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(Ln).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Bn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(C)},flatMap:function(e,t){return Xt(this,function(e,t,n){var r=tn(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Xt(this,$t(this,e,!0))},fromEntrySeq:function(){return new Ut(this)},get:function(e,t){return this.find((function(t,n){return me(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=an(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Dt():Ue()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=tn(e);return o.map((function(t){return Xt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return me(t,e)}))},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Jt(this,e)},maxBy:function(e,t){return Jt(this,t,e)},min:function(e){return Jt(this,e?Fn(e):Kn)},minBy:function(e,t){return Jt(this,t?Fn(t):Kn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Xt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Bn(e),t)},sortBy:function(e,t){return Xt(this,Gt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Xt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Xt(this,function(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(I,o),s=!0;return new F((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?r===I?e:U(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Bn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=Pe(t,3432918353),t=Pe(t<<15|t>>>-15,461845907),t=Pe(t<<13|t>>>-13,5),t=Pe((t=(t+3864292196|0)^e)^t>>>16,2246822507),ke((t=Pe(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Vn(je(e),je(t))|0}:function(e,t){r=r+Vn(je(e),je(t))|0}:t?function(e){r=31*r+je(e)|0}:function(e){r=r+je(e)|0}),r)}(this))}});var Mn=n.prototype;Mn[f]=!0,Mn[B]=Mn.values,Mn.__toJS=Mn.toArray,Mn.__toStringMapper=Un,Mn.inspect=Mn.toSource=function(){return this.toString()},Mn.chain=Mn.flatMap,Mn.contains=Mn.includes,Nn(r,{flip:function(){return Xt(this,qt(this))},mapEntries:function(e,t){var n=this,r=0;return Xt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Xt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var In=r.prototype;function An(e,t){return t}function Ln(e,t){return[t,e]}function Bn(e){return function(){return!e.apply(this,arguments)}}function Fn(e){return function(){return-e.apply(this,arguments)}}function Un(e){return"string"==typeof e?JSON.stringify(e):String(e)}function qn(){return P(arguments)}function Kn(e,t){return e<t?1:e>t?-1:0}function Vn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[p]=!0,In[B]=Mn.entries,In.__toJS=Mn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Un(e)},Nn(o,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(e,t){return Xt(this,zt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Xt(this,Vt(this,!1))},slice:function(e,t){return Xt(this,Wt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=x(e,e<0?this.count():this.size);var r=this.slice(0,e);return Xt(this,1===n?r:r.concat(P(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Xt(this,$t(this,e,!1))},get:function(e,t){return(e=j(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=j(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Xt(this,function(e,t){var n=nn(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new F((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?U(n,a++,t):U(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(P(arguments)),t=Yt(this.toSeq(),J.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Xt(this,n)},keySeq:function(){return we(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!1))},zip:function(){return Xt(this,Yt(this,qn,[this].concat(P(arguments))))},zipWith:function(e){var t=P(arguments);return t[0]=this,Xt(this,Yt(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Nn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Mn.includes,i.prototype.contains=i.prototype.includes,Nn(G,r.prototype),Nn(J,o.prototype),Nn(Q,i.prototype),Nn(Ee,r.prototype),Nn(Oe,o.prototype),Nn(_e,i.prototype),{Iterable:n,Seq:$,Collection:Se,Map:Ue,OrderedMap:Dt,List:yt,Stack:kn,Set:pn,OrderedSet:wn,Record:sn,Range:we,Repeat:be,is:me,fromJS:pe}}()},3996:e=>{"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},5182:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},1204:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,o){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},a.type=r.type||"text/javascript",a.charset=r.charset||"utf8",a.async=!("async"in r)||!!r.async,a.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(a,r.attrs),r.text&&(a.text=""+r.text),("onload"in a?t:n)(a,o),a.onload||t(a,o),i.appendChild(a)}},3655:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(7426)),s=/(\{[\d|\w]+\})/,c=/(\$ref\{[\w|.]+\})/,l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"function"==typeof n&&(n={customLanguageInterface:n}),this._opts=o({},{customLanguageInterface:a.getInterfaceLanguage,pseudo:!1,pseudoMultipleLanguages:!1,logsEnabled:!0},n),this._interfaceLanguage=this._opts.customLanguageInterface(),this._language=this._interfaceLanguage,this.setContent(t)}return i(e,[{key:"setContent",value:function(e){var t=this,n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Object.keys(e),1)[0];this._defaultLanguage=n,this._defaultLanguageFirstLevelKeys=[],this._props=e,a.validateTranslationKeys(Object.keys(e[this._defaultLanguage])),Object.keys(this._props[this._defaultLanguage]).forEach((function(e){"string"==typeof t._props[t._defaultLanguage][e]&&t._defaultLanguageFirstLevelKeys.push(e)})),this.setLanguage(this._interfaceLanguage),this._opts.pseudo&&this._pseudoAllValues(this._props)}},{key:"_pseudoAllValues",value:function(e){var t=this;Object.keys(e).forEach((function(n){if("object"===r(e[n]))t._pseudoAllValues(e[n]);else if("string"==typeof e[n]){if(0===e[n].indexOf("[")&&e[n].lastIndexOf("]")===e[n].length-1)return;for(var o=e[n].split(" "),i=0;i<o.length;i+=1)if(o[i].match(s));else if(o[i].match(c));else{var l=o[i].length;t._opts.pseudoMultipleLanguages&&(l=parseInt(1.4*l,10)),o[i]=a.randomPseudo(l)}e[n]="["+o.join(" ")+"]"}}))}},{key:"setLanguage",value:function(e){var t=this,n=a.getBestMatchingLanguage(e,this._props),r=Object.keys(this._props)[0];if(this._language=n,this._props[n]){for(var i=0;i<this._defaultLanguageFirstLevelKeys.length;i+=1)delete this[this._defaultLanguageFirstLevelKeys[i]];var s=o({},this._props[this._language]);Object.keys(s).forEach((function(e){t[e]=s[e]})),r!==this._language&&(s=this._props[r],this._fallbackValues(s,this))}}},{key:"_fallbackValues",value:function(e,t){var n=this;Object.keys(e).forEach((function(r){Object.prototype.hasOwnProperty.call(e,r)&&!t[r]&&""!==t[r]?(t[r]=e[r],n._opts.logsEnabled&&console.log("🚧 👷 key '"+r+"' not found in localizedStrings for language "+n._language+" 🚧")):"string"!=typeof t[r]&&n._fallbackValues(e[r],t[r])}))}},{key:"getLanguage",value:function(){return this._language}},{key:"getInterfaceLanguage",value:function(){return this._interfaceLanguage}},{key:"getAvailableLanguages",value:function(){var e=this;return this._availableLanguages||(this._availableLanguages=[],Object.keys(this._props).forEach((function(t){e._availableLanguages.push(t)}))),this._availableLanguages}},{key:"formatString",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=e||"";return"string"==typeof i&&(i=this.getString(e,null,!0)||i),i.split(c).filter((function(e){return!!e})).map((function(n){if(n.match(c)){var r=n.slice(5,-1);return t.getString(r)||(t._opts.logsEnabled&&console.log("No Localization ref found for '"+n+"' in string '"+e+"'"),"$ref(id:"+r+")")}return n})).join("").split(s).filter((function(e){return!!e})).map((function(e){if(e.match(s)){var t=e.slice(1,-1),n=r[t];if(void 0===n){var o=r[0][t];if(void 0===o)return n;n=o}return n}return e})).join("")}},{key:"getString",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=this._props[t||this._language],o=e.split("."),i=0;i<o.length;i+=1){if(void 0===r[o[i]])throw Error(o[i]);r=r[o[i]]}return r}catch(r){!n&&this._opts.logsEnabled&&console.log("No localization found for key '"+e+"' and language '"+t+"', failed on "+r.message)}return null}},{key:"getContent",value:function(){return this._props}}]),e}();t.default=l},7426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceLanguage=function(){var e="en-US";if("undefined"==typeof navigator)return e;var t=navigator;if(t){if(t.language)return t.language;if(t.languages&&t.languages[0])return t.languages[0];if(t.userLanguage)return t.userLanguage;if(t.browserLanguage)return t.browserLanguage}return e},t.getBestMatchingLanguage=function(e,t){if(t[e])return e;var n=e.indexOf("-"),r=n>=0?e.substring(0,n):e;return t[r]?r:Object.keys(t)[0]},t.validateTranslationKeys=function(e){var t=["_interfaceLanguage","_language","_defaultLanguage","_defaultLanguageFirstLevelKeys","_props"];e.forEach((function(e){if(-1!==t.indexOf(e))throw new Error(e+" cannot be used as a key. It is a reserved word.")}))},t.randomPseudo=function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r+=1)t+=n.charAt(Math.floor(Math.random()*n.length));return t}},2545:(e,t,n)=>{var r=n(1822)(n(7400),"DataView");e.exports=r},6586:(e,t,n)=>{var r=n(7753),o=n(2452),i=n(2115),a=n(8256),s=n(5400);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},6301:(e,t,n)=>{var r=n(9417),o=n(2470),i=n(6165),a=n(1873),s=n(2556);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},4538:(e,t,n)=>{var r=n(1822)(n(7400),"Map");e.exports=r},4554:(e,t,n)=>{var r=n(9448),o=n(7738),i=n(6575),a=n(7238),s=n(8738);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},4825:(e,t,n)=>{var r=n(1822)(n(7400),"Promise");e.exports=r},6151:(e,t,n)=>{var r=n(1822)(n(7400),"Set");e.exports=r},3694:(e,t,n)=>{var r=n(6301),o=n(7354),i=n(5863),a=n(2367),s=n(748),c=n(7569);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=s,l.prototype.set=c,e.exports=l},6539:(e,t,n)=>{var r=n(7400).Symbol;e.exports=r},9942:(e,t,n)=>{var r=n(7400).Uint8Array;e.exports=r},6902:(e,t,n)=>{var r=n(1822)(n(7400),"WeakMap");e.exports=r},594:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},263:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},8213:(e,t,n)=>{var r=n(4701),o=n(2900),i=n(9785),a=n(3854),s=n(2383),c=n(8519),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&o(e),f=!n&&!u&&a(e),p=!n&&!u&&!f&&c(e),h=n||u||f||p,d=h?r(e.length,String):[],y=d.length;for(var m in e)!t&&!l.call(e,m)||h&&("length"==m||f&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,y))||d.push(m);return d}},7141:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},1928:(e,t,n)=>{var r=n(8799),o=n(5638),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},3382:(e,t,n)=>{var r=n(5638);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},1876:(e,t,n)=>{var r=n(5159),o=n(98);e.exports=function(e,t){return e&&r(t,o(t),e)}},5947:(e,t,n)=>{var r=n(5159),o=n(3893);e.exports=function(e,t){return e&&r(t,o(t),e)}},8799:(e,t,n)=>{var r=n(2630);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},699:(e,t,n)=>{var r=n(3694),o=n(594),i=n(1928),a=n(1876),s=n(5947),c=n(2734),l=n(7561),u=n(1102),f=n(7048),p=n(1385),h=n(9759),d=n(3533),y=n(6541),m=n(2078),v=n(7635),b=n(9785),g=n(3854),w=n(8247),S=n(1611),E=n(7614),O=n(98),_=n(3893),P="[object Arguments]",k="[object Function]",j="[object Object]",C={};C[P]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[j]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[k]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,x,R,D){var N,M=1&n,I=2&n,A=4&n;if(T&&(N=R?T(t,x,R,D):T(t)),void 0!==N)return N;if(!S(t))return t;var L=b(t);if(L){if(N=y(t),!M)return l(t,N)}else{var B=d(t),F=B==k||"[object GeneratorFunction]"==B;if(g(t))return c(t,M);if(B==j||B==P||F&&!R){if(N=I||F?{}:v(t),!M)return I?f(t,s(N,t)):u(t,a(N,t))}else{if(!C[B])return R?t:{};N=m(t,B,M)}}D||(D=new r);var U=D.get(t);if(U)return U;D.set(t,N),E(t)?t.forEach((function(r){N.add(e(r,n,T,r,t,D))})):w(t)&&t.forEach((function(r,o){N.set(o,e(r,n,T,o,t,D))}));var q=L?void 0:(A?I?h:p:I?_:O)(t);return o(q||t,(function(r,o){q&&(r=t[o=r]),i(N,o,e(r,n,T,o,t,D))})),N}},158:(e,t,n)=>{var r=n(1611),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},1324:(e,t,n)=>{var r=n(7141),o=n(9785);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},9736:(e,t,n)=>{var r=n(6539),o=n(4840),i=n(1258),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},5829:(e,t,n)=>{var r=n(9736),o=n(2360);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},7657:(e,t,n)=>{var r=n(3533),o=n(2360);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},6729:(e,t,n)=>{var r=n(8338),o=n(9678),i=n(1611),a=n(6532),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,f=l.hasOwnProperty,p=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?p:s).test(a(e))}},6903:(e,t,n)=>{var r=n(3533),o=n(2360);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},6972:(e,t,n)=>{var r=n(9736),o=n(4194),i=n(2360),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},186:(e,t,n)=>{var r=n(6016),o=n(962),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},9464:(e,t,n)=>{var r=n(1611),o=n(6016),i=n(1586),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},4701:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},4833:(e,t,n)=>{var r=n(6127),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},9334:e=>{e.exports=function(e){return function(t){return e(t)}}},5825:(e,t,n)=>{var r=n(9942);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},2734:(e,t,n)=>{e=n.nmd(e);var r=n(7400),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},1859:(e,t,n)=>{var r=n(5825);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},9377:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},4116:(e,t,n)=>{var r=n(6539),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},3428:(e,t,n)=>{var r=n(5825);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},7561:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},5159:(e,t,n)=>{var r=n(1928),o=n(8799);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var l=t[s],u=i?i(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),a?o(n,l,u):r(n,l,u)}return n}},1102:(e,t,n)=>{var r=n(5159),o=n(3080);e.exports=function(e,t){return r(e,o(e),t)}},7048:(e,t,n)=>{var r=n(5159),o=n(791);e.exports=function(e,t){return r(e,o(e),t)}},4937:(e,t,n)=>{var r=n(7400)["__core-js_shared__"];e.exports=r},2630:(e,t,n)=>{var r=n(1822),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},9120:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},1385:(e,t,n)=>{var r=n(1324),o=n(3080),i=n(98);e.exports=function(e){return r(e,i,o)}},9759:(e,t,n)=>{var r=n(1324),o=n(791),i=n(3893);e.exports=function(e){return r(e,i,o)}},5899:(e,t,n)=>{var r=n(4479);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},1822:(e,t,n)=>{var r=n(6729),o=n(5371);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},2173:(e,t,n)=>{var r=n(8023)(Object.getPrototypeOf,Object);e.exports=r},4840:(e,t,n)=>{var r=n(6539),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},3080:(e,t,n)=>{var r=n(263),o=n(5937),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},791:(e,t,n)=>{var r=n(7141),o=n(2173),i=n(3080),a=n(5937),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},3533:(e,t,n)=>{var r=n(2545),o=n(4538),i=n(4825),a=n(6151),s=n(6902),c=n(9736),l=n(6532),u="[object Map]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",d="[object DataView]",y=l(r),m=l(o),v=l(i),b=l(a),g=l(s),w=c;(r&&w(new r(new ArrayBuffer(1)))!=d||o&&w(new o)!=u||i&&w(i.resolve())!=f||a&&w(new a)!=p||s&&w(new s)!=h)&&(w=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case y:return d;case m:return u;case v:return f;case b:return p;case g:return h}return t}),e.exports=w},5371:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},7753:(e,t,n)=>{var r=n(5718);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},2452:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},2115:(e,t,n)=>{var r=n(5718),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},8256:(e,t,n)=>{var r=n(5718),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},5400:(e,t,n)=>{var r=n(5718);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6541:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},2078:(e,t,n)=>{var r=n(5825),o=n(1859),i=n(9377),a=n(4116),s=n(3428);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},7635:(e,t,n)=>{var r=n(158),o=n(2173),i=n(6016);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},2383:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},4479:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},9678:(e,t,n)=>{var r,o=n(4937),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},6016:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},9417:e=>{e.exports=function(){this.__data__=[],this.size=0}},2470:(e,t,n)=>{var r=n(3382),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},6165:(e,t,n)=>{var r=n(3382);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},1873:(e,t,n)=>{var r=n(3382);e.exports=function(e){return r(this.__data__,e)>-1}},2556:(e,t,n)=>{var r=n(3382);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},9448:(e,t,n)=>{var r=n(6586),o=n(6301),i=n(4538);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},7738:(e,t,n)=>{var r=n(5899);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6575:(e,t,n)=>{var r=n(5899);e.exports=function(e){return r(this,e).get(e)}},7238:(e,t,n)=>{var r=n(5899);e.exports=function(e){return r(this,e).has(e)}},8738:(e,t,n)=>{var r=n(5899);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},5718:(e,t,n)=>{var r=n(1822)(Object,"create");e.exports=r},962:(e,t,n)=>{var r=n(8023)(Object.keys,Object);e.exports=r},1586:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},8125:(e,t,n)=>{e=n.nmd(e);var r=n(9120),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},1258:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},8023:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},7400:(e,t,n)=>{var r=n(9120),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},7354:(e,t,n)=>{var r=n(6301);e.exports=function(){this.__data__=new r,this.size=0}},5863:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},2367:e=>{e.exports=function(e){return this.__data__.get(e)}},748:e=>{e.exports=function(e){return this.__data__.has(e)}},7569:(e,t,n)=>{var r=n(6301),o=n(4538),i=n(4554);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},6532:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},6127:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},9584:(e,t,n)=>{var r=n(699);e.exports=function(e){return r(e,5)}},6726:(e,t,n)=>{var r=n(1611),o=n(2846),i=n(1936),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,f,p,h,d=0,y=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=c,r=l;return c=l=void 0,d=t,f=e.apply(r,n)}function g(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-d>=u}function w(){var e=o();if(g(e))return S(e);p=setTimeout(w,function(e){var n=t-(e-h);return m?s(n,u-(e-d)):n}(e))}function S(e){return p=void 0,v&&c?b(e):(c=l=void 0,f)}function E(){var e=o(),n=g(e);if(c=arguments,l=this,h=e,n){if(void 0===p)return function(e){return d=e,p=setTimeout(w,t),y?b(e):f}(h);if(m)return clearTimeout(p),p=setTimeout(w,t),b(h)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(y=!!n.leading,u=(m="maxWait"in n)?a(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==p&&clearTimeout(p),d=0,c=h=l=p=void 0},E.flush=function(){return void 0===p?f:S(o())},E}},5638:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},2900:(e,t,n)=>{var r=n(5829),o=n(2360),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},9785:e=>{var t=Array.isArray;e.exports=t},68:(e,t,n)=>{var r=n(8338),o=n(4194);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3854:(e,t,n)=>{e=n.nmd(e);var r=n(7400),o=n(7714),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},8338:(e,t,n)=>{var r=n(9736),o=n(1611);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},4194:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},8247:(e,t,n)=>{var r=n(7657),o=n(9334),i=n(8125),a=i&&i.isMap,s=a?o(a):r;e.exports=s},1611:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2360:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},7614:(e,t,n)=>{var r=n(6903),o=n(9334),i=n(8125),a=i&&i.isSet,s=a?o(a):r;e.exports=s},5193:(e,t,n)=>{var r=n(9736),o=n(2360);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},8519:(e,t,n)=>{var r=n(6972),o=n(9334),i=n(8125),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},98:(e,t,n)=>{var r=n(8213),o=n(186),i=n(68);e.exports=function(e){return i(e)?r(e):o(e)}},3893:(e,t,n)=>{var r=n(8213),o=n(9464),i=n(68);e.exports=function(e){return i(e)?r(e,!0):o(e)}},2846:(e,t,n)=>{var r=n(7400);e.exports=function(){return r.Date.now()}},5937:e=>{e.exports=function(){return[]}},7714:e=>{e.exports=function(){return!1}},9783:(e,t,n)=>{var r=n(6726),o=n(1611);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},1936:(e,t,n)=>{var r=n(4833),o=n(1611),i=n(5193),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},2525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var l in i=Object(arguments[c]))n.call(i,l)&&(s[l]=i[l]);if(t){a=t(i);for(var u=0;u<a.length;u++)r.call(i,a[u])&&(s[a[u]]=i[a[u]])}}return s}},405:(e,t,n)=>{var r=n(5182);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(t,n):r(t)?function(t,n,r){for(var o=[],i=0;i<t.length;i++)o.push(e(t[i],n,r).source);return u(new RegExp("(?:"+o.join("|")+")",f(r)),n)}(t,n,o):function(e,t,n){return p(i(e,n),t,n)}(t,n,o)},e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],p=n[1],h=n.index;if(s+=e.slice(a,h),a=h+f.length,p)s+=p[1];else{var d=e[a],y=n[2],m=n[3],v=n[4],b=n[5],g=n[6],w=n[7];s&&(r.push(s),s="");var S=null!=y&&null!=d&&d!==y,E="+"===g||"*"===g,O="?"===g||"*"===g,_=n[2]||u,P=v||b;r.push({name:m||i++,prefix:y||"",delimiter:_,optional:O,repeat:E,partial:S,asterisk:!!w,pattern:P?l(P):w?".*":"[^"+c(_)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",f(t)));return function(t,o){for(var i="",s=t||{},c=(o||{}).pretty?a:encodeURIComponent,l=0;l<e.length;l++){var u=e[l];if("string"!=typeof u){var f,p=s[u.name];if(null==p){if(u.optional){u.partial&&(i+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var h=0;h<p.length;h++){if(f=c(p[h]),!n[l].test(f))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(f)+"`");i+=(0===h?u.prefix:u.delimiter)+f}}else{if(f=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):c(p),!n[l].test(f))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+f+'"');i+=u.prefix+f}}else i+=u}return i}}function c(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function p(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)a+=c(l);else{var p=c(l.prefix),h="(?:"+l.pattern+")";t.push(l),l.repeat&&(h+="(?:"+p+h+")*"),a+=h=l.optional?l.partial?p+"("+h+")?":"(?:"+p+"("+h+"))?":p+"("+h+")"}}var d=c(n.delimiter||"/"),y=a.slice(-d.length)===d;return o||(a=(y?a.slice(0,-d.length):a)+"(?:"+d+"(?=$))?"),a+=i?"$":o&&y?"":"(?="+d+"|$)",u(new RegExp("^"+a,f(n)),t)}},8772:(e,t,n)=>{"use strict";var r=n(331);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},3615:(e,t,n)=>{e.exports=n(8772)()},331:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8891:(e,t,n)=>{"use strict";const r=n(9742),o=n(1998),i=n(9400),a=n(7728),s=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?o(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function p(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function h(e){const t=(e=p(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function y(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const a=o||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,a]=i(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=d(n[e],t);else r[e]=d(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=f(n):e[t]=n,e}),Object.create(null))}t.extract=h,t.parse=y,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",o,"]"].join("")]:[...n,[l(t,e),"[",l(o,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[l(n,e),t,l(o,e)].join("")]:[[r,l(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?l(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":o.reduce(r(n),[]).join("&"):l(n,t)+"="+l(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:y(h(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=p(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),a=Object.assign(i,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:a(i,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},8658:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(5839),a=n(4639),s=n(1346);e.exports=function(e){var t=e.displayName||e.name,n=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.handleClickOutside=t.handleClickOutside.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),o(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"handleClickOutside",value:function(e){var t=this.__domNode;t&&t.contains(e.target)||!this.__wrappedInstance||"function"!=typeof this.__wrappedInstance.handleClickOutside||this.__wrappedInstance.handleClickOutside(e)}},{key:"render",value:function(){var t=this,n=this.props,o=n.wrappedRef,i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["wrappedRef"]);return a.createElement(e,r({},i,{ref:function(e){t.__wrappedInstance=e,t.__domNode=s.findDOMNode(e),o&&o(e)}}))}}]),n}(a.Component);return n.displayName="clickOutside("+t+")",i(n,e)}},4335:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,c,l,u;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(!i(e[c],a[c]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(e[c]!==a[c])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((s=(l=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(t&&e instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!e.$$typeof)&&!i(e[l[c]],a[l[c]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},8326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4639),i=s(o),a=s(n(3615));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){return this.props.useCapture,this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,i=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;r=this.props.isReverse?i:this.calculateOffset(e,i)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,o=t.hasMore,a=(t.initialLoad,t.isReverse),s=t.loader,c=(t.loadMore,t.pageStart,t.ref),l=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));l.ref=function(t){e.scrollComponent=t,c&&c(t)};var u=[n];return o&&(s?a?u.unshift(s):u.push(s):this.defaultLoader&&(a?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),i.default.createElement(r,l,u)}}]),t}(o.Component);c.propTypes={children:a.default.node.isRequired,element:a.default.node,hasMore:a.default.bool,initialLoad:a.default.bool,isReverse:a.default.bool,loader:a.default.node,loadMore:a.default.func.isRequired,pageStart:a.default.number,ref:a.default.func,getScrollParent:a.default.func,threshold:a.default.number,useCapture:a.default.bool,useWindow:a.default.bool},c.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=c,e.exports=t.default},3674:(e,t,n)=>{e.exports=n(8326)},8702:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case l:case p:case m:case y:case c:return e;default:return t}}case o:return t}}}function E(e){return S(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||S(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return S(e)===l},t.isContextProvider=function(e){return S(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===m},t.isMemo=function(e){return S(e)===y},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===s||e===a||e===h||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===p||e.$$typeof===b||e.$$typeof===g||e.$$typeof===w||e.$$typeof===v)},t.typeOf=S},9185:(e,t,n)=>{"use strict";e.exports=n(8702)},9895:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=a(n(4639)),i=a(n(3655));function a(e){return e&&e.__esModule?e:{default:e}}var s=/(\{[\d|\w]+\})/;i.default.prototype.formatString=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=!1,c=(e||"").split(s).filter((function(e){return!!e})).map((function(e,t){if(e.match(s)){var i=e.slice(1,-1),c=n[i];if(null==c){var l=n[0][i];if(void 0===l)return c;c=l}return o.default.isValidElement(c)?(a=!0,o.default.Children.toArray(c).map((function(e){return r({},e,{key:t.toString()})}))):c}return e}));return a?c:c.join("")},t.Z=i.default},6269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),o=n(8416),i=n(3887);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(d,e);var t,n,o,a=(o=d,function(){var e,t=f(o);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?u(e):t}(this,e)});function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"mounted",!1),h(u(e),"isReady",!1),h(u(e),"isPlaying",!1),h(u(e),"isLoading",!0),h(u(e),"loadOnReady",null),h(u(e),"startOnPlay",!0),h(u(e),"seekOnPlay",null),h(u(e),"onDurationCalled",!1),h(u(e),"getInternalPlayer",(function(t){return e.player?e.player[t]:null})),h(u(e),"progress",(function(){if(e.props.url&&e.player&&e.isReady){var t=e.getCurrentTime()||0,n=e.getSecondsLoaded(),r=e.getDuration();if(r){var o={playedSeconds:t,played:t/r};null!==n&&(o.loadedSeconds=n,o.loaded=n/r),o.playedSeconds===e.prevPlayed&&o.loadedSeconds===e.prevLoaded||e.props.onProgress(o),e.prevPlayed=o.playedSeconds,e.prevLoaded=o.loadedSeconds}}e.progressTimeout=setTimeout(e.progress,e.props.progressFrequency||e.props.progressInterval)})),h(u(e),"handleReady",(function(){if(e.mounted){e.isReady=!0,e.isLoading=!1;var t=e.props,n=t.onReady,r=t.playing,o=t.volume,i=t.muted;n(),i||null===o||e.player.setVolume(o),e.loadOnReady?(e.player.load(e.loadOnReady,!0),e.loadOnReady=null):r&&e.player.play(),e.handleDurationCheck()}})),h(u(e),"handlePlay",(function(){e.isPlaying=!0,e.isLoading=!1;var t=e.props,n=t.onStart,r=t.onPlay,o=t.playbackRate;e.startOnPlay&&(e.player.setPlaybackRate&&1!==o&&e.player.setPlaybackRate(o),n(),e.startOnPlay=!1),r(),e.seekOnPlay&&(e.seekTo(e.seekOnPlay),e.seekOnPlay=null),e.handleDurationCheck()})),h(u(e),"handlePause",(function(t){e.isPlaying=!1,e.isLoading||e.props.onPause(t)})),h(u(e),"handleEnded",(function(){var t=e.props,n=t.activePlayer,r=t.loop,o=t.onEnded;n.loopOnEnded&&r&&e.seekTo(0),r||(e.isPlaying=!1,o())})),h(u(e),"handleError",(function(){var t;e.isLoading=!1,(t=e.props).onError.apply(t,arguments)})),h(u(e),"handleDurationCheck",(function(){clearTimeout(e.durationCheckTimeout);var t=e.getDuration();t?e.onDurationCalled||(e.props.onDuration(t),e.onDurationCalled=!0):e.durationCheckTimeout=setTimeout(e.handleDurationCheck,100)})),h(u(e),"handleLoaded",(function(){e.isLoading=!1})),h(u(e),"ref",(function(t){t&&(e.player=t)})),e}return t=d,n=[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.player.disablePIP&&this.player.disablePIP(),this.mounted=!1}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,s=n.muted,c=n.playbackRate,l=n.pip,u=n.loop,f=n.activePlayer;if(!(0,i.isEqual)(e.url,r)){if(this.isLoading&&!f.forceLoad)return console.warn("ReactPlayer: the attempt to load ".concat(r," is being deferred until the player has loaded")),void(this.loadOnReady=r);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}e.playing||!o||this.isPlaying||this.player.play(),e.playing&&!o&&this.isPlaying&&this.player.pause(),!e.pip&&l&&this.player.enablePIP&&this.player.enablePIP(),e.pip&&!l&&this.player.disablePIP&&this.player.disablePIP(),e.volume!==a&&null!==a&&this.player.setVolume(a),e.muted!==s&&(s?this.player.mute():(this.player.unmute(),null!==a&&setTimeout((function(){return t.player.setVolume(a)})))),e.playbackRate!==c&&this.player.setPlaybackRate&&this.player.setPlaybackRate(c),e.loop!==u&&this.player.setLoop&&this.player.setLoop(u)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():null}},{key:"seekTo",value:function(e,t){var n=this;if(!this.isReady&&0!==e)return this.seekOnPlay=e,void setTimeout((function(){n.seekOnPlay=null}),5e3);if(t?"fraction"===t:e>0&&e<1){var r=this.player.getDuration();return r?void this.player.seekTo(r*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return e?r.default.createElement(e,c({},this.props,{ref:this.ref,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}],n&&l(t.prototype,n),d}(r.Component);t.default=d,h(d,"displayName","Player"),h(d,"propTypes",o.propTypes),h(d,"defaultProps",o.defaultProps)},6148:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}(n(4639));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h="64px",d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(d,e);var t,n,o,a=(o=d,function(){var e,t=u(o);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=u(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?l(e):t}(this,e)});function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(l(e=a.call.apply(a,[this].concat(n))),"mounted",!1),p(l(e),"state",{image:null}),e}return t=d,(n=[{key:"componentDidMount",value:function(){this.mounted=!0,this.fetchImage(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.url,r=t.light;e.url===n&&e.light===r||this.fetchImage(this.props)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"fetchImage",value:function(e){var t=this,n=e.url,r=e.light;if("string"!=typeof r)return this.setState({image:null}),window.fetch("https://noembed.com/embed?url=".concat(n)).then((function(e){return e.json()})).then((function(e){if(e.thumbnail_url&&t.mounted){var n=e.thumbnail_url.replace("height=100","height=480");t.setState({image:n})}}));this.setState({image:r})}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.playIcon,o=this.state.image,i={display:"flex",alignItems:"center",justifyContent:"center"},a={preview:s({width:"100%",height:"100%",backgroundImage:o?"url(".concat(o,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},i),shadow:s({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:h,width:h,height:h},i),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},c=r.default.createElement("div",{style:a.shadow,className:"react-player__shadow"},r.default.createElement("div",{style:a.playIcon,className:"react-player__play-icon"}));return r.default.createElement("div",{style:a.preview,className:"react-player__preview",onClick:t},n||c)}}])&&c(t.prototype,n),d}(r.Component);t.default=d},9248:(e,t,n)=>{"use strict";t.ZP=void 0;var r=h(n(4639)),o=n(8416),i=n(3887),a=f(n(4985)),s=f(n(6269)),c=f(n(6148)),l=h(n(8450)),u=f(n(8428));f(n(8144)),f(n(4992)),f(n(1251)),f(n(6765)),f(n(5876)),f(n(2521)),f(n(7964)),f(n(4922)),f(n(1241));function f(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==d(e)&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v.apply(this,arguments)}function b(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function O(e,t){return O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},O(e,t)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=Object.keys(o.propTypes),k=[],j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(h,e);var t,n,f,p=(f=h,function(){var e,t=E(f);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?S(e):t}(this,e)});function h(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(S(e=p.call.apply(p,[this].concat(n))),"config",(0,i.getConfig)(e.props,o.defaultProps,!0)),_(S(e),"state",{showPreview:!!e.props.light}),_(S(e),"handleClickPreview",(function(){e.setState({showPreview:!1})})),_(S(e),"showPreview",(function(){e.setState({showPreview:!0})})),_(S(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),_(S(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),_(S(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),_(S(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),_(S(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),_(S(e),"handleReady",(function(){e.props.onReady(S(e))})),_(S(e),"wrapperRef",(function(t){e.wrapper=t})),_(S(e),"activePlayerRef",(function(t){e.player=t})),e}return t=h,(n=[{key:"componentDidMount",value:function(){this.props.progressFrequency&&console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,i.isEqual)(this.props,e)||!(0,i.isEqual)(this.state,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props.light;this.config=(0,i.getConfig)(this.props,o.defaultProps),!e.light&&t&&this.setState({showPreview:!0}),e.light&&!t&&this.setState({showPreview:!1})}},{key:"getActivePlayer",value:function(e){for(var t=0,n=[].concat(b(k),b(a.default));t<n.length;t++){var r=n[t];if(r.canPlay(e))return r}return l.FilePlayer}},{key:"renderActivePlayer",value:function(e,t){return e?r.default.createElement(s.default,v({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.handleReady})):null}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.controls,a=e.style,s=e.width,l=e.height,f=e.light,p=e.playIcon,h=e.wrapper,d=this.state.showPreview&&t,y=(0,i.omit)(this.props,P,o.DEPRECATED_CONFIG_PROPS),g=this.getActivePlayer(t),w=this.renderActivePlayer(t,g),S=(0,u.default)(t,n,this.config),E=[w].concat(b(S)).sort(this.sortPlayers),O=r.default.createElement(c.default,{url:t,light:f,playIcon:p,onClick:this.handleClickPreview});return r.default.createElement(h,v({ref:this.wrapperRef,style:m({},a,{width:s,height:l})},y),d?O:E)}}])&&w(t.prototype,n),h}(r.Component);t.ZP=j,_(j,"addCustomPlayer",(function(e){k.push(e)})),_(j,"removeCustomPlayers",(function(){k=[]})),_(j,"displayName","ReactPlayer"),_(j,"propTypes",o.propTypes),_(j,"defaultProps",o.defaultProps),_(j,"canPlay",(function(e){for(var t=0,n=[].concat(b(k),b(a.default));t<n.length;t++)if(n[t].canPlay(e))return!0;return!1})),_(j,"canEnablePIP",(function(e){for(var t=0,n=[].concat(b(k),b(a.default));t<n.length;t++){var r=n[t];if(r.canEnablePIP&&r.canEnablePIP(e))return!0}return!1}))},4922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DailyMotion=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=d(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),m(h(e),"onDurationChange",(function(){var t=e.getDuration();e.props.onDuration(t)})),m(h(e),"mute",(function(){e.callPlayer("setMuted",!0)})),m(h(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),m(h(e),"ref",(function(t){e.container=t})),e}return t=s,(n=[{key:"load",value:function(e){var t,n,r=this,o=this.props,a=o.controls,s=o.config,c=o.onError,l=o.playing,p=(t=e.match(v),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];this.player?this.player.load(p,{start:(0,i.parseStartTime)(e),autoplay:l}):(0,i.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",(function(e){return e.player})).then((function(t){if(r.container){var n=t.player;r.player=new n(r.container,{width:"100%",height:"100%",video:p,params:u({controls:a,autoplay:r.props.playing,mute:r.props.muted,start:(0,i.parseStartTime)(e),origin:window.location.origin},s.dailymotion.params),events:{apiready:r.props.onReady,seeked:function(){return r.props.onSeek(r.player.currentTime)},video_end:r.props.onEnded,durationchange:r.onDurationChange,pause:r.props.onPause,playing:r.props.onPlay,waiting:r.props.onBuffer,error:function(e){return c(e)}}})}}),c)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&p(t.prototype,n),s}(o.Component);t.DailyMotion=b,m(b,"displayName","DailyMotion"),m(b,"canPlay",(function(e){return v.test(e)})),m(b,"loopOnEnded",!0);var g=(0,a.default)(b);t.default=g},6765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Facebook=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d="https://connect.facebook.net/en_US/sdk.js",y="fbAsyncInit",m=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?u(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),h(u(e),"playerID",e.props.config.facebook.playerId||"".concat("facebook-player-").concat((0,i.randomString)())),h(u(e),"mute",(function(){e.callPlayer("mute")})),h(u(e),"unmute",(function(){e.callPlayer("unmute")})),e}return t=s,(n=[{key:"load",value:function(e,t){var n=this;t?(0,i.getSDK)(d,"FB",y).then((function(e){return e.XFBML.parse()})):(0,i.getSDK)(d,"FB",y).then((function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:n.props.config.facebook.version}),e.Event.subscribe("xfbml.render",(function(e){n.props.onLoaded()})),e.Event.subscribe("xfbml.ready",(function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("finishedBuffering",n.props.onBufferEnd),n.player.subscribe("error",n.props.onError),n.props.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")}))}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}])&&l(t.prototype,n),s}(o.Component);t.Facebook=v,h(v,"displayName","Facebook"),h(v,"canPlay",(function(e){return m.test(e)})),h(v,"loopOnEnded",!0);var b=(0,a.default)(v);t.default=b},8450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FilePlayer=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,v=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,b=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,g=/\.(m3u8)($|\?)/i,w=/\.(mpd)($|\?)/i,S=/www\.dropbox\.com\/.+/;function E(e){if(e instanceof Array){var t,n=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("string"==typeof r&&E(r))return!0;if(E(r.src))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}return!!(0,i.isMediaStream)(e)||v.test(e)||b.test(e)||g.test(e)||w.test(e)}function O(e){return e||(e=document.createElement("video")),e.webkitSupportsPresentationMode&&"function"==typeof e.webkitSetPresentationMode&&!/iPhone|iPod/.test(navigator.userAgent)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(f(e=a.call.apply(a,[this].concat(n))),"onReady",(function(){var t;return(t=e.props).onReady.apply(t,arguments)})),d(f(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),d(f(e),"onBuffer",(function(){var t;return(t=e.props).onBuffer.apply(t,arguments)})),d(f(e),"onBufferEnd",(function(){var t;return(t=e.props).onBufferEnd.apply(t,arguments)})),d(f(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),d(f(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),d(f(e),"onError",(function(){var t;return(t=e.props).onError.apply(t,arguments)})),d(f(e),"onEnablePIP",(function(){var t;return(t=e.props).onEnablePIP.apply(t,arguments)})),d(f(e),"onDisablePIP",(function(t){var n=e.props,r=n.onDisablePIP,o=n.playing;r(t),o&&e.play()})),d(f(e),"onPresentationModeChange",(function(t){if(e.player&&O(e.player)){var n=e.player.webkitPresentationMode;"picture-in-picture"===n?e.onEnablePIP(t):"inline"===n&&e.onDisablePIP(t)}})),d(f(e),"onSeek",(function(t){e.props.onSeek(t.target.currentTime)})),d(f(e),"mute",(function(){e.player.muted=!0})),d(f(e),"unmute",(function(){e.player.muted=!1})),d(f(e),"renderSourceElement",(function(e,t){return"string"==typeof e?o.default.createElement("source",{key:t,src:e}):o.default.createElement("source",l({key:t},e))})),d(f(e),"renderTrack",(function(e,t){return o.default.createElement("track",l({key:t},e))})),d(f(e),"ref",(function(t){e.player&&(e.prevPlayer=e.player),e.player=t})),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.addListeners(this.player),m&&this.player.load()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer),this.addListeners(this.player))}},{key:"componentWillUnmount",value:function(){this.removeListeners(this.player),this.hls&&this.hls.destroy()}},{key:"addListeners",value:function(e){var t=this.props.playsinline;e.addEventListener("canplay",this.onReady),e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),t&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}},{key:"removeListeners",value:function(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange)}},{key:"shouldUseAudio",value:function(e){return!e.config.file.forceVideo&&!e.config.file.attributes.poster&&(v.test(e.url)||e.config.file.forceAudio)}},{key:"shouldUseHLS",value:function(e){return g.test(e)&&!m||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return w.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this,n=this.props.config.file,r=n.hlsVersion,o=n.dashVersion;if(this.shouldUseHLS(e)&&(0,i.getSDK)("https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js".replace("VERSION",r),"Hls").then((function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,(function(e,r){t.props.onError(e,r,t.hls,n)})),t.hls.loadSource(e),t.hls.attachMedia(t.player)})),this.shouldUseDASH(e)&&(0,i.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js".replace("VERSION",o),"dashjs").then((function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.on("error",t.props.onError),t.dash.getDebug().setLogToBrowserConsole(!1)})),e instanceof Array)this.player.load();else if((0,i.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():O(this.player)&&"picture-in-picture"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():O(this.player)&&"inline"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){if(!this.player)return null;var e=this.player,t=e.duration,n=e.seekable;return t===1/0&&n.length>0?n.end(n.length-1):t}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,i.isMediaStream)(e)||t||n))return S.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,i=e.controls,a=e.muted,s=e.config,c=e.width,u=e.height,f=this.shouldUseAudio(this.props)?"audio":"video",p={width:"auto"===c?c:"100%",height:"auto"===u?u:"100%"};return o.default.createElement(f,l({ref:this.ref,src:this.getSource(t),style:p,preload:"auto",autoPlay:n||void 0,controls:i,muted:a,loop:r},s.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),s.file.tracks.map(this.renderTrack))}}])&&u(t.prototype,n),s}(o.Component);t.FilePlayer=_,d(_,"displayName","FilePlayer"),d(_,"canPlay",E),d(_,"canEnablePIP",(function(e){return E(e)&&(!!document.pictureInPictureEnabled||O())&&!v.test(e)}));var P=(0,a.default)(_);t.default=P},1241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Mixcloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/mixcloud\.com\/([^/]+\/[^/]+)/,m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(f(e),"duration",null),d(f(e),"currentTime",null),d(f(e),"secondsLoaded",null),d(f(e),"mute",(function(){})),d(f(e),"unmute",(function(){})),d(f(e),"ref",(function(t){e.iframe=t})),e}return t=s,n=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then((function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then((function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on((function(e,n){t.currentTime=e,t.duration=n})),t.props.onReady()}))}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(y)[1],a=(0,i.queryString)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.mixcloud.options,{feed:"/".concat(r,"/")}));return o.default.createElement("iframe",{key:r,ref:this.ref,style:{width:"100%",height:"100%"},src:"https://www.mixcloud.com/widget/iframe/?".concat(a),frameBorder:"0"})}}],n&&u(t.prototype,n),s}(o.Component);t.Mixcloud=m,d(m,"displayName","Mixcloud"),d(m,"canPlay",(function(e){return y.test(e)})),d(m,"loopOnEnded",!0);var v=(0,a.default)(m);t.default=v},4992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SoundCloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(f(e),"duration",null),d(f(e),"currentTime",null),d(f(e),"fractionLoaded",null),d(f(e),"mute",(function(){e.setVolume(0)})),d(f(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),d(f(e),"ref",(function(t){e.iframe=t})),e}return t=s,n=[{key:"load",value:function(e,t){var n=this;(0,i.getSDK)("https://w.soundcloud.com/player/api.js","SC").then((function(r){if(n.iframe){var o=r.Widget.Events,i=o.PLAY,a=o.PLAY_PROGRESS,s=o.PAUSE,c=o.FINISH,u=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(i,n.props.onPlay),n.player.bind(s,n.props.onPause),n.player.bind(a,(function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress})),n.player.bind(c,(function(){return n.props.onEnded()})),n.player.bind(u,(function(e){return n.props.onError(e)}))),n.player.load(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration((function(e){n.duration=e/1e3,n.props.onReady()}))}}))}}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:e,frameBorder:0,allow:"autoplay"})}}],n&&u(t.prototype,n),s}(o.Component);t.SoundCloud=m,d(m,"displayName","SoundCloud"),d(m,"canPlay",(function(e){return y.test(e)})),d(m,"loopOnEnded",!0);var v=(0,a.default)(m);t.default=v},5876:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Streamable=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=/streamable\.com\/([a-z0-9]+)$/,y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?u(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),h(u(e),"duration",null),h(u(e),"currentTime",null),h(u(e),"secondsLoaded",null),h(u(e),"mute",(function(){e.callPlayer("mute")})),h(u(e),"unmute",(function(){e.callPlayer("unmute")})),h(u(e),"ref",(function(t){e.iframe=t})),e}return t=s,(n=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then((function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),t.player.on("ready",t.props.onReady),t.player.on("play",t.props.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.duration,r=e.seconds;t.duration=n,t.currentTime=r})),t.player.on("buffered",(function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)})),t.props.muted&&t.player.mute())}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(d)[1];return o.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(e),frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allowFullScreen:!0})}}])&&l(t.prototype,n),s}(o.Component);t.Streamable=y,h(y,"displayName","Streamable"),h(y,"canPlay",(function(e){return d.test(e)}));var m=(0,a.default)(y);t.default=m},7964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Twitch=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,m=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(f(e),"playerID",e.props.config.twitch.playerId||"".concat("twitch-player-").concat((0,i.randomString)())),d(f(e),"mute",(function(){e.callPlayer("setMuted",!0)})),d(f(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),e}return t=s,n=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,s=r.config,c=r.controls,u=m.test(e),f=u?e.match(m)[1]:e.match(y)[1];t?u?this.player.setChannel(f):this.player.setVideo("v"+f):(0,i.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then((function(e){n.player=new e.Player(n.playerID,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({video:u?"":f,channel:u?f:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted,controls:!!u||c},s.twitch.options));var t=e.Player,r=t.READY,i=t.PLAYING,a=t.PAUSE,p=t.ENDED,h=t.ONLINE,y=t.OFFLINE;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(i,n.props.onPlay),n.player.addEventListener(a,n.props.onPause),n.player.addEventListener(p,n.props.onEnded),n.player.addEventListener(h,n.props.onLoaded),n.player.addEventListener(y,n.props.onLoaded)}),a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}],n&&u(t.prototype,n),s}(o.Component);t.Twitch=v,d(v,"displayName","Twitch"),d(v,"canPlay",(function(e){return y.test(e)||m.test(e)})),d(v,"loopOnEnded",!0);var b=(0,a.default)(v);t.default=b},1251:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Vimeo=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/vimeo\.com\/.+/,m=/vimeo\.com\/external\/[0-9]+\..+/,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(f(e),"duration",null),d(f(e),"currentTime",null),d(f(e),"secondsLoaded",null),d(f(e),"mute",(function(){e.setVolume(0)})),d(f(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),d(f(e),"ref",(function(t){e.container=t})),e}return t=s,n=[{key:"load",value:function(e){var t=this;this.duration=null,(0,i.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then((function(n){t.container&&(t.player=new n.Player(t.container,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({url:e,autoplay:t.props.playing,muted:t.props.muted,loop:t.props.loop,playsinline:t.props.playsinline,controls:t.props.controls},t.props.config.vimeo.playerOptions)),t.player.ready().then((function(){var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"})).catch(t.props.onError),t.player.on("loaded",(function(){t.props.onReady(),t.refreshDuration()})),t.player.on("play",(function(){t.props.onPlay(),t.refreshDuration()})),t.player.on("pause",t.props.onPause),t.player.on("seeked",(function(e){return t.props.onSeek(e.seconds)})),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.seconds;t.currentTime=n})),t.player.on("progress",(function(e){var n=e.seconds;t.secondsLoaded=n})))}),this.props.onError)}},{key:"refreshDuration",value:function(){var e=this;this.player.getDuration().then((function(t){e.duration=t}))}},{key:"play",value:function(){var e=this.callPlayer("play");e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e={width:"100%",height:"100%",overflow:"hidden",display:this.props.display};return o.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}],n&&u(t.prototype,n),s}(o.Component);t.Vimeo=v,d(v,"displayName","Vimeo"),d(v,"forceLoad",!0),d(v,"canPlay",(function(e){return!m.test(e)&&y.test(e)}));var b=(0,a.default)(v);t.default=b},2521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Wistia=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=h(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return y(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),y(p(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),y(p(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),y(p(e),"onSeek",(function(){var t;return(t=e.props).onSeek.apply(t,arguments)})),y(p(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),y(p(e),"mute",(function(){e.callPlayer("mute")})),y(p(e),"unmute",(function(){e.callPlayer("unmute")})),e}return t=s,(n=[{key:"getID",value:function(e){return e&&e.match(m)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,s=n.onReady,c=n.config,l=n.onError;(0,i.getSDK)("https://fast.wistia.com/assets/external/E-v1.js","Wistia").then((function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:u({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},c.wistia.options),onReady:function(e){t.player=e,t.unbind(),t.player.bind("play",t.onPlay),t.player.bind("pause",t.onPause),t.player.bind("seek",t.onSeek),t.player.bind("end",t.onEnded),s()}})}),l)}},{key:"unbind",value:function(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.unbind(),this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_".concat(e);return o.default.createElement("div",{key:e,className:t,style:{width:"100%",height:"100%"}})}}])&&f(t.prototype,n),s}(o.Component);t.Wistia=v,y(v,"displayName","Wistia"),y(v,"canPlay",(function(e){return m.test(e)})),y(v,"loopOnEnded",!0);var b=(0,a.default)(v);t.default=b},8144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.YouTube=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/,b=/list=([a-zA-Z0-9_-]+)/;function g(e){return b.test(e)?{listType:"playlist",list:(t=e.match(b),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1]}:{};var t,n}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=h(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return y(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),y(p(e),"onStateChange",(function(t){var n=t.data,r=e.props,o=r.onPlay,i=r.onPause,a=r.onBuffer,s=r.onBufferEnd,c=r.onEnded,l=r.onReady,u=r.loop,f=window.YT.PlayerState,p=f.PLAYING,h=f.PAUSED,d=f.BUFFERING,y=f.ENDED,m=f.CUED;if(n===p&&(o(),s()),n===h&&i(),n===d&&a(),n===y){var v=!!e.callPlayer("getPlaylist");u&&!v&&e.play(),c()}n===m&&l()})),y(p(e),"mute",(function(){e.callPlayer("mute")})),y(p(e),"unmute",(function(){e.callPlayer("unMute")})),y(p(e),"ref",(function(t){e.container=t})),e}return t=s,(n=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,s=r.playsinline,c=r.controls,l=r.loop,f=r.config,p=r.onError,h=f.youtube,d=h.playerVars,y=h.embedOptions,m=e&&e.match(v)[1];if(t)return b.test(e)?void this.player.loadPlaylist(g(e)):void this.player.cueVideoById({videoId:m,startSeconds:(0,i.parseStartTime)(e)||d.start,endSeconds:(0,i.parseEndTime)(e)||d.end});(0,i.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",(function(e){return e.loaded})).then((function(t){n.container&&(n.player=new t.Player(n.container,u({width:"100%",height:"100%",videoId:m,playerVars:u({autoplay:o?1:0,mute:a?1:0,controls:c?1:0,start:(0,i.parseStartTime)(e),end:(0,i.parseEndTime)(e),origin:window.location.origin,playsinline:s},g(e),{},d),events:{onReady:function(){l&&n.player.setLoop(!0),n.props.onReady()},onStateChange:n.onStateChange,onError:function(e){return p(e.data)}}},y)))}),p)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e),this.props.playing||this.pause()}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&f(t.prototype,n),s}(o.Component);t.YouTube=w,y(w,"displayName","YouTube"),y(w,"canPlay",(function(e){return v.test(e)}));var S=(0,a.default)(w);t.default=S},4985:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(8144),o=n(4992),i=n(1251),a=n(6765),s=n(5876),c=n(2521),l=n(7964),u=n(4922),f=n(1241),p=n(8450),h=[r.YouTube,o.SoundCloud,i.Vimeo,a.Facebook,s.Streamable,c.Wistia,l.Twitch,u.DailyMotion,f.Mixcloud,p.FilePlayer];t.default=h},8428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var i,a=[],s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(f);try{for(s.s();!(i=s.n()).done;){var c=i.value;!c.Player.canPlay(e)&&n[c.configKey].preload&&a.push(r.default.createElement(o.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,controls:t,playing:!0,muted:!0,display:"none"}))}}catch(e){s.e(e)}finally{s.f()}return a};var r=l(n(4639)),o=l(n(6269)),i=n(8144),a=n(4992),s=n(1251),c=n(4922);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=[{Player:i.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:a.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:s.Vimeo,configKey:"vimeo",url:"https://vimeo.com/300970506"},{Player:c.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}]},8416:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r,o=(r=n(3615))&&r.__esModule?r:{default:r},i=o.default.string,a=o.default.bool,s=o.default.number,c=o.default.array,l=o.default.oneOfType,u=o.default.shape,f=o.default.object,p=o.default.func,h=o.default.node,d={url:l([i,c,f]),playing:a,loop:a,controls:a,volume:s,muted:a,playbackRate:s,width:l([i,s]),height:l([i,s]),style:f,progressInterval:s,playsinline:a,pip:a,light:l([a,i]),playIcon:h,wrapper:l([i,p,u({render:p.isRequired})]),config:u({soundcloud:u({options:f,preload:a}),youtube:u({playerVars:f,embedOptions:f,preload:a}),facebook:u({appId:i,version:i,playerId:i}),dailymotion:u({params:f,preload:a}),vimeo:u({playerOptions:f,preload:a}),file:u({attributes:f,tracks:c,forceVideo:a,forceAudio:a,forceHLS:a,forceDASH:a,hlsOptions:f,hlsVersion:i,dashVersion:i}),wistia:u({options:f}),mixcloud:u({options:f}),twitch:u({options:f,playerId:i})}),onReady:p,onStart:p,onPlay:p,onPause:p,onBuffer:p,onBufferEnd:p,onEnded:p,onError:p,onDuration:p,onSeek:p,onProgress:p,onEnablePIP:p,onDisablePIP:p};t.propTypes=d,t.defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,light:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},preload:!1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{},hlsVersion:"0.13.1",dashVersion:"2.9.2"},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onBufferEnd:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){},onEnablePIP:function(){},onDisablePIP:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","fileConfig","wistiaConfig"]},3114:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n;return n=t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(g,t);var n,r,c,f=(n=g,function(){var e,t=y(n);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var r=y(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?d(e):t}(this,e)});function g(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(d(e=f.call.apply(f,[this].concat(n))),"config",(0,a.getConfig)(e.props,i.defaultProps,!0)),v(d(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),v(d(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),v(d(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),v(d(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),v(d(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),v(d(e),"ref",(function(t){e.player=t})),e}return r=g,(c=[{key:"shouldComponentUpdate",value:function(e){return!(0,a.isEqual)(this.props,e)}},{key:"componentDidUpdate",value:function(){this.config=(0,a.getConfig)(this.props,i.defaultProps)}},{key:"render",value:function(){var t=this.config.file,n=t.forceVideo,r=t.forceAudio,c=t.forceHLS,l=t.forceDASH,f=n||r||c||l;if(!e.canPlay(this.props.url)&&!f)return null;var h=this.props,d=h.style,y=h.width,m=h.height,v=h.wrapper,g=(0,a.omit)(this.props,b,i.DEPRECATED_CONFIG_PROPS);return o.default.createElement(v,u({style:p({},d,{width:y,height:m})},g),o.default.createElement(s.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}])&&h(r.prototype,c),g}(o.Component),v(t,"displayName","".concat(e.displayName,"Player")),v(t,"propTypes",i.propTypes),v(t,"defaultProps",i.defaultProps),v(t,"canPlay",e.canPlay),n};var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(8416),a=n(3887),s=(r=n(6269))&&r.__esModule?r:{default:r};function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=Object.keys(i.propTypes)},3887:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseStartTime=function(e){return m(e,p)},t.parseEndTime=function(e){return m(e,h)},t.randomString=function(){return Math.random().toString(36).substr(2,5)},t.queryString=function(e){return Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&")},t.getSDK=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise((function(r,o){if(v[e])v[e].push({resolve:r,reject:o});else{v[e]=[{resolve:r,reject:o}];var a=function(t){v[e].forEach((function(e){return e.resolve(t)}))};if(n){var s=window[n];window[n]=function(){s&&s(),a(window[t])}}i(e,(function(r){r?(v[e].forEach((function(e){return e.reject(r)})),v[e]=null):n||a(window[t])}))}}))},t.getConfig=function(e,t,n){var r,o=(0,i.default)(t.config,e.config),s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=u(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(a.DEPRECATED_CONFIG_PROPS);try{for(s.s();!(r=s.n()).done;){var c=r.value;if(e[c]){var f=c.replace(/Config$/,"");if(o=(0,i.default)(o,l({},f,e[c])),n){var p="ReactPlayer: %c".concat(c," %cis deprecated, please use the config prop instead – ").concat("https://github.com/CookPete/react-player#config-prop");console.warn(p,"font-weight: bold","")}}}}catch(e){s.e(e)}finally{s.f()}return o},t.omit=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=(t=[]).concat.apply(t,r),a={},s=0,c=Object.keys(e);s<c.length;s++){var l=c[s];-1===i.indexOf(l)&&(a[l]=e[l])}return a},t.callPlayer=function(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: ".concat(this.constructor.displayName," player could not call %c").concat(e,"%c – ");return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return(t=this.player)[e].apply(t,o)},t.isObject=b,t.isEqual=function e(t,n){if("function"==typeof t&&"function"==typeof n)return!0;if((0,r.isValidElement)(t)&&(0,r.isValidElement)(n))return!0;if(t instanceof Array&&n instanceof Array){if(t.length!==n.length)return!1;for(var o=0;o!==t.length;o++)if(!e(t[o],n[o]))return!1;return!0}if(b(t)&&b(n)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];if(!e(t[s],n[s]))return!1}return!0}return t===n},t.isMediaStream=function(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream};var r=n(4639),o=s(n(1204)),i=s(n(1857)),a=n(8416);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=/[?&#](?:start|t)=([0-9hms]+)/,h=/[?&#]end=([0-9hms]+)/,d=/(\d+)(h|m|s)/g,y=/^\d+$/;function m(e,t){var n=e.match(t);if(n){var r=n[1];if(r.match(d))return function(e){for(var t,n,r=0,o=d.exec(e);null!==o;){var i=(n=3,function(e){if(Array.isArray(e))return e}(t=o)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||u(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[1],s=i[2];"h"===s&&(r+=60*parseInt(a,10)*60),"m"===s&&(r+=60*parseInt(a,10)),"s"===s&&(r+=parseInt(a,10)),o=d.exec(e)}return r}(r);if(y.test(r))return parseInt(r)}}var v={};function b(e){return null!==e&&"object"===c(e)}},6205:(e,t,n)=>{"use strict";var r=n(9185),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var v=a[m];if(!(i[v]||r&&r[v]||y&&y[v]||s&&s[v])){var b=p(n,v);try{l(t,v,b)}catch(e){}}}}return t}},5738:(e,t,n)=>{"use strict";var r,o=n(4639),i=(r=o)&&"object"==typeof r&&"default"in r?r.default:r;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var c,l=[];function u(){c=e(l.map((function(e){return e.props}))),f.canUseDOM?t(c):n&&(c=n(c))}var f=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.peek=function(){return c},o.rewind=function(){if(o.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=c;return c=void 0,l=[],e};var a=o.prototype;return a.UNSAFE_componentWillMount=function(){l.push(this),u()},a.componentDidUpdate=function(){u()},a.componentWillUnmount=function(){var e=l.indexOf(this);l.splice(e,1),u()},a.render=function(){return i.createElement(r,this.props)},o}(o.PureComponent);return a(f,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),a(f,"canUseDOM",s),f}}},8132:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,r,o,i,a,s=1,c={},l=!1,u=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){o.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(h,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return c[s]=o,n(s),s++},f.clearImmediate=p}function p(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},9400:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},9742:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},2989:function(e,t,n){var r;!function(o,i){"use strict";var a="function",s="undefined",c="object",l="string",u="major",f="model",p="name",h="type",d="vendor",y="version",m="architecture",v="console",b="mobile",g="tablet",w="smarttv",S="wearable",E="embedded",O="Amazon",_="Apple",P="ASUS",k="BlackBerry",j="Browser",C="Chrome",T="Firefox",x="Google",R="Huawei",D="LG",N="Microsoft",M="Motorola",I="Opera",A="Samsung",L="Sharp",B="Sony",F="Xiaomi",U="Zebra",q="Facebook",K="Chromium OS",V="Mac OS",z=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},W=function(e,t){return typeof e===l&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,350)},G=function(e,t){for(var n,r,o,s,l,u,f=0;f<t.length&&!l;){var p=t[f],h=t[f+1];for(n=r=0;n<p.length&&!l&&p[n];)if(l=p[n++].exec(e))for(o=0;o<h.length;o++)u=l[++r],typeof(s=h[o])===c&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):i:this[s[0]]=u?s[1].call(this,u,s[2]):i:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):i):this[s]=u||i;f+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(W(t[n][r],e))return"?"===n?i:n}else if(W(t[n],e))return"?"===n?i:n;return e},Q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,y],[/opios[\/ ]+([\w\.]+)/i],[y,[p,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[p,I]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[p,"UC"+j]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[y,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[y,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+j],y],[/\bfocus\/([\w\.]+)/i],[y,[p,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[p,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[p,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[p,"MIUI "+j]],[/fxios\/([-\w\.]+)/i],[y,[p,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+j]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+j],y],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,q],y],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[p,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,C+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[p,"Android "+j]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[y,J,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[p,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[p,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,y],[/(cobalt)\/([\w\.]+)/i],[p,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,H]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[d,A],[h,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[d,A],[h,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[d,_],[h,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[d,_],[h,g]],[/(macintosh);/i],[f,[d,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[d,L],[h,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[d,R],[h,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[d,R],[h,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[d,F],[h,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[d,F],[h,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[d,"OPPO"],[h,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[d,"Vivo"],[h,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[d,"Realme"],[h,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[d,M],[h,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[d,M],[h,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[d,D],[h,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[d,D],[h,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[d,"Lenovo"],[h,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[d,"Nokia"],[h,b]],[/(pixel c)\b/i],[f,[d,x],[h,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[d,x],[h,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[d,B],[h,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[d,B],[h,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[d,"OnePlus"],[h,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[d,O],[h,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[d,O],[h,b]],[/(playbook);[-\w\),; ]+(rim)/i],[f,d,[h,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[d,k],[h,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[d,P],[h,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[d,P],[h,b]],[/(nexus 9)/i],[f,[d,"HTC"],[h,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[f,/_/g," "],[h,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[d,"Acer"],[h,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[d,"Meizu"],[h,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,f,[h,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,f,[h,g]],[/(surface duo)/i],[f,[d,N],[h,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[d,"Fairphone"],[h,b]],[/(u304aa)/i],[f,[d,"AT&T"],[h,b]],[/\bsie-(\w*)/i],[f,[d,"Siemens"],[h,b]],[/\b(rct\w+) b/i],[f,[d,"RCA"],[h,g]],[/\b(venue[\d ]{2,7}) b/i],[f,[d,"Dell"],[h,g]],[/\b(q(?:mv|ta)\w+) b/i],[f,[d,"Verizon"],[h,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[d,"Barnes & Noble"],[h,g]],[/\b(tm\d{3}\w+) b/i],[f,[d,"NuVision"],[h,g]],[/\b(k88) b/i],[f,[d,"ZTE"],[h,g]],[/\b(nx\d{3}j) b/i],[f,[d,"ZTE"],[h,b]],[/\b(gen\d{3}) b.+49h/i],[f,[d,"Swiss"],[h,b]],[/\b(zur\d{3}) b/i],[f,[d,"Swiss"],[h,g]],[/\b((zeki)?tb.*\b) b/i],[f,[d,"Zeki"],[h,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],f,[h,g]],[/\b(ns-?\w{0,9}) b/i],[f,[d,"Insignia"],[h,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[d,"NextBook"],[h,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],f,[h,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],f,[h,b]],[/\b(ph-1) /i],[f,[d,"Essential"],[h,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[d,"Envizen"],[h,g]],[/\b(trio[-\w\. ]+) b/i],[f,[d,"MachSpeed"],[h,g]],[/\btu_(1491) b/i],[f,[d,"Rotor"],[h,g]],[/(shield[\w ]+) b/i],[f,[d,"Nvidia"],[h,g]],[/(sprint) (\w+)/i],[d,f,[h,b]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[d,N],[h,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[d,U],[h,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[d,U],[h,b]],[/smart-tv.+(samsung)/i],[d,[h,w]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[d,A],[h,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,D],[h,w]],[/(apple) ?tv/i],[d,[f,_+" TV"],[h,w]],[/crkey/i],[[f,C+"cast"],[d,x],[h,w]],[/droid.+aft(\w)( bui|\))/i],[f,[d,O],[h,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[d,L],[h,w]],[/(bravia[\w ]+)( bui|\))/i],[f,[d,B],[h,w]],[/(mitv-\w{5}) bui/i],[f,[d,F],[h,w]],[/Hbbtv.*(technisat) (.*);/i],[d,f,[h,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,$],[f,$],[h,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,f,[h,v]],[/droid.+; (shield) bui/i],[f,[d,"Nvidia"],[h,v]],[/(playstation [345portablevi]+)/i],[f,[d,B],[h,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[d,N],[h,v]],[/((pebble))app/i],[d,f,[h,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[d,_],[h,S]],[/droid.+; (glass) \d/i],[f,[d,x],[h,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[d,U],[h,S]],[/(quest( 2| pro)?)/i],[f,[d,q],[h,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,E]],[/(aeobc)\b/i],[f,[d,O],[h,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[h,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,b]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[y,J,Q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[y,J,Q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,V],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,y],[/\(bb(10);/i],[y,[p,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[p,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[p,C+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,K],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,y],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,y]]},X=function(e,t){if(typeof e===c&&(t=e,e=i),!(this instanceof X))return new X(e,t).getResult();var n=typeof o!==s&&o.navigator?o.navigator:i,r=e||(n&&n.userAgent?n.userAgent:""),v=n&&n.userAgentData?n.userAgentData:i,w=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Y,t):Y,S=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[p]=i,t[y]=i,G.call(t,r,w.browser),t[u]=typeof(e=t[y])===l?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&n&&n.brave&&typeof n.brave.isBrave==a&&(t[p]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,G.call(e,r,w.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[f]=i,e[h]=i,G.call(e,r,w.device),S&&!e[h]&&v&&v.mobile&&(e[h]=b),S&&"Macintosh"==e[f]&&n&&typeof n.standalone!==s&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[f]="iPad",e[h]=g),e},this.getEngine=function(){var e={};return e[p]=i,e[y]=i,G.call(e,r,w.engine),e},this.getOS=function(){var e={};return e[p]=i,e[y]=i,G.call(e,r,w.os),S&&!e[p]&&v&&"Unknown"!=v.platform&&(e[p]=v.platform.replace(/chrome os/i,K).replace(/macos/i,V)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===l&&e.length>350?$(e,350):e,this},this.setUA(r),this};X.VERSION="0.7.35",X.BROWSER=z([p,y,u]),X.CPU=z([m]),X.DEVICE=z([f,d,h,v,b,w,g,S,E]),X.ENGINE=X.OS=z([p,y]),typeof t!==s?(e.exports&&(t=e.exports=X),t.UAParser=X):n.amdO?(r=function(){return X}.call(t,n,t,e))===i||(e.exports=r):typeof o!==s&&(o.UAParser=X);var Z=typeof o!==s&&(o.jQuery||o.Zepto);if(Z&&!Z.ua){var ee=new X;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:this)},4639:t=>{"use strict";t.exports=e},1346:e=>{"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.amdO={},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";o.r(i),o.d(i,{AssetProjectEditor:()=>nT,AssetView:()=>sO,CatteryApp:()=>kE,CourseView:()=>Q_,DashboardApp:()=>Fs,DiscussionApp:()=>Av,Enums:()=>c,ExploreApp:()=>lw,ExtensionProjectEditor:()=>IT,ExtensionView:()=>dO,InfiniteScrollGalleryContainer:()=>Cs,MultiSelectEditor:()=>Oi,PlaylistPlayer:()=>fP,PlaylistView:()=>r_,PortfolioView:()=>NE,ProfileApp:()=>rw,ProfileAvatarEditor:()=>JT,ProfileRenameInput:()=>KT,ProjectEditor:()=>CC,QuickSearch:()=>fe,Resources:()=>s,SearchApp:()=>hr,ShareApp:()=>cw,SimpleGalleryView:()=>Gv,TrainingView:()=>$E,WatchApp:()=>Qb});const e=new(o(9895).Z)({en:{BasicTraining:"Basic Training",Captions:"Caption Languages",Categories:"Categories",Category:"Category",CourseFiles:"Course Files",CoursePlayButton:{StartTheCourse:"Start the Course",WatchAgain:"Watch Again",ContinueWatching:"Continue Watching"},Current:"Current",Discussion:"Discussion",Docs:"Docs",Experience:{Beginner:"Beginner",Intermediate:"Intermediate",Experienced:"Experienced",Advanced:"Advanced",All:"All Skill Levels"},Files:"Files",Instructor:"Instructor",Instructors:"Instructors",Learn:"Learn",Length:"Length",Level:"Level",Overview:"Overview",Products:"Products",ShowMore:"Show More",Tags:"Tags",Tutorials:"Tutorials",VersionRequired:"Version Required",Video:"Video",Videos:"Videos"},ja:{BasicTraining:"ベーシックトレーニング",Categories:"カテゴリー",Category:"カテゴリー",CourseFiles:"学習用ファイル",CoursePlayButton:{StartTheCourse:"コースを開始",WatchAgain:"もう一度観ます",ContinueWatching:"見続けます"},Current:"現在",Discussion:"ディスカッション",Docs:"ドキュメント",Experience:{Beginner:"初級",Intermediate:"中級",Advanced:"上級"},Instructor:"インストラクター",Learn:"学びましょう",Length:"長さ",Level:"レベル",Overview:"概要",Products:"製品",ShowMore:"さらに表示する",Tags:"タグ",Tutorials:"チュートリアル",Video:"ビデオ",Videos:"ビデオ"},ko:{BasicTraining:"기본 교육",Categories:"카테고리",Category:"카테고리",CourseFiles:"코스 파일",CoursePlayButton:{StartTheCourse:"코스 시작하기",WatchAgain:"다시보기",ContinueWatching:"보고 계속"},Current:"현재",Discussion:"토론하기",Docs:"문서",Experience:{Beginner:"초급",Intermediate:"중급",Advanced:"고급"},Instructor:"강사",Learn:"학습하기",Length:"길이",Level:"레벨",Overview:"개요",Products:"프로덕트",ShowMore:"더 보기",Tags:"태그",Tutorials:"튜토리얼",Video:"비디오",Videos:"비디오"},zh:{BasicTraining:"基础训练",Categories:"分类",Category:"类别",CourseFiles:"课程文件",CoursePlayButton:{StartTheCourse:"开始课程",WatchAgain:"再次在手表",ContinueWatching:"继续观看"},Current:"当前",Discussion:"讨论",Docs:"文件",Experience:{Beginner:"初学者",Intermediate:"中间",Advanced:"高级"},Instructor:"讲师",Learn:"学习",Length:"长度",Level:"水平",Overview:"概观",Products:"制品",ShowMore:"展示更多",Tags:"标签",Tutorials:"教程",Video:"视频",Videos:"影片"}});function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function r(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"setLanguage",value:function(e){null===e&&(e="en"),this.language=e,this.UI.setLanguage(e)}},{key:"getLanguage",value:function(){return this.language}}],null&&n(t.prototype,null),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();!function(e,t,n){(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(a,"UI",e);const s=a,c={ProjectTypes:{Portfolio:3,Training:4,Asset:1,Extension:2},NotificationPeriod:{None:0,BookmarkOnly:10,OncePerView:50,AllUpdates:100},LoadStatus:{PreLoad:"PreLoad",Loading:"Loading",Loaded:"Loaded",Error:"Error"},ConsumerTypes:{Collection:"collections",Project:"projects"}};var l=o(4639),u=o.n(l),f=o(9783),p=o.n(f),h=o(3615),d=o.n(h),y=o(1346),m=o.n(y),v=!("undefined"==typeof window||!window.document||!window.document.createElement),b=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),b(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return v?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),m().createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(u().Component);g.propTypes={children:d().node.isRequired,node:d().any};const w=g;var S=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),S(t,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(e){this.renderPortal()}},{key:"componentWillUnmount",value:function(){m().unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(e){this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var t=this.props.children;"function"==typeof this.props.children.type&&(t=u().cloneElement(this.props.children)),this.portal=m().unstable_renderSubtreeIntoContainer(this,t,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),t}(u().Component);const O=E;E.propTypes={children:d().node.isRequired,node:d().any};const _=m().createPortal?w:O;var P=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),k=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.portalNode=null,n.state={active:!!e.defaultOpen},n.openPortal=n.openPortal.bind(n),n.closePortal=n.closePortal.bind(n),n.wrapWithPortal=n.wrapWithPortal.bind(n),n.handleOutsideMouseClick=n.handleOutsideMouseClick.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),P(t,[{key:"componentDidMount",value:function(){this.props.closeOnEsc&&document.addEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.addEventListener("click",this.handleOutsideMouseClick)}},{key:"componentWillUnmount",value:function(){this.props.closeOnEsc&&document.removeEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.removeEventListener("click",this.handleOutsideMouseClick)}},{key:"openPortal",value:function(e){this.state.active||(e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.setState({active:!0},this.props.onOpen))}},{key:"closePortal",value:function(){this.state.active&&this.setState({active:!1},this.props.onClose)}},{key:"wrapWithPortal",value:function(e){var t=this;return this.state.active?u().createElement(_,{node:this.props.node,key:"react-portal",ref:function(e){return t.portalNode=e}},e):null}},{key:"handleOutsideMouseClick",value:function(e){if(this.state.active){var t=this.portalNode&&(this.portalNode.props.node||this.portalNode.defaultNode);!t||t.contains(e.target)||e.button&&0!==e.button||this.closePortal()}}},{key:"handleKeydown",value:function(e){27===e.keyCode&&this.state.active&&this.closePortal()}},{key:"render",value:function(){return this.props.children({openPortal:this.openPortal,closePortal:this.closePortal,portal:this.wrapWithPortal,isOpen:this.state.active})}}]),t}(u().Component);k.propTypes={children:d().func.isRequired,defaultOpen:d().bool,node:d().any,closeOnEsc:d().bool,closeOnOutsideClick:d().bool,onOpen:d().func,onClose:d().func},k.defaultProps={onOpen:function(){},onClose:function(){}};const j=k;function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(this,arguments)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==C(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===C(i)?i:String(i)),r)}var o,i}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e){return N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},N(e)}var M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=N(r);if(o){var n=N(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleOverlayClick=t.handleOverlayClick.bind(D(t)),t.handleCloseClick=t.handleCloseClick.bind(D(t)),t.handlePortalClose=t.handlePortalClose.bind(D(t)),t.preventClose=t.preventClose.bind(D(t)),t}return t=a,(n=[{key:"componentDidMount",value:function(){this.windowScrollTop=$(window).scrollTop();var e=-1*this.windowScrollTop+"px",t=$("body");this.bodyStyle=t.attr("style"),$("body").attr("style","position: fixed; width: 100%; top: "+e)}},{key:"componentWillUnmount",value:function(){$("body").removeAttr("style"),$(window).scrollTop(this.windowScrollTop)}},{key:"handleOverlayClick",value:function(e){e.stopPropagation(),!0===this.props.closeOnOutsideClick&&(this.isClosed=!0,this.props.onClose&&this.props.onClose())}},{key:"handleCloseClick",value:function(e){e.stopPropagation(),this.isClosed=!0,this.props.onClose&&this.props.onClose()}},{key:"handlePortalClose",value:function(){this.props.closeOnEsc&&this.props.onClose&&!this.isClosed&&this.props.onClose()}},{key:"preventClose",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e="tf-overlay-content ".concat(this.props.contentClass?this.props.contentClass:""),t=null;this.props.overlayStyle&&(t={style:this.props.overlayStyle});var n=null;this.props.containerStyle&&(n={style:this.props.containerStyle});var r=null;this.props.contentStyle&&(r={style:this.props.contentStyle});var o=this;return u().createElement(j,{closeOnEsc:this.props.closeOnEsc,onClose:this.handlePortalClose,defaultOpen:!0},(function(i){i.openPortal;var a=i.closePortal,s=(i.isOpen,i.portal);return u().createElement(u().Fragment,null,s(u().createElement("div",T({className:"tf-overlay",onClick:o.handleOverlayClick},t),u().createElement("div",T({className:"tf-overlay-container",onClick:o.handleOverlayClick},n),u().createElement("div",{className:"close"},1==o.props.closeOnEsc&&u().createElement("span",{className:"close-hint"},"hit ",u().createElement("span",{className:"key"},"ESC")," to close"),o.props.showClose&&u().createElement("button",{type:"button",className:"close light",onClick:a},u().createElement("i",{className:"glyphicon glyphicon-remove"}))),u().createElement("div",T({className:e,onClick:o.preventClose},r),o.props.children)))))}))}}])&&x(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);M.propTypes={showClose:d().bool,closeOnEsc:d().bool,closeOnOutsideClick:d().bool,onClose:d().func,contentStyle:d().object,contentClass:d().string},M.defaultProps={showClose:!1,closeOnEsc:!1,closeOnOutsideClick:!1};const I=M;function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==A(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===A(i)?i:String(i)),r)}var o,i}function F(e,t,n){return t&&B(e.prototype,t),n&&B(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function U(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=z(e);if(t){var o=z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===A(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return V(e)}(this,n)}}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},z(e)}var W=function(e){U(n,e);var t=K(n);function n(e){var r;return L(this,n),(r=t.call(this,e)).getValues=r.getValues.bind(V(r)),r.handleClick=r.handleClick.bind(V(r)),r.selected=r.props.selected?r.props.selected:[],r}return F(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.selected=e.selected?e.selected:[]}},{key:"getValues",value:function(){return this.selected.length>0?this.selected:null}},{key:"handleClick",value:function(e,t){if(1==t)this.selected.push(this.props.options[e].value);else{var n=this.selected.indexOf(this.props.options[e].value);n>-1&&this.selected.splice(n,1)}this.props.onChange&&this.props.onChange(this.selected)}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){var r=e.selected.indexOf(t.value);return u().createElement(H,{key:n,text:t.text,value:t.value,toggled:-1!=r,onClick:e.handleClick.bind(null,n)})}));return u().createElement("div",{className:this.props.className},t)}}]),n}(u().Component);W.defaultProps={className:"toggle-button-group"};var H=function(e){U(n,e);var t=K(n);function n(e){var r;return L(this,n),(r=t.call(this,e)).getValue=r.getValue.bind(V(r)),r.handleClick=r.handleClick.bind(V(r)),r.state={toggled:!0===r.props.toggled},r}return F(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.toggled!=this.state.toggled&&this.setState({toggled:e.toggled})}},{key:"getValue",value:function(){return this.state.toggled}},{key:"handleClick",value:function(){var e=this,t=!this.state.toggled;this.setState({toggled:t},(function(){e.props.onClick&&e.props.onClick(t)}))}},{key:"render",value:function(){var e=1==this.state.toggled?"btn-primary":"";return u().createElement("button",{type:"button",value:this.props.value,onClick:this.handleClick,className:e},this.props.text)}}]),n}(u().Component);const G=W;function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==J(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==J(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===J(i)?i:String(i)),r)}var o,i}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}function X(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}const ee=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Z(r);if(o){var n=Z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return X(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleProductsToggle=t.handleProductsToggle.bind(X(t)),t.products=null,t.productOptions=[{text:"Nuke",value:"Nuke"},{text:"Hiero",value:"Hiero"},{text:"Katana",value:"Katana"},{text:"Modo",value:"Modo"},{text:"Mari",value:"Mari"},{text:"Cara VR",value:"CaraVR"},{text:"Colorway",value:"Colorway"},{text:"Flix",value:"Flix"}],t}return t=a,(n=[{key:"handleProductsToggle",value:function(e){this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){return u().createElement(G,{ref:"products",className:this.props.className,selected:this.props.selected,options:this.productOptions,onChange:this.handleProductsToggle})}}])&&Q(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==te(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===te(i)?i:String(i)),r)}var o,i}function re(e,t){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},re(e,t)}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}const ie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&re(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oe(r);if(o){var n=oe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===te(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"search-cta"},u().createElement("span",{className:"hint hint-submit"},"hit ",u().createElement("span",{className:"key"},"ENTER")," to "),u().createElement("a",{href:"#",onClick:this.props.onSearch,className:"search-submit"},"see all results"))}}])&&ne(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ae(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ae(i)?i:String(i)),r)}var o,i}function ce(e,t){return ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ce(e,t)}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ue(e){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ue(e)}const fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ce(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ue(r);if(o){var n=ue(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return le(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={results:[],showSearch:!1,allowQuery:!1},t.query="",t.products=null,t.handleKeyDown=t.handleKeyDown.bind(le(t)),t.handleKeyUp=t.handleKeyUp.bind(le(t)),t.handleProductsToggle=t.handleProductsToggle.bind(le(t)),t.doQuery=t.doQuery.bind(le(t)),t.onSearchClick=t.onSearchClick.bind(le(t)),t.onSearchClose=t.onSearchClose.bind(le(t)),t.searchSubmit=t.searchSubmit.bind(le(t)),t.fullSearch=t.fullSearch.bind(le(t)),t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=p()(this.doQuery,500)}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&(e.preventDefault(),this.fullSearch())}},{key:"handleKeyUp",value:function(e){var t=this.refs.input.value;if(t!=this.query){if(this.query=t,0==t.length&&this.state.results.length>0)return void this.setState({results:[]});this.query.length>=3?this.setState({allowQuery:!0},(function(){this.doQuery()})):this.setState({allowQuery:!1})}}},{key:"handleProductsToggle",value:function(e){this.products=e,this.state.allowQuery&&this.doQuery()}},{key:"doQuery",value:function(){if(!(this.query.length<3)){var e={query:this.query,products:this.products,count:10};$.ajax({type:"POST",url:"/api/search/hints",contentType:"application/json; charset=utf-8",data:JSON.stringify(e),dataType:"json",context:this}).then((function(e){null!=e&&0!=e.length&&this.setState({results:e})}))}}},{key:"onSearchClick",value:function(e){e.preventDefault(),this.setState({showSearch:!0},(function(){this.refs.input.focus()}))}},{key:"onSearchClose",value:function(e){this.setState({showSearch:!1})}},{key:"searchSubmit",value:function(e){e.preventDefault(),this.fullSearch()}},{key:"fullSearch",value:function(){var e=TFWeb.Resources.getLanguage(),t="/search?q=".concat(encodeURIComponent(this.refs.input.value)).concat(null!=this.products&&this.products.length>0?"&products="+this.products.toString():"");e&&"en"!=e&&(t="/".concat(e).concat(t)),window.location.href=t}},{key:"render",value:function(){var e=this.state.results.map((function(e,t){var n=null;e.thumbUrl&&(n=u().createElement("a",{href:e.url,className:"thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var r=[];return r.push(u().createElement("li",{key:"t"},e.type)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(u().createElement("li",{key:t,className:"product"},e))})),u().createElement("li",{key:t},n,u().createElement("a",{className:"title",href:e.url},e.title,e.path&&u().createElement("span",null,e.path)),null!=r&&r.length>0&&u().createElement("ul",null,r))}));return u().createElement("a",{href:"#",className:"nav-link nav-link--search--local nav-link--icon",onClick:this.onSearchClick},u().createElement("span",{className:"nav-link__title"},"Search"),1==this.state.showSearch&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!1,showClose:!0,onClose:this.onSearchClose,containerStyle:{padding:"0"},contentStyle:{width:"100%"}},u().createElement("div",{className:"search-control"},u().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,type:"text",placeholder:"Ask me anything...",className:"form-control"}),u().createElement(ee,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),this.state.allowQuery&&u().createElement(ie,{onSearch:this.searchSubmit}),null!=e&&e.length>0&&u().createElement("ol",{className:"quicksearch-results"},e),this.state.allowQuery&&this.state.results&&this.state.results.length>0&&u().createElement("div",{className:"search-submit"},u().createElement("a",{href:"#",onClick:this.searchSubmit},"see all results")))))}}])&&se(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function pe(e,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pe(e,t)}function he(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pe(e,t)}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}function ye(e){return"/"===e.charAt(0)}function me(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}const ve=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&ye(e),a=t&&ye(t),s=i||a;if(e&&ye(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var c=o[o.length-1];n="."===c||".."===c||""===c}else n=!1;for(var l=0,u=o.length;u>=0;u--){var f=o[u];"."===f?me(o,u):".."===f?(me(o,u),l++):l&&(me(o,u),l--)}if(!s)for(;l--;l)o.unshift("..");!s||""===o[0]||o[0]&&ye(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};var be=!0,ge="Invariant failed";function we(e,t){if(!e){if(be)throw new Error(ge);var n="function"==typeof t?t():t,r=n?"".concat(ge,": ").concat(n):ge;throw new Error(r)}}function Se(e){return"/"===e.charAt(0)?e:"/"+e}function Ee(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function Oe(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function _e(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function Pe(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=de({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=ve(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function ke(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var je=!("undefined"==typeof window||!window.document||!window.document.createElement);function Ce(e,t){t(window.confirm(e))}var Te="popstate",xe="hashchange";function Re(){try{return window.history.state||{}}catch(e){return{}}}var De=1073741823,Ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==o.g?o.g:{};const Me=u().createContext||function(e,t){var n,r,o,i="__create-react-context-"+((Ne[o="__global_unique_id__"]=(Ne[o]||0)+1)+"__"),a=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}(t.props.value),t}he(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?n=0:(n="function"==typeof t?t(r,o):De,0!=(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(l.Component);a.childContextTypes=((n={})[i]=d().object.isRequired,n);var s=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}he(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?De:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?De:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(l.Component);return s.contextTypes=((r={})[i]=d().object,r),{Provider:a,Consumer:s}};var Ie=o(405),Ae=o.n(Ie);function Le(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}o(9185);var Be=o(6205),Fe=o.n(Be),Ue=function(e){var t=Me();return t.displayName=e,t},qe=Ue("Router-History"),Ke=Ue("Router"),Ve=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}he(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return u().createElement(Ke.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},u().createElement(qe.Provider,{children:this.props.children||null,value:this.props.history}))},t}(u().Component);u().Component,u().Component;var ze={},We=0;function He(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,s=void 0!==a&&a,c=n.sensitive,l=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=ze[n]||(ze[n]={});if(r[e])return r[e];var o=[],i={regexp:Ae()(e,o,t),keys:o};return We<1e4&&(r[e]=i,We++),i}(n,{end:i,strict:s,sensitive:l}),o=r.regexp,a=r.keys,c=o.exec(e);if(!c)return null;var u=c[0],f=c.slice(1),p=e===u;return i&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:a.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var $e=function(e){function t(){return e.apply(this,arguments)||this}return he(t,e),t.prototype.render=function(){var e=this;return u().createElement(Ke.Consumer,null,(function(t){t||we(!1);var n=e.props.location||t.location,r=de({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?He(n.pathname,e.props):t.match}),o=e.props,i=o.children,a=o.component,s=o.render;return Array.isArray(i)&&function(e){return 0===u().Children.count(e)}(i)&&(i=null),u().createElement(Ke.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:a?u().createElement(a,r):s?s(r):null:"function"==typeof i?i(r):null)}))},t}(u().Component);u().Component;var Ge=function(e){function t(){return e.apply(this,arguments)||this}return he(t,e),t.prototype.render=function(){var e=this;return u().createElement(Ke.Consumer,null,(function(t){t||we(!1);var n,r,o=e.props.location||t.location;return u().Children.forEach(e.props.children,(function(e){if(null==r&&u().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?He(o.pathname,de({},e.props,{path:i})):t.match}})),r?u().cloneElement(n,{location:o,computedMatch:r}):null}))},t}(u().Component);function Je(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=Le(t,["wrappedComponentRef"]);return u().createElement(Ke.Consumer,null,(function(t){return t||we(!1),u().createElement(e,de({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,Fe()(n,e)}u().useContext;var Qe=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=function(e){void 0===e&&(e={}),je||we(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,a=i.forceRefresh,s=void 0!==a&&a,c=i.getUserConfirmation,l=void 0===c?Ce:c,u=i.keyLength,f=void 0===u?6:u,p=e.basename?Oe(Se(e.basename)):"";function h(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return p&&(i=Ee(i,p)),Pe(i,r,n)}function d(){return Math.random().toString(36).substr(2,f)}var y=ke();function m(e){de(C,e),C.length=n.length,y.notifyListeners(C.location,C.action)}function v(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||w(h(e.state))}function b(){w(h(Re()))}var g=!1;function w(e){g?(g=!1,m()):y.confirmTransitionTo(e,"POP",l,(function(t){t?m({action:"POP",location:e}):function(e){var t=C.location,n=E.indexOf(t.key);-1===n&&(n=0);var r=E.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(g=!0,_(o))}(e)}))}var S=h(Re()),E=[S.key];function O(e){return p+_e(e)}function _(e){n.go(e)}var P=0;function k(e){1===(P+=e)&&1===e?(window.addEventListener(Te,v),o&&window.addEventListener(xe,b)):0===P&&(window.removeEventListener(Te,v),o&&window.removeEventListener(xe,b))}var j=!1,C={length:n.length,action:"POP",location:S,createHref:O,push:function(e,t){var o="PUSH",i=Pe(e,t,d(),C.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.pushState({key:a,state:c},null,t),s)window.location.href=t;else{var l=E.indexOf(C.location.key),u=E.slice(0,l+1);u.push(i.key),E=u,m({action:o,location:i})}else window.location.href=t}}))},replace:function(e,t){var o="REPLACE",i=Pe(e,t,d(),C.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.replaceState({key:a,state:c},null,t),s)window.location.replace(t);else{var l=E.indexOf(C.location.key);-1!==l&&(E[l]=i.key),m({action:o,location:i})}else window.location.replace(t)}}))},go:_,goBack:function(){_(-1)},goForward:function(){_(1)},block:function(e){void 0===e&&(e=!1);var t=y.setPrompt(e);return j||(k(1),j=!0),function(){return j&&(j=!1,k(-1)),t()}},listen:function(e){var t=y.appendListener(e);return k(1),function(){k(-1),t()}}};return C}(t.props),t}return he(t,e),t.prototype.render=function(){return u().createElement(Ve,{history:this.history,children:this.props.children})},t}(u().Component);u().Component;var Ye=function(e,t){return"function"==typeof e?e(t):e},Xe=function(e,t){return"string"==typeof e?Pe(e,null,null,t):e},Ze=function(e){return e},et=u().forwardRef;void 0===et&&(et=Ze);var tt=et((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=Le(e,["innerRef","navigate","onClick"]),a=i.target,s=de({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=Ze!==et&&t||n,u().createElement("a",s)})),nt=et((function(e,t){var n=e.component,r=void 0===n?tt:n,o=e.replace,i=e.to,a=e.innerRef,s=Le(e,["component","replace","to","innerRef"]);return u().createElement(Ke.Consumer,null,(function(e){e||we(!1);var n=e.history,c=Xe(Ye(i,e.location),e.location),l=c?n.createHref(c):"",f=de({},s,{href:l,navigate:function(){var t=Ye(i,e.location),r=_e(e.location)===_e(Xe(t));(o||r?n.replace:n.push)(t)}});return Ze!==et?f.ref=t||a:f.innerRef=a,u().createElement(r,f)}))})),rt=function(e){return e},ot=u().forwardRef;void 0===ot&&(ot=rt);var it,at,st,ct,lt=ot((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,a=e.activeStyle,s=e.className,c=e.exact,l=e.isActive,f=e.location,p=e.sensitive,h=e.strict,d=e.style,y=e.to,m=e.innerRef,v=Le(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return u().createElement(Ke.Consumer,null,(function(e){e||we(!1);var n=f||e.location,o=Xe(Ye(y,n),n),b=o.pathname,g=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),w=g?He(n.pathname,{path:g,exact:c,sensitive:p,strict:h}):null,S=!!(l?l(w,n):w),E="function"==typeof s?s(S):s,O="function"==typeof d?d(S):d;S&&(E=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(E,i),O=de({},O,a));var _=de({"aria-current":S&&r||null,className:E,style:O,to:o},v);return rt!==ot?_.ref=t||m:_.innerRef=m,u().createElement(nt,_)}))})),ut=o(5738),ft=o.n(ut),pt=o(4335),ht=o.n(pt),dt=o(2525),yt=o.n(dt),mt="bodyAttributes",vt="htmlAttributes",bt={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},gt=(Object.keys(bt).map((function(e){return bt[e]})),"charset"),wt="cssText",St="href",Et="innerHTML",Ot="itemprop",_t="rel",Pt={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},kt=Object.keys(Pt).reduce((function(e,t){return e[Pt[t]]=t,e}),{}),jt=[bt.NOSCRIPT,bt.SCRIPT,bt.STYLE],Ct="data-react-helmet",Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dt=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Nt=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},Mt=function(e){var t=Ft(e,bt.TITLE),n=Ft(e,"titleTemplate");if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Ft(e,"defaultTitle");return t||r||void 0},It=function(e){return Ft(e,"onChangeClientState")||function(){}},At=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return Rt({},e,t)}),{})},Lt=function(e,t){return t.filter((function(e){return void 0!==e[bt.BASE]})).map((function(e){return e[bt.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o<r.length;o++){var i=r[o].toLowerCase();if(-1!==e.indexOf(i)&&n[i])return t.concat(n)}return t}),[])},Bt=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&zt("Helmet: "+e+' should be of type "Array". Instead found type "'+Tt(t[e])+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var o={};n.filter((function(e){for(var n=void 0,i=Object.keys(e),a=0;a<i.length;a++){var s=i[a],c=s.toLowerCase();-1===t.indexOf(c)||n===_t&&"canonical"===e[n].toLowerCase()||c===_t&&"stylesheet"===e[c].toLowerCase()||(n=c),-1===t.indexOf(s)||s!==Et&&s!==wt&&s!==Ot||(n=s)}if(!n||!e[n])return!1;var l=e[n].toLowerCase();return r[n]||(r[n]={}),o[n]||(o[n]={}),!r[n][l]&&(o[n][l]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var i=Object.keys(o),a=0;a<i.length;a++){var s=i[a],c=yt()({},r[s],o[s]);r[s]=c}return e}),[]).reverse()},Ft=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Ut=(it=Date.now(),function(e){var t=Date.now();t-it>16?(it=t,e(t)):setTimeout((function(){Ut(e)}),0)}),qt=function(e){return clearTimeout(e)},Kt="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Ut:o.g.requestAnimationFrame||Ut,Vt="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||qt:o.g.cancelAnimationFrame||qt,zt=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},Wt=null,Ht=function(e,t){var n=e.baseTag,r=e.bodyAttributes,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.onChangeClientState,l=e.scriptTags,u=e.styleTags,f=e.title,p=e.titleAttributes;Jt(bt.BODY,r),Jt(bt.HTML,o),Gt(f,p);var h={baseTag:Qt(bt.BASE,n),linkTags:Qt(bt.LINK,i),metaTags:Qt(bt.META,a),noscriptTags:Qt(bt.NOSCRIPT,s),scriptTags:Qt(bt.SCRIPT,l),styleTags:Qt(bt.STYLE,u)},d={},y={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(d[e]=n),r.length&&(y[e]=h[e].oldTags)})),t&&t(),c(e,d,y)},$t=function(e){return Array.isArray(e)?e.join(""):e},Gt=function(e,t){void 0!==e&&document.title!==e&&(document.title=$t(e)),Jt(bt.TITLE,t)},Jt=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(Ct),o=r?r.split(","):[],i=[].concat(o),a=Object.keys(t),s=0;s<a.length;s++){var c=a[s],l=t[c]||"";n.getAttribute(c)!==l&&n.setAttribute(c,l),-1===o.indexOf(c)&&o.push(c);var u=i.indexOf(c);-1!==u&&i.splice(u,1)}for(var f=i.length-1;f>=0;f--)n.removeAttribute(i[f]);o.length===i.length?n.removeAttribute(Ct):n.getAttribute(Ct)!==a.join(",")&&n.setAttribute(Ct,a.join(","))}},Qt=function(e,t){var n=document.head||document.querySelector(bt.HEAD),r=n.querySelectorAll(e+"["+Ct+"]"),o=Array.prototype.slice.call(r),i=[],a=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===Et)n.innerHTML=t.innerHTML;else if(r===wt)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s=void 0===t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(Ct,"true"),o.some((function(e,t){return a=t,n.isEqualNode(e)}))?o.splice(a,1):i.push(n)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:o,newTags:i}},Yt=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},Xt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[Pt[n]||n]=e[n],t}),t)},Zt=function(e,t,n){switch(e){case bt.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[Ct]=!0,o=Xt(n,r),[u().createElement(bt.TITLE,o,e)];var e,n,r,o},toString:function(){return function(e,t,n,r){var o=Yt(n),i=$t(t);return o?"<"+e+" "+Ct+'="true" '+o+">"+Nt(i,r)+"</"+e+">":"<"+e+" "+Ct+'="true">'+Nt(i,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case mt:case vt:return{toComponent:function(){return Xt(t)},toString:function(){return Yt(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[Ct]=!0,r);return Object.keys(t).forEach((function(e){var n=Pt[e]||e;if(n===Et||n===wt){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),u().createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!(e===Et||e===wt)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+Nt(r[t],n)+'"';return e?e+" "+o:o}),""),i=r.innerHTML||r.cssText||"",a=-1===jt.indexOf(e);return t+"<"+e+" "+Ct+'="true" '+o+(a?"/>":">"+i+"</"+e+">")}),"")}(e,t,n)}}}},en=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.scriptTags,l=e.styleTags,u=e.title,f=void 0===u?"":u,p=e.titleAttributes;return{base:Zt(bt.BASE,t,r),bodyAttributes:Zt(mt,n,r),htmlAttributes:Zt(vt,o,r),link:Zt(bt.LINK,i,r),meta:Zt(bt.META,a,r),noscript:Zt(bt.NOSCRIPT,s,r),script:Zt(bt.SCRIPT,c,r),style:Zt(bt.STYLE,l,r),title:Zt(bt.TITLE,{title:f,titleAttributes:p},r)}},tn=ft()((function(e){return{baseTag:Lt([St,"target"],e),bodyAttributes:At(mt,e),defer:Ft(e,"defer"),encode:Ft(e,"encodeSpecialCharacters"),htmlAttributes:At(vt,e),linkTags:Bt(bt.LINK,[_t,St],e),metaTags:Bt(bt.META,["name",gt,"http-equiv","property",Ot],e),noscriptTags:Bt(bt.NOSCRIPT,[Et],e),onChangeClientState:It(e),scriptTags:Bt(bt.SCRIPT,["src",Et],e),styleTags:Bt(bt.STYLE,[wt],e),title:Mt(e),titleAttributes:At("titleAttributes",e)}}),(function(e){Wt&&Vt(Wt),e.defer?Wt=Kt((function(){Ht(e,(function(){Wt=null}))})):(Ht(e),Wt=null)}),en)((function(){return null})),nn=(at=tn,ct=st=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!ht()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case bt.SCRIPT:case bt.NOSCRIPT:return{innerHTML:t};case bt.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,o=e.newChildProps,i=e.nestedChildren;return Rt({},r,((t={})[n.type]=[].concat(r[n.type]||[],[Rt({},o,this.mapNestedChildrenToProps(n,i))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,i=e.newChildProps,a=e.nestedChildren;switch(r.type){case bt.TITLE:return Rt({},o,((t={})[r.type]=a,t.titleAttributes=Rt({},i),t));case bt.BODY:return Rt({},o,{bodyAttributes:Rt({},i)});case bt.HTML:return Rt({},o,{htmlAttributes:Rt({},i)})}return Rt({},o,((n={})[r.type]=Rt({},i),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=Rt({},t);return Object.keys(e).forEach((function(t){var r;n=Rt({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return u().Children.forEach(e,(function(e){if(e&&e.props){var o=e.props,i=o.children,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[kt[n]||n]=e[n],t}),t)}(Dt(o,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case bt.LINK:case bt.META:case bt.NOSCRIPT:case bt.SCRIPT:case bt.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:a,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=Dt(e,["children"]),r=Rt({},n);return t&&(r=this.mapChildrenToProps(t,r)),u().createElement(at,r)},xt(t,null,[{key:"canUseDOM",set:function(e){at.canUseDOM=e}}]),t}(u().Component),st.propTypes={base:d().object,bodyAttributes:d().object,children:d().oneOfType([d().arrayOf(d().node),d().node]),defaultTitle:d().string,defer:d().bool,encodeSpecialCharacters:d().bool,htmlAttributes:d().object,link:d().arrayOf(d().object),meta:d().arrayOf(d().object),noscript:d().arrayOf(d().object),onChangeClientState:d().func,script:d().arrayOf(d().object),style:d().arrayOf(d().object),title:d().string,titleAttributes:d().object,titleTemplate:d().string},st.defaultProps={defer:!0,encodeSpecialCharacters:!0},st.peek=at.peek,st.rewind=function(){var e=at.rewind();return e||(e=en({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},ct);nn.renderStatic=nn.rewind;const rn=nn;var on=o(8891),an={viewport:function(){var e=window,t="inner";return!1 in window&&(t="client",e=document.documentElement||document.body),{width:e[t+"Width"],height:e[t+"Height"]}},isUrl:function(e){return new RegExp(/(http|https):\/\//).test(e)},createMarkup:function(e){return{__html:e}},generateUID:function(){return((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)+"."+((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)},updateScrollPosition:function(e){var t=window.location.hash;if(t){var n=t.replace("#",""),r=document.querySelector("a[name='"+n+"']");r&&r.scrollIntoView()}else!0===e&&window.scrollTo(0,0)},isOnScreen:function(e){var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)},setEndOfContenteditable:function(e){var t,n;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(n=window.getSelection()).removeAllRanges(),n.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())},jsonToOptions:function(e){for(var t=[],n=e.length,r=0;r<n;r++){var o=$("<option/>");if(o.attr({value:e[r].Value}).text(e[r].Text),""==e[r].Value&&o.addClass("ignore"),null!=e[r].DataAttributes&&e[r].DataAttributes.length>0)for(var i=0;i<e[r].DataAttributes.length;i++)o.attr(e[r].DataAttributes[i].Name,e[r].DataAttributes[i].Value);t.push(o)}return t},getFileExtension:function(e){var t=e.split(".");return 1===t.length||""===t[0]&&2===t.length?null:"."+t.pop().toLowerCase()},getFileNameWithoutExtension:function(e){return e.substr(0,e.lastIndexOf("."))||e},indexOfFile:function(e,t){for(var n=0;n<t.length;n++)if(t[n].name==e)return n;return-1},indexOfOption:function(e,t){for(var n=0;n<e.length;n++)if(e[n].value==t)return n;return-1},createSlug:function(e){var t=e.toLowerCase().replace(/[^a-z0-9\s-]+/gi,"-");return t=(t=t.replace(/[^a-z0-9-]+/gi,"-")).replace(/(-{2,})/gi,"-"),an.lrTrim(t,"-")},lrTrim:function(e,t,n){if(n=n||"g","string"!=typeof e||"string"!=typeof t||"string"!=typeof n)throw new TypeError("argument must be string");if(!/^[gi]*$/.test(n))throw new TypeError("Invalid flags supplied '"+n.match(new RegExp("[^gi]*"))+"'");return t=an.escapeRegex(t),e.replace(new RegExp("^["+t+"]+|["+t+"]+$",n),"")},format:function(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/\{(\d+)\}/g,(function(e,n){return t[n]}))},escapeRegex:function(e){return e.replace(/[\[\](){}?*+\^$\\.|\-]/g,"\\$&")},arrayUnique:function(e){for(var t=e.concat(),n=0;n<t.length;++n)for(var r=n+1;r<t.length;++r)t[n]===t[r]&&t.splice(r--,1);return t},clone:function(e){return JSON.parse(JSON.stringify(e))},cloneArray:function(e){return JSON.parse(JSON.stringify(e))},base64toBlob:function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i<r.length;i+=n){for(var a=r.slice(i,i+n),s=new Array(a.length),c=0;c<a.length;c++)s[c]=a.charCodeAt(c);var l=new Uint8Array(s);o.push(l)}return new Blob(o,{type:t})},niceDuration:function(e){var t=Math.floor(e/60/60);e-=60*t*60;var n=Math.floor(e/60),r=Math.trunc(e%60),o="".concat(n,"m ").concat(r,"s");return t>0&&(o="".concat(t,"h ")+o),o},niceFileSize:function(e){var t=e+" Bytes";return e>=1073741824?t=(e/1073741824).toFixed(1)+" GB":e>=1048576?t=(e/1048576).toFixed(1)+" MB":e>=1024&&(t=(e/1024).toFixed(1)+" KB"),t}};const sn=an;function cn(e){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(e)}function ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==cn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==cn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===cn(i)?i:String(i)),r)}var o,i}function un(e,t){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},un(e,t)}function fn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pn(e)}const hn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&un(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pn(r);if(o){var n=pn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fn(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).nextActiveSquare=t.nextActiveSquare.bind(fn(t)),t.updateActiveSquare=t.updateActiveSquare.bind(fn(t)),t.active_square=1,t}return t=a,(n=[{key:"componentDidMount",value:function(){this.updateActiveSquare()}},{key:"nextActiveSquare",value:function(){++this.active_square,this.active_square>3&&(this.active_square=0),this.updateActiveSquare()}},{key:"updateActiveSquare",value:function(){var e=(this.active_square+1)%4,t=(this.active_square+2)%4,n=(this.active_square+3)%4,r=this;$('#loader .loader-square[data-squareid="'+this.active_square+'"]').fadeTo(500,1,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)})),setTimeout((function(){$('#loader .loader-square[data-squareid="'+e+'"]').fadeTo(500,.5,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)}))}),100),setTimeout((function(){$('#loader .loader-square[data-squareid="'+t+'"]').fadeTo(500,.2,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200,r.nextActiveSquare)}),500)}))}),200),$('#loader .loader-square[data-squareid="'+n+'"]').fadeTo(0,0)}},{key:"render",value:function(){return u().createElement("div",{id:"loader"},u().createElement("div",{className:"loader-container"},u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"0"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"1"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"3"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"2"}," "))))}}])&&ln(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function dn(e){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dn(e)}function yn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==dn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===dn(i)?i:String(i)),r)}var o,i}function mn(e,t){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mn(e,t)}function vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bn(e){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bn(e)}var gn={first:'<i class="fa fa-angle-double-left" aria-hidden="true"></i>',prev:'<i class="fa fa-angle-left" aria-hidden="true"></i>',prevSet:"...",nextSet:"...",next:'<i class="fa fa-angle-right" aria-hidden="true"></i>',last:'<i class="fa fa-angle-double-right" aria-hidden="true"></i>'},wn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mn(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bn(r);if(o){var n=bn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===dn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vn(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleKeyPress=t.handleKeyPress.bind(vn(t)),t.handleFirstPage=t.handleFirstPage.bind(vn(t)),t.handlePreviousPage=t.handlePreviousPage.bind(vn(t)),t.handleNextPage=t.handleNextPage.bind(vn(t)),t.handleLastPage=t.handleLastPage.bind(vn(t)),t.handleMorePrevPages=t.handleMorePrevPages.bind(vn(t)),t.handleMoreNextPages=t.handleMoreNextPages.bind(vn(t)),t.handlePageChanged=t.handlePageChanged.bind(vn(t)),t.buildUrl=t.buildUrl.bind(vn(t)),t}return t=a,(n=[{key:"componentDidMount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.removeEventListener("keydown",this.handleKeyPress)}},{key:"getTitles",value:function(e){return this.props.titles[e]||gn[e]}},{key:"calcBlocks",value:function(){var e=this.props,t=e.total,n=e.visiblePages,r=e.current+1;return{total:Math.ceil(t/n),current:Math.ceil(r/n)-1,size:n}}},{key:"isPrevDisabled",value:function(){return this.props.current<=0}},{key:"isNextDisabled",value:function(){return this.props.current>=this.props.total-1}},{key:"isPrevMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||0===e.current}},{key:"isNextMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||e.current===e.total-1}},{key:"visibleRange",value:function(){var e=this.calcBlocks(),t=e.current*e.size,n=this.props.total-t;return[t+1,t+(n>e.size?e.size:n)+1]}},{key:"handleKeyPress",value:function(e){37==e.keyCode?this.handlePreviousPage(e):39==e.keyCode&&this.handleNextPage(e)}},{key:"handleFirstPage",value:function(e){e.preventDefault(),this.isPrevDisabled()||this.handlePageChanged(0)}},{key:"handlePreviousPage",value:function(e){e.preventDefault(),this.isPrevDisabled()||this.handlePageChanged(this.props.current-1)}},{key:"handleNextPage",value:function(e){e.preventDefault(),this.isNextDisabled()||this.handlePageChanged(this.props.current+1)}},{key:"handleLastPage",value:function(e){e.preventDefault(),this.isNextDisabled()||this.handlePageChanged(this.props.total-1)}},{key:"handleMorePrevPages",value:function(e){e.preventDefault();var t=this.calcBlocks();this.handlePageChanged(t.current*t.size-1)}},{key:"handleMoreNextPages",value:function(e){e.preventDefault();var t=this.calcBlocks();this.handlePageChanged((t.current+1)*t.size)}},{key:"handlePageChanged",value:function(e,t){t&&t.preventDefault();var n=this.props.onPageChanged;n&&n(e)}},{key:"renderPages",value:function(e){var t=this;return function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(e[0],e[1]).map((function(e,n){var r=e-1,o=t.handlePageChanged.bind(t,r),i=t.props.current===r;return u().createElement(Sn,{key:n,index:n,isActive:i,className:"btn-numbered-page",onClick:o,url:t.buildUrl(r)},e)}))}},{key:"buildUrl",value:function(e){if(!this.props.baseUrl)return null;var t=this.props.baseUrl,n=t.indexOf("?");return e&&e>0&&(t="".concat(t).concat(-1==n?"?":"&","page=").concat(e)),t}},{key:"render",value:function(){var e=this.getTitles.bind(this),t=this.props.current-1,n=this.props.current+1,r=this.props.total-1;return u().createElement("nav",{className:"page-control"},this.props.children,u().createElement("ul",{className:"pagination pagination-sm"},u().createElement(Sn,{className:"btn-first-page",key:"btn-first-page",isHidden:this.isPrevDisabled(),onClick:this.handleFirstPage,url:this.buildUrl(0)},e("first")),u().createElement(Sn,{className:"btn-prev-page",key:"btn-prev-page",isHidden:this.isPrevDisabled(),onClick:this.handlePreviousPage,url:this.buildUrl(t)},e("prev")),u().createElement(Sn,{className:"btn-prev-more",key:"btn-prev-more",isHidden:this.isPrevMoreHidden(),onClick:this.handleMorePrevPages},e("prevSet")),this.renderPages(this.visibleRange()),u().createElement(Sn,{className:"btn-next-more",key:"btn-next-more",isHidden:this.isNextMoreHidden(),onClick:this.handleMoreNextPages},e("nextSet")),u().createElement(Sn,{className:"btn-next-page",key:"btn-next-page",isHidden:this.isNextDisabled(),onClick:this.handleNextPage,url:this.buildUrl(n)},e("next")),u().createElement(Sn,{className:"btn-last-page",key:"btn-last-page",isHidden:this.isNextDisabled(),onClick:this.handleLastPage,url:this.buildUrl(r)},e("last"))))}}])&&yn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);wn.propTypes={current:d().number.isRequired,total:d().number.isRequired,visiblePages:d().number,titles:d().object,onPageChanged:d().func,enableKeyEvents:d().bool,baseUrl:d().string},wn.defaultProps={titles:gn,visiblePages:8,enableKeyEvents:!1};var Sn=function(e){if(e.isHidden)return null;var t=e.className?"".concat(e.className," "):"",n="".concat(t).concat(e.isActive?" active":"").concat(e.isDisabled?" disabled":"");return u().createElement("li",{key:e.index,className:n},u().createElement("a",{onClick:e.onClick,href:e.url,dangerouslySetInnerHTML:{__html:e.children}}))};Sn.propTypes={isHidden:d().bool,isActive:d().bool,isDisabled:d().bool,className:d().string,onClick:d().func};const En=wn;function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}function _n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==On(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===On(i)?i:String(i)),r)}var o,i}function kn(e,t,n){return t&&Pn(e.prototype,t),n&&Pn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}function Cn(e,t){return Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cn(e,t)}function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Rn(e);if(t){var o=Rn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===On(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xn(e)}(this,n)}}function xn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rn(e){return Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rn(e)}var Dn=function(e){jn(n,e);var t=Tn(n);function n(e){var r;return _n(this,n),(r=t.call(this,e)).handleChange=r.handleChange.bind(xn(r)),r.handleMultiChange=r.handleMultiChange.bind(xn(r)),r}return kn(n,[{key:"handleChange",value:function(e){var t=JSON.parse(JSON.stringify(this.props.filter));t[e.target.name].value=e.target.value,this.props.onChange&&this.props.onChange(t)}},{key:"handleMultiChange",value:function(e,t){var n=JSON.parse(JSON.stringify(this.props.filter));n[e].value=t,this.props.onChange&&this.props.onChange(n)}},{key:"render",value:function(){var e=[],t=[];for(var n in this.props.filter)if(this.props.filter.hasOwnProperty(n)){var r=this.props.filter[n];if(null!=r){var o=u().createElement("select",{key:n,name:n,value:r.value,onChange:this.handleChange},r.options.map((function(e,t){return u().createElement("option",{key:t,value:e.value},e.text)})));switch(r.type){case"Filter":e.push(o);break;case"Sort":t.push(o);break;case"MultiFilter":e.push(u().createElement(Nn,{key:n,name:n,filter:r,onChange:this.handleMultiChange}))}}}return u().createElement("div",null,t.length>0&&u().createElement("div",{className:"sort-filter"},u().createElement("h5",null,"Sort"),t),e.length>0&&u().createElement("div",null,e))}}]),n}(u().Component);Dn.propTypes={filter:d().object,onChange:d().func};var Nn=function(e){jn(n,e);var t=Tn(n);function n(e){var r;_n(this,n),(r=t.call(this,e)).setSelected=r.setSelected.bind(xn(r)),r.handleClick=r.handleClick.bind(xn(r)),r.clearSelected=r.clearSelected.bind(xn(r)),r.updateSelected=r.updateSelected.bind(xn(r)),r.getSelected=r.getSelected.bind(xn(r)),r.findOption=r.findOption.bind(xn(r));var o=JSON.parse(JSON.stringify(r.props.filter.options));return r.setSelected(o,r.props.filter.value),r.state={options:o,hasSelectedOptions:null!=r.props.filter.value&&""!=r.props.filter.value&&r.props.filter.value.length&&r.props.filter.value.length>0},r}return kn(n,[{key:"setSelected",value:function(e,t){if(null!=t&&""!=t&&t.length&&t.length>0)for(var n=0;n<t.length;n++){var r=this.findOption(e,t[n]);null!=r&&(r.isSelected=!0)}}},{key:"handleClick",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.options)),r=this.findOption(n,e);this.updateSelected(r,t);var o=this.getSelected(n),i=this;this.setState({options:n,hasSelectedOptions:null!=o&&o.length>0},(function(){i.props.onChange&&i.props.onChange(i.props.name,o)}))}},{key:"clearSelected",value:function(){for(var e=JSON.parse(JSON.stringify(this.state.options)),t=0;t<=e.length-1;t++)this.updateSelected(e[t],!1);var n=this;this.setState({options:e,hasSelectedOptions:!1},(function(){n.props.onChange&&n.props.onChange(n.props.name,null)}))}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"getSelected",value:function(e){for(var t=[],n=0;n<=e.length-1;n++)if(!0===e[n].isSelected&&t.push(e[n].value),null!=e[n].children&&e[n].children.length>0){var r=this.getSelected(e[n].children);null!=r&&r.length>0&&(t=t.concat(r))}return t}},{key:"findOption",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].value==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findOption(e[n].children,t);if(null!=r)return r}}return null}},{key:"render",value:function(){var e=this,t=this.state.options.map((function(t,n){return null!=t.children&&t.children.length>0?u().createElement(Mn,{key:n,option:t,onClick:e.handleClick}):u().createElement(In,{key:n,option:t,onClick:e.handleClick})}));return u().createElement("div",{className:"multi-filter"},u().createElement("h5",null,this.props.name,this.state.hasSelectedOptions&&u().createElement("a",{onClick:this.clearSelected},"Clear")),u().createElement("ul",null,t))}}]),n}(u().Component);Nn.propTypes={name:d().string,filter:d().object};var Mn=function(e){jn(n,e);var t=Tn(n);function n(){return _n(this,n),t.apply(this,arguments)}return kn(n,[{key:"render",value:function(){var e=this,t=this.props.option.children.map((function(t,r){return null!=t.children&&t.children.length>0?u().createElement(n,{key:r,option:t,onClick:e.props.onClick}):u().createElement("li",{key:r},u().createElement(In,{option:t,onClick:e.props.onClick}))}));return u().createElement("li",null,u().createElement(In,{option:this.props.option,onClick:this.props.onClick}),u().createElement("ul",null,t))}}]),n}(u().Component),In=function(e){jn(n,e);var t=Tn(n);function n(e){var r;return _n(this,n),(r=t.call(this,e)).handleClick=r.handleClick.bind(xn(r)),r}return kn(n,[{key:"handleClick",value:function(e){this.props.onClick&&this.props.onClick(this.props.option.value,this.refs.checkbox.checked)}},{key:"render",value:function(){var e=this.props.option.hasOwnProperty("isSelected")&&!0===this.props.option.isSelected;return u().createElement("label",null,u().createElement("input",{ref:"checkbox",type:"checkbox",checked:e,onChange:this.handleClick}),this.props.option.display)}}]),n}(u().Component);const An=Dn;function Ln(e){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ln(e)}function Bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ln(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ln(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ln(i)?i:String(i)),r)}var o,i}function Un(e,t,n){return t&&Fn(e.prototype,t),n&&Fn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kn(e,t)}function Kn(e,t){return Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kn(e,t)}function Vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Wn(e);if(t){var o=Wn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ln(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zn(e)}(this,n)}}function zn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wn(e){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wn(e)}var Hn=function(e){qn(n,e);var t=Vn(n);function n(e){var r;return Bn(this,n),(r=t.call(this,e)).handleNewProps=r.handleNewProps.bind(zn(r)),r.updateUrl=r.updateUrl.bind(zn(r)),r.getData=r.getData.bind(zn(r)),r.handleKeyDown=r.handleKeyDown.bind(zn(r)),r.handleSearch=r.handleSearch.bind(zn(r)),r.handleProductsToggle=r.handleProductsToggle.bind(zn(r)),r.handleTypeFilter=r.handleTypeFilter.bind(zn(r)),r.handleFilterChange=r.handleFilterChange.bind(zn(r)),r.handleNewPage=r.handleNewPage.bind(zn(r)),r.handleExit=r.handleExit.bind(zn(r)),r.defaultEndpoint="all",r.query=null,r.products=null,r.page=0,r.type=r.defaultEndpoint,r.find=null,r.state={loadStatus:c.LoadStatus.PreLoad,total:0,results:null,aggregations:null,filter:null,suggest:null},r}return Un(n,[{key:"componentDidMount",value:function(){this.handleNewProps(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.handleNewProps(e)}},{key:"handleNewProps",value:function(e){e.location&&e.location.search&&(this.parsedQS=on.parse(e.location.search),this.parsedQS.q&&(this.query=this.parsedQS.q,this.type=null!=this.parsedQS.type?this.parsedQS.type:this.defaultEndpoint,this.find=null!=this.parsedQS.f?this.parsedQS.f:null,this.refs.input.value=this.query,this.products=null!=this.parsedQS.products?this.parsedQS.products.split(","):null,this.page=null!=this.parsedQS.page?this.parsedQS.page:0)),null!=this.query&&""!=this.query&&this.setState({loadStatus:c.LoadStatus.Loading},(function(){this.getData(e)}))}},{key:"updateUrl",value:function(){var e=[];if(this.query&&e.push("q="+encodeURIComponent(this.query)),this.products&&this.products.length>0&&e.push("products="+this.products.join()),this.type&&this.type!=this.defaultEndpoint&&e.push("type="+this.type),this.find&&e.push("field="+this.find),null!=this.state.filter)for(var t in this.state.filter)this.state.filter.hasOwnProperty(t)&&null!=this.state.filter[t]&&this.state.filter[t].value&&""!=this.state.filter[t].value&&e.push("".concat(t,"=").concat(this.state.filter[t].value));this.page>0&&e.push("page="+this.page);var n=this.props.location.pathname;e.length>0&&(n+="?"+e.join("&")),this.props.history.push(n)}},{key:"getData",value:function(e){var t=this;$.ajax({type:"GET",url:"/api/search/".concat(this.type).concat(e.location.search).concat(null==this.state.aggregations?"&refreshAggs=true":""),contentType:"application/json; charset=utf-8",context:this}).done((function(e,n,r){var o=null!=e.aggregations&&e.aggregations.length>0?e.aggregations:t.state.aggregations,i=null!=e.filter?e.filter:t.state.filter;t.setState({loadStatus:c.LoadStatus.Loaded,total:e.total,results:e.results,aggregations:o,filter:i,suggest:e.suggest},(function(){sn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({loadStatus:c.LoadStatus.Error,results:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&this.handleSearch(e)}},{key:"handleSearch",value:function(e){e.preventDefault();var t=this.refs.input.value;this.query=t,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleProductsToggle",value:function(e){this.products=e,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleTypeFilter",value:function(e){this.type=e,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleFilterChange",value:function(e){this.page=0,this.setState({filter:e},(function(){this.updateUrl()}))}},{key:"handleNewPage",value:function(e){this.page=e,this.updateUrl()}},{key:"handleExit",value:function(e,t){var n={q:this.query,products:this.products,url:e};return $.ajax({async:!1,type:"POST",url:"/api/search/exit",contentType:"application/json; charset=utf-8",data:JSON.stringify(n),dataType:"json"}).then((function(){return!0})),!1}},{key:"render",value:function(){return u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"search-control"},u().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,type:"text",placeholder:"Ask me anything...",className:"form-control"}),u().createElement(ee,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),u().createElement(ie,{onSearch:this.handleSearch})))),this.state.loadStatus==c.LoadStatus.Loading&&u().createElement(hn,null),(""==this.query||null==this.query)&&u().createElement(Gn,{suggest:"Please enter a search term in the search box above"}),!(""==this.query||null==this.query)&&this.state.loadStatus==c.LoadStatus.Loaded&&u().createElement("div",{className:"search-x"},u().createElement("div",{className:"search-filters"},u().createElement($n,{doctypes:this.state.aggregations,defaultEndpoint:this.defaultEndpoint,selected:this.type,onTypeChange:this.handleTypeFilter}),u().createElement(An,{filter:this.state.filter,onChange:this.handleFilterChange})),this.state.total>0&&u().createElement(Jn,{results:this.state.results,onPageChange:this.handleNewPage,onTypeChange:this.handleTypeFilter,onExit:this.handleExit}),0==this.state.total&&u().createElement(Gn,{suggest:this.state.suggest})))}}]),n}(u().Component),$n=function(e){qn(n,e);var t=Vn(n);function n(){return Bn(this,n),t.apply(this,arguments)}return Un(n,[{key:"render",value:function(){if(null==this.props.doctypes||0==this.props.doctypes.length)return null;var e=this,t=this.props.doctypes.map((function(t,n){var r;return r=1==t.disabled||t.text.toLowerCase()==e.props.selected.toLowerCase()?u().createElement("span",{className:t.text.toLowerCase()==e.props.selected.toLowerCase()?"selected":""},t.display," (",t.value,")"):u().createElement("a",{onClick:e.props.onTypeChange.bind(null,t.text)},t.display," (",t.value,")"),u().createElement("li",{key:n},r)}));return this.props.selected==this.props.defaultEndpoint?t.unshift(u().createElement("li",{key:this.props.doctypes.length},u().createElement("span",{className:"selected"},"All"))):t.unshift(u().createElement("li",{key:this.props.doctypes.length},u().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.defaultEndpoint)},"All"))),u().createElement("ul",{className:"doctype-filter"},t)}}]),n}(u().Component),Gn=function(e){qn(n,e);var t=Vn(n);function n(){return Bn(this,n),t.apply(this,arguments)}return Un(n,[{key:"render",value:function(){return u().createElement("div",{className:"no-search-results"},u().createElement("div",{className:"noempty-results-container",dangerouslySetInnerHTML:sn.createMarkup(this.props.suggest)}))}}]),n}(u().Component),Jn=function(e){qn(n,e);var t=Vn(n);function n(){return Bn(this,n),t.apply(this,arguments)}return Un(n,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=[];for(var t in this.props.results)this.props.results.hasOwnProperty(t)&&e.push(u().createElement(Qn,{key:t,documentType:t,results:this.props.results[t],onPageChange:this.props.onPageChange,onTypeChange:this.props.onTypeChange,onExit:this.props.onExit}));return u().createElement("div",{className:"search-results"},e)}}]),n}(u().Component),Qn=Je(function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=this,t=this.props.results.documents.data.map((function(t,n){switch(e.props.documentType){case"course":return u().createElement(Yn,{key:n,result:t,onClick:e.props.onExit});case"asset":case"training":case"portfolio":case"catalogue":return u().createElement(Xn,{key:n,result:t,onClick:e.props.onExit});case"profile":return u().createElement(Zn,{key:n,result:t,onClick:e.props.onExit});case"discussionTopic":return u().createElement(er,{key:n,result:t,onClick:e.props.onExit});default:return u().createElement(tr,{key:n,result:t,onClick:e.props.onExit})}})),n="search-results-list";switch(e.props.documentType){case"course":case"asset":case"training":case"portfolio":case"catalogue":n="search-results-card";break;case"profile":n="search-results-profile"}var r=on.parse(this.props.location.search);return u().createElement("div",{className:"search-results-container"},u().createElement("div",{className:"clearfix"},u().createElement("h5",null,this.props.results.displayName),!r.type&&u().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.documentType)},"See All")),this.props.results.documents.totalPages>1&&u().createElement(En,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}),u().createElement("ul",{className:n},t),this.props.results.documents.totalPages>1&&u().createElement(En,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}))}}]),n}(u().Component)),Yn=function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(u().createElement("li",{key:"p:".concat(n),className:"product"},e))})),u().createElement("li",{className:"course"},u().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},u().createElement("img",{src:e.thumbUrl})),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),null!=t&&t.length>0&&u().createElement("ul",null,t)))}}]),n}(u().Component),Xn=function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(u().createElement("li",{key:"p:".concat(n),className:"product"},e))})),u().createElement("li",null,u().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},u().createElement("img",{src:e.thumbUrl})),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),null!=t&&t.length>0&&u().createElement("ul",null,t)))}}]),n}(u().Component),Zn=function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){var e=this.props.result;return u().createElement("li",null,u().createElement("a",{href:e.url,className:"profile-image",style:{backgroundImage:"url("+e.thumbUrl+")"},onClick:this.props.onClick.bind(null,e.url)}),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title)))}}]),n}(u().Component),er=function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=u().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=[];return n.push(u().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){n.push(u().createElement("li",{key:"p:".concat(t),className:"product"},e))})),u().createElement("li",null,t,u().createElement("div",{className:"title"},u().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),e.path&&u().createElement("span",{className:"path"},e.path)),null!=n&&n.length>0&&u().createElement("ul",null,n)))}}]),n}(u().Component),tr=function(e){qn(n,e);var t=Vn(n);function n(e){return Bn(this,n),t.call(this,e)}return Un(n,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=u().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=null;e.highlight&&e.highlight.length>0&&(n=e.highlight.map((function(e,t){return u().createElement("p",{key:"h:".concat(t),dangerouslySetInnerHTML:sn.createMarkup(e)})})));var r=[];r.push(u().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(u().createElement("li",{key:"p:".concat(t),className:"product"},e))}));var o=null!=e.rating&&e.rating>0?u().createElement("span",null,"+",e.rating):null;return u().createElement("li",null,t,u().createElement("div",{className:"title"},u().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),e.path&&u().createElement("span",{className:"path"},e.path)),null!=r&&r.length>0&&u().createElement("ul",null,r)),null!=n&&u().createElement("div",{className:"highlights"},n),u().createElement("div",{className:"support"},e.date," ",o))}}]),n}(u().Component);const nr=Je(Hn);function rr(e){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(e)}function or(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ir(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==rr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===rr(i)?i:String(i)),r)}var o,i}function ar(e,t,n){return t&&ir(e.prototype,t),n&&ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cr(e,t)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cr(e,t)}function lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ur(e);if(t){var o=ur(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===rr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ur(e)}var fr=function(e){sr(n,e);var t=lr(n);function n(e){return or(this,n),t.call(this,e)}return ar(n,[{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Search",titleTemplate:"%s | Foundry Community"}),u().createElement(Qe,null,u().createElement(pr,null)))}}]),n}(u().Component),pr=Je(function(e){sr(n,e);var t=lr(n);function n(e){return or(this,n),t.call(this,e)}return ar(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(Ge,null,u().createElement($e,{path:"/:culture/search"},u().createElement(nr,null)),u().createElement($e,{path:"/search"},u().createElement(nr,null)))}}]),n}(u().Component));const hr=fr,dr=function(e){var t="f-container";return e.marginTop&&(t+=" f-mTop"),e.marginBottom&&(t+=" f-mBottom"),u().createElement("div",{className:t},u().createElement("div",{className:"f-max"},e.children))};var yr=o(8658),mr=o.n(yr);function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kr(r.key),r)}}function wr(e,t,n){return t&&gr(e.prototype,t),n&&gr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Er(e,t)}function Er(e,t){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Er(e,t)}function Or(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pr(e);if(t){var o=Pr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _r(e)}(this,n)}}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(e){return Pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pr(e)}function kr(e){var t=function(e,t){if("object"!==vr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===vr(t)?t:String(t)}var jr=function(e){Sr(n,e);var t=Or(n);function n(e){var r;return br(this,n),function(e,t,n){(t=kr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(_r(r=t.call(this,e)),"getNavLinkClass",(function(e){return r.props.location.pathname===e?"active":""})),r.viewportIsMobile=r.viewportIsMobile.bind(_r(r)),r.handleResize=r.handleResize.bind(_r(r)),r.handleGroupClick=r.handleGroupClick.bind(_r(r)),r.handleClickOutside=r.handleClickOutside.bind(_r(r)),r.mobileBreakpoint=768,r.state={index:null,isMobile:r.viewportIsMobile()},r}return wr(n,[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"viewportIsMobile",value:function(){return sn.viewport().width<=this.mobileBreakpoint}},{key:"handleResize",value:function(e){this.setState({isMobile:this.viewportIsMobile()})}},{key:"handleGroupClick",value:function(e,t){t.preventDefault();var n=null===this.state.index?e:null;this.setState({index:n})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),e.stopPropagation(),this.setState({index:null})}},{key:"render",value:function(){var e=this,t=null,n=this.props.data.map((function(n,r){switch(n.type){case"ClientRoute":return u().createElement("li",{key:r,className:e.getNavLinkClass(n.url)},u().createElement(lt,{to:n.url,activeClassName:"active"},n.text));case"Anchor":return u().createElement("li",{className:e.getNavLinkClass(n.url)},u().createElement("a",{key:r,href:n.url},n.text));case"Group":e.state.index==r&&(t=u().createElement(Cr,{items:n.children,onClickOutside:e.handleClickOutside,onOptionClick:e.handleClickOutside}));for(var o=!1,i=0;i<n.children.length-1;i++)e.props.location.pathname===n.children[i].url&&(o=!0);return u().createElement("li",{key:r,className:o?"active":""},u().createElement("a",{href:"#",onClick:e.handleGroupClick.bind(null,r)},n.text," ",u().createElement("span",{className:"caret"})),e.state.index==r&&null!=t&&!e.state.isMobile&&t)}})),r="category-tabs".concat(this.props.className?" "+this.props.className:"");return u().createElement("nav",{className:r},u().createElement("div",{className:"mobile-options-wrapper"},u().createElement("ul",{className:"options"},n)),null!=t&&this.state.isMobile&&t)}}]),n}(u().Component);jr.propTypes={data:d().array,activeIndex:d().number,className:d().string};var Cr=function(){var e=function(e){Sr(n,e);var t=Or(n);function n(e){var r;return br(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(_r(r)),r.handleOptionClick=r.handleOptionClick.bind(_r(r)),r}return wr(n,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick(e)}},{key:"render",value:function(){var e=this,t=this.props.items.map((function(t,n){switch(t.type){case"ClientRoute":return u().createElement("li",{key:n,onClick:e.handleOptionClick},u().createElement(lt,{to:t.url},t.text));case"Anchor":return u().createElement("li",{key:n},u().createElement("a",{href:t.url},t.text))}}));return u().createElement("ul",{className:"subnav"},t)}}]),n}(u().Component);return e.propTypes={items:d().array.isRequired,onClickOutside:d().func.isRequired,onOptionClick:d().func},mr()(e)}();const Tr=Je(jr);function xr(e){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xr(e)}function Rr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==xr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===xr(i)?i:String(i)),r)}var o,i}function Dr(e,t){return Dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dr(e,t)}function Nr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mr(e){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mr(e)}var Ir=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dr(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mr(r);if(o){var n=Mr(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===xr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Nr(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getAttribute=t.getAttribute.bind(Nr(t)),t.metricAttributes=[{metric:"views",title:"Views",icon:"glyphicon glyphicon-eye-open"},{metric:"downloads",title:"Downloads",icon:"glyphicon glyphicon-download"},{metric:"likes",title:"Likes",icon:"glyphicon glyphicon-heart"},{metric:"rating",title:"Rating",icon:"glyphicon glyphicon-star"},{metric:"watchers",title:"Watchers",icon:"glyphicon glyphicon-download"},{metric:"collections",title:"Collections",icon:"glyphicon glyphicon-pushpin"},{metric:"comments",title:"Comments",icon:"glyphicon glyphicon-comment"},{metric:"profileView",title:"Profile Views",icon:"glyphicon glyphicon-eye-open"},{metric:"profileFollow",title:"Profile Followers",icon:"glyphicon glyphicon-user"},{metric:"projectView",title:"Project Views",icon:"glyphicon glyphicon-eye-open"},{metric:"projectLike",title:"Project Likes",icon:"glyphicon glyphicon-thumbs-up"}],t}return t=a,(n=[{key:"getAttribute",value:function(e){for(var t=0;t<this.metricAttributes.length;t++)if(this.metricAttributes[t].metric==e)return this.metricAttributes[t];return null}},{key:"render",value:function(){var e=[];for(var t in this.props.metrics)if(this.props.metrics.hasOwnProperty(t)){var n=this.getAttribute(t);null!=n&&e.push(u().createElement("span",{key:n.metric,className:n.metric,title:n.title},this.props.metrics[t]))}var r="metrics ".concat(this.props.displayClass?this.props.displayClass:"");return u().createElement("div",{className:r},e)}}])&&Rr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ir.propTypes={metrics:d().object};const Ar=Ir;function Lr(e){return Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lr(e)}function Br(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Lr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Lr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Lr(i)?i:String(i)),r)}var o,i}function Fr(e,t){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fr(e,t)}function Ur(e){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ur(e)}var qr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fr(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ur(r);if(o){var n=Ur(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Lr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.profile,t={backgroundImage:"url(".concat(e.avatarUrl,")")};return u().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}},u().createElement("div",{className:"hero-content main clearfix",style:{margin:"0 auto"}},u().createElement("div",{className:"user-info"},u().createElement("a",{href:e.url,className:"profile"},u().createElement("span",{className:"profile-image",style:t}),u().createElement("span",{className:"profile-name"},"Hello ",u().createElement("b",null,e.name)))),u().createElement("div",{className:"user-edit"},u().createElement("div",{className:"user-ctas button-group"},!0===e.show.newProject&&u().createElement("a",{href:"/project/new",className:"button icon icon-after icon-add"},"Upload new project"),u().createElement("a",{href:e.url,className:"button icon icon-after icon-arrow"},"View profile")),u().createElement("div",{className:"profile-stats-wrapper"},u().createElement("p",null,"Your Profile"),u().createElement("div",{className:"profile-stats clearfix"},u().createElement(Ar,{metrics:e.metrics,displayClass:"light"}))))))}}])&&Br(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);qr.propTypes={profile:d().object.isRequired};const Kr=qr;function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Vr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Vr(i)?i:String(i)),r)}var o,i}function Hr(e,t,n){return t&&Wr(e.prototype,t),n&&Wr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gr(e,t)}function Gr(e,t){return Gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gr(e,t)}function Jr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Yr(e);if(t){var o=Yr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qr(e)}(this,n)}}function Qr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yr(e){return Yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yr(e)}var Xr=function(e){$r(n,e);var t=Jr(n);function n(e){var r;return zr(this,n),(r=t.call(this,e)).handleToggle=r.handleToggle.bind(Qr(r)),r.handleClickOutside=r.handleClickOutside.bind(Qr(r)),r.handleOptionClick=r.handleOptionClick.bind(Qr(r)),r.state={isOpen:!1},r}return Hr(n,[{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({isOpen:!this.state.isOpen})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),this.state.isOpen&&e.target!=this.refs.action&&this.setState({isOpen:!1})}},{key:"handleOptionClick",value:function(){this.setState({isOpen:!1})}},{key:"render",value:function(){var e;"anchor"==this.props.actionTag||"link"==this.props.actionTag?e=u().createElement("a",{href:"#",ref:"action",onClick:this.handleToggle},this.props.actionLabel," ",u().createElement("span",{className:"caret"})):"button"==this.props.actionTag?e=u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",u().createElement("span",{className:"caret"})):"buttonLink"==this.props.actionTag&&(e=u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",u().createElement("span",{className:"caret"})));var t=null;switch(this.state.isOpen&&(t=u().createElement(Zr,{options:this.props.options,onClickOutside:this.handleClickOutside,onOptionClick:this.handleOptionClick,className:this.props.dropdownClassName})),this.props.wrapperTag){case"li":return u().createElement("li",{className:"tfdropdown"},e,t);case"span":return u().createElement("span",{className:"tfdropdown"},e,t);default:return u().createElement("div",{className:"tfdropdown"},e,t)}}}]),n}(u().Component);Xr.propTypes={wrapperTag:d().string,actionTag:d().string,actionLabel:d().oneOfType([d().string,d().object]),options:d().array,dropdownClassName:d().string};var Zr=function(){var e=function(e){$r(n,e);var t=Jr(n);function n(e){var r;return zr(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(Qr(r)),r.handleOptionClick=r.handleOptionClick.bind(Qr(r)),r}return Hr(n,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick()}},{key:"render",value:function(){var e=this,t=null;return this.props.className&&(t={className:this.props.className}),u().createElement("ul",t,this.props.options.map((function(t,n){return u().createElement("li",{key:n,onClick:e.handleOptionClick},t)})))}}]),n}(u().Component);return e.propTypes={options:d().array.isRequired,onClickOutside:d().func.isRequired,onOptionClick:d().func},mr()(e)}();const eo=Xr;var to=o(9584),no=o.n(to);function ro(e){return ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ro(e)}function oo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ro(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ro(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ro(i)?i:String(i)),r)}var o,i}function io(e,t){return io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},io(e,t)}function ao(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function so(e){return so=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},so(e)}var co=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&io(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=so(r);if(o){var n=so(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ro(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ao(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleDelete=t.handleDelete.bind(ao(t)),t.state={filter:t.props.filter},t}return t=a,n=[{key:"handleDelete",value:function(e,t){t.preventDefault();var n=this.state.filter;n.options.splice(e,1);var r=n.options.map((function(e,t){return e.value}));n.value=r.join(","),this.props.onChange&&this.props.onChange(this.props.name,n)}},{key:"render",value:function(){var e=this,t=this.state.filter.options.map((function(t,n){return u().createElement("a",{key:n,href:"#",className:"tag"},t.text,u().createElement("span",{className:"remove",onClick:e.handleDelete.bind(null,n)},"Remove"))}));return null!=t&&t.length>0?u().createElement("div",{className:"filter-tags"},t):null}}],n&&oo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);co.propTypes={name:d().string,filter:d().object};const lo=co;function uo(e){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uo(e)}function fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==uo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==uo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===uo(i)?i:String(i)),r)}var o,i}function po(e,t){return po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},po(e,t)}function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ho(e)}const yo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&po(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ho(r);if(o){var n=ho(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===uo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"render",value:function(){var e=this;return u().createElement("div",{className:"multi-radio-container"},this.props.filter.options.map((function(t,n){return u().createElement("label",{key:t.value,className:"clearfix multi-select"},u().createElement("input",{name:e.props.name,value:t.value,checked:t.value===e.props.filter.value,onChange:e.props.onChange,type:"radio"}),u().createElement("span",{className:"radio-multi-label"},t.text))})))}}])&&fo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function mo(e){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mo(e)}function vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==mo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==mo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===mo(i)?i:String(i)),r)}var o,i}function bo(e,t){return bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bo(e,t)}function go(e){return go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},go(e)}const wo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=go(r);if(o){var n=go(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===mo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"render",value:function(){return u().createElement("select",{name:this.props.name,value:this.props.filter.value,onChange:this.props.onChange},this.props.filter.options.map((function(e,t){return u().createElement("option",{key:t,value:e.value},e.text)})))}}])&&vo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function So(e){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(e)}function Eo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==So(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==So(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===So(i)?i:String(i)),r)}var o,i}function Oo(e,t){return Oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oo(e,t)}function _o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Po(e){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Po(e)}var ko=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Po(r);if(o){var n=Po(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===So(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _o(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={filter:t.props.filter},t.handleChange=t.handleChange.bind(_o(t)),t.handleKeyDown=t.handleKeyDown.bind(_o(t)),t.handleSubmit=t.handleSubmit.bind(_o(t)),t.handleClear=t.handleClear.bind(_o(t)),t.minChars=2,t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.filter.value!==this.state.filter.value&&this.setState({filter:e.filter})}},{key:"handleChange",value:function(e){var t=e.target.value;if(t!=this.state.filter.value){var n=no()(this.state.filter);n.value=t,this.setState({filter:n})}}},{key:"handleKeyDown",value:function(e){"Enter"===e.key&&this.state.filter.value.length>=this.minChars&&this.handleSubmit(e)}},{key:"handleSubmit",value:function(e){e.preventDefault(),this.props.onChange&&this.props.onChange(this.props.name,this.state.filter)}},{key:"handleClear",value:function(e){e.preventDefault();var t=no()(this.state.filter);t.value="";var n=this;this.setState({filter:t},(function(){n.props.onChange&&n.props.onChange(n.props.name,n.state.filter)}))}},{key:"render",value:function(){var e=!(""===this.state.filter.value),t=this.state.filter.value.length>=this.minChars;return u().createElement("div",{className:"query-filter"},u().createElement("input",{name:this.props.name,type:"text",value:this.state.filter.value,placeholder:this.props.placeholder,onChange:this.handleChange,onKeyDown:this.handleKeyDown}),u().createElement("div",null,e&&u().createElement("button",{className:"query-clear",onClick:this.handleClear},u().createElement("i",{className:"fa fa-times","aria-hidden":"true"})),u().createElement("button",{className:"query",disabled:!t,onClick:this.handleSubmit},u().createElement("i",{className:"fa fa-search","aria-hidden":"true"}))))}}])&&Eo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ko.propTypes={filter:d().object.isRequired,name:d().string,property:d().string,placeholder:d().string,onChange:d().func};const jo=ko;function Co(e){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Co(e)}function To(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Co(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Co(i)?i:String(i)),r)}var o,i}function xo(e,t){return xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xo(e,t)}function Ro(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Do(e)}var No=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Do(r);if(o){var n=Do(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Co(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ro(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(Ro(t)),t.handleFilterChange=t.handleFilterChange.bind(Ro(t)),t.handleSubmit=t.handleSubmit.bind(Ro(t)),t.resetFilter=t.resetFilter.bind(Ro(t)),t}return t=a,(n=[{key:"handleChange",value:function(e){var t=no()(this.props.filter),n=e.target.name,r=t[n];for(var o in r.value=e.target.value,t)if(t.hasOwnProperty(o)&&null!=t[o]&&t[o]!=r){var i=t[o];null!=i.dependentOf&&i.dependentOf.includes(n)&&(i.value="")}this.props.onChange&&this.props.onChange(t)}},{key:"handleFilterChange",value:function(e,t){var n=no()(this.props.filter);n[e]=t,this.props.onChange&&this.props.onChange(n)}},{key:"handleSubmit",value:function(e){e.preventDefault()}},{key:"resetFilter",value:function(){var e=no()(this.props.filter);for(var t in e)e.hasOwnProperty(t)&&null!=e[t]&&(e[t].value="");this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){var e=[],t=[],n=!1;for(var r in this.props.filter)if(this.props.filter.hasOwnProperty(r)){var o=this.props.filter[r];if(null!=o)switch(""!=o.value&&(n=!0),o.type){case"Sort":t.push(u().createElement(wo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"Filter":e.push(u().createElement(wo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"FilterRadio":e.push(u().createElement(yo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"Query":e.push(u().createElement(jo,{key:r,name:r,filter:o,placeholder:"Search...",onChange:this.handleFilterChange}))}}return u().createElement("div",{className:"filters"},u().createElement("div",{className:"filter-select"},u().createElement("form",{onSubmit:this.handleSubmit},u().createElement("div",null,this.props.embeddedNav&&u().createElement("fieldset",{className:"nav"},this.props.embeddedNav),e.length>0&&u().createElement("fieldset",{className:"filter"},e)),u().createElement("div",null,t.length>0&&u().createElement("fieldset",{className:"sort"},t),n&&u().createElement("fieldset",{className:"reset"},u().createElement("button",{onClick:this.resetFilter},"Reset Filter"))))),this.props.filter&&this.props.filter.hasOwnProperty("tags")&&u().createElement(lo,{name:"tags",filter:this.props.filter.tags,onChange:this.handleFilterChange}))}}])&&To(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);No.propTypes={filter:d().object,onChange:d().func};const Mo=No;function Io(e){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Io(e)}function Ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Io(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Io(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Io(i)?i:String(i)),r)}var o,i}function Lo(e,t){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lo(e,t)}function Bo(e){return Bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bo(e)}var Fo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bo(r);if(o){var n=Bo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Io(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r=this.props.showArrow?" icon icon-after icon-arrow":"",o=this.props.colorClassName?" ".concat(this.props.colorClassName):"",i="profile".concat(t).concat(n).concat(r).concat(o),a=!0===this.props.showAvatar&&u().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}),s=u().createElement("span",{className:"profile-name"},this.props.profile.name),c=e.join(", ");return!0===this.props.showLink?u().createElement("a",{href:this.props.profile.url,className:i,title:c},a,s):u().createElement("div",{className:i},a,s)}}])&&Ao(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Fo.propTypes={profile:d().object.isRequired,size:d().string,showAvatar:d().bool,showArrow:d().bool,colorClassName:d().string,showLink:d().bool},Fo.defaultProps={showAvatar:!0,showArrow:!1,showLink:!0};const Uo=Fo;function qo(e){return qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qo(e)}function Ko(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==qo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==qo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===qo(i)?i:String(i)),r)}var o,i}function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zo(e)}var Wo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zo(r);if(o){var n=zo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===qo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;"Asset"==this.props.project.type&&this.props.project.contents&&(e=this.props.project.contents.map((function(e,t){var n="c"+t;return u().createElement("span",{key:n,className:"content-type"},e)})));var t=null;this.props.project.products&&(t=this.props.project.products.map((function(e,t){return u().createElement("span",{key:t,className:"product"},e)})));var n=null;this.props.showProfile&&(n=u().createElement("div",{className:"info"},u().createElement(Uo,{profile:this.props.project.profile,showArrow:!0})));var r="card".concat("Asset"==this.props.project.type?" asset-card":""),o="text-container".concat(this.props.showProfile?"":" noprofile"),i=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:r},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("a",{href:this.props.project.url,className:o},u().createElement("h4",{className:"Training"===this.props.project.type?"video":null,dangerouslySetInnerHTML:sn.createMarkup(i)}),u().createElement("div",{className:"products"},e,t)),n,this.props.children)}}])&&Ko(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Wo.propTypes={project:d().object.isRequired,showProfile:d().bool},Wo.defaultProps={showProfile:!0};const Ho=Wo;function $o(e){return $o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$o(e)}function Go(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==$o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==$o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===$o(i)?i:String(i)),r)}var o,i}function Jo(e,t){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jo(e,t)}function Qo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yo(e){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yo(e)}var Xo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Yo(r);if(o){var n=Yo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qo(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onBackButtonEvent=t.onBackButtonEvent.bind(Qo(t)),t.buildQueryString=t.buildQueryString.bind(Qo(t)),t.handleFilterChange=t.handleFilterChange.bind(Qo(t)),t.handleNewPage=t.handleNewPage.bind(Qo(t)),t.populate=t.populate.bind(Qo(t)),t.getData=t.getData.bind(Qo(t)),t.handleClickDelete=t.handleClickDelete.bind(Qo(t)),t.handleDelete=t.handleDelete.bind(Qo(t)),t.parsedQS=on.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.totalPages=null,t.filterHistory=[],t.state={loaded:!1,projects:null,filter:null,showDeleteModal:!1,targetIndex:null},t}return t=a,n=[{key:"componentDidMount",value:function(){this.populate()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=on.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.getData(null,!1)}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():null;this.getData(t,!1)}},{key:"buildQueryString",value:function(e){var t=[];if(null!=e)for(var n in e)e.hasOwnProperty(n)&&e[n].value&&t.push("".concat(n,"=").concat(e[n].value));this.page&&t.push("p=".concat(this.page));var r="";return t.length>0&&(r="?"+t.join("&")),r}},{key:"handleFilterChange",value:function(e){this.page=0,this.getData(e,!0)}},{key:"handleNewPage",value:function(e){this.page=e,this.getData(this.state.filter,!0)}},{key:"populate",value:function(){var e=this;$.getJSON("/api/dashboard/projects",(function(t){e.totalPages=null!=t?t.gallery.totalPages:e.totalPages,e.setState({loaded:!0,projects:t.gallery.data,filter:t.filter},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"getData",value:function(e,t){var n=this.buildQueryString(e),r="/api/dashboard/projects/get".concat(n),o=this;$.getJSON(r,(function(t){o.loaded=!0,o.totalPages=null!=t?t.totalPages:o.totalPages,o.setState({projects:t.data,filter:e},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"handleClickDelete",value:function(e){this.setState({showDeleteModal:!0,targetIndex:e})}},{key:"handleDelete",value:function(e){if(!0===e){var t=this.state.projects[this.state.targetIndex],n=this;$.ajax({url:"/api/project/"+t.id+"/delete",type:"DELETE",success:function(e){if(!0===e.isSuccess){var t=n.state.projects;t.splice(n.state.targetIndex,1),n.setState({projects:t,showDeleteModal:!1,targetIndex:null})}}})}}},{key:"render",value:function(){if(!1===this.state.loaded)return u().createElement(hn,null);var e,t=this;e=null===this.state.projects||0===this.state.projects.length?u().createElement("div",{className:"no-content",style:{width:"100%"}},"No Projects Found"):this.state.projects.map((function(e,n){var r=null,o=[];return o.push(u().createElement("a",{href:"/project/"+e.id+"/edit"},"Edit")),o.push(u().createElement("a",{onClick:t.handleClickDelete.bind(null,n)},"Delete")),e.viewer.canEdit&&(r=u().createElement("div",{className:"edit"},u().createElement(eo,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:o}))),u().createElement(Ho,{key:e.id,project:e,showProfile:!1},r)}));var n=null;if(null!=this.state.targetIndex){var r=this.state.projects[this.state.targetIndex];this.state.showDeleteModal&&(n=u().createElement(I,{contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},u().createElement("div",{className:"project-delete-modal report"},u().createElement("h4",null,"Delete project"),u().createElement("p",null,"Are you sure you want to delete the ",u().createElement("strong",null,r.title)," project?  All images, text and stats associated with this project will be permanently deleted."),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete.bind(null,!1)},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleDelete.bind(null,!0)},"Delete")))))}return u().createElement(u().Fragment,null,u().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange}),u().createElement("div",{className:"cards-container content-subsection"},this.totalPages&&this.totalPages>1&&u().createElement(En,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage}),u().createElement("div",null,e),this.totalPages&&this.totalPages>1&&u().createElement(En,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage})),n)}}],n&&Go(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);const Zo=Je(Xo);function ei(e){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ei(e)}function ti(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ei(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ei(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ei(i)?i:String(i)),r)}var o,i}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ni(e,t)}function ri(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oi(e){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oi(e)}const ii=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ni(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oi(r);if(o){var n=oi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ri(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(ri(t)),t.getValue=t.getValue.bind(ri(t)),t}return t=a,(n=[{key:"handleChange",value:function(){this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"render",value:function(){return u().createElement("div",{className:"form-group"},u().createElement("label",{className:"static"},"Time Zone"),u().createElement("select",{ref:"select",name:"TimeZone",defaultValue:this.props.value,onChange:this.handleChange},u().createElement("option",{value:"-12"},"[GMT - 12:00] Baker Island Time"),u().createElement("option",{value:"-11"},"[GMT - 11:00] Niue Time, Samoa Standard Time"),u().createElement("option",{value:"-10"},"[GMT - 10:00] Hawaii-Aleutian Standard Time, Cook Island Time"),u().createElement("option",{value:"-9.5"},"[GMT - 9:30] Marquesas Islands Time"),u().createElement("option",{value:"-9"},"[GMT - 9:00] Alaska Standard Time, Gambier Island Time"),u().createElement("option",{value:"-8"},"[GMT - 8:00] Pacific Standard Time"),u().createElement("option",{value:"-7"},"[GMT - 7:00] Mountain Standard Time"),u().createElement("option",{value:"-6"},"[GMT - 6:00] Central Standard Time"),u().createElement("option",{value:"-5"},"[GMT - 5:00] Eastern Standard Time"),u().createElement("option",{value:"-4.5"},"[GMT - 4:30] Venezuelan Standard Time"),u().createElement("option",{value:"-4"},"[GMT - 4:00] Atlantic Standard Time"),u().createElement("option",{value:"-3.5"},"[GMT - 3:30] Newfoundland Standard Time"),u().createElement("option",{value:"-3"},"[GMT - 3:00] Amazon Standard Time, Central Greenland Time"),u().createElement("option",{value:"-2"},"[GMT - 2:00] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time"),u().createElement("option",{value:"-1"},"[GMT - 1:00] Azores Standard Time, Cape Verde Time, Eastern Greenland Time"),u().createElement("option",{value:"0"},"[GMT] Western European Time, Greenwich Mean Time"),u().createElement("option",{value:"1"},"[GMT + 1:00] Central European Time, West African Time"),u().createElement("option",{value:"2"},"[GMT + 2:00] Eastern European Time, Central African Time"),u().createElement("option",{value:"3"},"[GMT + 3:00] Moscow Standard Time, Eastern African Time"),u().createElement("option",{value:"3.5"},"[GMT + 3:30] Iran Standard Time"),u().createElement("option",{value:"4"},"[GMT + 4:00] Gulf Standard Time, Samara Standard Time"),u().createElement("option",{value:"4.5"},"[GMT + 4:30] Afghanistan Time"),u().createElement("option",{value:"5"},"[GMT + 5:00] Pakistan Standard Time, Yekaterinburg Standard Time"),u().createElement("option",{value:"5.5"},"[GMT + 5:30] Indian Standard Time, Sri Lanka Time"),u().createElement("option",{value:"5.75"},"[GMT + 5:45] Nepal Time"),u().createElement("option",{value:"6"},"[GMT + 6:00] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time"),u().createElement("option",{value:"6.5"},"[GMT + 6:30] Cocos Islands Time, Myanmar Time"),u().createElement("option",{value:"7"},"[GMT + 7:00] Indochina Time, Krasnoyarsk Standard Time"),u().createElement("option",{value:"8"},"[GMT + 8:00] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time"),u().createElement("option",{value:"8.75"},"[GMT + 8:45] Southeastern Western Australia Standard Time"),u().createElement("option",{value:"9"},"[GMT + 9:00] Japan Standard Time, Korea Standard Time, Chita Standard Time"),u().createElement("option",{value:"9.5"},"[GMT + 9:30] Australian Central Standard Time"),u().createElement("option",{value:"10"},"[GMT + 10:00] Australian Eastern Standard Time, Vladivostok Standard Time"),u().createElement("option",{value:"10.5"},"[GMT + 10:30] Lord Howe Standard Time"),u().createElement("option",{value:"11"},"[GMT + 11:00] Solomon Island Time, Magadan Standard Time"),u().createElement("option",{value:"11.5"},"[GMT + 11:30] Norfolk Island Time"),u().createElement("option",{value:"12"},"[GMT + 12:00] New Zealand Time, Fiji Time, Kamchatka Standard Time"),u().createElement("option",{value:"12.75"},"[GMT + 12:45] Chatham Islands Time"),u().createElement("option",{value:"13"},"[GMT + 13:00] Tonga Time, Phoenix Islands Time"),u().createElement("option",{value:"14"},"[GMT + 14:00] Line Island Time")))}}])&&ti(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ai(e){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ai(e)}function si(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ai(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ai(i)?i:String(i)),r)}var o,i}function ci(e,t){return ci=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ci(e,t)}function li(e){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},li(e)}var ui=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ci(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=li(r);if(o){var n=li(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ai(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("span",{className:"help-block"},this.props.message)}}])&&si(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ui.propTypes={message:d().string.isRequired};const fi=ui;function pi(e){return pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pi(e)}function hi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==pi(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==pi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===pi(i)?i:String(i)),r)}var o,i}function yi(e,t,n){return t&&di(e.prototype,t),n&&di(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vi(e,t)}function vi(e,t){return vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vi(e,t)}function bi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wi(e);if(t){var o=wi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===pi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gi(e)}(this,n)}}function gi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wi(e){return wi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wi(e)}var Si=function(e){mi(n,e);var t=bi(n);function n(e){var r;return hi(this,n),(r=t.call(this,e)).validate=r.validate.bind(gi(r)),r.getSelectedOptions=r.getSelectedOptions.bind(gi(r)),r.handleChange=r.handleChange.bind(gi(r)),r.getOption=r.getOption.bind(gi(r)),r.getSelectedOptionIndex=r.getSelectedOptionIndex.bind(gi(r)),r.onDelete=r.onDelete.bind(gi(r)),r.onUpdateOrder=r.onUpdateOrder.bind(gi(r)),r.handleGroupFocus=r.handleGroupFocus.bind(gi(r)),r.handleGroupBlur=r.handleGroupBlur.bind(gi(r)),r.placeholderValue=null!=r.props.placeholderOption?r.props.placeholderOption.value:null,r.state={selectedOptions:r.props.selectedOptions?r.props.selectedOptions:[],validate:!1,isValid:!0===r.props.required&&null!=r.props.selectedOptions&&r.props.selectedOptions.length>0,showValidation:!1,hasFocus:!1},r}return yi(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){null!=e.selectedOptions&&e.selectedOptions!==this.state.selectedOptions&&this.setState({selectedOptions:e.selectedOptions?e.selectedOptions:[]})}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.selectedOptions&&this.state.selectedOptions.length>0}},{key:"getSelectedOptions",value:function(){return this.state.selectedOptions}},{key:"handleChange",value:function(){var e=this,t=this.refs.select.value,n=this.getOption(t);if(t!=this.placeholderValue&&null==this.getSelectedOptionIndex(t)){var r=no()(this.state.selectedOptions);r.push(n),this.setState({selectedOptions:r,isValid:this.valid()},(function(){e.props.onChange&&e.props.onChange(r)})),this.placeholderValue&&(this.refs.select.value,this.placeholderValue)}}},{key:"getOption",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t];return null}},{key:"getSelectedOptionIndex",value:function(e){for(var t=0;t<this.state.selectedOptions.length;t++)if(this.state.selectedOptions[t].value==e)return t;return null}},{key:"onDelete",value:function(e){var t=this,n=no()(this.state.selectedOptions);n.splice(e,1),this.setState({selectedOptions:n,isValid:this.valid()},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"onUpdateOrder",value:function(e,t){var n=this.state.selectedOptions;n.splice(t,0,n.splice(e,1)[0]),this.setState({selectedOptions:n})}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=null;this.props.options&&this.props.options.length>0&&(t=this.props.options.map((function(t,n){var r=!1;return null!==e.getSelectedOptionIndex(t.value)&&(r=!0),u().createElement("option",{key:t.value,value:t.value,disabled:r},t.text)})));var n="multiselect-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(n+=" has-focus"):n+=" has-error";var r="static";!0===this.props.required&&(r+=" required");var o=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(o=u().createElement(fi,{message:this.props.helpMessage})):o=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:n,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:r},this.props.label),u().createElement("div",null,u().createElement("select",{ref:"select",value:this.placeholderValue,onChange:this.handleChange,disabled:null==t},null!=this.props.placeholderOption&&u().createElement("option",{key:this.props.placeholderOption.value,value:this.props.placeholderOption.value,disabled:!1},this.props.placeholderOption.text),t),u().createElement(Ei,{data:this.state.selectedOptions,onUpdateOrder:this.onUpdateOrder,onDelete:this.onDelete})),o)}}]),n}(u().Component);Si.propTypes={label:d().string,helpMessage:d().string,options:d().array.isRequired,placeholderOption:d().object,selectedOptions:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},Si.defaultProps={required:!1,requiredErrorMessage:"At least one item is required"};var Ei=function(e){mi(n,e);var t=bi(n);function n(e){var r;return hi(this,n),(r=t.call(this,e)).dragStart=r.dragStart.bind(gi(r)),r.dragOver=r.dragOver.bind(gi(r)),r.dragEnter=r.dragEnter.bind(gi(r)),r.dragEnd=r.dragEnd.bind(gi(r)),r.placeholder=document.createElement("li"),r.placeholder.className="placeholder",r.dragged=null,r}return yi(n,[{key:"dragStart",value:function(e){this.dragged=e.currentTarget,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("Text",e.currentTarget.id)}},{key:"dragOver",value:function(e){if(e.preventDefault(),this.dragged.style.display="none","placeholder"!=e.target.className&&"LI"==e.target.nodeName){this.over=e.target;var t=e.pageY-$(this.over).offset().top,n=this.over.offsetHeight/2,r=e.target.parentNode;"OL"==r.nodeName&&(t>n?(this.nodePlacement="after",r.insertBefore(this.placeholder,e.target.nextElementSibling)):(this.nodePlacement="before",r.insertBefore(this.placeholder,e.target)))}}},{key:"dragEnter",value:function(e){e.preventDefault()}},{key:"dragEnd",value:function(e){this.dragged.style.display="block",this.dragged.parentNode.removeChild(this.placeholder);var t=Number(this.dragged.dataset.id),n=Number(this.over.dataset.id);t<n&&n--,"after"==this.nodePlacement&&n++,this.props.onUpdateOrder(t,n)}},{key:"render",value:function(){if(null===this.props.data&&0===this.props.data.length)return null;var e=this;return u().createElement("ol",{onDragOver:this.dragOver,onDragEnter:this.dragEnter},this.props.data.map((function(t,n){return u().createElement("li",{"data-id":n,key:n,draggable:!0,onDragEnd:e.dragEnd,onDragStart:e.dragStart},u().createElement("span",{className:"drag-handle glyphicon glyphicon-option-vertical"}),null!=t.display?t.display:t.text," ",u().createElement("button",{type:"button",className:"close",onClick:e.props.onDelete.bind(null,n)},u().createElement("span",null,"×")))})))}}]),n}(u().Component);const Oi=Si;function _i(e){return _i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_i(e)}function Pi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ki(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_i(i)?i:String(i)),r)}var o,i}function ji(e,t,n){return t&&ki(e.prototype,t),n&&ki(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ci(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ti(e,t)}function Ti(e,t){return Ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ti(e,t)}function xi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Di(e);if(t){var o=Di(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===_i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ri(e)}(this,n)}}function Ri(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(e)}var Ni=function(e){Ci(n,e);var t=xi(n);function n(e){var r;Pi(this,n),(r=t.call(this,e)).setSelected=r.setSelected.bind(Ri(r)),r.updateHasSelectedChildren=r.updateHasSelectedChildren.bind(Ri(r)),r.clearSelectedForums=r.clearSelectedForums.bind(Ri(r)),r.getSelectedForums=r.getSelectedForums.bind(Ri(r)),r.getSelected=r.getSelected.bind(Ri(r)),r.handleSelect=r.handleSelect.bind(Ri(r)),r.updateSelected=r.updateSelected.bind(Ri(r)),r.findForum=r.findForum.bind(Ri(r)),r.handleShow=r.handleShow.bind(Ri(r));var o=r.props.forums;null!=r.props.selectedForums&&r.setSelected(o,r.props.selectedForums);var i=[];return r.updateHasSelectedChildren(o,i),r.state={forums:o,show:[],hasSelectedChildren:i},r}return ji(n,[{key:"setSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++){var r=t.indexOf(e[n].id);e[n].isSelected=-1!=r,null!=e[n].children&&e[n].children.length>0&&this.setSelected(e[n].children,t)}}},{key:"updateHasSelectedChildren",value:function(e,t){for(var n=!1,r=0;r<=e.length-1;r++)!0===e[r].isSelected&&(n=!0),null!=e[r].children&&e[r].children.length>0&&!0===this.updateHasSelectedChildren(e[r].children,t)&&("Root"===e[r].type&&t.push(e[r].id),n=!0);return n}},{key:"clearSelectedForums",value:function(){this.setSelected(this.state.forums,[]),this.setState({show:[],hasSelectedChildren:[]})}},{key:"getSelectedForums",value:function(){var e=[];return this.getSelected(this.state.forums,e),e}},{key:"getSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++)!0===e[n].isSelected&&t.push(e[n].id),null!=e[n].children&&e[n].children.length>0&&this.getSelected(e[n].children,t)}},{key:"handleSelect",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.forums)),r=this.findForum(n,e);this.updateSelected(r,t);var o=[];this.updateHasSelectedChildren(n,o),this.setState({forums:n,hasSelectedChildren:o})}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"findForum",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].id==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findForum(e[n].children,t);if(null!=r)return r}}return null}},{key:"handleShow",value:function(e){var t=JSON.parse(JSON.stringify(this.state.show)),n=t.indexOf(e);-1===n?t.push(e):t.splice(n,1),this.setState({show:t})}},{key:"render",value:function(){var e=this,t=this.state.forums.map((function(t){var n=-1!=e.state.hasSelectedChildren.indexOf(t.id);switch(t.type){case"Root":var r=-1!=e.state.show.indexOf(t.id);return u().createElement(Mi,{key:t.id,root:t,onSelect:e.handleSelect,onShow:e.handleShow,show:r,hasSelectedChildren:n});case"Group":return u().createElement(Ai,{key:t.id,group:t,onSelect:e.handleSelect})}}));return u().createElement("div",{className:"forumSelectTree"},t)}}]),n}(u().Component);Ni.propTypes={forums:d().array,selectedForums:d().array};var Mi=function(e){Ci(n,e);var t=xi(n);function n(){return Pi(this,n),t.apply(this,arguments)}return ji(n,[{key:"render",value:function(){var e=this,t=this.props.root.children.map((function(t){return u().createElement(Ai,{key:t.id,group:t,onSelect:e.props.onSelect})}));return u().createElement("div",null,u().createElement(Ii,{show:this.props.show,onClick:this.props.onShow.bind(null,this.props.root.id)}),u().createElement(Bi,{forum:this.props.root,onSelect:this.props.onSelect,hasSelectedChildren:this.props.hasSelectedChildren}),!0===this.props.show&&u().createElement("ul",{className:"root"},t))}}]),n}(u().Component),Ii=function(e){Ci(n,e);var t=xi(n);function n(){return Pi(this,n),t.apply(this,arguments)}return ji(n,[{key:"render",value:function(){var e=!0===this.props.show?"caret":"right-caret";return u().createElement("div",{className:"expand",onClick:this.props.onClick},u().createElement("span",{className:e}))}}]),n}(u().Component),Ai=function(e){Ci(n,e);var t=xi(n);function n(){return Pi(this,n),t.apply(this,arguments)}return ji(n,[{key:"render",value:function(){var e=this,t=this.props.group.children.map((function(t){switch(t.type){case"Group":return u().createElement(n,{key:t.id,group:t,onSelect:e.props.onSelect});case"Discussion":case"Gallery":return u().createElement(Li,{key:t.id,forum:t,onSelect:e.props.onSelect});default:return null}}));return u().createElement("li",null,u().createElement(Bi,{forum:this.props.group,onSelect:this.props.onSelect}),u().createElement("ul",{className:"group"},t))}}]),n}(u().Component),Li=function(e){Ci(n,e);var t=xi(n);function n(){return Pi(this,n),t.apply(this,arguments)}return ji(n,[{key:"render",value:function(){return u().createElement("li",null,u().createElement(Bi,{forum:this.props.forum,onSelect:this.props.onSelect}))}}]),n}(u().Component),Bi=function(e){Ci(n,e);var t=xi(n);function n(e){var r;return Pi(this,n),(r=t.call(this,e)).handleClick=r.handleClick.bind(Ri(r)),r}return ji(n,[{key:"handleClick",value:function(e){this.props.onSelect&&this.props.onSelect(this.props.forum.id,this.refs.checkbox.checked)}},{key:"render",value:function(){var e="noselect".concat(this.props.hasSelectedChildren&&!0===this.props.hasSelectedChildren?" has-selected-children":"");return u().createElement("label",{className:e},u().createElement("input",{type:"checkbox",ref:"checkbox",checked:this.props.forum.isSelected,onChange:this.handleClick})," ",this.props.forum.name)}}]),n}(u().Component);const Fi=Ni;function Ui(e){return Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ui(e)}function qi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ui(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ui(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ui(i)?i:String(i)),r)}var o,i}function Ki(e,t){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ki(e,t)}function Vi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zi(e){return zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zi(e)}const Wi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ki(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zi(r);if(o){var n=zi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ui(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vi(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(Vi(t)),t.handleAutoSubscribeChange=t.handleAutoSubscribeChange.bind(Vi(t)),t.handleAddSignatureToPostChange=t.handleAddSignatureToPostChange.bind(Vi(t)),t.handleHideRootProductLinksChange=t.handleHideRootProductLinksChange.bind(Vi(t)),t.handleTimeZoneChange=t.handleTimeZoneChange.bind(Vi(t)),t.handleSignatureChange=t.handleSignatureChange.bind(Vi(t)),t.handleLimitUnreadPostsChange=t.handleLimitUnreadPostsChange.bind(Vi(t)),t.onShowUnread=t.onShowUnread.bind(Vi(t)),t.onAcceptUnread=t.onAcceptUnread.bind(Vi(t)),t.onCancelUnread=t.onCancelUnread.bind(Vi(t)),t.handleCancel=t.handleCancel.bind(Vi(t)),t.handleSubmit=t.handleSubmit.bind(Vi(t)),t.state={form:null,showUnreadPostsForumsModal:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/dashboard/preferences").done((function(t,n,r){e.setState({form:t})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleAutoSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribe=!t.autoSubscribe,this.setState({form:t})}},{key:"handleAddSignatureToPostChange",value:function(e){var t=this.state.form;t.addSignatureToPost=!t.addSignatureToPost,this.setState({form:t})}},{key:"handleHideRootProductLinksChange",value:function(e){var t=this.state.form;t.hideRootProductLinks=!t.hideRootProductLinks,this.setState({form:t})}},{key:"handleTimeZoneChange",value:function(e){var t=this.state.form;t.utcOffset=e,this.setState({form:t})}},{key:"handleSignatureChange",value:function(e){}},{key:"handleLimitUnreadPostsChange",value:function(e){var t=this.state.form;t.limitUnreadPosts=!t.limitUnreadPosts,this.setState({form:t})}},{key:"onShowUnread",value:function(){this.setState({showUnreadPostsForumsModal:!0})}},{key:"onAcceptUnread",value:function(){var e=this.state.form;e.unreadPostsForumData=this.refs.unreadForums.getSelectedForums(),this.setState({form:e,showUnreadPostsForumsModal:!1})}},{key:"onCancelUnread",value:function(){this.setState({showUnreadPostsForumsModal:!1})}},{key:"handleCancel",value:function(){this.setup()}},{key:"handleSubmit",value:function(){var e=this.state.form;e.rootForumDisplayData=this.refs.rootForumDisplay.getSelectedOptions(),e.signature=this.refs.signature.value,$.ajax({type:"POST",url:"/api/dashboard/preferences",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success("Preferences Saved")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return null===this.state.form?null:u().createElement("div",{className:"preferences"},u().createElement("div",{className:"container clearfix"},u().createElement("fieldset",null,u().createElement("legend",null,"Community Site Preferences"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement(ii,{value:this.state.form.utcOffset,onChange:this.handleTimeZoneChange})))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Preferences"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"autoSubscribe",name:"autoSubscribe",checked:this.state.form.autoSubscribe,onChange:this.handleAutoSubscribeChange}),u().createElement("label",{htmlFor:"autoSubscribe"},"Automatically Set Subscription Checkbox During New Topic / Reply To Topic"))))),u().createElement("fieldset",null,u().createElement("legend",null,"Signature"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"addSignatureToPost",name:"addSignatureToPost",checked:this.state.form.addSignatureToPost,onChange:this.handleAddSignatureToPostChange}),u().createElement("label",{htmlFor:"addSignatureToPost"},"Add Signature To Forum Posts")),u().createElement("div",{className:"form-group"},u().createElement("textarea",{name:"signature",ref:"signature",rows:"3",defaultValue:this.state.form.signature,onChange:this.handleSignatureChange,disabled:!this.state.form.addSignatureToPost}))))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Product Links"),u().createElement("div",{className:"row unread clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},'A group of links to product specific forums has been placed on the front page for the forum to help guide new users.  Advanced users can hide this group and continue using the products drop-down under the "Discuss" section navigation bar.'),u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"hideRootProductLinks",name:"hideRootProductLinks",checked:this.state.form.hideRootProductLinks,onChange:this.handleHideRootProductLinksChange}),u().createElement("label",{htmlFor:"hideRootProductLinks"},"Hide Product links group from front page of forum."))))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Front Page"),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},"Select the Foundry product specific forums you want to display on the front page of the forum under the 'General' section.  On desktop browsers you can also arrange the products in any order through drag and drop."),u().createElement(Oi,{ref:"rootForumDisplay",required:!1,options:this.state.form.rootForumDisplayOptions,placeholderOption:{text:"Select front page forums",value:"-1"},selectedOptions:this.state.form.rootForumDisplayData})))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Unread Posts Limit"),u().createElement("div",{className:"row unread"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},"The Unread Posts feature defaults to displaying results from all forums.  You can limit the results to specific forums by enabling this preference."),u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"limitUnreadPosts",name:"limitUnreadPosts",checked:this.state.form.limitUnreadPosts,onChange:this.handleLimitUnreadPostsChange}),u().createElement("label",{htmlFor:"limitUnreadPosts"},"Limit Unread Posts to Selected Forums")),u().createElement("div",{className:"unread-select"},u().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowUnread,disabled:!this.state.form.limitUnreadPosts},"Select Forums For Unread Posts"),u().createElement("span",null,this.state.form.unreadPostsForumData?this.state.form.unreadPostsForumData.length:0," forums selected")),this.state.showUnreadPostsForumsModal&&u().createElement(I,{closeOnEsc:!0,contentClass:"unread-overlay"},u().createElement(Fi,{ref:"unreadForums",forums:this.state.form.unreadPostsForumOptions,selectedForums:this.state.form.unreadPostsForumData}),u().createElement("ul",{className:"list-inline center-contents"},u().createElement("li",null,u().createElement("button",{className:"btn-default",onClick:this.onCancelUnread},"Cancel")),u().createElement("li",null,u().createElement("button",{className:"btn-primary",onClick:this.onAcceptUnread},"Accept Selection")))))))),u().createElement("ul",{className:"list-inline center-contents"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"reset",onClick:this.handleCancel},"Reset")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Preferences"))))}}])&&qi(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Hi(e){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(e)}function $i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Hi(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Hi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Hi(i)?i:String(i)),r)}var o,i}function Gi(e,t){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gi(e,t)}function Ji(e){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ji(e)}var Qi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gi(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ji(r);if(o){var n=Ji(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Hi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).displayValues=[{label:"Forum in",lengthOffset:2},{label:"Topic in",lengthOffset:1},{label:"in",lengthOffset:1}],t}return t=a,(n=[{key:"render",value:function(){if(!this.props.path)return null;var e=this.displayValues[0];switch(this.props.displayMode.toLowerCase()){case"topic":e=this.displayValues[1];break;case"search":e=this.displayValues[2];break;default:e=this.displayValues[0]}for(var t=[],n=0;n<=this.props.path.length-e.lengthOffset;n++)t.push(u().createElement(nt,{key:n,to:this.props.path[n].url},this.props.path[n].name));return u().createElement("span",{className:"forum-path"},e.label," ",t)}}])&&$i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Qi.propTypes={displayMode:d().string},Qi.defaultProps={displayMode:"forum"};const Yi=Qi;function Xi(e){return Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xi(e)}function Zi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Xi(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Xi(i)?i:String(i)),r)}var o,i}function ea(e,t){return ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ea(e,t)}function ta(e){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(e)}const na=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ea(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ta(r);if(o){var n=ta(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Xi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.data)return null;var e="contribution-info".concat(this.props.addClass);return u().createElement("div",{className:e},u().createElement("time",null,this.props.data.displayDT),this.props.data.profile&&u().createElement(Uo,{profile:this.props.data.profile}))}}])&&Zi(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ra(e){return ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ra(e)}function oa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ra(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ra(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ra(i)?i:String(i)),r)}var o,i}function aa(e,t,n){return t&&ia(e.prototype,t),n&&ia(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sa(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ca(e,t)}function ca(e,t){return ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ca(e,t)}function la(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ua(e);if(t){var o=ua(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ra(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function ua(e){return ua=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ua(e)}var fa=function(e){sa(n,e);var t=la(n);function n(){return oa(this,n),t.apply(this,arguments)}return aa(n,[{key:"render",value:function(){var e=[];this.props.topics.data.forEach((function(t,n){e.push(u().createElement(pa,{key:"t:"+t.topicID,topic:t}))}));var t="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return u().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&u().createElement(En,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,t)," ",this.props.children)),u().createElement("div",{className:"sort"},u().createElement("span",null,"Started")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},e),this.props.topics.totalPages>1&&u().createElement(En,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(u().Component);fa.propTypes={topics:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired,topicCountLabel:d().string};var pa=function(e){sa(n,e);var t=la(n);function n(){return oa(this,n),t.apply(this,arguments)}return aa(n,[{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=u().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=!0===e.viewer.isSubscribed?" subscribed":"",o="".concat("thread"," clearfix").concat(n).concat(r),i=null;if(e.stickyFL)i=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=u().createElement("span",{className:"moved"},"Link :")}return u().createElement("article",{className:o},u().createElement("div",{className:"topic clearfix"},t,u().createElement("div",{className:"info"},u().createElement("h4",null,null!=i&&i," ",u().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),u().createElement(Yi,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"contributions"},u().createElement(na,{data:e.addedBy,addClass:" started"})),u().createElement("div",{className:"contributions mobile-hidden"},u().createElement(na,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(u().Component);pa.propTypes={topic:d().object.isRequired};const ha=fa;function da(e){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(e)}function ya(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==da(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==da(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===da(i)?i:String(i)),r)}var o,i}function ma(e,t){return ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ma(e,t)}function va(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(e){return ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ba(e)}const ga=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ma(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ba(r);if(o){var n=ba(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===da(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return va(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(va(t)),t.addQuerystring=t.addQuerystring.bind(va(t)),t.getData=t.getData.bind(va(t)),t.handleMarkTopics=t.handleMarkTopics.bind(va(t)),t.handleNewPage=t.handleNewPage.bind(va(t)),t.parsedQS=on.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.state={hasLoaded:!1,topics:null,viewer:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=on.parse(e.location.search),e.location&&e.location.search&&this.parsedQS&&this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()}},{key:"buildUrl",value:function(){var e="/api/dashboard/unread";return this.addQuerystring(e,this.page)}},{key:"addQuerystring",value:function(e,t){var n=[];return t>0&&n.push("page="+t),n.length>0&&(e+="?"+n.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({hasLoaded:!0,topics:t.topics,viewer:t.viewer},(function(){sn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):alerts.error(t.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleMarkTopics",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/dashboard/mark-unread",contentType:"application/json; charset=utf-8",data:JSON.stringify({page:this.page}),dataType:"json",context:this}).done((function(e,n,r){t.page=e.newPage,t.props.history.push(e.redirectUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname,this.page);this.props.history.push(t)}},{key:"render",value:function(){return!1===this.state.hasLoaded?u().createElement(hn,null):!0===this.state.hasLoaded&&0==this.state.topics.data.length?u().createElement("div",{className:"subsection no-content"},"No Unread Posts"):u().createElement(ha,{topics:this.state.topics,viewer:this.state.viewer,topicCountLabel:"Unread ",onPageChanged:this.handleNewPage},u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleMarkTopics},"Mark topics as read"))}}])&&ya(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function wa(e){return wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wa(e)}function Sa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==wa(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==wa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===wa(i)?i:String(i)),r)}var o,i}function Ea(e,t){return Ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ea(e,t)}function Oa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _a(e){return _a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_a(e)}var Pa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ea(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_a(r);if(o){var n=_a(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===wa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Oa(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleSubscribeClick=t.handleSubscribeClick.bind(Oa(t)),t.updateSubscription=t.updateSubscription.bind(Oa(t)),t.getOptionsName=t.getOptionsName.bind(Oa(t)),t.state={period:t.props.period},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({period:e.period})}},{key:"handleSubscribeClick",value:function(e){e>0?this.updateSubscription(!0,e):this.updateSubscription(!1,0)}},{key:"updateSubscription",value:function(e,t){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e,period:t}),dataType:"json",context:this}).done((function(e,n,r){this.setState({period:t},(function(){this.props.afterAction&&this.props.afterAction(t)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"getOptionsName",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t].name;return""}},{key:"render",value:function(){var e=this,t=[];if(this.props.options.forEach((function(n){t.push(u().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,n.value),disabled:n.value==e.state.period},n.name))})),0==this.state.period){var n=this.props.addLabel&&""!=this.props.addLabel?this.props.addLabel:"Watch +";return u().createElement(eo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}n="".concat(this.props.activeLabelPrefix).concat(this.getOptionsName(this.state.period));var r=this.props.removeLabel&&""!=this.props.removeLabel?this.props.removeLabel:"Stop watching -";return t.push(u().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,-1)},r)),u().createElement(eo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}}])&&Sa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Pa.propTypes={consumer:d().string,id:d().number,period:d().number,addLabel:d().string,removeLabel:d().string};const ka=Pa;function ja(e){return ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ja(e)}function Ca(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ta(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ja(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ja(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ja(i)?i:String(i)),r)}var o,i}function xa(e,t,n){return t&&Ta(e.prototype,t),n&&Ta(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ra(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Da(e,t)}function Da(e,t){return Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Da(e,t)}function Na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ia(e);if(t){var o=Ia(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ja(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ma(e)}(this,n)}}function Ma(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ia(e){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ia(e)}var Aa=function(e){Ra(n,e);var t=Na(n);function n(){return Ca(this,n),t.apply(this,arguments)}return xa(n,[{key:"render",value:function(){var e=this,t=[];this.props.forums.data.forEach((function(n,r){t.push(u().createElement(La,{key:"f:"+n.itemID,forum:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.forums.totalRecords," ").concat(this.props.forumCountLabel?this.props.forumCountLabel:"").concat(1==this.props.forums.totalRecords?"forum":"forums");return u().createElement("div",{className:"thread-container subsection"},this.props.forums.totalPages>1&&u().createElement(En,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,n)," ",this.props.children)),u().createElement("div",{className:"control"},u().createElement("span",null,"Subscription Type")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},t),this.props.forums.totalPages>1&&u().createElement(En,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(u().Component);Aa.propTypes={forums:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired};var La=function(e){Ra(n,e);var t=Na(n);function n(e){var r;return Ca(this,n),(r=t.call(this,e)).onSubscriptionChange=r.onSubscriptionChange.bind(Ma(r)),r}return xa(n,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.forum.itemID,e)}},{key:"render",value:function(){var e=this.props.forum,t=!0===e.hasNewContent?" new-content":"",n=0===e.subscription?" deleted":"",r="thread clearfix".concat(t).concat(n);return u().createElement("article",{className:r},u().createElement("div",{className:"topic clearfix"},u().createElement("div",{className:"info"},u().createElement("h4",null,u().createElement("a",{href:e.forum.url},e.forum.name)),u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.topicCount," topics"),u().createElement("span",null,e.postCount," posts"),u().createElement(Yi,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"control"},u().createElement(ka,{consumer:"Forum",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching forum -",afterAction:this.onSubscriptionChange})),u().createElement("div",{className:"contributions"},u().createElement(na,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(u().Component);La.propTypes={forum:d().object.isRequired};const Ba=Aa;function Fa(e){return Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fa(e)}function Ua(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Fa(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Fa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Fa(i)?i:String(i)),r)}var o,i}function Ka(e,t,n){return t&&qa(e.prototype,t),n&&qa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Va(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&za(e,t)}function za(e,t){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},za(e,t)}function Wa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$a(e);if(t){var o=$a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Fa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ha(e)}(this,n)}}function Ha(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $a(e){return $a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$a(e)}var Ga=function(e){Va(n,e);var t=Wa(n);function n(){return Ua(this,n),t.apply(this,arguments)}return Ka(n,[{key:"render",value:function(){var e=this,t=[];this.props.topics.data.forEach((function(n,r){t.push(u().createElement(Ja,{key:"t:"+n.itemID,topic:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return u().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&u().createElement(En,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,n)," ",this.props.children)),u().createElement("div",{className:"control"},u().createElement("span",null,"Subscription Type")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},t),this.props.topics.totalPages>1&&u().createElement(En,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(u().Component);Ga.propTypes={topics:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired,topicCountLabel:d().string};var Ja=function(e){Va(n,e);var t=Wa(n);function n(e){var r;return Ua(this,n),(r=t.call(this,e)).onSubscriptionChange=r.onSubscriptionChange.bind(Ha(r)),r}return Ka(n,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.topic.itemID,e)}},{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=u().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=0===e.subscription?" deleted":"",o="thread clearfix".concat(n).concat(r),i=null;if(e.stickyFL)i=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=u().createElement("span",{className:"moved"},"Link :")}return u().createElement("article",{className:o},u().createElement("div",{className:"topic clearfix"},t,u().createElement("div",{className:"info"},u().createElement("h4",null,null!=i&&i," ",u().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),u().createElement(Yi,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"control"},u().createElement(ka,{consumer:"Topic",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching topic -",afterAction:this.onSubscriptionChange})),u().createElement("div",{className:"contributions"},u().createElement(na,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(u().Component);Ja.propTypes={topic:d().object.isRequired};const Qa=Ga;function Ya(e){return Ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ya(e)}function Xa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ya(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ya(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ya(i)?i:String(i)),r)}var o,i}function Za(e,t){return Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Za(e,t)}function es(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ts(e){return ts=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ts(e)}const ns=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Za(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ts(r);if(o){var n=ts(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ya(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return es(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).addQuerystring=t.addQuerystring.bind(es(t)),t.getData=t.getData.bind(es(t)),t.handleFilterChange=t.handleFilterChange.bind(es(t)),t.handleNewPage=t.handleNewPage.bind(es(t)),t.handleSubscriptionChange=t.handleSubscriptionChange.bind(es(t)),t.hasLoaded=!1,t.mode=t.props.mode,t.parsedQS=on.parse(e.location.search),t.state={pagedData:null,viewer:null,filter:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=on.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this.parsedQS.page?this.parsedQS.page:0,n=this,r="/api/dashboard/subscriptions/".concat(this.mode.toLowerCase()).concat(e.location.search),o=!this.hasLoaded;$.getJSON(r).done((function(e,r,i){if(n.hasLoaded=!0,t>0&&null===e.pagedData.totalRecords){var a=n.addQuerystring(n.props.location.pathname,n.state.filter,t-1);this.props.history.push(a)}else n.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){o||window.scrollTo(0,0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"handleSubscriptionChange",value:function(e,t){for(var n=this.state.pagedData,r=0;r<n.data.length;r++)n.data[r].itemID===e&&(n.data[r].subscription=t);this.setState({pagedData:n})}},{key:"render",value:function(){if(!1===this.hasLoaded)return u().createElement(hn,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return u().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Forums":e=u().createElement(Ba,{forums:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange});break;case"Topics":e=u().createElement(Qa,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange})}return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-filter"},u().createElement("h3",null,"Watched ",this.mode),u().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&Xa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));var rs=o(3674),os=o.n(rs);function is(e){return is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},is(e)}function as(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==is(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==is(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===is(i)?i:String(i)),r)}var o,i}function ss(e,t){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ss(e,t)}function cs(e){return cs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cs(e)}const ls=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ss(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cs(r);if(o){var n=cs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===is(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"cards-container content-section"},this.props.children)}}])&&as(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function us(e){return us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},us(e)}function fs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==us(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==us(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===us(i)?i:String(i)),r)}var o,i}function ps(e,t){return ps=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ps(e,t)}function hs(e){return hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hs(e)}var ds=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ps(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hs(r);if(o){var n=hs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===us(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;this.props.showProfile&&(e=u().createElement("div",{className:"info"},u().createElement(Uo,{profile:this.props.project.profile,showArrow:!0})));var t="text-container".concat(this.props.showProfile?"":" noprofile");return u().createElement("article",{className:"card"},u().createElement("a",{href:this.props.collection.url,className:"card-image"},u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("a",{href:this.props.collection.url,className:t},u().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.title)}),u().createElement("div",{className:"details clearfix"},u().createElement("span",{className:"count"},this.props.collection.itemCount," Videos"))),e)}}])&&fs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ds.propTypes={collection:d().object.isRequired,showProfile:d().bool},ds.defaultProps={showProfile:!1};const ys=ds;function ms(e){return ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(e)}function vs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ms(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ms(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ms(i)?i:String(i)),r)}var o,i}function bs(e,t){return bs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bs(e,t)}function gs(e){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gs(e)}var ws=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bs(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gs(r);if(o){var n=gs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ms(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e,t=u().createElement("div",{className:"loader"},"Loading ..."),n="Gallery"==this.props.mode,r=this;return e=null==this.props.galleryData||0==this.props.galleryData.length?u().createElement("div",null,"No Projects Found"):this.props.galleryData.map((function(e,t){switch(r.props.galleryOf){case"Project":return u().createElement(Ho,{key:e.id,project:e,showProfile:n});case"Collection":return u().createElement(ys,{key:e.id,collection:e})}})),e=!0===this.props.loadMoreClicked?u().createElement(os(),{pageStart:0,loadMore:this.props.loadMore,hasMore:this.props.hasMore,threshold:this.props.scrollThreshold,loader:t},e):u().createElement("div",null,e),u().createElement("div",{className:"subsection filter-results"},u().createElement(ls,null,e),this.props.children)}}])&&vs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ws.propTypes={mode:d().string,galleryData:d().array.isRequired,galleryOf:d().string,infiniteScroll:d().bool,scrollThreshold:d().number,hasMore:d().bool,loadMore:d().func,loadMoreClicked:d().bool},ws.defaultProps={mode:"Gallery",scrollThreshold:30,hasMore:!1,loadMoreClicked:!1};const Ss=ws;function Es(e){return Es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Es(e)}function Os(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Es(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Es(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Es(i)?i:String(i)),r)}var o,i}function _s(e,t){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_s(e,t)}function Ps(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ks(e){return ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ks(e)}var js=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_s(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ks(r);if(o){var n=ks(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Es(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ps(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onBackButtonEvent=t.onBackButtonEvent.bind(Ps(t)),t.buildQueryString=t.buildQueryString.bind(Ps(t)),t.loadMore=t.loadMore.bind(Ps(t)),t.handleFilterChange=t.handleFilterChange.bind(Ps(t)),t.handleLoadMoreClick=t.handleLoadMoreClick.bind(Ps(t)),t.getData=t.getData.bind(Ps(t)),t.hasMore=t.props.galleryView.gallery.hasMore,t.filterHistory=[],t.state={galleryData:t.props.galleryView.gallery.data,galleryOf:t.props.galleryView.galleryOf,filter:t.props.galleryView.filter,loadMoreClicked:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){window.onpopstate=this.onBackButtonEvent}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():this.props.galleryView.filter;this.getData(t,null,!1)}},{key:"buildQueryString",value:function(e,t){var n=this.props.qs?this.props.qs.slice():[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&e[r].value&&n.push("".concat(r,"=").concat(e[r].value));t&&n.push("p=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"loadMore",value:function(e){this.getData(this.state.filter,e,!1)}},{key:"handleFilterChange",value:function(e){this.getData(e,null,!0)}},{key:"handleLoadMoreClick",value:function(){this.setState({loadMoreClicked:!0})}},{key:"getData",value:function(e,t,n){var r=this.buildQueryString(e,t),o="/api/".concat(this.props.section,"/get").concat(r),i="/".concat(this.props.section).concat(r),a=this;$.getJSON(o,(function(r){var o;a.hasMore=!(null==r||!r.hasMore)&&r.hasMore;var s=a.state.loadMoreClicked;null===t?(o=r.data,s=!1):o=null!=r&&r.data.length>0?a.state.data.concat(r.data):a.state.data,!0===a.props.updateHistory&&!0===n&&(a.state.filter!=a.props.galleryView.filter&&a.filterHistory.push(JSON.parse(JSON.stringify(a.state.filter))),history.pushState(null,null,i)),a.setState({galleryData:o,filter:e,loadMoreClicked:s})}))}},{key:"render",value:function(){return u().createElement("div",null,u().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange}),u().createElement(Ss,{galleryData:this.state.galleryData,galleryOf:this.state.galleryOf,mode:this.props.mode,hasMore:this.hasMore,loadMore:this.loadMore,scrollTheshold:this.props.scrollThreshold,loadMoreClicked:this.state.loadMoreClicked},this.hasMore&&!1===this.state.loadMoreClicked&&u().createElement("button",{className:"load-more",onClick:this.handleLoadMoreClick},"Load more")))}}])&&Os(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);js.propTypes={mode:d().string,galleryView:d().object.isRequired,section:d().string.isRequired,qs:d().array,updateHistory:d().bool,infiniteScroll:d().bool,scrollThreshold:d().number},js.defaultProps={mode:"Gallery",updateHistory:!0,scrollThreshold:250};const Cs=js;function Ts(e){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ts(e)}function xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ts(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ts(i)?i:String(i)),r)}var o,i}function Ds(e,t,n){return t&&Rs(e.prototype,t),n&&Rs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ns(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ms(e,t)}function Ms(e,t){return Ms=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ms(e,t)}function Is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=As(e);if(t){var o=As(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ts(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function As(e){return As=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},As(e)}u().Component;var Ls=function(e){Ns(n,e);var t=Is(n);function n(e){var r;return xs(this,n),(r=t.call(this,e)).subsData=[{type:"ClientRoute",children:null,text:"Forums",url:"/dashboard/watched/forums"},{type:"ClientRoute",children:null,text:"Topics",url:"/dashboard/watched/topics"}],r.navData=[{type:"ClientRoute",children:null,text:"Projects",url:"/dashboard"},{type:"ClientRoute",children:null,text:"Unread Posts",url:"/dashboard/unread"},{type:"Group",children:r.subsData,text:"Watched",url:""},{type:"ClientRoute",children:null,text:"Preferences",url:"/dashboard/preferences"}],r}return Ds(n,[{key:"render",value:function(){return u().createElement("div",null,u().createElement(Kr,{profile:this.props.profile}),u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Dashboard | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(Qe,null,u().createElement(Tr,{data:this.navData}),u().createElement(Bs,null))))}}]),n}(u().Component),Bs=Je(function(e){Ns(n,e);var t=Is(n);function n(e){return xs(this,n),t.call(this,e)}return Ds(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(Ge,null,u().createElement($e,{exact:!0,path:"/dashboard"},u().createElement(dr,{marginTop:!0,marginBottom:!0},u().createElement(Zo,null))),u().createElement($e,{path:"/dashboard/unread"},u().createElement(ga,null)),u().createElement($e,{path:"/dashboard/watched/forums"},u().createElement(ns,{mode:"Forums"})),u().createElement($e,{path:"/dashboard/watched/topics"},u().createElement(ns,{mode:"Topics"})),u().createElement($e,{path:"/dashboard/preferences"},u().createElement(Wi,null)))}}]),n}(u().Component));const Fs=Ls;function Us(e){return Us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Us(e)}function qs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Us(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Us(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Us(i)?i:String(i)),r)}var o,i}function Ks(e,t){return Ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ks(e,t)}function Vs(e){return Vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vs(e)}const zs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ks(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Vs(r);if(o){var n=Vs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Us(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"page-error"},u().createElement("div",{dangerouslySetInnerHTML:{__html:this.props.xhr.responseJSON.errorMessage}}),401==this.props.xhr.status&&u().createElement("div",null,"You will be automatically redirected to ",u().createElement("a",{href:this.props.xhr.responseJSON.redirectUrl},"Sign-In")),this.props.returnUrl&&u().createElement("div",null,u().createElement("a",{href:this.props.returnUrl.url},this.props.returnUrl.text)))}}])&&qs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Ws(e){return Ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ws(e)}function Hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ws(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ws(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ws(i)?i:String(i)),r)}var o,i}function $s(e,t){return $s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$s(e,t)}function Gs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Js(e){return Js=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Js(e)}const Qs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$s(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Js(r);if(o){var n=Js(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ws(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Gs(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).markRoot=t.markRoot.bind(Gs(t)),t}return t=a,(n=[{key:"markRoot",value:function(){$.ajax({type:"POST",url:"/api/forum/markroot",contentType:"application/json; charset=utf-8",data:JSON.stringify({rootID:this.props.rootID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("button",{type:"button",className:"btn-link",onClick:this.markRoot},"Mark forums as read")}}])&&Hs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Ys(e){return Ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ys(e)}function Xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ys(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ys(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ys(i)?i:String(i)),r)}var o,i}function ec(e,t,n){return t&&Zs(e.prototype,t),n&&Zs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nc(e,t)}function nc(e,t){return nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nc(e,t)}function rc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ic(e);if(t){var o=ic(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ys(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oc(e)}(this,n)}}function oc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ic(e){return ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ic(e)}var ac=function(e){tc(n,e);var t=rc(n);function n(e){var r;return Xs(this,n),(r=t.call(this,e)).setLocal=r.setLocal.bind(oc(r)),r.buildUrl=r.buildUrl.bind(oc(r)),r.reload=r.reload.bind(oc(r)),r.getData=r.getData.bind(oc(r)),r.createGroup=r.createGroup.bind(oc(r)),r.isGroup=r.isGroup.bind(oc(r)),r.notGroup=r.notGroup.bind(oc(r)),r.Modes={Root:"Root",Group:"Group"},r.mode=r.Modes.Root,r.id=null,r.root=null,r.ajaxError=null,r.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,rootID:null,rootUrl:null,forumList:null,viewer:null},r}return ec(n,[{key:"componentDidMount",value:function(){this.setLocal(this.props),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setLocal(e),this.getData()}},{key:"setLocal",value:function(e){e.match.params.id&&e.match.path.startsWith("/discuss/group")?(this.id=e.match.params.id,this.mode=this.Modes.Group):(this.root=e.match.params.root?e.match.params.root:"",this.mode=this.Modes.Root)}},{key:"buildUrl",value:function(){var e="/api/discuss/";switch(this.mode){case this.Modes.Group:e+="group/"+this.id;break;case this.Modes.Root:e+=this.root}return e}},{key:"reload",value:function(){this.getData()}},{key:"getData",value:function(e){var t=this;e=this.buildUrl(),$.getJSON(e).done((function(e,n,r){t.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,rootID:e.rootID,rootUrl:e.rootUrl,forumList:e.forumList,viewer:e.viewer})})).fail((function(e,n,r){t.ajaxError=e,t.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"createGroup",value:function(e,t){var n=this,r=[],o=[];!0===t&&this.state.viewer.isSignedIn&&o.push(u().createElement(Qs,{key:0,rootID:this.state.rootID,afterAction:this.reload})),r.push(u().createElement(sc,{key:e.forumID,group:e,childrenData:e.children.filter(this.notGroup),titleLink:this.mode==this.Modes.Root},o));var i=e.children.filter(this.isGroup);if(i.length>0){var a=i.map((function(e,t){return n.createGroup(e,!1)}));r=r.concat(a)}return r}},{key:"isGroup",value:function(e){return"Group"==e.type}},{key:"notGroup",value:function(e){return"Group"!=e.type}},{key:"render",value:function(){var e=this;if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Error)return u().createElement(zs,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}});if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading)return u().createElement(hn,null);var t=this.state.forumList.map((function(t,n){return e.createGroup(t,0==n)})),n=null!=this.state.forumList[0].metaDescription?this.state.forumList[0].metaDescription:this.state.forumList[0].description;return u().createElement("div",null,u().createElement(rn,null,u().createElement("title",null,this.state.forumList[0].name),null!=n&&""!=n&&u().createElement("meta",{name:"description",content:n}),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.rootUrl)})),u().createElement("div",{className:"subsection"},!1,t))}}]),n}(u().Component),sc=function(e){tc(n,e);var t=rc(n);function n(){return Xs(this,n),t.apply(this,arguments)}return ec(n,[{key:"render",value:function(){var e=[];return this.props.childrenData.forEach((function(t,n){switch(t.type){case"Discussion":e.push(u().createElement(lc,{key:t.forumID,forum:t}));break;case"Gallery":e.push(u().createElement(uc,{key:t.forumID,forum:t}));break;case"Link":e.push(u().createElement(cc,{key:t.forumID,forum:t}))}})),u().createElement("div",{className:"discussion"},u().createElement("div",{className:"group"},u().createElement("div",{className:"group-name clearfix"},this.props.children,u().createElement("h3",null,this.props.titleLink?u().createElement(nt,{to:this.props.group.url},this.props.group.name):this.props.group.name)),u().createElement("div",{className:"forums"},e)))}}]),n}(u().Component),cc=function(e){tc(n,e);var t=rc(n);function n(){return Xs(this,n),t.apply(this,arguments)}return ec(n,[{key:"render",value:function(){return u().createElement("article",{className:"discuss clearfix"},u().createElement("a",{href:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)))}}]),n}(u().Component),lc=function(e){tc(n,e);var t=rc(n);function n(){return Xs(this,n),t.apply(this,arguments)}return ec(n,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n="discuss clearfix".concat(e).concat(t);return u().createElement("article",{className:n},u().createElement(nt,{to:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)))}}]),n}(u().Component),uc=function(e){tc(n,e);var t=rc(n);function n(){return Xs(this,n),t.apply(this,arguments)}return ec(n,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n=null!=this.props.forum.imageStrip?" discuss-gallery ":"",r="discuss clearfix".concat(n).concat(e).concat(t);return u().createElement("article",{className:r},u().createElement(nt,{to:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)),u().createElement(fc,{imageStrip:this.props.forum.imageStrip}))}}]),n}(u().Component),fc=function(e){tc(n,e);var t=rc(n);function n(){return Xs(this,n),t.apply(this,arguments)}return ec(n,[{key:"render",value:function(){if(!this.props.imageStrip)return null;var e=[];return this.props.imageStrip.forEach((function(t,n){e.push(u().createElement("li",{key:t.topicID},u().createElement("a",{href:t.url,style:{backgroundImage:"url("+t.thumbUrl+")"}})))})),u().createElement("ul",{className:"discuss-carousel"},e)}}]),n}(u().Component);const pc=ac;function hc(e){return hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hc(e)}function dc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==hc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==hc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===hc(i)?i:String(i)),r)}var o,i}function yc(e,t){return yc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yc(e,t)}function mc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vc(e){return vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vc(e)}const bc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vc(r);if(o){var n=vc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===hc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mc(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleMarkForum=t.handleMarkForum.bind(mc(t)),t}return t=a,(n=[{key:"handleMarkForum",value:function(e){$.ajax({type:"POST",url:"/api/forum/mark",contentType:"application/json; charset=utf-8",data:JSON.stringify({forumID:this.props.forumID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("span",null,u().createElement("button",{type:"button",className:"btn-link mark-forum",onClick:this.handleMarkForum},"Mark topics as read"))}}])&&dc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function gc(e){return gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gc(e)}function wc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==gc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==gc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===gc(i)?i:String(i)),r)}var o,i}function Sc(e,t){return Sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sc(e,t)}function Ec(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oc(e){return Oc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oc(e)}const _c=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Oc(r);if(o){var n=Oc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===gc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ec(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleClick=t.handleClick.bind(Ec(t)),t}return t=a,(n=[{key:"handleClick",value:function(){this.props.history.push("/discuss/topic/new?id=".concat(this.props.forumID))}},{key:"render",value:function(){return u().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleClick},"Start new discussion")}}])&&wc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function Pc(e){return Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pc(e)}function kc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Pc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Pc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Pc(i)?i:String(i)),r)}var o,i}function jc(e,t){return jc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jc(e,t)}function Cc(e){return Cc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cc(e)}var Tc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cc(r);if(o){var n=Cc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.forum;return u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},u().createElement("div",{className:"with-button"},e.show.newTopic&&!this.props.viewer.isMobile&&u().createElement(_c,{forumID:e.forumID}),u().createElement("h2",{className:"brandDot"},e.name)),u().createElement("div",{className:"forum-meta"},e.show.subscription&&u().createElement(ka,{consumer:"Forum",id:e.forumID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],addLabel:"Watch forum +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching forum -"}),e.show.markAsRead&&u().createElement(bc,{forumID:e.forumID,afterAction:this.props.afterAction}),u().createElement(Yi,{displayMode:"Forum",path:e.path})))))}}])&&kc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Tc.propTypes={forum:d().object.isRequired};const xc=Tc;function Rc(e){return Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rc(e)}function Dc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rc(i)?i:String(i)),r)}var o,i}function Nc(e,t){return Nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nc(e,t)}function Mc(e){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mc(e)}var Ic=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mc(r);if(o){var n=Mc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.topic,t="thread",n=null;"gallery"==e.type.toLowerCase()&&(t="thread gallery",null!=e.thumbUrl&&(n=u().createElement(nt,{to:e.url,className:"thumb"},u().createElement("img",{src:e.thumbUrl}))));var r=!0===e.viewer.hasNewContent?" new-content":"",o=!0===e.viewer.isSubscribed?" subscribed":"",i="".concat(t," clearfix").concat(r).concat(o),a=null;if(e.stickyFL)a=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":a=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":a=null!=e.productIcon?u().createElement("img",{src:e.productIcon,alt:"Promoted :"}):u().createElement("span",{className:"moved"},"Promoted :")}return u().createElement("article",{className:i},n,u().createElement("div",{className:"topic"},u().createElement("div",{className:"info"},u().createElement("h4",null,null!=a&&a," ",u().createElement(nt,{to:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement(nt,{to:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement(nt,{to:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"))),u().createElement("div",{className:"contributions"},u().createElement(na,{data:e.addedBy,addClass:" started"})),u().createElement("div",{className:"contributions mobile-hidden"},u().createElement(na,{data:e.lastPostBy,addClass:" latest"}))))}}])&&Dc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ic.propTypes={topic:d().object.isRequired};const Ac=Ic;function Lc(e){return Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lc(e)}function Bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Lc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Lc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Lc(i)?i:String(i)),r)}var o,i}function Fc(e,t){return Fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fc(e,t)}function Uc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qc(e){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qc(e)}const Kc=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qc(r);if(o){var n=qc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Lc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uc(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(Uc(t)),t.buildBaseUrl=t.buildBaseUrl.bind(Uc(t)),t.addQuerystring=t.addQuerystring.bind(Uc(t)),t.getData=t.getData.bind(Uc(t)),t.handleNewPage=t.handleNewPage.bind(Uc(t)),t.parsedQS=on.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.days=t.parsedQS.days?t.parsedQS.days:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topics:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData(this.page)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=on.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.days=this.parsedQS.days?this.parsedQS.days:null,this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/forum/"+this.props.match.params.id;return this.addQuerystring(e,this.page,this.days)}},{key:"buildBaseUrl",value:function(){var e=this.props.location.pathname;return this.addQuerystring(e,null,this.days)}},{key:"addQuerystring",value:function(e,t,n){var r=[];return t&&t>0&&r.push("page="+t),null!==n&&r.push("days="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topics:t.topics,viewer:t.viewer,nav:t.nav},(function(){sn.updateScrollPosition(!0)}))})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,e,this.days),this.props.history.push(t)}},{key:"render",value:function(){var e=this.buildBaseUrl();if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics)return u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(hn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(zs,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}}));var t="thread-container".concat("gallery"==this.state.forum.type.toLowerCase()?" gallery":""),n=null;if(this.state.topics.data.length>0){var r=[];this.state.topics.data.forEach((function(e,t){r.push(u().createElement(Ac,{key:e.topicID,topic:e}))})),n=u().createElement("div",{className:t},this.state.topics.totalPages>1&&u().createElement(En,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage,enableKeyEvents:!0,baseUrl:e}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,this.state.topics.totalRecords," ",1==this.state.topics.totalRecords?"Topic":"Topics"))),u().createElement("div",{className:"sort"},u().createElement("span",null,"Started")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},r),this.state.topics.totalPages>1&&u().createElement(En,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage,baseUrl:e}))}else n=u().createElement("div",{className:"subsection no-content"},"No topics available.  Start the conversation.");var o="".concat(window.location.origin).concat(this.state.forum.url);return this.page>0&&(o+="?page=".concat(this.page)),u().createElement("div",null,u().createElement(rn,null,u().createElement("title",null,this.state.forum.name),u().createElement("link",{rel:"canonical",href:o})),u().createElement(xc,{forum:this.state.forum,viewer:this.state.viewer,afterAction:this.getData}),n,this.state.forum.show.newTopic&&u().createElement("div",{className:"new-content-button"},u().createElement(_c,{forumID:this.state.forum.forumID})))}}])&&Bc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function Vc(e){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(e)}function zc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Vc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Vc(i)?i:String(i)),r)}var o,i}function Wc(e,t){return Wc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wc(e,t)}function Hc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $c(e){return $c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$c(e)}const Gc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$c(r);if(o){var n=$c(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Vc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hc(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(Hc(t)),t.validate=t.validate.bind(Hc(t)),t.valid=t.valid.bind(Hc(t)),t.getValue=t.getValue.bind(Hc(t)),t.handleCancel=t.handleCancel.bind(Hc(t)),t.handleSubmit=t.handleSubmit.bind(Hc(t)),t.handleTitleChange=t.handleTitleChange.bind(Hc(t)),t.state={isValid:!0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/discuss/topic/edit?id="+this.props.topic.topicID).done((function(t,n,r){e.refs.title.focus()})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){if(this.validate()){var e=this.getValue(),t={topicID:this.props.topic.topicID,title:e};$.ajax({type:"POST",url:"/api/discuss/topic/edit?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.props.onSubmit(e.title)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"handleTitleChange",value:function(){this.setState({isValid:this.valid()})}},{key:"render",value:function(){var e="form-group".concat(this.state.isValid?"":" has-error"),t=null;return this.state.isValid||(t=u().createElement(fi,{message:"title required and must be 3 or more characters in length"})),u().createElement("div",{className:e},u().createElement("div",{className:"input-group"},u().createElement("input",{name:"title",ref:"title",defaultValue:this.props.topic.text,className:"form-control",style:{width:"100%"},onChange:this.handleTitleChange}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",disabled:!this.state.isValid,onClick:this.handleSubmit},"Submit"))),t)}}])&&zc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Jc(e){return Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jc(e)}function Qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Jc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Jc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Jc(i)?i:String(i)),r)}var o,i}function Xc(e,t,n){return t&&Yc(e.prototype,t),n&&Yc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&el(e,t)}function el(e,t){return el=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},el(e,t)}function tl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=rl(e);if(t){var o=rl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Jc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nl(e)}(this,n)}}function nl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rl(e){return rl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rl(e)}var ol=function(e){Zc(n,e);var t=tl(n);function n(e){var r;return Qc(this,n),(r=t.call(this,e)).handleClose=r.handleClose.bind(nl(r)),r.handleToggle=r.handleToggle.bind(nl(r)),r.state={showLinks:!1},r}return Xc(n,[{key:"handleClose",value:function(e){e.preventDefault(),this.state.showLinks&&e.target!=this.refs.action&&this.setState({showLinks:!1})}},{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({showLinks:!this.state.showLinks})}},{key:"render",value:function(){return u().createElement("span",{id:"share"},u().createElement("button",{ref:"action",type:"button",className:"btn-link share",onClick:this.handleToggle},"Share"),!0===this.state.showLinks&&u().createElement(il,{onClose:this.handleClose}))}}]),n}(u().Component),il=function(){var e=function(e){Zc(n,e);var t=tl(n);function n(e){var r;return Qc(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(nl(r)),r}return Xc(n,[{key:"UNSAFE_componentWillMount",value:function(){this.url="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname)}},{key:"handleClickOutside",value:function(e){this.props.onClose(e)}},{key:"render",value:function(){var e="https://www.facebook.com/sharer/sharer.php?u=".concat(this.url),t="https://twitter.com/intent/tweet?url=".concat(this.url),n="https://www.linkedin.com/shareArticle?mini=true&url=".concat(this.url);return u().createElement("nav",{className:"social"},u().createElement("a",{href:e,target:"_blank"},u().createElement("span",{className:"facebook"},"Facebook")),u().createElement("a",{href:t,target:"_blank"},u().createElement("span",{className:"twitter"},"Twitter")),u().createElement("a",{href:n,target:"_blank"},u().createElement("span",{className:"linkedin"},"Linkedin")))}}]),n}(u().Component);return mr()(e)}();const al=ol;function sl(e){return sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sl(e)}function cl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==sl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===sl(i)?i:String(i)),r)}var o,i}function ll(e,t){return ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ll(e,t)}function ul(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fl(e){return fl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fl(e)}var pl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ll(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fl(r);if(o){var n=fl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ul(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEdit=t.handleEdit.bind(ul(t)),t.handleCancelEdit=t.handleCancelEdit.bind(ul(t)),t.handleSubmitEdit=t.handleSubmitEdit.bind(ul(t)),t.viewMode={TopicView:"TopicView",PostView:"PostView"},t.state={topic:t.props.topic,showEdit:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({topic:e.topic})}},{key:"handleEdit",value:function(){this.setState({showEdit:!0})}},{key:"handleCancelEdit",value:function(){this.setState({showEdit:!1})}},{key:"handleSubmitEdit",value:function(e){var t=this.state.topic;t.text=e,this.setState({showEdit:!1,topic:t})}},{key:"render",value:function(){var e=this.state.topic;return u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},this.state.showEdit?u().createElement(Gc,{ref:"title",topic:e,onSubmit:this.handleSubmitEdit,onCancel:this.handleCancelEdit}):u().createElement("h2",null,this.props.viewMode===this.viewMode.TopicView&&e.text,this.props.viewMode===this.viewMode.PostView&&u().createElement("span",null,"Post from: ",u().createElement(nt,{to:"".concat(e.url,"?mode=Post&postID=").concat(this.props.post.postID,"#").concat(this.props.post.postID)},e.text)),this.props.viewMode===this.viewMode.TopicView&&e.viewer.canEdit&&u().createElement("button",{type:"button",className:"btn-link light icon icon-after icon-color-white icon-edit",onClick:this.handleEdit},"Edit Title")),null!=e.addedBy&&null!=e.addedBy.profile&&u().createElement(Uo,{profile:e.addedBy.profile}),u().createElement("div",{className:"forum-meta"},e.show.subscription&&u().createElement(ka,{consumer:"Topic",id:e.topicID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],addLabel:"Watch topic +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching topic -"}),u().createElement(al,null),u().createElement("time",null,e.addedBy.displayDT),u().createElement(Yi,{displayMode:"Topic",path:this.props.forumPath})),this.props.children)))}}])&&cl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);pl.propTypes={topic:d().object,forumPath:d().array},pl.defaultProps={viewMode:"TopicView"};const hl=pl;function dl(e){return dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dl(e)}function yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==dl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===dl(i)?i:String(i)),r)}var o,i}function ml(e,t){return ml=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ml(e,t)}function vl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bl(e){return bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bl(e)}var gl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ml(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bl(r);if(o){var n=bl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===dl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vl(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(vl(t)),t.getValue=t.getValue.bind(vl(t)),t.setValue=t.setValue.bind(vl(t)),t}return t=a,(n=[{key:"handleChange",value:function(){this.props.onChange&&this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"setValue",value:function(e){this.refs.select.value=e}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),u().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group no-help".concat(this.props.isInline?" form-inline":"");return u().createElement("div",{className:t},this.props.label&&u().createElement("label",{className:"static"},this.props.label),u().createElement("select",{ref:"select",defaultValue:this.props.value,onChange:this.handleChange},e),this.props.children)}}])&&yl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);gl.propTypes={label:d().string,isInline:d().bool,options:d().array.isRequired,onChange:d().func,value:d().oneOfType([d().string,d().number])},gl.defaultProps={isInline:!1};const wl=gl;function Sl(e){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sl(e)}function El(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ol(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Sl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Sl(i)?i:String(i)),r)}var o,i}function _l(e,t,n){return t&&Ol(e.prototype,t),n&&Ol(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pl(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kl(e,t)}function kl(e,t){return kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kl(e,t)}function jl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Tl(e);if(t){var o=Tl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Sl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cl(e)}(this,n)}}function Cl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tl(e){return Tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tl(e)}var xl=function(e){Pl(n,e);var t=jl(n);function n(e){var r;return El(this,n),(r=t.call(this,e)).setup=r.setup.bind(Cl(r)),r.handleEditClick=r.handleEditClick.bind(Cl(r)),r.handleEditCancel=r.handleEditCancel.bind(Cl(r)),r.handleEditComplete=r.handleEditComplete.bind(Cl(r)),r.handleSpamClick=r.handleSpamClick.bind(Cl(r)),r.handleSpamCancel=r.handleSpamCancel.bind(Cl(r)),r.handleSpamComplete=r.handleSpamComplete.bind(Cl(r)),r.state={showPanel:!1,showEdit:!1,showSpam:!1},r}return _l(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0,showSpam:!1})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"handleSpamClick",value:function(){this.setState({showEdit:!1,showSpam:!0})}},{key:"handleSpamCancel",value:function(){this.setState({showSpam:!1})}},{key:"handleSpamComplete",value:function(){this.setState({showSpam:!1})}},{key:"render",value:function(){return this.state.showPanel?u().createElement("div",{className:"topic-editor clearfix"},u().createElement("ul",{className:"list-inline"},u().createElement("li",null,u().createElement("button",{type:"button",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Topic")),u().createElement("li",null,u().createElement("button",{type:"button",onClick:this.handleSpamClick,disabled:this.state.showSpam},"Mark As Spam - Close Topic and Lock Creator's Account")),this.props.topic.viewer.eMessage&&u().createElement("li",{className:"emessage"},this.props.topic.viewer.eMessage)),this.state.showEdit&&u().createElement(Dl,{topic:this.props.topic,onCancel:this.handleEditCancel,onComplete:this.handleEditComplete}),this.state.showSpam&&u().createElement(Rl,{topic:this.props.topic,onCancel:this.handleSpamCancel,onComplete:this.handleSpamComplete})):null}}]),n}(u().Component),Rl=Je(function(e){Pl(n,e);var t=jl(n);function n(e){var r;return El(this,n),(r=t.call(this,e)).handleCancel=r.handleCancel.bind(Cl(r)),r.handleSubmit=r.handleSubmit.bind(Cl(r)),r}return _l(n,[{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/spam-topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("div",{className:"report clearfix"},u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement("h4",null,"Warning! Only Use For SPAM!"),u().createElement("p",null,"Are You sure this is SPAM?  Click 'Submit' to CLOSE the topic and LOCK the submitters account."))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}]),n}(u().Component)),Dl=Je(function(e){Pl(n,e);var t=jl(n);function n(e){var r;return El(this,n),(r=t.call(this,e)).setup=r.setup.bind(Cl(r)),r.handleRootForumChange=r.handleRootForumChange.bind(Cl(r)),r.handleStickyChange=r.handleStickyChange.bind(Cl(r)),r.handleForumChange=r.handleForumChange.bind(Cl(r)),r.handlePlaceholderChange=r.handlePlaceholderChange.bind(Cl(r)),r.handleStatusChange=r.handleStatusChange.bind(Cl(r)),r.handleClosePostsChange=r.handleClosePostsChange.bind(Cl(r)),r.handleCancel=r.handleCancel.bind(Cl(r)),r.handleSubmit=r.handleSubmit.bind(Cl(r)),r.state={form:null,currentForumID:null},r}return _l(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic?id="+this.props.topic.topicID).done((function(t,n,r){e.setState({form:t,currentForumID:t.forumID})}))}},{key:"handleRootForumChange",value:function(e){var t=this;$.getJSON("/api/forum/e/forum-list?id="+e).done((function(n,r,o){var i=t.state.form;i.rootID=e,i.forumOptions=n,t.setState({form:i},(function(){var e=t.refs.forum.getValue(),n=t.state.form;e!=n.forumID&&(n.forumID=e,t.setState({form:n}))}))}))}},{key:"handleStickyChange",value:function(e){var t=this.state.form;t.stickyFL=!t.stickyFL,this.setState({form:t})}},{key:"handleForumChange",value:function(e){var t=this.state.form;e!=t.forumID&&(t.forumID=e,this.setState({form:t}))}},{key:"handlePlaceholderChange",value:function(e){if(this.state.form.forumID!=this.state.currentForumID){var t=this.state.form;t.leaveMovedPlaceholderFL=!t.leaveMovedPlaceholderFL,this.setState({form:t})}}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleClosePostsChange",value:function(e){if("200"==this.state.form.status){var t=this.state.form;t.closePostsFL=!t.closePostsFL,this.setState({form:t})}}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.state.form}),dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return null===this.state.form?null:u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"stickyFL",name:"stickyFL",checked:this.state.form.stickyFL,onChange:this.handleStickyChange}),u().createElement("label",{htmlFor:"stickyFL"},"Sticky Topic")))),u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement(wl,{label:"Topic Status",options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"closePostsFL",name:"closePostsFL",checked:this.state.form.closePostsFL,disabled:"200"!=this.state.form.status,onChange:this.handleClosePostsChange}),u().createElement("label",{htmlFor:"closePostsFL"},"Close all posts in topic"))))),u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-md-6"},u().createElement("h3",null,"Move Topic"),u().createElement(wl,{label:"Root",options:this.state.form.rootForumOptions,value:this.state.form.rootID,onChange:this.handleRootForumChange})),u().createElement("div",{className:"col-md-6"},u().createElement("h3",null," "),u().createElement(wl,{ref:"forum",label:"Forum",options:this.state.form.forumOptions,value:this.state.form.forumID,onChange:this.handleForumChange},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"leaveMovedPlaceholderFL",name:"leaveMovedPlaceholderFL",checked:this.state.form.leaveMovedPlaceholderFL,disabled:this.state.form.forumID==this.state.currentForumID,onChange:this.handlePlaceholderChange}),u().createElement("label",{htmlFor:"leaveMovedPlaceholderFL"},"Leave moved topic placeholder"))))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}]),n}(u().Component));const Nl=xl;function Ml(e){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ml(e)}function Il(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ml(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ml(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ml(i)?i:String(i)),r)}var o,i}function Al(e,t){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Al(e,t)}function Ll(e){return Ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ll(e)}var Bl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Al(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ll(r);if(o){var n=Ll(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r="profile".concat(t).concat(n),o=e.join(", ");return u().createElement("a",{href:this.props.profile.url,className:r,title:o},u().createElement("span",{className:"profile-name"},this.props.profile.name),u().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}))}}])&&Il(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Bl.propTypes={profile:d().object.isRequired};const Fl=Bl;function Ul(e){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(e)}function ql(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ul(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ul(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ul(i)?i:String(i)),r)}var o,i}function Kl(e,t){return Kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kl(e,t)}function Vl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zl(e){return zl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zl(e)}var Wl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kl(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zl(r);if(o){var n=zl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ul(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vl(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(Vl(t)),t.state={post:t.props.post,viewer:t.props.viewer},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/signal",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:"Post",id:this.props.id,value:this.state.viewer?null:1}),dataType:"json",context:this}).then((function(e){this.setState({viewer:e.value,post:e.result})}))}},{key:"render",value:function(){var e="btn-link user-action like".concat(null!==this.state.viewer?" active":""),t=(this.state.post>0?"+":"")+this.state.post;return this.props.allowRating?u().createElement("div",{className:"rating"},u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"),u().createElement("span",null,t)):u().createElement("div",{className:"rating metrics dark"},u().createElement("span",{className:"like"},t))}}])&&ql(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Wl.propTypes={id:d().number.isRequired,post:d().number,viewer:d().number,allowRating:d().bool},Wl.defaultProps={post:0,viewer:null,allowRating:!1};const Hl=Wl;function $l(e){return $l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$l(e)}function Gl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==$l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==$l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===$l(i)?i:String(i)),r)}var o,i}function Jl(e,t){return Jl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jl(e,t)}function Ql(e){return Ql=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ql(e)}const Yl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jl(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ql(r);if(o){var n=Ql(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",null,u().createElement("p",{dangerouslySetInnerHTML:sn.createMarkup(this.props.report.comment)}),u().createElement("div",null,u().createElement("span",null,this.props.report.reportType),u().createElement("span",null,this.props.report.product),u().createElement("span",null,this.props.report.addedBy),u().createElement("span",null,this.props.report.addedDT)))}}])&&Gl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Xl(e){return Xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xl(e)}function Zl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Xl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Xl(i)?i:String(i)),r)}var o,i}function eu(e,t){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eu(e,t)}function tu(e){return tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tu(e)}const nu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tu(r);if(o){var n=tu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Xl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return null==this.props.reports?null:u().createElement("div",{className:"post-reports"},this.props.reports.map((function(e,t){return u().createElement(Yl,{key:t,report:e})})))}}])&&Zl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ru(e){return ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ru(e)}function ou(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ru(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ru(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ru(i)?i:String(i)),r)}var o,i}function iu(e,t){return iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iu(e,t)}function au(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},su(e)}const cu=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=su(r);if(o){var n=su(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ru(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return au(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleSubmit=t.handleSubmit.bind(au(t)),t.handleChange=t.handleChange.bind(au(t)),t.state={type:null,submitDisabled:!1},t}return t=a,(n=[{key:"handleSubmit",value:function(){var e={postID:this.props.postID,type:this.refs.type.value,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message),e.forceRefresh&&this.props.history.push(e.refreshUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handleChange",value:function(){this.setState({type:this.refs.type.value,submitDisabled:"2"==this.refs.type.value&&this.refs.report.value.length<3})}},{key:"render",value:function(){var e=null;return"2"==this.state.type&&(e=u().createElement(fi,{message:'Reason required for "other" reports'})),u().createElement("div",{className:"post-report report clearfix"},u().createElement("h4",null,"THIS FORM IS FOR REPORTING BAD POSTS, COMMENTS AND SPAM TO THE MODERATORS!"),u().createElement("p",null,'Please use the "REPLY" button to add a new post to a topic.'),u().createElement("p",null,"Examples for using this reporting feature would be if the post contains foul or offensive language, spam, or abusive language towards another forum member."),u().createElement("p",null,"We try to monitor all of the topics & posts in our forum, but sometimes something can slip through that may offend someone."),u().createElement("p",null,"Thank you for your help."),u().createElement("div",{className:"form-group"},u().createElement("label",{className:"static"},"Report Type"),u().createElement("select",{name:"type",ref:"type",onChange:this.handleChange,className:"form-control"},u().createElement("option",{value:"Spam"},"Spam"),u().createElement("option",{value:"Other"},"Other"))),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Reason For Reporting"),u().createElement("textarea",{name:"report",ref:"report",onChange:this.handleChange,className:"form-control"}),e),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit")))}}])&&ou(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function lu(e){return lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(e)}function uu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==lu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==lu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===lu(i)?i:String(i)),r)}var o,i}function fu(e,t){return fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fu(e,t)}function pu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hu(e){return hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hu(e)}const du=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hu(r);if(o){var n=hu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===lu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReport=t.handleReport.bind(pu(t)),t.handleReportClose=t.handleReportClose.bind(pu(t)),t.state={showReport:!1},t}return t=a,(n=[{key:"handleReport",value:function(e){this.setState({showReport:!0})}},{key:"handleReportClose",value:function(e){this.setState({showReport:!1})}},{key:"render",value:function(){return u().createElement("span",null,u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleReport},"Report"),this.state.showReport&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},u().createElement(cu,{postID:this.props.postID,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&uu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function yu(e){return yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yu(e)}function mu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==yu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==yu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===yu(i)?i:String(i)),r)}var o,i}function vu(e,t){return vu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vu(e,t)}function bu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gu(e){return gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gu(e)}const wu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gu(r);if(o){var n=gu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===yu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bu(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(bu(t)),t.handleSubmit=t.handleSubmit.bind(bu(t)),t.handlePostChange=t.handlePostChange.bind(bu(t)),t.handleReportChange=t.handleReportChange.bind(bu(t)),t.state={post:null,isValid:!0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/post/edit/?id=".concat(this.props.post.postID)).done((function(t,n,r){e.setState({post:t.data.form.post})})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"handleSubmit",value:function(){var e={postID:this.props.post.postID,type:this.props.link.type,product:"Developer"==this.props.link.type?this.props.link.value:null,post:this.state.post,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/internal-report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handlePostChange",value:function(e){this.setState({post:e.target.value})}},{key:"handleReportChange",value:function(){}},{key:"render",value:function(){if(null==this.state.post)return null;var e=null;this.state.isValid||(e=u().createElement(fi,{message:"post required"}));var t="".concat(this.props.link.value," Report");return"Support"==this.props.link.type&&(t="Support Escalation"),u().createElement("div",{className:"post-report report clearfix"},u().createElement("h4",null,t),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Post text to be included in report email"),u().createElement("textarea",{name:"post",ref:"post",value:this.state.post,onChange:this.handlePostChange,className:"form-control",rows:"8"}),e),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Reason For Reporting (Optional)"),u().createElement("textarea",{name:"report",ref:"report",onChange:this.handleReportChange,className:"form-control"})),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit")))}}])&&mu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Su(e){return Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(e)}function Eu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Su(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Su(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Su(i)?i:String(i)),r)}var o,i}function Ou(e,t){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ou(e,t)}function _u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pu(e){return Pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pu(e)}const ku=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ou(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Pu(r);if(o){var n=Pu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Su(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _u(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReportClick=t.handleReportClick.bind(_u(t)),t.handleReportClose=t.handleReportClose.bind(_u(t)),t.link=null,t.state={showReport:!1},t}return t=a,(n=[{key:"handleReportClick",value:function(e){this.link=e,this.setState({showReport:!0})}},{key:"handleReportClose",value:function(){this.setState({showReport:!1})}},{key:"render",value:function(){var e=this,t=[];return this.props.links.forEach((function(n,r){var o="Add To ".concat(n.value," Report");"Support"===n.type&&(o="Create ".concat(n.value," Ticket")),t.push(u().createElement("button",{type:"button",onClick:e.handleReportClick.bind(null,n)},o))})),u().createElement("span",null,u().createElement(eo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:"Internal Report",options:t}),this.state.showReport&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},u().createElement(wu,{post:this.props.post,link:this.link,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&Eu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ju(e){return ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ju(e)}function Cu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ju(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ju(i)?i:String(i)),r)}var o,i}function xu(e,t,n){return t&&Tu(e.prototype,t),n&&Tu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ru(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Du(e,t)}function Du(e,t){return Du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Du(e,t)}function Nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Iu(e);if(t){var o=Iu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ju(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mu(e)}(this,n)}}function Mu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Iu(e)}var Au=function(e){Ru(n,e);var t=Nu(n);function n(e){var r;return Cu(this,n),(r=t.call(this,e)).filterContent=r.filterContent.bind(Mu(r)),r}return xu(n,[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n){t.push(u().createElement("li",{key:n.id,className:"view"},u().createElement(Lu,{content:n,postID:e.props.postID})))})),o.forEach((function(t){n.push(u().createElement("li",{key:t.id,className:"dl"},u().createElement(Bu,{content:t,postID:e.props.postID})))})),u().createElement("ul",{className:"content-list clearfix"},t,n)}}]),n}(u().Component);Au.propTypes={content:d().array,postID:d().number};var Lu=Je(function(e){Ru(n,e);var t=Nu(n);function n(){return Cu(this,n),t.apply(this,arguments)}return xu(n,[{key:"render",value:function(){var e={pathname:"/discuss/post/".concat(this.props.postID,"/content/").concat(this.props.content.id),state:{modal:!0,background:this.props.location}},t="".concat(this.props.content.type," ").concat(null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""," : ").concat(this.props.content.title);return u().createElement("div",{className:"content-view"},u().createElement(nt,{to:e,title:t,className:"link"},u().createElement("img",{src:this.props.content.thumbUrl})),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title)))}}]),n}(u().Component)),Bu=function(e){Ru(n,e);var t=Nu(n);function n(){return Cu(this,n),t.apply(this,arguments)}return xu(n,[{key:"render",value:function(){var e="/forum/post/".concat(this.props.postID,"/content/").concat(this.props.content.id,"/download"),t="".concat(this.props.content.type," : ").concat(this.props.content.title),n="Generic"!=this.props.content.type?u().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return u().createElement("div",{className:"content-dl"},u().createElement("a",{href:e,title:t,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title),n))}}]),n}(u().Component);const Fu=Au;function Uu(e){return Uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uu(e)}function qu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Uu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Uu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Uu(i)?i:String(i)),r)}var o,i}function Ku(e,t){return Ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ku(e,t)}function Vu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zu(e){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zu(e)}var Wu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ku(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zu(r);if(o){var n=zu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Uu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vu(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReply=t.handleReply.bind(Vu(t)),t.handleQuote=t.handleQuote.bind(Vu(t)),t.handleEdit=t.handleEdit.bind(Vu(t)),t.DisplayModes={Topic:"topic",Single:"single"},t}return t=a,(n=[{key:"handleReply",value:function(){this.props.onReply&&this.props.onReply(this.props.post.postID)}},{key:"handleQuote",value:function(){this.props.onQuote&&this.props.onQuote(this.props.post.postID)}},{key:"handleEdit",value:function(){this.props.onEdit&&this.props.onEdit(this.props.post.postID)}},{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply"+this.props.depth:"",n=!0===e.show.opHighlight?" op-highlight":"",r="comment".concat(t).concat(n," clearfix"),o=this.props.viewer.internalReportLinks&&u().createElement(ku,{links:this.props.viewer.internalReportLinks,post:e});return u().createElement("article",{className:r},u().createElement("a",{className:"post-anchor",name:e.postID}),!0===e.show.newPostAnchor&&u().createElement("a",{name:"NewPost"}),u().createElement("div",{className:"comment-header clearfix"},u().createElement("div",null,e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&u().createElement(Uo,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&u().createElement("div",{className:"profile"},e.addedBy.guestName)),u().createElement("div",null,u().createElement("div",{className:"report-links"},o,this.props.viewer.isSignedIn&&u().createElement(du,{postID:e.postID}),this.props.displayMode==this.DisplayModes.Topic&&u().createElement("span",null,u().createElement(nt,{to:e.url},"Permalink"))),u().createElement(Hl,{id:e.postID,post:e.rating,viewer:e.viewer.postRating,allowRating:e.viewer.showRating}))),u().createElement("div",{className:"comment-body clearfix"},u().createElement("div",{className:"comment-profile"},e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&u().createElement(Fl,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&u().createElement("div",{className:"profile"},e.addedBy.guestName),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.location&&u().createElement("div",null,e.addedBy.profile.location),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.joinedDT&&u().createElement("div",null,u().createElement("span",null,"Joined")," ",e.addedBy.profile.joinedDT),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.postCount&&u().createElement("div",null,e.addedBy.profile.postCount," ",u().createElement("span",null,e.addedBy.profile.postCount>1?"Posts":"Post"))),u().createElement("div",{className:"comment-body-container clearfix"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),null!=e.content&&e.content.length>0&&u().createElement(Fu,{content:e.content,postID:e.postID}),u().createElement("div",{className:"comment-body-footer"},e.addedBy&&e.addedBy.profile&&!0===e.addedBy.profile.showSignatureFL&&""!=e.addedBy.profile.signature&&u().createElement("span",{className:"signature",dangerouslySetInnerHTML:{__html:e.addedBy.profile.signature}}),!0===e.editedFL&&e.modifiedBy&&e.modifiedBy.profile&&u().createElement("span",{className:"edited"},"edited by: ",e.modifiedBy.profile.name)),u().createElement(nu,{reports:e.reports}))),u().createElement("div",{className:"comment-footer clearfix"},u().createElement("div",{className:"comment-info"},u().createElement("time",null,e.addedBy.displayDT)),u().createElement("div",{className:"comment-actions-container"},this.props.displayMode==this.DisplayModes.Topic&&this.props.showEditControls&&u().createElement("div",{className:"comment-actions"},u().createElement("button",{type:"button",className:"icon icon-after icon-reply",onClick:this.handleReply},"Reply"),this.props.displayMode==this.DisplayModes.Topic&&u().createElement("button",{type:"button",className:"icon icon-after icon-quote",onClick:this.handleQuote},"Quote"),e.viewer.canEdit&&u().createElement("button",{type:"button",className:"icon icon-after icon-refresh",onClick:this.handleEdit},"Edit")))))}}])&&qu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Wu.propTypes={displayMode:d().string,post:d().object,depth:d().number,viewer:d().object,onReply:d().func,onQuote:d().func,onEdit:d().func,showEditControls:d().bool},Wu.defaultProps={displayMode:"topic",depth:null,showEditControls:!1};const Hu=Wu;function $u(e){return $u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$u(e)}function Gu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==$u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==$u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===$u(i)?i:String(i)),r)}var o,i}function Ju(e,t){return Ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ju(e,t)}function Qu(e){return Qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qu(e)}var Yu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ju(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Qu(r);if(o){var n=Qu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply".concat(this.props.depth):"",n="comment anonymized ".concat(t," clearfix");return u().createElement("article",{className:n},u().createElement("a",{name:e.postID}),!0===e.show.newPostAnchor&&u().createElement("a",{name:"NewPost"}),u().createElement("div",{className:"comment-header clearfix"},u().createElement("div",null)),u().createElement("div",{className:"comment-body clearfix"},u().createElement("div",{className:"comment-profile"}),u().createElement("div",{className:"comment-body-container clearfix"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}))))}}])&&Gu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Yu.propTypes={post:d().object,depth:d().number},Yu.defaultProps={depth:null};const Xu=Yu;function Zu(e){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zu(e)}function ef(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Zu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Zu(i)?i:String(i)),r)}var o,i}function tf(e,t){return tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tf(e,t)}function nf(e){return nf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nf(e)}var rf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=nf(r);if(o){var n=nf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Zu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.percentComplete||0==this.props.percentComplete)return null;var e={width:this.props.percentComplete+"%"};return u().createElement("div",{className:"progress progress-small"},u().createElement("div",{className:"progress-bar",style:e}))}}])&&ef(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);rf.propTypes={percentComplete:d().number.isRequired};const of=rf;function af(e){return af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(e)}function sf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==af(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==af(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===af(i)?i:String(i)),r)}var o,i}function cf(e,t){return cf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cf(e,t)}function lf(e){return lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lf(e)}const uf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=lf(r);if(o){var n=lf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===af(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e,t=this.props.data;return"Uploading"!=t.status&&(e=t.message),u().createElement("li",null,u().createElement("span",null,t.name+t.extension),e,"Uploading"==t.status?u().createElement(of,{percentComplete:t.percentComplete}):null)}}])&&sf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ff(e){return ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ff(e)}function pf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ff(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ff(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ff(i)?i:String(i)),r)}var o,i}function hf(e,t){return hf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hf(e,t)}function df(e){return df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},df(e)}const yf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=df(r);if(o){var n=df(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ff(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(0==this.props.uploads.length)return null;var e=this,t=[];return this.props.uploads.forEach((function(n){t.push(u().createElement(uf,{key:n.key,data:n,onUploadDelete:e.props.onUploadDelete}))})),u().createElement("ul",{className:"upload-list"},t)}}])&&pf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function mf(e){return mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mf(e)}function vf(){return vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vf.apply(this,arguments)}function bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==mf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==mf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===mf(i)?i:String(i)),r)}var o,i}function gf(e,t){return gf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gf(e,t)}function wf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sf(e){return Sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sf(e)}var Ef=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sf(r);if(o){var n=Sf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===mf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wf(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onDragEnter=t.onDragEnter.bind(wf(t)),t.onDragOver=t.onDragOver.bind(wf(t)),t.onDragLeave=t.onDragLeave.bind(wf(t)),t.onDrop=t.onDrop.bind(wf(t)),t.open=t.open.bind(wf(t)),t.supportMultiple="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input"),t.state={isDragActive:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.enterCounter=0}},{key:"onDragEnter",value:function(e){e.preventDefault(),++this.enterCounter;var t=e.dataTransfer&&e.dataTransfer.items?e.dataTransfer.items:[],n=Array.prototype.slice.call(t);this.setState({isDragActive:n})}},{key:"onDragOver",value:function(e){return e.preventDefault(),e.stopPropagation(),!1}},{key:"onDragLeave",value:function(e){e.preventDefault(),--this.enterCounter>0||this.setState({isDragActive:!1})}},{key:"onDrop",value:function(e){e.preventDefault(),this.enterCounter=0,this.setState({isDragActive:!1});for(var t=e.dataTransfer?e.dataTransfer.files:e.target.files,n=this.props.multiple?t.length:1,r=[],o=0;o<n;o++){var i=t[o];r.push(i)}this.props.onDrop&&this.props.onDrop.call(this,r,e)}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this,t={onClick:this.open,onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},n={type:"file",style:{display:"none"},multiple:this.supportMultiple&&this.props.multiple,ref:function(t){return e.fileInputEl=t},onChange:this.onDrop},r=null!=this.props.children?this.props.children:u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload");return u().createElement("div",vf({className:"drop-area"+(this.state.isDragActive?" drop-area-active":"")},t,{style:{textAlign:"center"}}),r,u().createElement(yf,{uploads:this.props.uploads}),u().createElement("input",n))}}])&&bf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ef.defaultProps={multiple:!0};const Of=Ef;function _f(e){return _f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_f(e)}function Pf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_f(i)?i:String(i)),r)}var o,i}function kf(e,t){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kf(e,t)}function jf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cf(e){return Cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cf(e)}var Tf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cf(r);if(o){var n=Cf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jf(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onChange=t.onChange.bind(jf(t)),t.onSubmit=t.onSubmit.bind(jf(t)),t.clearInput=t.clearInput.bind(jf(t)),t._validateUrl=t._validateUrl.bind(jf(t)),t.state={isValidUrl:!1},t}return t=a,(n=[{key:"onChange",value:function(e){e.preventDefault();var t=this.refs.url.value,n=this._validateUrl(t);this.setState({isValidUrl:n})}},{key:"onSubmit",value:function(e){e.preventDefault();var t=this.refs.url.value;$.ajax({type:"POST",url:"/staging/hosted",contentType:"application/json; charset=utf-8",data:JSON.stringify({url:t,groupsAllowed:this.props.groupsAllowed}),dataType:"json",context:this}).then((function(e){this.props.onRegister(e.uploads,e.resources,e.content),this.clearInput}))}},{key:"clearInput",value:function(){this.refs.url.value=""}},{key:"_validateUrl",value:function(e){var t=e.toLowerCase();return t.includes("youtube.com")?/youtube\.com\/watch\?v=([a-zA-Z0-9-_]+)/.test(e):t.includes("youtu.be")?/youtu\.be\/([a-zA-Z0-9-_]+)/.test(e):t.includes("vimeo.com")?/vimeo\.com\/([0-9]+)(?:\/([a-f0-9]+))?(?:\?.+)?/.test(e):!!t.includes("sketchfab.com")&&/sketchfab\.com\/models\/([a-zA-Z0-9]+)(?:\?.+?)?/.test(e)}},{key:"render",value:function(){return u().createElement("div",{className:"form-group staging-hosted-content"},u().createElement("h4",null,"Embedding a YouTube or Vimeo video?"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&Pf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Tf.propTypes={onRegister:d().func.isRequired};const xf=Tf;function Rf(e){return Rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rf(e)}function Df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rf(i)?i:String(i)),r)}var o,i}function Nf(e,t){return Nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nf(e,t)}function Mf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function If(e){return If=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},If(e)}var Af=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=If(r);if(o){var n=If(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mf(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Mf(t)),t.valid=t.valid.bind(Mf(t)),t.getValue=t.getValue.bind(Mf(t)),t.setValue=t.setValue.bind(Mf(t)),t.onChange=t.onChange.bind(Mf(t)),t.state={value:null!=t.props.value?t.props.value.toString():"",isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.refs.select.value&&""!=this.refs.select.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),u().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group".concat(null==this.props.label?" no-label":"").concat(this.props.isInline?" form-inline":"");!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?n=u().createElement(fi,{message:this.props.helpMessage}):t+=" no-help":n=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:t},this.props.label&&u().createElement("label",{className:"static"},this.props.label),u().createElement("select",{ref:"select",disabled:this.props.disabled,value:this.state.value,onChange:this.onChange},e),n)}}])&&Df(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Af.propTypes={options:d().array.isRequired,value:d().oneOfType([d().string,d().number]),label:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,isInline:d().bool,disabled:d().bool,onChange:d().func},Af.defaultProps={label:null,required:!1,requiredErrorMessage:"input required.",isInline:!1};const Lf=Af;function Bf(e){return Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bf(e)}function Ff(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Bf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Bf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Bf(i)?i:String(i)),r)}var o,i}function Uf(e,t){return Uf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Uf(e,t)}function qf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kf(e){return Kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kf(e)}const Vf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Kf(r);if(o){var n=Kf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Bf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return qf(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(qf(t)),t.onSubmit=t.onSubmit.bind(qf(t)),t.onChange=t.onChange.bind(qf(t)),t.onContentTypeChange=t.onContentTypeChange.bind(qf(t)),t.onResourceFormatChange=t.onResourceFormatChange.bind(qf(t)),t.form={url:"",contentType:"",resourceFormat:""},t.state={setupForm:null,isValidUrl:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){null==this.setupForm&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/staging/hostedfile").done((function(t,n,r){e.form.contentType=t.contentType,e.form.resourceFormat=t.resourceFormat,e.setState({setupForm:t})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onSubmit",value:function(){this.form.url=this.refs.url.value,$.ajax({type:"POST",url:"/staging/hostedfile",data:this.form,context:this}).done((function(e,t,n){this.props.onRegister(null,e.resources,e.content),this.refs.url.value=""})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){}))}},{key:"onChange",value:function(e){var t=this.refs.url.value;this.setState({isValidUrl:t.startsWith("http://")||t.startsWith("https://")})}},{key:"onContentTypeChange",value:function(e){this.form.contentType=e}},{key:"onResourceFormatChange",value:function(e){this.form.resourceFormat=e}},{key:"render",value:function(){return null==this.state.setupForm?null:u().createElement("div",{className:"form-group staging-hosted-file clearfix"},u().createElement("h4",null,"Attaching a file that's hosted on another server?"),u().createElement("div",{className:"input-group type-and-formats"},u().createElement(Lf,{ref:"contentType",label:"Content Type",value:this.state.setupForm.contentType,options:this.state.setupForm.contentTypeOptions,required:!0,requiredErrorMessage:"Content Type Required",onChange:this.onContentTypeChange}),u().createElement(Lf,{ref:"resourceFormat",label:"Format",value:this.state.setupForm.resourceFormat,options:this.state.setupForm.resourceFormatOptions,required:!0,requiredErrorMessage:"Resource Format Required",onChange:this.onResourceFormatChange})),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&Ff(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function zf(e){return zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zf(e)}function Wf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==zf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==zf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===zf(i)?i:String(i)),r)}var o,i}function $f(e,t,n){return t&&Hf(e.prototype,t),n&&Hf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jf(e,t)}function Jf(e,t){return Jf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jf(e,t)}function Qf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xf(e);if(t){var o=Xf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===zf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Yf(e)}(this,n)}}function Yf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xf(e){return Xf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xf(e)}var Zf=function(e){Gf(n,e);var t=Qf(n);function n(e){var r;return Wf(this,n),(r=t.call(this,e)).onNotificationClose=r.onNotificationClose.bind(Yf(r)),r}return $f(n,[{key:"onNotificationClose",value:function(e,t){t.preventDefault(),this.props.onNotificationClose(e,t)}},{key:"render",value:function(){var e=[],t=this;return this.props.notifications.forEach((function(n,r){n.show&&e.push(u().createElement(ep,{key:r,data:n,onNotificationClose:t.onNotificationClose.bind(null,r)}))})),e.length>0?u().createElement("div",null,e):null}}]),n}(u().Component),ep=function(e){Gf(n,e);var t=Qf(n);function n(){return Wf(this,n),t.apply(this,arguments)}return $f(n,[{key:"render",value:function(){var e=this.props.data,t=[];return 1==e.messages.length?t=u().createElement("p",null,e.messages[0]):e.messages.length>1&&(t=u().createElement("ul",null,e.messages.map((function(e,t){return u().createElement("li",{key:t},e)})))),u().createElement("div",{className:"alert alert-danger"},u().createElement("button",{type:"button",className:"close",onClick:this.props.onNotificationClose},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("strong",null,e.title),t)}}]),n}(u().Component);const tp=Zf;function np(e){return np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},np(e)}function rp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==np(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==np(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===np(i)?i:String(i)),r)}var o,i}function op(e,t){return op=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},op(e,t)}function ip(e){return ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ip(e)}const ap=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&op(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ip(r);if(o){var n=ip(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===np(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.data,t=e.name;return"Missing"==e.status&&(t="Missing : "+e.path),u().createElement("div",{className:"staging-item staging-item-child"+(e.blocking.length>0?" attention":"")},u().createElement("div",{className:"tfmedia"},e.thumb?u().createElement("img",{src:e.thumb,className:"tfthumb"}):null,u().createElement("div",{className:"tfmedia-body"},u().createElement("h4",null,u().createElement("span",{className:"content-type-badge"},e.type),t))))}}])&&rp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function sp(e){return sp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sp(e)}function cp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==sp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==sp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===sp(i)?i:String(i)),r)}var o,i}function lp(e,t){return lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lp(e,t)}function up(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fp(e){return fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fp(e)}const pp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fp(r);if(o){var n=fp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return up(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e))._handleChange=t._handleChange.bind(up(t)),t}return t=a,(n=[{key:"_handleChange",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onChange(e.target.value)}},{key:"render",value:function(){return u().createElement("div",{className:"form-group"+(this.props.isRenameSuccess?" has-success":" has-error")},u().createElement("label",{className:"static"},"Rename Title"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",value:this.props.inputValue,onChange:this._handleChange}),u().createElement("span",{className:"input-group-addon"},this.props.extension)))}}])&&cp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function hp(e){return hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hp(e)}function dp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==hp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==hp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===hp(i)?i:String(i)),r)}var o,i}function yp(e,t){return yp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yp(e,t)}function mp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vp(e){return vp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vp(e)}var bp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vp(r);if(o){var n=vp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===hp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mp(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).checkStatus=t.checkStatus.bind(mp(t)),t.onRenameChange=t.onRenameChange.bind(mp(t)),t.handleRename=t.handleRename.bind(mp(t)),t.handleTargetUsageChange=t.handleTargetUsageChange.bind(mp(t)),t.handleTargetUsageUpdate=t.handleTargetUsageUpdate.bind(mp(t)),t.handleDelete=t.handleDelete.bind(mp(t)),t.handleRegisterContent=t.handleRegisterContent.bind(mp(t)),t.niceOptionText=t.niceOptionText.bind(mp(t)),t.EditorStatus={Ready:"ready",ExternalReferences:"externalreferences",TargetUsage:"targetusage",Rename:"rename"},t.state={status:t.checkStatus(t.props.resource),renamedTitle:t.props.resource.nameWithoutExtension,isRenameSuccess:!1,targetUsage:null,isTargetUsageSuccess:!1,showOverlay:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.resource.blocking[0]==this.props.resource.blocking[0]&&e.resource.group.length==this.props.resource.group.length&&e.resource.status==this.props.resource.status||this.setState({status:this.checkStatus(e.resource)})}},{key:"checkStatus",value:function(e){return"ExternalReferences"==e.blocking[0]?this.EditorStatus.ExternalReferences:e.group.length>1?this.EditorStatus.TargetUsage:"Rename"==e.status?this.EditorStatus.Rename:this.EditorStatus.Ready}},{key:"onRenameChange",value:function(e){$.ajax({type:"GET",url:"/staging/checkrename",data:{itemID:this.props.resource.id,titlePart:encodeURIComponent(e)},context:this}).then((function(t){var n=!t.data;this.setState({renamedTitle:e,isRenameSuccess:n})}))}},{key:"handleRename",value:function(e,t,n){$.ajax({type:"POST",url:"/staging/rename",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,renamedTitle:encodeURIComponent(this.state.renamedTitle)}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleTargetUsageChange",value:function(e){var t=e.target.value,n=""!=e.target.value;this.setState({targetUsage:t,isTargetUsageSuccess:n})}},{key:"handleTargetUsageUpdate",value:function(e){$.ajax({type:"POST",url:"/staging/usage",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,targetUsage:this.state.targetUsage}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleDelete",value:function(e){$.ajax({type:"DELETE",url:"/staging",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleRegisterContent",value:function(e){var t=this;this.setState({showOverlay:!0},(function(){$.ajax({type:"POST",url:"/staging/register",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:t.props.resource.id}),dataType:"json",context:t}).then((function(e){var n=[];n.push(e.content),t.props.onResourceUpdate(e.resources,n)}))}))}},{key:"niceOptionText",value:function(e){var t=this.props.resource.type;switch(e){case"Asset":return"Downloadable File: Share file as download for use in applications outside of the browser";case"Portfolio":return"Display in Browser: Use for easy viewing of screen shots, rendered images, and videos directly in the browser.";case"Training":return"Display in Browser: Use for easy viewing of tutorials directly in the browser.";default:return e+" "+t}}},{key:"render",value:function(){if(!this.props.resource)return null;var e=this.props.resource,t=this.state.status==this.EditorStatus.TargetUsage&&!0===this.state.isTargetUsageSuccess,n=this.state.status==this.EditorStatus.Rename&&!0===this.state.isRenameSuccess,r=this.state.status==this.EditorStatus.Ready,o=this;return u().createElement("div",{className:"staging-item-edit clearfix"},this.state.status==this.EditorStatus.Rename&&u().createElement(pp,{onChange:this.onRenameChange,isRenameSuccess:this.state.isRenameSuccess,inputValue:this.state.renamedTitle,extension:e.extension}),this.state.status==this.EditorStatus.TargetUsage&&u().createElement("div",{className:"form-group"+(this.state.isTargetUsageSuccess?" has-success":" has-error")},this.state.isTargetUsageSuccess&&u().createElement("label",{className:"static"},"Link Content As:"),u().createElement("select",{className:"form-control",onChange:this.handleTargetUsageChange},u().createElement("option",{key:"-1",value:""},"Intended usage"),e.group.map((function(e,t){return u().createElement("option",{key:t,value:e},o.niceOptionText(e))})))),u().createElement("div",{className:"pull-right"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete},"Delete"),this.state.status==this.EditorStatus.TargetUsage&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!t,onClick:this.handleTargetUsageUpdate},"Update"),this.state.status==this.EditorStatus.Rename&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!n,onClick:this.handleRename},"Rename"),this.state.status==this.EditorStatus.Ready&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!r,onClick:this.handleRegisterContent},"Save Content")),!0===this.state.showOverlay&&u().createElement("div",{className:"overlay-waiting"},u().createElement("img",{src:"/common/img/assets/spinner.gif"})))}}])&&dp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);bp.propTypes={resource:d().object,onResourceUpdate:d().func};const gp=bp;function wp(e){return wp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wp(e)}function Sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==wp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==wp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===wp(i)?i:String(i)),r)}var o,i}function Ep(e,t){return Ep=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ep(e,t)}function Op(e){return Op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Op(e)}var _p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ep(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Op(r);if(o){var n=Op(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.resource,t=[];e.children.forEach((function(e){"Duplicate"!=e.status&&t.push(u().createElement(ap,{key:e.id,data:e}))}));var n="staging-item";this.props.selected&&(n+=" selected"),("Ready"!=e.status||e.blocking.length>0)&&(n+=" attention");var r=u().createElement("p",null,"Ready");if(e.blocking.length>0)switch(e.blocking[0]){case"ExternalReferences":r=u().createElement("p",null,"Upload missing external references.");break;case"Rename":r=u().createElement("p",null,"An Asset with this name already exists, please rename.");break;case"TargetGroup":r=u().createElement("p",null,"Choose how this content item should be used or upload the parent asset.",u().createElement("br",null),u().createElement("br",null),"For example, if this is a texture image used in a material, please upload the material asset.")}return u().createElement("li",null,u().createElement("div",{className:n,onClick:this.props.onResourceSelect.bind(null,e.id)},u().createElement("div",{className:"tfmedia"},e.thumb?u().createElement("img",{src:e.thumb,className:"tfthumb"}):null,u().createElement("div",{className:"tfmedia-body"},u().createElement("h4",null,u().createElement("span",{className:"content-type-badge"},e.type),e.name),r)),this.props.selected?u().createElement(gp,{resource:e,onResourceUpdate:this.props.onResourceUpdate}):null,t))}}])&&Sp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);_p.propTypes={resource:d().object,selected:d().bool,onResourceSelect:d().func,onResourceUpdate:d().func};const Pp=_p;function kp(e){return kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kp(e)}function jp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==kp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==kp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===kp(i)?i:String(i)),r)}var o,i}function Cp(e,t){return Cp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cp(e,t)}function Tp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xp(e){return xp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xp(e)}var Rp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xp(r);if(o){var n=xp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===kp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Tp(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onResourceSelect=t.onResourceSelect.bind(Tp(t)),t.existsInResources=t.existsInResources.bind(Tp(t)),t.state={selectedId:null},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(null==this.state.selectedId||!this.existsInResources(this.state.selectedId,e.resources)){var t=null!=e.resources&&e.resources.length>0?e.resources[0].id:null;t!=this.state.selectedId&&this.setState({selectedId:t})}}},{key:"onResourceSelect",value:function(e,t){t.preventDefault(),t.stopPropagation();var n=e;this.existsInResources(e,this.props.resources)||(n=null),this.setState({selectedId:n})}},{key:"existsInResources",value:function(e,t){for(var n=0;n<t.length;n++)if(t[n].id==e)return!0;return!1}},{key:"render",value:function(){var e=this,t=[];return this.props.resources.forEach((function(n){var r=e.state.selectedId==n.id;t.push(u().createElement(Pp,{key:n.id,resource:n,selected:r,onResourceSelect:e.onResourceSelect,onResourceUpdate:e.props.onResourceUpdate}))})),t.length<=0?null:u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"staging-list"},t))}}])&&jp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Rp.propTypes={resources:d().array,onResourceUpdate:d().func};const Dp=Rp;function Np(e){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Np(e)}function Mp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Np(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Np(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Np(i)?i:String(i)),r)}var o,i}function Ip(e,t){return Ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ip(e,t)}function Ap(e){return Ap=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ap(e)}const Lp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ip(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ap(r);if(o){var n=Ap(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Np(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e="".concat(this.props.content.type," - ").concat(this.props.content.format," : ").concat(this.props.content.title);return u().createElement("div",{className:"content-view"},u().createElement("div",{title:e,className:"link"},u().createElement("img",{src:this.props.content.thumbUrl})),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&Mp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Bp(e){return Bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bp(e)}function Fp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Bp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Bp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Bp(i)?i:String(i)),r)}var o,i}function Up(e,t){return Up=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Up(e,t)}function qp(e){return qp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qp(e)}var Kp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Up(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qp(r);if(o){var n=qp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Bp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e="".concat(this.props.content.type," : ").concat(this.props.content.title),t="Generic"!=this.props.content.type?u().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return u().createElement("div",{className:"content-dl"},u().createElement("div",{title:e,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title),t),this.props.children)}}])&&Fp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);const Vp=Kp;function zp(e){return zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zp(e)}function Wp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==zp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==zp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===zp(i)?i:String(i)),r)}var o,i}function Hp(e,t){return Hp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hp(e,t)}function $p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gp(e){return Gp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gp(e)}var Jp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gp(r);if(o){var n=Gp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===zp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $p(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).filterContent=t.filterContent.bind($p(t)),t}return t=a,(n=[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=[],t=[],n=$.grep(this.props.content,this.filterContent),r=$.grep(this.props.content,this.filterContent,!0);return n.forEach((function(t){e.push(u().createElement("li",{key:t.id,className:"view"},u().createElement(Lp,{content:t})))})),r.forEach((function(e){t.push(u().createElement("li",{key:e.id,className:"dl"},u().createElement(Vp,{content:e})))})),u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"content-list clearfix"},e,t))}}])&&Wp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Jp.propTypes={content:d().array};const Qp=Jp;function Yp(e){return Yp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yp(e)}function Xp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Yp(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Yp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Yp(i)?i:String(i)),r)}var o,i}function Zp(e,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zp(e,t)}function eh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function th(e){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},th(e)}var nh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=th(r);if(o){var n=th(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Yp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return eh(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onNotificationClose=t.onNotificationClose.bind(eh(t)),t.checkDuplicateResource=t.checkDuplicateResource.bind(eh(t)),t.onResourceUpdate=t.onResourceUpdate.bind(eh(t)),t.canClose=t.canClose.bind(eh(t)),t.onUploadDelete=t.onUploadDelete.bind(eh(t)),t.deleteUpload=t.deleteUpload.bind(eh(t)),t.createUploadKey=t.createUploadKey.bind(eh(t)),t.getUploadIndexByFilename=t.getUploadIndexByFilename.bind(eh(t)),t.getUploadIndexByKey=t.getUploadIndexByKey.bind(eh(t)),t.updateNotifications=t.updateNotifications.bind(eh(t)),t.onHostedRegister=t.onHostedRegister.bind(eh(t)),t.onFileDrop=t.onFileDrop.bind(eh(t)),t.nextFile=t.nextFile.bind(eh(t)),t.processFile=t.processFile.bind(eh(t)),t.updateUploadArray=t.updateUploadArray.bind(eh(t)),t.updateResourceAndContentArrays=t.updateResourceAndContentArrays.bind(eh(t)),t.updateUpload=t.updateUpload.bind(eh(t)),t.updateUploadInState=t.updateUploadInState.bind(eh(t)),t.fileProgress=t.fileProgress.bind(eh(t)),t.fileDone=t.fileDone.bind(eh(t)),t.inProcess=!1,t.files=[],t.fileSizeLimit=TFGlobal.stagingFileSizeLimit,t.state={uploads:[],notifications:[],resources:[],content:[]},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){$.ajax({type:"GET",url:"/staging",dataType:"json",context:this}).then((function(e){!0===e.status.isSuccess?this.setState({resources:e.data}):$("#errorModal").find("p").html(e.status.message).end().foundation("reveal","open")}))}},{key:"onNotificationClose",value:function(e,t){var n=this.state.notifications;n[e].show=!1,this.setState({notifications:n})}},{key:"checkDuplicateResource",value:function(e,t){if(void 0!==e)for(var n=0,r=e.length;n<r;n++){if(e[n].name==t&&"Missing"!=e[n].status&&"Duplicate"!=e[n].status)return!0;var o=this.checkDuplicateResource(e[n].children,t);if(null!=o)return o}return null}},{key:"onResourceUpdate",value:function(e,t){this.updateResourceAndContentArrays(e,t)}},{key:"canClose",value:function(){return!(!this.props.closeAfterAutoAcceptContent||0!=this.state.resources.length||0!=this.files.length)}},{key:"onUploadDelete",value:function(e,t){this.deleteUpload(e,null)}},{key:"deleteUpload",value:function(e,t){var n=this.getUploadIndexByKey(e);if(-1!=n){var r=this.state.uploads;r.splice(n,1);var o=this.state.notifications;t&&o.push(t),this.setState({uploads:r,notifications:o})}}},{key:"createUploadKey",value:function(e){return e.split(".").join("-")}},{key:"getUploadIndexByFilename",value:function(e){return this.getUploadIndexByKey(this.createUploadKey(e))}},{key:"getUploadIndexByKey",value:function(e){for(var t=0,n=!1;t<this.state.uploads.length;t++)if(this.state.uploads[t].key==e){n=!0;break}return n?t:-1}},{key:"updateNotifications",value:function(e){var t=this.state.notifications.push(e);this.setState({notifications:t})}},{key:"onHostedRegister",value:function(e,t,n){e&&this.updateUploadArray(e),this.updateResourceAndContentArrays(t,n)}},{key:"onFileDrop",value:function(e){var t=[],n=[],r=[],o=this;e.forEach((function(e){if($.grep(o.files,(function(t){return t.name==e.name})).length>0||-1!=o.getUploadIndexByFilename(e.name)||!0===o.checkDuplicateResource(o.state.resources,e.name)){var i={title:e.name,level:"Danger",messages:["Duplicate File"],show:!0};r.push(i)}else if(Math.floor(e.size/1024)>o.fileSizeLimit){var a={title:e.name,level:"Danger",messages:["File Too Large"],show:!0};r.push(a)}else{var s={key:o.createUploadKey(e.name),name:sn.getFileNameWithoutExtension(e.name),extension:sn.getFileExtension(e.name),type:e.type,status:"New",message:"Checking...",percentComplete:0};t.push(s),n.push(e)}})),this.setState({uploads:this.state.uploads.concat(t),notifications:r.concat(this.state.notifications)},(function(){for(var e=0,t=0;t<n.length;++t){var r=n[t],i=o.getUploadIndexByFilename(r.name);$.ajax({type:"GET",url:"/staging/validate",data:{mimeType:encodeURIComponent(r.type),filename:encodeURIComponent(r.name),groupsAllowed:this.props.groupsAllowed},contentType:"application/json; charset=utf-8",context:r,dataType:"json",traditional:!0}).done((function(e){if(!0===e.status.isSuccess)o.files.push(this),o.updateUpload(i,"Ready","Waiting to upload...",null);else{var t={title:r.name,level:"Danger",messages:[e.status.message],show:!0};o.deleteUpload(o.state.uploads[i].key,t)}})).fail((function(e,t,n){var a={title:r.name,level:"Danger",messages:["Error On File Recognition"],show:!0};o.deleteUpload(o.state.uploads[i].key,a)})).always((function(){++e==n.length&&(o.inProcess||o.nextFile())}))}}))}},{key:"nextFile",value:function(){this.inProcess=!0,0!=this.files.length?this.processFile(this.files.shift()):this.inProcess=!1}},{key:"processFile",value:function(e){var t=this.getUploadIndexByFilename(e.name),n=new FormData;n.append(e.name,e),n.append("groupsAllowed",this.props.groupsAllowed),this.updateUpload(t,"Uploading","Uploading...",null);var r=this;$.ajax({type:"POST",url:"/staging/upload",contentType:!1,processData:!1,data:n,context:e,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&(e.upload.addEventListener("progress",r.fileProgress.bind(null,t)),e.upload.addEventListener("load",r.fileDone.bind(null,t))),e}}).done((function(e,t,n){r.updateUploadArray(e.uploads),r.updateResourceAndContentArrays(e.resources,e.content),r.nextFile()})).fail((function(e,t,n){alert(this.name+" : "+n)}))}},{key:"updateUploadArray",value:function(e){if(-1!=this.getUploadIndexByFilename(e.filename)){var t=null;if(!0!==e.status.isSuccess){for(var n=e.status.message?[e.status.message]:[],r=0;r<e.children.length;r++)!1===e.children[r].status.isSuccess&&n.push(e.children[r].status.message+" : "+e.children[r].filename);t={title:e.filename,level:"Danger",messages:n,show:!0}}this.deleteUpload(this.createUploadKey(e.filename),t)}}},{key:"updateResourceAndContentArrays",value:function(e,t){var n=null!=e&&e.length>0;if(null==t||0==t.length)this.setState({resources:e});else if(!0===this.props.autoAcceptContent)this.props.onAccept(t,this.canClose()&&!n),this.setState({resources:e});else{var r=t;null!=this.state.content&&0!=this.state.content.length&&(r=t.concat(this.state.content)),this.setState({resources:e,content:r})}}},{key:"updateUpload",value:function(e,t,n,r){var o=this.state.uploads[e];null!=o&&(null!=t&&(o.status=t),null!=n&&(o.message=n),null!=r&&(o.percentComplete=r),this.updateUploadInState(o,e))}},{key:"updateUploadInState",value:function(e,t){var n=this.state.uploads.slice();n[t]=e,this.setState({uploads:n})}},{key:"fileProgress",value:function(e,t){if(t.lengthComputable){var n=Math.round(t.loaded/t.total*100);this.updateUpload(e,null,null,n)}}},{key:"fileDone",value:function(e,t){this.updateUpload(e,"Loaded",null,100)}},{key:"render",value:function(){var e=this.props.autoAcceptContent?null:u().createElement("button",{className:"btn-primary",onClick:this.props.onAccept.bind(null,this.state.content),disabled:0==this.state.content.length},"Accept"),t=this.props.showCancel?u().createElement("button",{className:"btn-default",onClick:this.props.onCancel},this.props.cancelButtonLabel):null,n=!1;return!this.props.showHostedContent||null!=this.props.groupsAllowed&&-1==this.props.groupsAllowed.indexOf("Portfolio")&&-1==this.props.groupsAllowed.indexOf("Training")||(n=!0),u().createElement("div",{className:"content-staging"},u().createElement(tp,{notifications:this.state.notifications,onNotificationClose:this.onNotificationClose}),u().createElement("div",{style:{padding:"20px 20px 0 20px",border:"1px solid #ccc",marginBottom:"20px"}},!0===this.props.showUpload&&u().createElement(Of,{onDrop:this.onFileDrop,uploads:this.state.uploads,multiple:this.props.allowMultipleFiles},this.props.children),!0===n&&u().createElement(xf,{onRegister:this.onHostedRegister}),!0===this.props.showHostedFile&&u().createElement(Vf,{onRegister:this.onHostedRegister})),u().createElement(Dp,{resources:this.state.resources,onResourceUpdate:this.onResourceUpdate}),null!=this.state.content&&this.state.content.length>0&&u().createElement(Qp,{content:this.state.content,test:"no content selected"}),(null!=e||null!=t)&&u().createElement("div",{style:{textAlign:"right"}},t," ",e))}}])&&Xp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);nh.propTypes={groupsAllowed:d().array,allowMultipleFiles:d().bool,autoAcceptContent:d().bool,closeAfterAutoAcceptContent:d().bool,showCancel:d().bool,cancelButtonLabel:d().string,onCancel:d().func,showUpload:d().bool,showHostedContent:d().bool,showHostedFile:d().bool},nh.defaultProps={groupsAllowed:null,allowMultipleFiles:!0,closeAfterAutoAcceptContent:!0,autoAcceptContent:!0,showCancel:!1,cancelButtonLabel:"Cancel",showUpload:!0,showHostedContent:!0,showHostedFile:!1};const rh=nh;function oh(e){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oh(e)}function ih(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==oh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==oh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===oh(i)?i:String(i)),r)}var o,i}function ah(e,t){return ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ah(e,t)}function sh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ch(e){return ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ch(e)}var lh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ah(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ch(r);if(o){var n=ch(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===oh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sh(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleClickDelete=t.handleClickDelete.bind(sh(t)),t.filterContent=t.filterContent.bind(sh(t)),t}return t=a,(n=[{key:"handleClickDelete",value:function(e){this.props.onDeleteContent(e)}},{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n,r){var o,i=[];i.push(u().createElement("a",{onClick:e.handleClickDelete.bind(null,n.id)},"Delete")),o=u().createElement("div",{className:"edit"},u().createElement(eo,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),t.push(u().createElement("li",{key:n.id,className:"view"},u().createElement(Lp,{content:n},o)))})),o.forEach((function(t,r){var o,i=[];i.push(u().createElement("a",{onClick:e.handleClickDelete.bind(null,t.id)},"Delete")),o=u().createElement("div",{className:"edit"},u().createElement(eo,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),n.push(u().createElement("li",{key:t.id,className:"dl"},u().createElement(Vp,{content:t},o)))})),u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"content-list clearfix"},t,n))}}])&&ih(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);lh.propTypes={content:d().array,onDeleteContent:d().func};const uh=lh;function fh(e){return fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fh(e)}function ph(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==fh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==fh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===fh(i)?i:String(i)),r)}var o,i}function hh(e,t){return hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hh(e,t)}function dh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yh(e){return yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yh(e)}var mh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yh(r);if(o){var n=yh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===fh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dh(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(dh(t)),t.valid=t.valid.bind(dh(t)),t.getValue=t.getValue.bind(dh(t)),t.clear=t.clear.bind(dh(t)),t.addMarkup=t.addMarkup.bind(dh(t)),t.openLink=t.openLink.bind(dh(t)),t.addLink=t.addLink.bind(dh(t)),t.openEmbed=t.openEmbed.bind(dh(t)),t.addEmbed=t.addEmbed.bind(dh(t)),t.openImageLink=t.openImageLink.bind(dh(t)),t.addImageLink=t.addImageLink.bind(dh(t)),t.handleCloseOverlay=t.handleCloseOverlay.bind(dh(t)),t.openContent=t.openContent.bind(dh(t)),t.addContent=t.addContent.bind(dh(t)),t.handleDeleteContent=t.handleDeleteContent.bind(dh(t)),t.handlePreview=t.handlePreview.bind(dh(t)),t.handleSimpleMarkupChange=t.handleSimpleMarkupChange.bind(dh(t)),t.handlePostChange=t.handlePostChange.bind(dh(t)),t.handleFocus=t.handleFocus.bind(dh(t)),t.focus=t.focus.bind(dh(t)),t.Modes={Attract:"attract",Post:"post",Embed:"embed",Link:"link",Image:"image",Content:"content",Preview:"preview"},t.Embeds={},t.Embeds.YOUTUBE={action:"YOUTUBE",label:"Enter YouTube Video ID:",button:"Add YouTube video to post"},t.Embeds.VIMEO={action:"VIMEO",label:"Enter Vimeo Video ID:",button:"Add Vimeo video to post"},t.Embeds.SKETCHFAB={action:"SKETCHFAB",label:"Enter Sketchfab Model View Url or Model ID:",button:"Add Sketchfab model to post"},t.overlayLabel="",t.overlayButton="",t.action="",t.state={mode:t.props.mode,simpleMarkupFL:!0,preview:null,isValid:!1,showValidation:!1},t}return t=a,n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.refs.post.value=e.value}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().post.length>=3}},{key:"getValue",value:function(){return{post:this.refs.post.value,simpleMarkupFL:this.refs.simpleMarkupFL.checked}}},{key:"clear",value:function(){this.refs.post.value=""}},{key:"addMarkup",value:function(e){var t,n=this.refs.post;if(document.selection){if(n.focus(),sel=document.selection.createRange(),0==sel.text.length)return;(t=sel.text)&&(sel.text="["+e+"]"+t+"[/"+e+"]")}else{if(n.selectionEnd-n.selectionStart==0)return;(t=n.value.substring(n.selectionStart,n.selectionEnd))&&(n.value=n.value.substring(0,n.selectionStart)+"["+e+"]"+t+"[/"+e+"]"+n.value.substring(n.selectionEnd,n.value.length))}this.handlePostChange()}},{key:"openLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),e)return sel.text="[URL]"+e+"[/URL]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),e)return t.value=t.value.substring(0,t.selectionStart)+"[URL]"+e+"[/URL]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Link})}},{key:"addLink",value:function(){var e=this.refs.post,t=this.refs.link.value,n=this.refs.linktext.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text=n?'[URL="'+t+'"]'+n+"[/URL]":"[URL]"+t+"[/URL]")):t&&(e.value=n?e.value.substring(0,e.selectionStart)+'[URL="'+t+'"]'+n+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length):e.value.substring(0,e.selectionStart)+"[URL]"+t+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openEmbed",value:function(e){this.overlayLabel=this.Embeds[e].label,this.overlayButton=this.Embeds[e].button,this.action=e,this.setState({mode:this.Modes.Embed})}},{key:"addEmbed",value:function(){var e=this.refs.post,t=this.refs.embed.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="["+this.action+'="'+t+'"]')):t&&(e.value=e.value.substring(0,e.selectionStart)+"["+this.action+'="'+t+'"]'+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openImageLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),null!=e&&"null"!=e&&""!=e)return sel.text="[IMG]"+e+"[/IMG]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),null!=e&&"null"!=e&&""!=e)return t.value=t.value.substring(0,t.selectionStart)+"[IMG]"+e+"[/IMG]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Image})}},{key:"addImageLink",value:function(){var e=this.refs.post,t=this.refs.image.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="[IMG]"+t+"[/IMG]")):t&&(e.value=e.value.substring(0,e.selectionStart)+"[IMG]"+t+"[/IMG]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"handleCloseOverlay",value:function(){this.setState({mode:this.Modes.Post})}},{key:"openContent",value:function(){this.setState({mode:this.Modes.Content})}},{key:"addContent",value:function(e){if(null!=e||e.length>0){var t=e;null!=this.props.content&&0!=this.props.content.length&&(t=this.props.content.concat(e)),this.props.onContentChange(t)}this.setState({mode:this.Modes.Post})}},{key:"handleDeleteContent",value:function(e){if(null!=this.props.content&&0!=this.props.content.length){for(var t=this.props.content,n=null,r=0;r<t.length;r++)t[r].id==e&&(n=r);null!=n&&(t.splice(n,1),this.props.onContentChange(t))}}},{key:"handlePreview",value:function(){this.state.mode!=this.Modes.Preview?this.validate()&&this.setState({mode:this.Modes.Preview},(function(){var e=this.getValue(),t={post:e.post,simpleMarkupFL:e.simpleMarkupFL};$.ajax({type:"POST",url:"/api/forum/post/preview",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.setState({preview:e.data})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))})):this.handleCloseOverlay()}},{key:"handleSimpleMarkupChange",value:function(e){this.setState({simpleMarkupFL:e.target.checked}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handlePostChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handleFocus",value:function(){this.state.mode===this.Modes.Attract&&this.setState({mode:this.Modes.Post},(function(){this.props.onFocus&&this.props.onFocus()}))}},{key:"focus",value:function(){this.refs.post.focus()}},{key:"render",value:function(){var e="post-editor-input".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=this.state.mode==this.Modes.Attract?"Join the conversation...":"",n=null;return!0!==this.state.showValidation||this.state.isValid||(n=u().createElement(fi,{message:"post required and must be 3 or more characters in length"})),u().createElement("div",null,u().createElement("div",{className:"post-editor-primary"},this.state.mode!=this.Modes.Attract&&u().createElement("ul",{className:"post-edit-controls"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"B")},"B")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"I")},"I")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"QUOTE")},"Quote")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODE")},"Inline Code")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODEBLOCK")},"Code Block")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openLink},"Add Link")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openImageLink},"Add Image Link")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"YOUTUBE")},"YouTube")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"VIMEO")},"Vimeo")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"SKETCHFAB")},"Sketchfab")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",onClick:this.openContent},"Attach Content"))),u().createElement("div",{className:e},u().createElement("textarea",{name:"post",ref:"post",placeholder:t,defaultValue:this.props.value,className:"form-control",rows:"12",onFocus:this.handleFocus,onChange:this.handlePostChange,disabled:!this.props.enabled,tabIndex:"2"}),n),null!=this.props.content&&this.props.content.length>0&&u().createElement(uh,{content:this.props.content,onDeleteContent:this.handleDeleteContent}),this.state.mode==this.Modes.Content&&u().createElement(I,{onClose:this.handleCloseOverlay,contentStyle:{width:"100%",padding:"20px",backgroundColor:"white"}},u().createElement(rh,{closeAfterAutoAcceptContent:!1,autoAcceptContent:!1,onAccept:this.addContent,showCancel:!0,onCancel:this.handleCloseOverlay},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))),this.state.mode==this.Modes.Embed&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},this.overlayLabel),u().createElement("input",{type:"text",ref:"embed",name:"embed"})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addEmbed},this.overlayButton)),this.state.mode==this.Modes.Link&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Full Url: "),u().createElement("input",{type:"text",ref:"link",name:"link",placeholder:"http://...",className:"form-control"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Text for the Link (Leave blank to display full address):"),u().createElement("input",{type:"text",ref:"linktext",name:"linktext"})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addLink},"Add Link")),this.state.mode==this.Modes.Image&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Image Url: "),u().createElement("input",{type:"text",ref:"image",name:"image",placeholder:"http://..."})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addImageLink},"Add Image Link")),this.state.mode==this.Modes.Preview&&u().createElement("div",{className:"post-editor-overlay clearfix"},u().createElement("button",{type:"button",className:"close",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("article",{className:"comment preview"},u().createElement("div",{className:"comment-body"},u().createElement("div",{className:"comment-body-container"},u().createElement("div",{className:"comment-body-content clearfix",dangerouslySetInnerHTML:{__html:this.state.preview}})))))),this.state.mode!=this.Modes.Attract&&u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},u().createElement("input",{type:"checkbox",id:"simpleMarkupFL",name:"simpleMarkupFL",ref:"simpleMarkupFL",checked:this.state.simpleMarkupFL,onChange:this.handleSimpleMarkupChange}),u().createElement("label",{htmlFor:"simpleMarkupFL"},"Enable Simple Markup")),this.state.simpleMarkupFL&&u().createElement("button",{type:"button",className:"btn-default",name:"preview",onClick:this.handlePreview},"Preview"),u().createElement("div",{className:"pull-right"},this.props.children)))}}],n&&ph(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);mh.propTypes={type:d().string},mh.defaultProps={mode:"post",type:"Post"};const vh=mh;function bh(e){return bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bh(e)}function gh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==bh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==bh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===bh(i)?i:String(i)),r)}var o,i}function wh(e,t){return wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wh(e,t)}function Sh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eh(e){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Eh(e)}const Oh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Eh(r);if(o){var n=Eh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===bh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sh(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).tick=t.tick.bind(Sh(t)),t.format=t.format.bind(Sh(t)),t.state={secondsRemaining:0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onCountdownFinished&&this.props.onCountdownFinished())}},{key:"format",value:function(e,t){var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=Math.floor(this.state.secondsRemaining/60),t=this.state.secondsRemaining%60;e<=9&&(e="0"+e),t<=9&&(t="0"+t);var n="".concat(e,":").concat(t);return u().createElement("div",null,this.format(this.props.message,{time:n}))}}])&&gh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function _h(e){return _h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_h(e)}function Ph(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_h(i)?i:String(i)),r)}var o,i}function kh(e,t){return kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kh(e,t)}function jh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ch(e)}var Th=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ch(r);if(o){var n=Ch(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jh(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(jh(t)),t.buildUrl=t.buildUrl.bind(jh(t)),t.handleSubmit=t.handleSubmit.bind(jh(t)),t.handleCancel=t.handleCancel.bind(jh(t)),t.handleDelayEnd=t.handleDelayEnd.bind(jh(t)),t.handlePostChange=t.handlePostChange.bind(jh(t)),t.handleContentChange=t.handleContentChange.bind(jh(t)),t.handleStatusChange=t.handleStatusChange.bind(jh(t)),t.handleSubscribeChange=t.handleSubscribeChange.bind(jh(t)),t.profile=null,t.editor=null,t.state={form:null,submitDisabled:!1,delay:!1,delayTimeSpan:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){"attract"!=this.props.mode&&"display"!=this.props.mode&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON(this.buildUrl()).done((function(t,n,r){e.profile=t.data.profile,e.editor=t.data.editor,e.setState({form:t.data.form},(function(){!0===this.props.autoFocus&&e.refs.post.focus()}))})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"buildUrl",value:function(){return"/api/forum/post/".concat(this.props.mode,"?type=").concat(this.props.type,"&id=").concat(this.props.itemID)+"".concat(null!=this.props.postID?"&postID="+this.props.postID:"")}},{key:"handleSubmit",value:function(){if(this.refs.post.validate()){var e=this;this.setState({submitDisabled:!0},(function(){var t=this.state.form;null!=t.content&&t.content.length>0&&(t.contentList=t.content.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:e.buildUrl(),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json"}).done((function(t,n,r){switch(t.data.result){case"Success":e.props.onSubmit(t.data);break;case"Delay":e.setState({delay:!0,delayTimeSpan:t.data.timeSpan})}})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.setState({submitDisabled:!1})}))}))}}},{key:"handleCancel",value:function(){this.refs.post.clear(),this.props.onCancel()}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.content=e,this.setState({form:t})}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:u().createElement("div",{className:"post-editor",id:"postEditor"},u().createElement(Uo,{profile:this.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),u().createElement(vh,{ref:"post",type:this.props.type,value:this.state.form.post,content:this.state.form.content,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:!0},"new"==this.props.mode&&0==this.editor.subscription&&u().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},u().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),u().createElement("label",{htmlFor:"subscribeFL"}," Watch discussion +")),this.editor&&this.editor.e&&u().createElement(wl,{options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange,isInline:!0}),u().createElement("span",{className:"button-group"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&u().createElement(Oh,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))}}])&&Ph(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Th.propTypes={mode:d().string,itemID:d().number,type:d().string,viewer:d().object,autoFocus:d().bool,onSubmit:d().func.isRequired,onCancel:d().func.isRequired},Th.defaultProps={autoFocus:!0,mode:"new",type:"Post"};const xh=Th;function Rh(e){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(e)}function Dh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rh(i)?i:String(i)),r)}var o,i}function Mh(e,t,n){return t&&Nh(e.prototype,t),n&&Nh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ih(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ah(e,t)}function Ah(e,t){return Ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ah(e,t)}function Lh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Fh(e);if(t){var o=Fh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Rh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bh(e)}(this,n)}}function Bh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fh(e){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fh(e)}var Uh=function(e){Ih(n,e);var t=Lh(n);function n(e){var r;return Dh(this,n),(r=t.call(this,e)).handleNew=r.handleNew.bind(Bh(r)),r.handleReply=r.handleReply.bind(Bh(r)),r.handleQuote=r.handleQuote.bind(Bh(r)),r.handleEdit=r.handleEdit.bind(Bh(r)),r.handleSubmit=r.handleSubmit.bind(Bh(r)),r.handleCancel=r.handleCancel.bind(Bh(r)),r.Modes={Display:"display",New:"new",Edit:"edit",Reply:"reply",Quote:"quote"},r.state={mode:r.props.mode,targetID:null},r}return Mh(n,[{key:"componentDidUpdate",value:function(){if(this.state.mode==this.Modes.New){var e=document.getElementById("postEditor");e&&e.scrollIntoView()}}},{key:"handleNew",value:function(){this.setState({mode:this.Modes.New,targetID:null})}},{key:"handleReply",value:function(e){this.setState({mode:this.Modes.Reply,targetID:e})}},{key:"handleQuote",value:function(e){this.setState({mode:this.Modes.Quote,targetID:e})}},{key:"handleEdit",value:function(e){this.setState({mode:this.Modes.Edit,targetID:e})}},{key:"handleSubmit",value:function(e){var t=this;this.setState({mode:this.Modes.Display,targetID:null},(function(){t.props.history.push(e.url)}))}},{key:"handleCancel",value:function(){this.setState({mode:this.Modes.Display,targetID:null})}},{key:"render",value:function(){var e=this,t=[];if(this.props.posts){this.props.posts.data.forEach((function(n,r){e.state.mode==e.Modes.Edit&&n.postID==e.state.targetID?t.push(u().createElement(xh,{key:0,mode:e.state.mode,type:"Discussion",itemID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel})):"GDPRRemoval"===n.status?t.push(u().createElement(Xu,{key:n.postID,post:n})):t.push(u().createElement(Hu,{key:n.postID,post:n,viewer:e.props.viewer,onReply:e.handleReply,onQuote:e.handleQuote,onEdit:e.handleEdit,showEditControls:e.props.topic.show.newPost})),e.state.mode!=e.Modes.Quote&&e.state.mode!=e.Modes.Reply||n.postID!=e.state.targetID||t.push(u().createElement(xh,{key:0,mode:e.state.mode,type:"Discussion",itemID:e.props.topic.topicID,postID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel}))})),this.state.mode==this.Modes.New&&t.push(u().createElement(xh,{key:0,mode:this.state.mode,type:"Discussion",itemID:this.props.topic.topicID,viewer:this.props.viewer,onSubmit:e.handleSubmit,onCancel:this.handleCancel}));var n=null;return this.props.topic.show.newPost&&this.state.mode==this.Modes.Display&&(n=u().createElement(qh,{onClick:this.handleNew})),u().createElement("div",null,u().createElement("div",{className:"comment-container forum"},this.props.posts.totalPages>1&&u().createElement(En,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),t,this.props.posts.totalPages>1&&u().createElement(En,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged})),n)}return u().createElement("div",{className:"subsection comment"},u().createElement("div",{className:"comment-container"},u().createElement("h4",null,"No Content")))}}]),n}(u().Component);Uh.propTypes={mode:d().string,topic:d().object,posts:d().object,viewer:d().object,onPageChanged:d().func};var qh=function(e){Ih(n,e);var t=Lh(n);function n(){return Dh(this,n),t.apply(this,arguments)}return Mh(n,[{key:"render",value:function(){return u().createElement("div",{className:"new-content-button"},u().createElement("button",{type:"button",className:"btn-primary",onClick:this.props.onClick},"Reply To Topic"))}}]),n}(u().Component);const Kh=Je(Uh);function Vh(e){return Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(e)}function zh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Vh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Vh(i)?i:String(i)),r)}var o,i}function Wh(e,t){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wh(e,t)}function Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hh(e)}var $h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hh(r);if(o){var n=Hh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Vh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;return null!=this.props.limitHeight&&(e={maxHeight:this.props.limitHeight}),u().createElement("div",{className:"image-element"},u().createElement("img",{src:this.props.content.data,style:e}),this.props.children)}}])&&zh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);$h.propTypes={content:d().object.isRequired,limitHeight:d().number};const Gh=$h;function Jh(e){return Jh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jh(e)}function Qh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Jh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Jh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Jh(i)?i:String(i)),r)}var o,i}function Yh(e,t){return Yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yh(e,t)}function Xh(e){return Xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xh(e)}var Zh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xh(r);if(o){var n=Xh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Jh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"text-element",dangerouslySetInnerHTML:sn.createMarkup(this.props.content.data)})}}])&&Qh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Zh.propTypes={content:d().object.isRequired};const ed=Zh;function td(e){return td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},td(e)}function nd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==td(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==td(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===td(i)?i:String(i)),r)}var o,i}function rd(e,t){return rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rd(e,t)}function od(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function id(e){return id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},id(e)}var ad=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=id(r);if(o){var n=id(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===td(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return od(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setHeight=t.setHeight.bind(od(t)),t.handleResize=t.handleResize.bind(od(t)),t.aspect=t.props.content.attributes.height/t.props.content.attributes.width,t.state={height:t.props.content.attributes.height},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;switch(this.props.content.format){case"YouTube":case"Vimeo":var t=null;switch(this.props.content.format){case"YouTube":t="https://www.youtube.com/embed/"+this.props.content.data;break;case"Vimeo":var n=this.props.content.data,r="";if(-1!=n.indexOf(":")){var o=n.split(":");n=o[0],r="h=".concat(o[1],"&")}t="https://player.vimeo.com/video/".concat(n,"?").concat(r,"byline=0&portrait=0")}e=u().createElement("iframe",{ref:"video",height:this.state.height,src:t,frameBorder:"0",allowFullScreen:!0});break;case"Wistia":var i="wistia_embed wistia_async_".concat(this.props.content.data),a={height:this.state.height,display:"inline-block"};e=u().createElement("div",{ref:"video",className:i,style:a}," ");break;case"QuickTime":e=u().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"},u().createElement("embed",{src:this.props.content.data,scale:"tofit",autoPlay:!1,loop:!0,controller:"true",airplay:"allow",pluginspage:"http://www.apple.com/quicktime/download/"}));break;default:e=u().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"})}return u().createElement("div",{className:"video-element"},e)}}])&&nd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ad.propTypes={content:d().object.isRequired,limitHeight:d().number};const sd=ad;function cd(e){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cd(e)}function ld(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==cd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==cd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===cd(i)?i:String(i)),r)}var o,i}function ud(e,t){return ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ud(e,t)}function fd(e){return fd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fd(e)}var pd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ud(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fd(r);if(o){var n=fd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",null,u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",{className:"details"},u().createElement("p",{className:"type"},this.props.content.type),u().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&ld(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);pd.propTypes={content:d().object.isRequired};const hd=pd;function dd(e){return dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(e)}function yd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==dd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===dd(i)?i:String(i)),r)}var o,i}function md(e,t){return md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},md(e,t)}function vd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bd(e){return bd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bd(e)}var gd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&md(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bd(r);if(o){var n=bd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===dd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vd(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setHeight=t.setHeight.bind(vd(t)),t.handleResize=t.handleResize.bind(vd(t)),t.aspect=.625,t.state={height:0},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;return"Sketchfab"===this.props.content.format&&(e="https://sketchfab.com/models/"+this.props.content.data+"/embed"),u().createElement("div",{className:"embedded3d-element"},u().createElement("iframe",{ref:"video",height:this.state.height,src:e,frameBorder:"0",allowFullScreen:!0}))}}])&&yd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);gd.propTypes={content:d().object.isRequired};const wd=gd;function Sd(e){return Sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sd(e)}function Ed(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Sd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Sd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Sd(i)?i:String(i)),r)}var o,i}function Od(e,t){return Od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Od(e,t)}function _d(e){return _d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_d(e)}var Pd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Od(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_d(r);if(o){var n=_d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Sd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.content)return null;switch(this.props.content.type){case"Image":return u().createElement(Gh,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight},this.props.children);case"Text":return u().createElement(ed,{display:this.props.display,content:this.props.content});case"Video":return u().createElement(sd,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});case"Embedded3DViewer":return u().createElement(wd,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});default:return u().createElement(hd,{display:this.props.display,content:this.props.content},this.props.children)}}}])&&Ed(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Pd.propTypes={display:d().string,limitHeight:d().number},Pd.defaultProps={display:"inline",limitHeight:null};const kd=Pd;function jd(e){return jd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jd(e)}function Cd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==jd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==jd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===jd(i)?i:String(i)),r)}var o,i}function Td(e,t){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Td(e,t)}function xd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rd(e){return Rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rd(e)}var Dd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Td(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Rd(r);if(o){var n=Rd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xd(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).updateValues=t.updateValues.bind(xd(t)),t.onThumbClick=t.onThumbClick.bind(xd(t)),t.changePrimary=t.changePrimary.bind(xd(t)),t.onOverlayOpen=t.onOverlayOpen.bind(xd(t)),t.onOverlayClose=t.onOverlayClose.bind(xd(t)),t.onChangeThumb=t.onChangeThumb.bind(xd(t)),t.onChangePrimary=t.onChangePrimary.bind(xd(t)),t.windowHeight=null,t.containerWidth=null,t.visibleThumbCount=null,t.showThumbNav=!1,t.showPrimaryNav=!1,t.state={currentIndex:0,thumbStartIndex:0,primary:t.props.gallery?t.props.gallery.primary:null,height:null,showOverlay:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.windowHeight=window.innerHeight,null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"componentDidUpdate",value:function(){null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"updateValues",value:function(){this.containerWidth=this.wrapper.offsetWidth,null!=this.props.gallery.content&&this.props.gallery.content.length>1&&(this.showPrimaryNav=!0),this.visibleThumbCount=Math.floor(this.containerWidth/this.props.thumbWidth),null==this.props.gallery.content||this.visibleThumbCount>=this.props.gallery.content.length?this.showThumbNav=!1:(this.showThumbNav=!0,this.visibleThumbCount*this.props.thumbWidth+2*this.props.navWidth>this.containerWidth&&(this.visibleThumbCount=this.visibleThumbCount-1));var e=this.state.showOverlay?this.windowHeight-80-100-5:this.wrapper.offsetWidth*this.props.aspectMultiplier;this.setState({height:e,thumbStartIndex:0})}},{key:"onThumbClick",value:function(e,t){t.preventDefault(),this.changePrimary(e)}},{key:"changePrimary",value:function(e){if(e!=this.state.currentIndex){var t=this.props.gallery.content[e].id,n=this.state.thumbStartIndex;e<this.state.thumbStartIndex?n=e:e>this.state.thumbStartIndex+this.visibleThumbCount-1&&(n+=1);var r=this,o=sn.format(this.props.dataUrl,t);$.getJSON(o).done((function(t,o,i){r.setState({primary:t,currentIndex:e,thumbStartIndex:n})})).fail((function(e,t,n){}))}}},{key:"onOverlayOpen",value:function(){this.setState({showOverlay:!0,height:null})}},{key:"onOverlayClose",value:function(){this.setState({showOverlay:!1,height:null})}},{key:"onChangeThumb",value:function(e,t){t.preventDefault();var n=this.state.thumbStartIndex+e;n<0?n=0:n>this.props.gallery.content.length-this.visibleThumbCount&&(n=this.props.gallery.content.length-this.visibleThumbCount),this.setState({thumbStartIndex:n})}},{key:"onChangePrimary",value:function(e,t){var n=this.state.currentIndex+e;n<0?n=0:n>this.props.gallery.content.length-1&&(n=this.props.gallery.content.length-1),this.changePrimary(n)}},{key:"render",value:function(){if(null==this.props.gallery)return null;var e=this;if(null==this.state.height||null==this.state.primary){e=this;var t=u().createElement("div",{className:"embedded-gallery-test",ref:function(t){e.wrapper=t}}," ");return!0===this.state.showOverlay?u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%",height:e.windowHeight-80}},t):t}var n="embedded-gallery";!0===this.state.showOverlay&&(n+=" overlay");var r=[];if(null!=this.props.gallery.content){var o=this.state.currentIndex>0,i=this.state.currentIndex<this.props.gallery.content.length-1,a=this.state.thumbStartIndex+(this.visibleThumbCount-1);a>this.props.gallery.content.length-1&&(a=this.props.gallery.content.length-1);for(var s=this.state.thumbStartIndex>0,c=a<this.props.gallery.content.length-1,l=this.state.thumbStartIndex;l<=a;l++){var f=this.props.gallery.content[l],p=e.state.currentIndex===l?"active":"";r.push(u().createElement("a",{key:f.id,href:"#",className:p,style:{backgroundImage:"url("+f.thumbUrl+")"},onClick:e.onThumbClick.bind(null,l)}))}}var h=u().createElement("div",{className:n,style:this.props.style},u().createElement("div",{className:"primary-container"},u().createElement("div",{className:"primary",style:{height:this.state.height}},this.props.children&&!this.state.showOverlay&&u().createElement("div",{className:"child-controls"},this.props.children),!this.state.showOverlay&&u().createElement("span",{className:"open-overlay glyphicon glyphicon-fullscreen",onClick:this.onOverlayOpen}),u().createElement(kd,{content:this.state.primary,limitHeight:this.state.height}),this.showPrimaryNav&&u().createElement("button",{className:"nav left",onClick:this.onChangePrimary.bind(null,-1),disabled:!o},u().createElement("span",{className:"glyphicon glyphicon-menu-left"})),this.showPrimaryNav&&u().createElement("button",{className:"nav right",onClick:this.onChangePrimary.bind(null,1),disabled:!i},u().createElement("span",{className:"glyphicon glyphicon-menu-right"})))),null!=this.props.gallery.content&&this.props.gallery.content.length>1&&u().createElement("div",{className:"thumbs"},u().createElement("div",{className:"clearfix"},this.showThumbNav&&u().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,-1),disabled:!s},u().createElement("span",{className:"glyphicon glyphicon-menu-left"})),r,this.showThumbNav&&u().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,1),disabled:!c},u().createElement("span",{className:"glyphicon glyphicon-menu-right"})))));return!0===this.state.showOverlay?u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%"}},h):h}}])&&Cd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Dd.propTypes={gallery:d().object,aspectMultiplier:d().number,thumbWidth:d().number,navWidth:d().number},Dd.defaultProps={aspectMultiplier:1,thumbWidth:160,navWidth:30};const Nd=Dd,Md=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return e[n];return null},Id=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null},Ad=function(e,t){if(null!=e&&0!=e.length)for(var n=0;n<e.length;n++)e[n].id==t&&e.splice(n,1)},Ld=function(e){return{id:e.id,tagData:e.tagData,categoryData:e.categoryData,productData:e.productData}},Bd=function(e){return{id:e.id,tagData:e.tagData,categoryData:e.categoryData,productData:e.productData,productReleaseData:e.productReleaseData}};var Fd=o(2066),Ud=o.n(Fd);function qd(e){return qd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qd(e)}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kd.apply(this,arguments)}function Vd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==qd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==qd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===qd(i)?i:String(i)),r)}var o,i}function zd(e,t){return zd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zd(e,t)}function Wd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hd(e){return Hd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hd(e)}var $d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hd(r);if(o){var n=Hd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===qd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wd(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onShowCrop=t.onShowCrop.bind(Wd(t)),t.onCancel=t.onCancel.bind(Wd(t)),t.onAccept=t.onAccept.bind(Wd(t)),t.onCropComplete=t.onCropComplete.bind(Wd(t)),t._pixelCrop=null,t.state={showCrop:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this._maxHeight=.95*$(window).height();var e=new Image;e.src=this.props.src;var t=this;e.onload=function(){t._imgWidth=this.width,t._imgHeight=this.height,t.onShowCrop()}}},{key:"onShowCrop",value:function(){this.setState({showCrop:!0})}},{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onAccept",value:function(){this.props.onAccept(this._pixelCrop)}},{key:"onCropComplete",value:function(e,t){this._pixelCrop=t}},{key:"render",value:function(){var e=this,t=null;if(this._imgHeight>this._maxHeight){var n=(this._maxHeight-100)/this._imgHeight;t={style:{width:this._imgWidth*n+"px",margin:"0 auto"}}}var r=this.props.size.width/this.props.size.height,o={crop:{aspect:r},minWidth:this.props.size.width/this._imgWidth*100,minHeight:this.props.size.height/this._imgHeight*100};return r>=1?o.crop.height=100:o.crop.width=100,u().createElement("div",{className:"imagecrop-editor clearfix"},u().createElement("div",t,this.state.showCrop?u().createElement(Ud(),Kd({src:this.props.src},o,{onComplete:function(t,n){return e.onCropComplete(t,n)}})):null),u().createElement("div",{className:"pull-right"},u().createElement("button",{className:"btn-default",onClick:this.onCancel},"Cancel"),u().createElement("button",{className:"btn-primary",onClick:this.onAccept},"Accept")))}}])&&Vd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);$d.propTypes={onCancel:d().func.isRequired,onAccept:d().func.isRequired,src:d().string.isRequired,size:d().object.isRequired};const Gd=$d;function Jd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qd(e,t){if(e){if("string"==typeof e)return Jd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(e,t):void 0}}function Yd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Qd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xd(e){return Xd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(e)}function Zd(e){var t=function(e,t){if("object"!==Xd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Xd(t)?t:String(t)}function ey(e,t,n){return(t=Zd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ty(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){ey(e,t,n[t])}))}return e}function ny(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ry(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zd(r.key),r)}}function oy(e,t,n){return t&&ry(e.prototype,t),n&&ry(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ay(e,t){if(t&&("object"===Xd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return iy(e)}function sy(e){return sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sy(e)}function cy(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pe(e,t)}var ly=o(3996),uy=o.n(ly);var fy=function(){function e(){ny(this,e),ey(this,"refs",{})}return oy(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(py)}}]),e}();function py(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function hy(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var dy={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},yy=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function my(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function vy(e,t){e.style["".concat(yy,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function by(e,t){e.style["".concat(yy,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function gy(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function wy(e,t,n){return Math.max(e,Math.min(n,t))}function Sy(e){return"px"===e.substr(-2)?parseFloat(e):0}function Ey(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function Oy(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function _y(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function Py(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:Py(e.parentNode,t,r)}}function ky(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);uy()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=s[1]}return uy()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function jy(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:jy(e.parentNode):null}var Cy={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function Ty(e){return null!=e.sortableHandle}var xy,Ry=function(){function e(t,n){ny(this,e),this.container=t,this.onScrollCallback=n}return oy(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,s={x:0,y:0},c={x:1,y:1},l=this.container,u=l.scrollTop,f=l.scrollLeft,p=l.scrollHeight,h=l.scrollWidth,d=0===u,y=p-u-l.clientHeight==0,m=0===f,v=h-f-l.clientWidth==0;n.y>=o.y-a/2&&!y?(s.y=1,c.y=10*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!v?(s.x=1,c.x=10*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!d?(s.y=-1,c.y=10*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!m&&(s.x=-1,c.x=10*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:c.x*s.x,top:c.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),Dy={axis:d().oneOf(["x","y","xy"]),contentWindow:d().any,disableAutoscroll:d().bool,distance:d().number,getContainer:d().func,getHelperDimensions:d().func,helperClass:d().string,helperContainer:d().oneOfType([d().func,"undefined"==typeof HTMLElement?d().any:d().instanceOf(HTMLElement)]),hideSortableGhost:d().bool,keyboardSortingTransitionDuration:d().number,lockAxis:d().string,lockOffset:d().oneOfType([d().number,d().string,d().arrayOf(d().oneOfType([d().number,d().string]))]),lockToContainerEdges:d().bool,onSortEnd:d().func,onSortMove:d().func,onSortOver:d().func,onSortStart:d().func,pressDelay:d().number,pressThreshold:d().number,keyCodes:d().shape({lift:d().arrayOf(d().number),drop:d().arrayOf(d().number),cancel:d().arrayOf(d().number),up:d().arrayOf(d().number),down:d().arrayOf(d().number)}),shouldCancelStart:d().func,transitionDuration:d().number,updateBeforeSortStart:d().func,useDragHandle:d().bool,useWindowAsScrollContainer:d().bool},Ny={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},My={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:Ny,shouldCancelStart:function(e){return-1!==[Cy.Input,Cy.Textarea,Cy.Select,Cy.Option,Cy.Button].indexOf(e.target.tagName)||!!gy(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},Iy=Object.keys(Dy),Ay=(0,l.createContext)({manager:{}}),Ly={index:d().number.isRequired,collection:d().oneOfType([d().number,d().string]),disabled:d().bool},By=Object.keys(Ly);function Fy(e){return Fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fy(e)}function Uy(e,t,n){return(t=Ky(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ky(r.key),r)}}function Ky(e){var t=function(e,t){if("object"!==Fy(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Fy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Fy(t)?t:String(t)}function Vy(e,t){return Vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vy(e,t)}function zy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wy(e){return Wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wy(e)}var Hy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vy(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wy(r);if(o){var n=Wy(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zy(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(zy(t)),t.validate=t.validate.bind(zy(t)),t.valid=t.valid.bind(zy(t)),t.getContent=t.getContent.bind(zy(t)),t.getNodes=t.getNodes.bind(zy(t)),t.hasContent=t.hasContent.bind(zy(t)),t.addContent=t.addContent.bind(zy(t)),t.onEditThumbnail=t.onEditThumbnail.bind(zy(t)),t.onAcceptCrop=t.onAcceptCrop.bind(zy(t)),t.onCancelCrop=t.onCancelCrop.bind(zy(t)),t.onDeleteContent=t.onDeleteContent.bind(zy(t)),t.onSortEnd=t.onSortEnd.bind(zy(t)),t.onUpdate=t.onUpdate.bind(zy(t)),t.imageCropSize=null,t.thumbCropData=null,t.state={content:null!=t.props.content?t.props.content:[],showImageCropModal:!1,imageCropIndex:null,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getContent",value:function(){return{content:this.state.content,thumbCropData:this.thumbCropData}}},{key:"getNodes",value:function(){return this.state.content.map((function(e,t){return{id:sn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null}}))}},{key:"hasContent",value:function(){return null!=this.state&&null!=this.state.content&&this.state.content.length>0}},{key:"addContent",value:function(e){var t=this,n=sn.cloneArray(this.state.content);(null!=e||e.length>0)&&(n=this.state.content.concat(e)),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onEditThumbnail",value:function(e){var t=Id(this.state.content,e);null!=t&&this.setState({showImageCropModal:!0,imageCropIndex:t})}},{key:"onAcceptCrop",value:function(e){var t=this.state.content[this.state.imageCropIndex].id;0==this.state.imageCropIndex?this.thumbCropData={id:t,crop:e}:this.thumbCropData=null;var n=this;$.ajax({type:"POST",url:"/api/content/".concat(t,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,t,r){var o=n.state.content;o[n.state.imageCropIndex].thumbUrl=e,n.setState({content:o,showImageCropModal:!1,imageCropIndex:null})})).fail((function(e,t,r){alerts.error(e.responseJSON.errorMessage),n.setState({showImageCropModal:!1,imageCropIndex:null})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1,imageCropIndex:null})}},{key:"onDeleteContent",value:function(e){var t=this,n=sn.cloneArray(this.state.content);Ad(n,e),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onSortEnd",value:function(e){var t,n,r,o=this,i=this.state.content;this.setState({content:(t=i,n=e.oldIndex,r=e.newIndex,(t=t.slice()).splice(r<0?t.length+r:r,0,t.splice(n,1)[0]),t)},(function(){o.onUpdate()}))}},{key:"onUpdate",value:function(){this.props.onUpdate&&this.props.onUpdate(this.state.content)}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t="";!0===this.props.required&&(t+=" required");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=u().createElement(fi,{message:this.props.helpMessage})):n=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},this.props.label&&u().createElement("label",{className:t},this.props.label),u().createElement("div",{className:"tfpanel"},u().createElement($y,{content:this.state.content,staticContent:this.staticContent,onSortEnd:this.onSortEnd,useDragHandle:!0,axis:"xy",onEditThumbnail:this.onEditThumbnail,onDelete:this.onDeleteContent})),n,u().createElement(rh,{groupsAllowed:["Portfolio"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.addContent,showCancel:!1},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||this.state.isValid?null:u().createElement(fi,{message:"At least one content item (image/video) is required"}),this.props.children,this.state.showImageCropModal&&u().createElement(I,null,u().createElement(Gd,{src:this.state.content[this.state.imageCropIndex].coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}],n&&qy(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Hy.propTypes=(Uy(xy={label:d().string,placeholder:d().string,helpMessage:d().string,content:d().array,required:d().bool,requiredErrorMessage:d().string,fileSizeLimit:d().number},"required",d().bool),Uy(xy,"requiredErrorMessage",d().string),xy),Hy.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};var $y=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;ny(this,n),ey(iy(iy(t=ay(this,sy(n).call(this,e)))),"state",{}),ey(iy(iy(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=_y(e);var i=gy(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,s=i.sortableInfo,c=s.index,l=s.collection;if(s.disabled)return;if(a&&!gy(e.target,Ty))return;t.manager.active={collection:l,index:c},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==Cy.Anchor||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),ey(iy(iy(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),ey(iy(iy(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=_y(e),a={x:t.position.x-i.x,y:t.position.y-i.y},s=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(s>=o)?r&&s>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),ey(iy(iy(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),ey(iy(iy(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),ey(iy(iy(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n,r,o,l,y,m,v,b=p.sortableInfo.index,g=(n=p,{bottom:Sy((r=window.getComputedStyle(n)).marginBottom),left:Sy(r.marginLeft),right:Sy(r.marginRight),top:Sy(r.marginTop)}),w=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:Sy(t.gridColumnGap),y:Sy(t.gridRowGap)}:{x:0,y:0}}(t.container),S=t.scrollContainer.getBoundingClientRect(),E=a({index:b,node:p,collection:h});if(t.node=p,t.margin=g,t.gridGap=w,t.width=E.width,t.height=E.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=S,t.index=b,t.newIndex=b,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=Py(p,t.container),t.initialOffset=_y(d?ty({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((l="input, textarea, select, canvas, [contenteditable]",y=(o=p).querySelectorAll(l),(v=(m=o.cloneNode(!0)).querySelectorAll(l),function(e){if(Array.isArray(e))return Jd(e)}(v)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(v)||Qd(v)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e,t){"file"!==e.type&&(e.value=y[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===Cy.Canvas&&y[t].width>0&&y[t].height>0&&e.getContext("2d").drawImage(y[t],0,0)})),m)),my(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-g.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-g.top,"px"),width:"".concat(t.width,"px")}),d&&t.helper.focus(),c&&(t.sortableGhost=p,my(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},d){var O=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,_=O.top,P=O.left,k=O.width,j=_+O.height,C=P+k;t.axis.x&&(t.minTranslate.x=P-t.boundingClientRect.left,t.maxTranslate.x=C-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=_-t.boundingClientRect.top,t.maxTranslate.y=j-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:S.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:S.left+S.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:S.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:S.top+S.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,d?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(dy.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),dy.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:b}),u&&u({node:p,index:b,collection:h,isKeySorting:d,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),d&&t.keyMove(0)},o=t.props,i=o.axis,a=o.getHelperDimensions,s=o.helperClass,c=o.hideSortableGhost,l=o.updateBeforeSortStart,u=o.onSortStart,f=o.useWindowAsScrollContainer,p=n.node,h=n.collection,d=t.manager.isKeySorting,y=function(){if("function"==typeof l){t._awaitingUpdateBeforeSortStart=!0;var n=function(t,n){try{var r=function(){var t=p.sortableInfo.index;return Promise.resolve(l({collection:h,index:t,node:p,isKeySorting:d},e)).then((function(){}))}()}catch(e){return n(!0,e)}return r&&r.then?r.then(n.bind(null,!1),n.bind(null,!0)):n(!1,value)}(0,(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),ey(iy(iy(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),ey(iy(iy(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,s=i.isKeySorting,c=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(dy.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),dy.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&my(t.sortableGhost,{opacity:"",visibility:""});for(var l=0,u=c.length;l<u;l++){var f=c[l],p=f.node;f.edgeOffset=null,f.boundingClientRect=null,vy(p,null),by(p,null),f.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:c},e),t.touched=!1})),ey(iy(iy(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=ty({},t.translate),o=0,i=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),i=t.translate.y-r.y),t.translate=r,vy(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=i)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),ey(iy(iy(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),ey(iy(iy(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,o=r.shouldCancelStart,i=r.keyCodes,a=ty({},Ny,void 0===i?{}:i);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||a.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),a.lift.includes(n)&&!t.manager.active?t.keyLift(e):a.drop.includes(n)&&t.manager.active?t.keyDrop(e):a.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):a.up.includes(n)?t.keyMove(-1):a.down.includes(n)&&t.keyMove(1))})),ey(iy(iy(t)),"keyLift",(function(e){var n=e.target,r=gy(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=r.index,i=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:i},t.handlePress(e)})),ey(iy(iy(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,i=t.newIndex;if(!(o<0||o>r)){t.prevIndex=i,t.newIndex=o;var a=function(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===a})),c=s.node,l=t.containerScrollDelta,u=s.boundingClientRect||Oy(c,l),f=s.translate||{x:0,y:0},p=u.top+f.y-l.top,h=u.left+f.x-l.left,d=i<o,y=d&&t.axis.x?c.offsetWidth-t.width:0,m=d&&t.axis.y?c.offsetHeight-t.height:0;t.handleSortMove({pageX:h+y,pageY:p+m,ignoreTransition:0===e})}})),ey(iy(iy(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),ey(iy(iy(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),ey(iy(iy(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,o=gy(r,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?Ty(r):r.sortableInfo)}));var r=new fy;return function(e){uy()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=r,t.wrappedInstance=(0,l.createRef)(),t.sortableContextValue={manager:r},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return cy(n,t),oy(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:jy(e.container)||e.container,e.autoScroller=new Ry(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return dy[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return dy[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,o=t.lockToContainerEdges,i=t.transitionDuration,a=t.keyboardSortingTransitionDuration,s=void 0===a?i:a,c=this.manager.isKeySorting,l=e.ignoreTransition,u=_y(e),f={x:u.x-this.initialOffset.x,y:u.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,o){var p=function(e){var t=e.height,n=e.width,r=e.lockOffset,o=Array.isArray(r)?r:[r,r];uy()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var i=Yd(o,2),a=i[0],s=i[1];return[ky({height:t,lockOffset:a,width:n}),ky({height:t,lockOffset:s,width:n})]}({height:this.height,lockOffset:r,width:this.width}),h=Yd(p,2),d=h[0],y=h[1],m={x:this.width/2-d.x,y:this.height/2-d.y},v={x:this.width/2-y.x,y:this.height/2-y.y};f.x=wy(this.minTranslate.x+m.x,this.maxTranslate.x-v.x,f.x),f.y=wy(this.minTranslate.y+m.y,this.maxTranslate.y-v.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),c&&s&&!l&&by(this.helper,s),vy(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,o=this.containerScrollDelta,i=this.windowScrollDelta,a=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+o.left,c=this.offsetEdge.top+this.translate.y+o.top,l=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var f=0,p=a.length;f<p;f++){var h=a[f].node,d=h.sortableInfo.index,y=h.offsetWidth,m=h.offsetHeight,v={height:this.height>m?m/2:this.height/2,width:this.width>y?y/2:this.width/2},b=l&&d>this.index&&d<=u,g=l&&d<this.index&&d>=u,w={x:0,y:0},S=a[f].edgeOffset;S||(S=Py(h,this.container),a[f].edgeOffset=S,l&&(a[f].boundingClientRect=Oy(h,o)));var E=f<a.length-1&&a[f+1],O=f>0&&a[f-1];E&&!E.edgeOffset&&(E.edgeOffset=Py(E.node,this.container),l&&(E.boundingClientRect=Oy(E.node,o))),d!==this.index?(t&&by(h,t),this.axis.x?this.axis.y?g||d<this.index&&(s+i.left-v.width<=S.left&&c+i.top<=S.top+v.height||c+i.top+v.height<=S.top)?(w.x=this.width+this.marginOffset.x,S.left+w.x>this.containerBoundingRect.width-v.width&&E&&(w.x=E.edgeOffset.left-S.left,w.y=E.edgeOffset.top-S.top),null===this.newIndex&&(this.newIndex=d)):(b||d>this.index&&(s+i.left+v.width>=S.left&&c+i.top+v.height>=S.top||c+i.top+v.height>=S.top+m))&&(w.x=-(this.width+this.marginOffset.x),S.left+w.x<this.containerBoundingRect.left+v.width&&O&&(w.x=O.edgeOffset.left-S.left,w.y=O.edgeOffset.top-S.top),this.newIndex=d):b||d>this.index&&s+i.left+v.width>=S.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=d):(g||d<this.index&&s+i.left<=S.left+v.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=d)):this.axis.y&&(b||d>this.index&&c+i.top+v.height>=S.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=d):(g||d<this.index&&c+i.top<=S.top+v.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=d))),vy(h,w),a[f].translate=w):n&&(this.sortableGhost=h,my(h,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),l&&(this.newIndex=u);var _=l?this.prevIndex:u;r&&this.newIndex!==_&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:_,isKeySorting:l,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return uy()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,y.findDOMNode)(this):e(r.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(Ay.Provider,{value:this.sortableContextValue},(0,l.createElement)(e,de({ref:t},hy(this.props,Iy))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(l.Component),ey(t,"displayName",Ey("sortableList",e)),ey(t,"defaultProps",My),ey(t,"propTypes",Dy),n}((function(e){var t=e.content,n=e.onEditThumbnail,r=e.onDelete,o=null!=t&&t.length>1,i=t.map((function(e,t){return u().createElement(Jy,{key:e.id,index:t,contentItem:e,onEditThumbnail:n,onDelete:r},o&&u().createElement(Gy,null))}));return u().createElement("ul",{className:"gallery-editor-content"},i)})),Gy=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;ny(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return ey(iy(iy(t=ay(this,(e=sy(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,l.createRef)()),t}return cy(n,t),oy(n,[{key:"componentDidMount",value:function(){(0,y.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return uy()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(e,de({ref:t},this.props))}}]),n}(l.Component),ey(t,"displayName",Ey("sortableHandle",e)),n}((function(){return u().createElement("span",{className:"handle no-select"},"::")})),Jy=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;ny(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return ey(iy(iy(t=ay(this,(e=sy(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,l.createRef)()),t}return cy(n,t),oy(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=(0,y.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return uy()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(e,de({ref:t},hy(this.props,By)))}}]),n}(l.Component),ey(t,"displayName",Ey("sortableElement",e)),ey(t,"contextType",Ay),ey(t,"propTypes",Ly),ey(t,"defaultProps",{collection:0}),n}((function(e){var t=e.children,n=e.contentItem,r=e.onEditThumbnail,o=e.onDelete,i=[];return i.push(u().createElement("a",{onClick:r.bind(null,n.id)},"Edit Thumbnail")),i.push(u().createElement("a",{onClick:o.bind(null,n.id)},"Delete")),u().createElement("li",{className:"gallery-editor-content-item"},u().createElement("img",{className:"no-drag",src:n.thumbUrl}),u().createElement("div",{className:"edit"},t,!n.hasOwnProperty("isStatic")&&u().createElement(eo,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})))}));const Qy=Hy;function Yy(e){return Yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yy(e)}function Xy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Yy(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Yy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Yy(i)?i:String(i)),r)}var o,i}function Zy(e,t){return Zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zy(e,t)}function em(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tm(e)}var nm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zy(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tm(r);if(o){var n=tm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Yy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return em(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEditClick=t.handleEditClick.bind(em(t)),t.handleEditCancel=t.handleEditCancel.bind(em(t)),t.handleEditSaveChanges=t.handleEditSaveChanges.bind(em(t)),t.state={mode:"view"},t}return t=a,(n=[{key:"handleEditClick",value:function(){this.setState({mode:"edit"})}},{key:"handleEditCancel",value:function(){this.setState({mode:"view"})}},{key:"handleEditSaveChanges",value:function(){var e={headerContentList:null,thumbCropData:null};if(!this.refs.header.validate())return!1;var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData),$.ajax({type:"POST",url:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header"),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({mode:"view"},(function(){this.props.onUpdate(e.header)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}},{key:"render",value:function(){return"view"==this.state.mode?u().createElement("div",{className:"forum-project-gallery"},u().createElement(Nd,{gallery:this.props.topic.header,aspectMultiplier:.5625,dataUrl:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header/{0}")},this.props.topic.viewer.canEdit&&u().createElement("div",{className:"edit"},u().createElement("button",{className:"icon icon-after icon-edit",onClick:this.handleEditClick},"Edit Gallery")))):u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Gallery Content"),u().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),u().createElement(Qy,{ref:"header",content:this.props.topic.header.content,required:!0},u().createElement("div",{style:{textAlign:"right"}},u().createElement("button",{onClick:this.handleEditCancel},"Cancel"),u().createElement("button",{onClick:this.handleEditSaveChanges},"Save Changes"))))}}])&&Xy(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);nm.propTypes={onUpdate:d().func};const rm=nm;function om(e){return om="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(e)}function im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==om(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==om(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===om(i)?i:String(i)),r)}var o,i}function am(e,t){return am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},am(e,t)}function sm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cm(e)}const lm=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&am(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cm(r);if(o){var n=cm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===om(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sm(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(sm(t)),t.addQuerystring=t.addQuerystring.bind(sm(t)),t.getData=t.getData.bind(sm(t)),t.handleNewPage=t.handleNewPage.bind(sm(t)),t.handleHeaderGalleryUpdate=t.handleHeaderGalleryUpdate.bind(sm(t)),t.parsedQS=on.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.mode=t.parsedQS.mode?t.parsedQS.mode:null,t.postID=t.parsedQS.postID?t.parsedQS.postID:null,t.show=t.parsedQS.show?t.parsedQS.show:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=on.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"componentDidUpdate",value:function(){}},{key:"buildUrl",value:function(){var e="/api/discuss/topic/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){sn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,null,null,e,this.show),this.props.history.push(t)}},{key:"handleHeaderGalleryUpdate",value:function(e){var t=JSON.parse(JSON.stringify(this.state.topic));t.header=e,this.setState({topic:t})}},{key:"render",value:function(){if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics)return u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(hn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(zs,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}}));var e="".concat(window.location.origin).concat(this.state.topic.url);return this.page>0&&(e+="?page=".concat(this.page)),u().createElement("div",null,u().createElement(rn,null,u().createElement("title",null,this.state.topic.text),u().createElement("meta",{property:"og:url",content:"".concat(window.location.origin).concat(this.state.topic.url)}),u().createElement("meta",{property:"og:type",content:"article"}),u().createElement("meta",{property:"og:title",content:this.state.topic.text}),u().createElement("link",{rel:"canonical",href:e})),u().createElement(hl,{topic:this.state.topic,forumPath:this.state.forum.path},this.state.posts&&this.state.topic.viewer.e&&u().createElement(Nl,{topic:this.state.topic})),this.state.topic.header&&null!=this.state.topic.header&&u().createElement(rm,{topic:this.state.topic,onUpdate:this.handleHeaderGalleryUpdate}),u().createElement(Kh,{mode:"display",topic:this.state.topic,posts:this.state.posts,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))}}])&&im(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function um(e){return um="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(e)}function fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==um(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==um(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===um(i)?i:String(i)),r)}var o,i}function pm(e,t){return pm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pm(e,t)}function hm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dm(e)}const ym=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dm(r);if(o){var n=dm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===um(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hm(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(hm(t)),t.addQuerystring=t.addQuerystring.bind(hm(t)),t.getData=t.getData.bind(hm(t)),t.parsedQS=on.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.mode=t.parsedQS.mode?t.parsedQS.mode:null,t.postID=t.parsedQS.postID?t.parsedQS.postID:null,t.show=t.parsedQS.show?t.parsedQS.show:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=on.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"buildUrl",value:function(){var e="/api/discuss/link/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){sn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.replace(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics?u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(hn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(zs,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):null}}])&&fm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function mm(e){return mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mm(e)}function vm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==mm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===mm(i)?i:String(i)),r)}var o,i}function bm(e,t){return bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bm(e,t)}function gm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wm(e){return wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wm(e)}const Sm=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=wm(r);if(o){var n=wm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===mm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gm(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(gm(t)),t.addQuerystring=t.addQuerystring.bind(gm(t)),t.getData=t.getData.bind(gm(t)),t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,post:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/post/"+this.props.match.params.id;return this.addQuerystring(e)}},{key:"addQuerystring",value:function(e){var t=[];return t.length>0&&(e+="?"+t.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,post:t.post,viewer:t.viewer,nav:t.nav})})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics||null===this.state.posts?u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(hn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(zs,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):u().createElement("div",null,u().createElement(rn,null,u().createElement("title",null,this.state.topic.text),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.post.url)})),u().createElement(hl,{viewMode:"PostView",topic:this.state.topic,post:this.state.post,forumPath:this.state.forum.path}),u().createElement("div",{className:"subsection comment"},u().createElement("div",{className:"comment-container"},u().createElement(Hu,{post:this.state.post,topic:this.state.topic,viewer:this.state.viewer,displayMode:"single"}))))}}])&&vm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function Em(e){return Em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Em(e)}function Om(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Em(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Em(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Em(i)?i:String(i)),r)}var o,i}function Pm(e,t,n){return t&&_m(e.prototype,t),n&&_m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function km(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jm(e,t)}function jm(e,t){return jm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jm(e,t)}function Cm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xm(e);if(t){var o=xm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Em(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Tm(e)}(this,n)}}function Tm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xm(e)}var Rm=function(e){km(n,e);var t=Cm(n);function n(e){var r;Om(this,n),(r=t.call(this,e)).setup=r.setup.bind(Tm(r)),r.handleCancel=r.handleCancel.bind(Tm(r)),r.handleSubmit=r.handleSubmit.bind(Tm(r)),r.handleDelayEnd=r.handleDelayEnd.bind(Tm(r)),r.handleTopicChange=r.handleTopicChange.bind(Tm(r)),r.handlePostChange=r.handlePostChange.bind(Tm(r)),r.handleContentChange=r.handleContentChange.bind(Tm(r)),r.handleSubscribeChange=r.handleSubscribeChange.bind(Tm(r)),r.handleTopicLinkChange=r.handleTopicLinkChange.bind(Tm(r)),r.parsedQS=on.parse(e.location.search),r.viewer=null,r.forum=null;var o=r.props.location.pathname.split("/");return r.state={enabled:!1,type:o[2],mode:o[3],itemID:r.parsedQS.id,form:null,postValue:r.props.value?r.props.value:"",submitDisabled:!1,delay:!1,delayTimeSpan:null},r}return Pm(n,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-regular light"),this.setup()}},{key:"setup",value:function(){var e="/api/discuss/topic/new?id="+this.state.itemID,t=this;$.getJSON(e).done((function(e,n,r){t.viewer=e.data.viewer,t.forum=e.data.forum,t.setState({enabled:!0,form:e.data.form,postValue:e.data.form.post})})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.props.history.goBack()}))}},{key:"handleCancel",value:function(){this.props.history.goBack()}},{key:"handleSubmit",value:function(){var e=!0;"topic"==this.state.type&&(e=this.refs.topic.validate());var t=!0;"Gallery"===this.state.form.type&&(t=this.refs.header.validate());var n=this.refs.post.validate();e&&t&&n&&this.setState({submitDisabled:!0},(function(){var e=this.state.form;if("Gallery"===this.state.form.type){var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData)}null!=e.postContent&&e.postContent.length>0&&(e.postContentList=e.postContent.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:"/api/discuss/topic/new?id="+this.state.itemID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){switch(e.data.result){case"Success":this.props.history.push(e.data.url);break;case"Delay":this.setState({delay:!0,delayTimeSpan:e.data.timeSpan})}})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}))}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handleTopicChange",value:function(e){var t=this.state.form;t.title=e,this.setState({form:t})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.postContent=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"handleTopicLinkChange",value:function(e){var t=this.state.form;t.topicLinkFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Start a new discussion in ",this.forum.name))),u().createElement("div",{className:"container subsection"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Dm,{ref:"topic",value:this.state.form.topic,onChange:this.handleTopicChange,enabled:this.state.enabled},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),u().createElement("label",{htmlFor:"subscribeFL"},"Watch topic +")),this.viewer.e&&this.forum.allowTopicLink&&u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"linkFL",name:"linkFL",ref:"topicTopicFL",onChange:this.handleTopicLinkChange}),u().createElement("label",{htmlFor:"linkFL"},"Create Topic Link in News & Announcements"))),"Gallery"===this.state.form.type&&u().createElement("div",{className:"gallery-editor"},u().createElement("label",null,"Gallery Content"),u().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),u().createElement(Qy,{ref:"header",content:this.state.form.headerContent,required:!0})),u().createElement("div",{className:"post-editor"},u().createElement(Uo,{profile:this.viewer.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),u().createElement(vh,{ref:"post",type:"Discussion",value:null!=this.state.form.post?this.state.form.post:"",content:this.state.form.postContent,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:this.state.enabled},u().createElement("span",{className:"button-group"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&u().createElement(Oh,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))))))}}]),n}(u().Component),Dm=function(e){km(n,e);var t=Cm(n);function n(e){var r;return Om(this,n),(r=t.call(this,e)).validate=r.validate.bind(Tm(r)),r.valid=r.valid.bind(Tm(r)),r.getValue=r.getValue.bind(Tm(r)),r.handleTopicChange=r.handleTopicChange.bind(Tm(r)),r.handleFocus=r.handleFocus.bind(Tm(r)),r.handleBlur=r.handleBlur.bind(Tm(r)),r.state={isValid:!1,showValidation:!1},r}return Pm(n,[{key:"componentDidMount",value:function(){this.handleTopicChange()}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleTopicChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.refs.title.value)}},{key:"handleFocus",value:function(){}},{key:"handleBlur",value:function(){}},{key:"render",value:function(){var e="form-group".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=null;return!0!==this.state.showValidation||this.state.isValid||(t=u().createElement(fi,{message:"topic required and must be 3 or more characters in length"})),u().createElement("div",{className:e},u().createElement("label",{className:"static"},"Discussion Title"),u().createElement("input",{type:"text",name:"title",ref:"title",defaultValue:this.props.value,placeholder:"Enter a discussion title",maxLength:"255",onChange:this.handleTopicChange,onFocus:this.handleFocus,onBlur:this.handleBlur,disabled:!this.props.enabled,tabIndex:"1",autoFocus:!0}),t,this.props.children)}}]),n}(u().Component);const Nm=Je(Rm);function Mm(e){return Mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mm(e)}function Im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Mm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Mm(i)?i:String(i)),r)}var o,i}function Am(e,t){return Am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Am(e,t)}function Lm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bm(e)}var Fm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Am(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bm(r);if(o){var n=Bm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Mm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lm(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Lm(t)),t.valid=t.valid.bind(Lm(t)),t.getValue=t.getValue.bind(Lm(t)),t.setValue=t.setValue.bind(Lm(t)),t.onChange=t.onChange.bind(Lm(t)),t.handleFocus=t.handleFocus.bind(Lm(t)),t.handleBlur=t.handleBlur.bind(Lm(t)),t.state={value:null!=t.props.value?t.props.value:"",validate:!1,isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=u().createElement(fi,{message:this.props.helpMessage}):e+=" no-help":t=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},u().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),u().createElement("input",{name:this.props.name,type:"text",value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&Im(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Fm.propTypes={name:d().string,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},Fm.defaultProps={required:!1,requiredErrorMessage:"input required."};const Um=Fm;function qm(e){return qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qm(e)}function Km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==qm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==qm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===qm(i)?i:String(i)),r)}var o,i}function Vm(e,t){return Vm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vm(e,t)}function zm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wm(e)}var Hm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wm(r);if(o){var n=Wm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===qm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zm(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getValue=t.getValue.bind(zm(t)),t.setValue=t.setValue.bind(zm(t)),t.setDisabled=t.setDisabled.bind(zm(t)),t.onChange=t.onChange.bind(zm(t)),t.state={value:!!t.props.value&&t.props.value,disabled:!!t.props.disabled&&t.props.disabled},t}return t=a,(n=[{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==e&&(t=!1),this.setState({value:t})}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.checked;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){return u().createElement("div",{className:"form-group no-help"},u().createElement("input",{ref:"checkbox",type:"checkbox",id:this.props.name,name:this.props.name,checked:this.state.value,disabled:this.state.disabled,onChange:this.onChange}),u().createElement("label",{htmlFor:this.props.name},this.props.label))}}])&&Km(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Hm.propTypes={name:d().string.isRequired,label:d().string.isRequired,value:d().bool,disabled:d().bool,onChange:d().func};const $m=Hm;function Gm(e){return Gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gm(e)}function Jm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Gm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Gm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Gm(i)?i:String(i)),r)}var o,i}function Qm(e,t){return Qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qm(e,t)}function Ym(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xm(e){return Xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xm(e)}var Zm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xm(r);if(o){var n=Xm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Gm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ym(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setValue=t.setValue.bind(Ym(t)),t.getValue=t.getValue.bind(Ym(t)),t.setDisabled=t.setDisabled.bind(Ym(t)),t.onChange=t.onChange.bind(Ym(t)),t.state={value:!!t.props.value&&t.props.value,disabled:!!t.props.disabled&&t.props.disabled},t}return t=a,(n=[{key:"setValue",value:function(e){this.setState({value:e})}},{key:"getValue",value:function(){return this.state.value}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){return u().createElement("label",{key:t.value,className:"clearfix multi-select"},u().createElement("input",{name:e.props.name,checked:e.state.value==t.value,value:t.value,disabled:e.state.disabled,onChange:e.onChange,type:"radio"}),u().createElement("span",{className:"radio-multi-label"},t.text))})),n=this.props.label?u().createElement("label",{className:"static"},this.props.label):null;return u().createElement("div",{className:"form-group"},n,u().createElement("div",{className:"multi-radio-container"},t))}}])&&Jm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Zm.propTypes={name:d().string.isRequired,label:d().string,options:d().array.isRequired,value:d().string,disabled:d().bool,onChange:d().func};const ev=Zm;function tv(e){return tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tv(e)}function nv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==tv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==tv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===tv(i)?i:String(i)),r)}var o,i}function ov(e,t,n){return t&&rv(e.prototype,t),n&&rv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iv(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&av(e,t)}function av(e,t){return av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},av(e,t)}function sv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cv(e);if(t){var o=cv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===tv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function cv(e){return cv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cv(e)}var lv=function(e){iv(n,e);var t=sv(n);function n(){return nv(this,n),t.apply(this,arguments)}return ov(n,[{key:"render",value:function(){var e=[];return this.props.posts.data.forEach((function(t,n){e.push(u().createElement(uv,{key:"p:"+t.postID,post:t}))})),u().createElement("div",{className:"thread-container subsection"},this.props.posts.totalPages>1?u().createElement(En,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged},u().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"post":"posts")):u().createElement("div",{className:"gallery-list-info"},u().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"Post":"Posts")),e,this.props.posts.totalPages>1&&u().createElement(En,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(u().Component),uv=function(e){iv(n,e);var t=sv(n);function n(){return nv(this,n),t.apply(this,arguments)}return ov(n,[{key:"render",value:function(){var e=this.props.post;return u().createElement("article",{className:"post-extended"},u().createElement("div",{className:"post-header"},u().createElement("h3",null,u().createElement("a",{href:e.topicUrl},e.topicTitle)),u().createElement(Yi,{displayMode:"Search",path:e.forumPath})),u().createElement("div",{className:"post-body"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),u().createElement("div",{className:"post-footer"},u().createElement(na,{data:e.addedBy,addClass:" started"}),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating))))}}]),n}(u().Component);const fv=lv;function pv(e){return pv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pv(e)}function hv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==pv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==pv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===pv(i)?i:String(i)),r)}var o,i}function yv(e,t,n){return t&&dv(e.prototype,t),n&&dv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mv(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vv(e,t)}function vv(e,t){return vv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vv(e,t)}function bv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wv(e);if(t){var o=wv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===pv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gv(e)}(this,n)}}function gv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wv(e){return wv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wv(e)}var Sv=function(e){mv(n,e);var t=bv(n);function n(e){var r;return hv(this,n),(r=t.call(this,e)).setup=r.setup.bind(gv(r)),r.getData=r.getData.bind(gv(r)),r.handleSearch=r.handleSearch.bind(gv(r)),r.updateFormFromAdvanced=r.updateFormFromAdvanced.bind(gv(r)),r.handleNewPage=r.handleNewPage.bind(gv(r)),r.addQuerystring=r.addQuerystring.bind(gv(r)),r.handleAdvancedClick=r.handleAdvancedClick.bind(gv(r)),r.handleDisplayChange=r.handleDisplayChange.bind(gv(r)),r.clearForm=r.clearForm.bind(gv(r)),r.handleClear=r.handleClear.bind(gv(r)),r.page=0,r.form={query:null,display:"Posts",sortOptions:null,sortBy:null},r.state={hasLoaded:!1,showLoader:!1,showAdvanced:!1,display:"Posts",results:null,viewer:null},r}return yv(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=on.parse(e.location.search),e.location&&e.location.search&&this.parsedQS.q?(null!=e.location.search&&null!=this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()):(this.page=0,this.handleClear())}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/search").done((function(t,n,r){e.form=t.form,e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"getData",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/forum/search".concat(this.page>0?"?page=".concat(this.page):""),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.form}),dataType:"json",context:this}).done((function(e,n,r){t.setState({showLoader:!1,results:e.searchResults,viewer:e.viewer},(function(){sn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({showLoader:!1,results:null,viewer:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleSearch",value:function(e){if(e.preventDefault(),this.page=0,this.refs.query.validate()){this.form.query=this.refs.query.getValue(),this.form.limitToTopicTitle=this.refs.limitToTopicTitle.getValue(),this.form.display=this.refs.display.getValue(),this.form.sortBy=this.refs.sort.getValue(),!0===this.state.showAdvanced&&this.updateFormFromAdvanced();var t=this;this.setState({results:null,viewer:null,showLoader:!0},(function(){var e=t.addQuerystring(t.props.location.pathname);t.props.history.push(e)}))}}},{key:"updateFormFromAdvanced",value:function(){var e=this.refs.advanced.getValue();this.form.profile=e.profile,this.form.limitToProfile=e.limitToProfile,this.form.limitToForums=e.limitToForums}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname);this.props.history.push(t)}},{key:"addQuerystring",value:function(e){var t=[];return null!=this.form&&(this.form.query&&""!=this.form.query&&t.push("q="+encodeURIComponent(this.form.query)),this.form.display&&"Posts"!=this.form.display&&t.push("display="+encodeURIComponent(this.form.display)),this.form.sortBy&&"Newest"!=this.form.sortBy&&t.push("sortBy="+encodeURIComponent(this.form.sortBy))),this.page>0&&t.push("page="+this.page),t.length>0&&(e+="?"+t.join("&")),e}},{key:"handleAdvancedClick",value:function(e){e.preventDefault(),this.state.showAdvanced&&this.updateFormFromAdvanced(),this.setState({showAdvanced:!this.state.showAdvanced})}},{key:"handleDisplayChange",value:function(e){this.form.display=e,this.refs.limitToTopicTitle.setDisabled("Topics"!=e),null!=this.state.results?this.setState({display:e,results:null}):this.setState({display:e})}},{key:"clearForm",value:function(){this.form.query=null,this.form.display="Posts",this.form.profile=null,this.form.limitToProfile=!1,this.form.limitToForums=[],this.form.sortBy="Newest"}},{key:"handleClear",value:function(e){e&&e.preventDefault(),this.refs.query.setValue(null),this.refs.display.setValue("Posts"),this.refs.limitToTopicTitle.setValue(!1),this.refs.limitToTopicTitle.setDisabled(!0),!0===this.state.showAdvanced&&this.refs.advanced.clearValues(),this.page=0,this.clearForm(),this.setState({display:"Posts",results:null,viewer:null})}},{key:"render",value:function(){if(!this.state.hasLoaded)return u().createElement(hn,null);var e=null;return!0===this.state.showLoader?e=u().createElement(hn,null):null!=this.state.results&&(null==this.state.results.data||0==this.state.results.data.length?e=u().createElement("div",{className:"no-content"},"No Results Found"):"Topics"==this.form.display?e=u().createElement(ha,{topics:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}):"Posts"==this.form.display&&(e=u().createElement(fv,{posts:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))),u().createElement("div",null,u().createElement(rn,null,u().createElement("title",null,"Forum Search"),u().createElement("meta",{name:"description",content:"Search and discover all of our Forums in our Community."})),u().createElement("div",{className:"subsection"},u().createElement("div",{className:"forum-search-container"},u().createElement("form",{onSubmit:this.handleSearch},u().createElement(Um,{ref:"query",name:"query",label:"Search",placeholder:"Search...",required:!0,requiredErrorMessage:"Search query required."}),u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"panel-left",style:{verticalAlign:"baseline"}},u().createElement("div",{className:"panel-inline",style:{marginRight:"20px"}},u().createElement(ev,{ref:"display",name:"first",label:"Display",options:[{text:"Posts",value:"Posts"},{text:"Topics",value:"Topics"}],value:this.form.display,onChange:this.handleDisplayChange})),u().createElement("div",{className:"panel-inline"},u().createElement($m,{ref:"limitToTopicTitle",name:"limitToTopicTitle",label:"Limit search to topic title",value:!1,disabled:"Topics"!=this.state.display}))),u().createElement("div",{className:"panel-right"},u().createElement(wl,{ref:"sort",label:"Sort by",options:"Posts"==this.state.display?this.form.postSortOptions:this.form.topicSortOptions,value:this.form.sortBy}))),u().createElement("div",{className:"forum-search-advanced"},u().createElement("a",{href:"#",onClick:this.handleAdvancedClick},"Advanced Options ",u().createElement("span",{className:"caret"}))),this.state.showAdvanced&&u().createElement(Ev,{ref:"advanced",form:this.form}),u().createElement("div",{className:"forum-search-button"},u().createElement("button",{className:"btn btn-default",type:"button",onClick:this.handleClear},"Clear"),u().createElement("button",{className:"btn btn-primary",type:"submit"},"Search"))),e)))}}]),n}(u().Component),Ev=function(e){mv(n,e);var t=bv(n);function n(e){var r;return hv(this,n),(r=t.call(this,e)).getValue=r.getValue.bind(gv(r)),r.clearValues=r.clearValues.bind(gv(r)),r}return yv(n,[{key:"getValue",value:function(){return{profile:this.refs.profile.getValue(),limitToProfile:this.refs.limitToProfile.getValue(),limitToForums:this.refs.limitToForums.getSelectedForums()}}},{key:"clearValues",value:function(){this.refs.profile.setValue(""),this.refs.limitToProfile.setValue(!1),this.refs.limitToForums.clearSelectedForums()}},{key:"render",value:function(){return u().createElement("div",{className:"forum-search-advanced-container clearfix"},u().createElement("div",{className:"panel-left form-group"},u().createElement("label",{className:"static"},"Filter results by forums"),u().createElement(Fi,{ref:"limitToForums",forums:this.props.form.limitToForumOptions,selectedForums:this.props.form.limitToForums,style:{marginTop:"10px"}})),u().createElement("div",{className:"panel-right"},u().createElement(Um,{ref:"profile",name:"profile",label:"Filter results by profile",placeholder:"Filter results by profile...",required:!1},u().createElement($m,{ref:"limitToProfile",name:"limitToProfile",label:"Limit to topics started by profile",value:!1}))))}}]),n}(u().Component);const Ov=Je(Sv);function _v(e){return _v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_v(e)}function Pv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_v(i)?i:String(i)),r)}var o,i}function kv(e,t){return kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kv(e,t)}function jv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cv(e){return Cv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cv(e)}const Tv=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cv(r);if(o){var n=Cv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jv(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getData=t.getData.bind(jv(t)),t.postID=t.props.match.params.id,t.contentID=t.props.match.params.contentid,t.isModal=t.props.location.state&&t.props.location.state.modal,t.state={content:null,support:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.isModal||$("body").attr("class","hero-content forum"),this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/forum/content-view?postID=".concat(this.postID,"&contentID=").concat(this.contentID)).done((function(t,n,r){e.setState({content:t.content,support:t.support})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){if(null==this.state.content)return null;this.isModal&&"Video"==this.state.content.type&&$(".tf-overlay-content").css("width","100%");var e=null,t=null;return this.isModal||(e="contentview-container",t="contentview-body"),u().createElement("div",{className:e},!this.isModal&&u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},u().createElement("h2",null,"Content from topic: ",this.state.support.title),u().createElement("h3",null,u().createElement(nt,{to:this.state.support.url},u().createElement("i",{className:"fa fa-long-arrow-left"})," View Post"))))),u().createElement("div",{className:t},u().createElement(kd,{content:this.state.content})))}}])&&Pv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function xv(e){return xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xv(e)}function Rv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==xv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==xv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===xv(i)?i:String(i)),r)}var o,i}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dv(e,t)}function Nv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mv(e){return Mv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mv(e)}var Iv=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mv(r);if(o){var n=Mv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===xv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Nv(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleOverlayClose=t.handleOverlayClose.bind(Nv(t)),t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"handleOverlayClose",value:function(){this.props.history.goBack()}},{key:"render",value:function(){var e=this.props.location.state&&this.props.location.state.background;return u().createElement(Ge,null,u().createElement($e,{path:["/discuss/forum/:id/:slug?","/discuss/projects/:id/:slug?","/discuss/topic/new","/discuss/topic/:id/:slug?","/discuss/link/:id/:slug?","/discuss/post/:id","/discuss/post/:id/content/:contentid"]},u().createElement(Ge,{location:e||this.props.location},u().createElement($e,{path:"/discuss/forum/:id/:slug?",component:Kc}),u().createElement($e,{path:"/discuss/projects/:id/:slug?",component:Kc}),u().createElement($e,{path:"/discuss/topic/new",component:Nm}),u().createElement($e,{path:"/discuss/topic/:id/:slug?",component:lm}),u().createElement($e,{path:"/discuss/link/:id/:slug?",component:ym}),u().createElement($e,{path:"/discuss/post/:id/content/:contentid",component:Tv}),u().createElement($e,{path:"/discuss/post/:id",component:Sm})),e&&u().createElement($e,{path:"/discuss/post/:id/content/:contentid"},u().createElement(I,{showClose:!0,closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleOverlayClose},u().createElement(Tv,null)))),u().createElement($e,{path:["/discuss/search","/discuss/group/:id/:slug?","/discuss/:root","/discuss"]},u().createElement("section",{id:"heroBanner",style:{backgroundImage:"url(/common/img/assets/headers/discuss_header_3.jpg)"}},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discuss"))),u().createElement(Ge,null,u().createElement($e,{path:"/discuss/search",component:Ov}),u().createElement($e,{path:"/discuss/group/:id/:slug?",component:pc}),u().createElement($e,{path:"/discuss/:root",component:pc}),u().createElement($e,{exact:!0,path:"/discuss",component:pc}))))}}])&&Rv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));const Av=function(e){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Discuss | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(Qe,null,u().createElement(Iv,null)))};function Lv(e){return Lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lv(e)}function Bv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Lv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Lv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Lv(i)?i:String(i)),r)}var o,i}function Fv(e,t){return Fv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fv(e,t)}function Uv(e){return Uv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uv(e)}var qv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Uv(r);if(o){var n=Uv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Lv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[];this.props.project.tagLinks&&(this.props.project.tagLinks.contentType&&(e=this.props.project.tagLinks.contentType.map((function(e,t){return u().createElement("span",{key:"c".concat(t),className:"type-c"},u().createElement("a",{href:e.url},e.text))}))),this.props.project.tagLinks.product&&(e=e.concat(this.props.project.tagLinks.product.map((function(e,t){return u().createElement("span",{key:"p".concat(t),className:"type-p"},u().createElement("a",{href:e.url},e.text))})))),this.props.project.tagLinks.usageRights&&(e=e.concat(this.props.project.tagLinks.usageRights.map((function(e,t){return u().createElement("span",{key:"u".concat(t),className:"type-u"},u().createElement("a",{href:e.url},e.text))})))));var t=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:"card"},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("div",{className:"text-container"},u().createElement("h4",null,u().createElement("a",{href:this.props.project.url,dangerouslySetInnerHTML:sn.createMarkup(t)})),u().createElement("div",{className:"tag-links"},e),this.props.children))}}])&&Bv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);qv.propTypes={project:d().object.isRequired};const Kv=qv;function Vv(e){return Vv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vv(e)}function zv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Vv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Vv(i)?i:String(i)),r)}var o,i}function Wv(e,t){return Wv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wv(e,t)}function Hv(e){return Hv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hv(e)}var $v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hv(r);if(o){var n=Hv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Vv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.galleryData.map((function(t,n){switch(e.props.galleryOf){case"Project":return"Catalogue"===t.type?u().createElement(Kv,{key:t.id,project:t}):u().createElement(Ho,{key:t.id,project:t});case"Collection":return u().createElement(ys,{key:t.id,collection:t})}}));return u().createElement(ls,null,u().createElement("div",null,t))}}])&&zv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);$v.propTypes={galleryData:d().array.isRequired,galleryOf:d().string};const Gv=$v;function Jv(e){return Jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jv(e)}function Qv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Jv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Jv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Jv(i)?i:String(i)),r)}var o,i}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yv(e,t)}function Xv(e){return Xv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xv(e)}var Zv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xv(r);if(o){var n=Xv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Jv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;this.props.collection.attributes.duration&&(e=sn.niceDuration(this.props.collection.attributes.duration));var t=null;null!=this.props.collection.experienceLevel&&"None"!=this.props.collection.experienceLevel&&(t=TFWeb.Resources.UI.getString("Experience.".concat(this.props.collection.experienceLevel)));var n=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(n=this.props.collection.bulletPoints.map((function(e,t){return u().createElement("div",{className:e.type.toLowerCase(),key:t},e.title,", ",u().createElement("span",{dangerouslySetInnerHTML:sn.createMarkup(e.text)}))})));var r=null;if(null!=this.props.collection.productReleases){var o="foundry foundry-".concat(this.props.collection.productReleases.logoClass);r=u().createElement("div",{className:"software"},u().createElement("i",{className:o})," ",this.props.collection.productReleases.names.map((function(e,t){return u().createElement("span",{key:t},e)})))}return u().createElement("article",{className:"card course"},u().createElement("a",{href:this.props.collection.url,className:"card-image"},u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("a",{href:this.props.collection.url,className:"text-container"},u().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.title)}),this.props.collection.itemCount>0&&u().createElement("div",{className:"duration"},u().createElement("span",null,this.props.collection.itemCount," ",1==this.props.collection.itemCount?TFWeb.Resources.UI.Video:TFWeb.Resources.UI.Videos,null!=e?",":"")," ",null!=e&&u().createElement("span",null,e)),n,u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.description)})),(null!=r||null!=t)&&u().createElement("div",{className:"info"},null!=r&&r,null!=t&&u().createElement("div",{className:"experience"},t)))}}])&&Qv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Zv.propTypes={collection:d().object.isRequired},Zv.defaultProps={showProfile:!1};const eb=Zv;function tb(e){return tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tb(e)}function nb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==tb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==tb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===tb(i)?i:String(i)),r)}var o,i}function rb(e,t){return rb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rb(e,t)}function ob(e){return ob=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ob(e)}var ib=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ob(r);if(o){var n=ob(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===tb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){"Asset"==this.props.project.type&&this.props.project.contents&&this.props.project.contents.map((function(e,t){var n="c"+t;return u().createElement("span",{key:n,className:"content-type"},e)}));var e=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:"card cattery"},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("a",{href:this.props.project.url,className:"text-container"},u().createElement("h4",{dangerouslySetInnerHTML:sn.createMarkup(e)}),this.props.project.description&&u().createElement("p",{dangerouslySetInnerHTML:sn.createMarkup(this.props.project.description)})),this.props.children)}}])&&nb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ib.propTypes={project:d().object.isRequired,showProfile:d().bool},ib.defaultProps={showProfile:!0};const ab=ib;function sb(e){return sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sb(e)}function cb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==sb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==sb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===sb(i)?i:String(i)),r)}var o,i}function lb(e,t){return lb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lb(e,t)}function ub(e){return ub=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ub(e)}var fb=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ub(r);if(o){var n=ub(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===sb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.gallery.data||0==this.props.gallery.data.length)return u().createElement("div",{className:"no-content"},"No Content Found");var e=this,t=this.props.gallery.data.map((function(t,n){switch(e.props.galleryOf){case"Project":return"Catalogue"==t.type?u().createElement(Kv,{key:t.id,project:t}):"Cattery"==t.type?u().createElement(ab,{key:t.id,project:t,showProfile:!0}):u().createElement(Ho,{key:t.id,project:t,showProfile:!0});case"Collection":return"Course"===t.type?u().createElement(eb,{key:t.id,collection:t}):u().createElement(ys,{key:t.id,collection:t})}}));return t=u().createElement("div",null,t),u().createElement("div",{className:"cards-container"},this.props.children&&this.props.children,this.props.gallery.totalPages>1&&u().createElement(En,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged,enableKeyEvents:!0,baseUrl:this.props.baseUrl}),t,this.props.gallery.totalPages>1&&u().createElement(En,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged,baseUrl:this.props.baseUrl}))}}])&&cb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);fb.propTypes={gallery:d().object.isRequired,galleryOf:d().string,baseUrl:d().string},fb.defaultProps={galleryOf:"Project"};const pb=fb;function hb(e){return hb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hb(e)}function db(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==hb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==hb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===hb(i)?i:String(i)),r)}var o,i}function yb(e,t){return yb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yb(e,t)}function mb(e){return mb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mb(e)}var vb=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=mb(r);if(o){var n=mb(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===hb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"asset-download"},u().createElement("div",{className:"info"},u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",null,u().createElement("p",{className:"title"},this.props.content.title),u().createElement("span",{className:"format"},this.props.content.resourceFormat),u().createElement("span",{className:"filesize"},this.props.content.size))),this.props.children)}}])&&db(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);vb.propTypes={content:d().object};const bb=vb;function gb(e){return gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gb(e)}function wb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==gb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==gb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===gb(i)?i:String(i)),r)}var o,i}function Eb(e,t,n){return t&&Sb(e.prototype,t),n&&Sb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ob(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_b(e,t)}function _b(e,t){return _b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_b(e,t)}function Pb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=jb(e);if(t){var o=jb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===gb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kb(e)}(this,n)}}function kb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jb(e){return jb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jb(e)}var Cb=function(e){Ob(n,e);var t=Pb(n);function n(e){var r;return wb(this,n),(r=t.call(this,e)).getData=r.getData.bind(kb(r)),r.onCartClick=r.onCartClick.bind(kb(r)),r.handleCartClose=r.handleCartClose.bind(kb(r)),r.refresh=r.refresh.bind(kb(r)),r.addToCart=r.addToCart.bind(kb(r)),r.onRemoveFromCart=r.onRemoveFromCart.bind(kb(r)),r.onRemoveAllFromCart=r.onRemoveAllFromCart.bind(kb(r)),r.onDownloadAll=r.onDownloadAll.bind(kb(r)),r.state={loadStatus:c.LoadStatus.PreLoad,showCart:!1,content:null,highlightCount:!1},r}return Eb(n,[{key:"componentDidMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/share/cart/get").done((function(t,n,r){e.setState({loadStatus:c.LoadStatus.Loaded,content:t})})).fail((function(t,n,r){e.ajaxError=t}))}},{key:"onCartClick",value:function(){this.setState({showCart:!0})}},{key:"handleCartClose",value:function(e){this.setState({showCart:!1})}},{key:"refresh",value:function(){this.getData()}},{key:"addToCart",value:function(e){$.ajax({type:"POST",url:"/api/share/cart/add",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({content:e,highlightCount:!0},(function(){var e=this;setTimeout((function(){e.setState({highlightCount:!1})}),1e3)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveFromCart",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/share/cart/remove",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,n,r){t.setState({content:e})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveAllFromCart",value:function(){var e=this;$.ajax({type:"POST",url:"/api/share/cart/remove-all",contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(t,n,r){e.setState({content:null})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onDownloadAll",value:function(e){this.setState({showCart:!1,loadStatus:c.LoadStatus.PreLoad,content:null},(function(){window.location.replace("/share/cart/download?format="+e)}))}},{key:"render",value:function(){var e="asset-download-cart".concat(!0===this.props.inline?" inline":""),t=this.state.content?this.state.content.length:0,n="count".concat(!0===this.state.highlightCount?" highlight":"");return u().createElement("div",{className:e,ref:"cart"},u().createElement("button",{type:"button",className:"btn btn-small show-cart",onClick:this.onCartClick},"Download Cart ",u().createElement("i",{className:"fa fa-shopping-cart"}),t>0&&u().createElement("span",{className:n},t)),!0===this.state.showCart&&this.state.loadStatus==c.LoadStatus.Loading&&u().createElement(hn,null),!0===this.state.showCart&&this.state.loadStatus==c.LoadStatus.Loaded&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.handleCartClose,contentStyle:{backgroundColor:"white"}},u().createElement(Tb,{content:this.state.content,onRemoveFromCart:this.onRemoveFromCart,onRemoveAllFromCart:this.onRemoveAllFromCart,onDownloadAll:this.onDownloadAll})))}}]),n}(u().Component);Cb.propTypes={inline:d().bool},Cb.defaultProps={inline:!1};var Tb=function(e){Ob(n,e);var t=Pb(n);function n(){return wb(this,n),t.apply(this,arguments)}return Eb(n,[{key:"render",value:function(){var e=[],t=this.props.content?this.props.content.length:0;return t>0?this.props.content.forEach((function(t,n){e.push(u().createElement(bb,{key:t.id,content:t},u().createElement("button",{className:"remove",type:"button",onClick:this.props.onRemoveFromCart.bind(null,t.data)},u().createElement("i",{className:"glyphicon glyphicon-remove"}))))}),this):e.push(u().createElement("div",{key:"e",className:"empty"},"Download Cart is empty")),u().createElement("div",{className:"asset-download-cart-contents clearfix"},t>1&&u().createElement("div",{style:{textAlign:"right",marginBottom:"10px"}},u().createElement("button",{type:"button",onClick:this.props.onRemoveAllFromCart},"Clear Download Cart")),e,t>0&&u().createElement("div",{className:"asset-download-cart-buttons"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"ModoPackage")},"Download All as Modo Package (.lpk)"),u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"Zip")},"Download All as Zip")))}}]),n}(u().Component);const xb=Cb;function Rb(e){return Rb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rb(e)}function Db(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rb(i)?i:String(i)),r)}var o,i}function Nb(e,t){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nb(e,t)}function Mb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ib(e){return Ib=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ib(e)}const Ab=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ib(r);if(o){var n=Ib(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mb(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getIndex=t.getIndex.bind(Mb(t)),t.buildQuerystring=t.buildQuerystring.bind(Mb(t)),t.getData=t.getData.bind(Mb(t)),t.handleFilterChange=t.handleFilterChange.bind(Mb(t)),t.handleNewPage=t.handleNewPage.bind(Mb(t)),t.state={hasLoaded:!1,loadStatus:c.LoadStatus.PreLoad,filter:null,gallery:null,galleryOf:null,viewer:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getIndex()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&this.getData(e)}},{key:"getIndex",value:function(){var e=this,t="/api/".concat(this.props.section,"/get-index").concat(this.props.location.search);$.getJSON(t).done((function(t,n,r){e.setState({gallery:t.gallery,galleryOf:t.galleryOf,filter:t.filter,viewer:t.viewer,loadStatus:c.LoadStatus.Loaded},(function(){$("#globalFooter").removeClass("hide")}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"buildQuerystring",value:function(e,t){var n=[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&null!=e[r]&&e[r].value&&""!=e[r].value&&("Query"===e[r].type?n.push("".concat(r,"=").concat(encodeURIComponent(e[r].value))):n.push("".concat(r,"=").concat(e[r].value)));t&&t>0&&n.push("page=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"getData",value:function(e){var t=this,n="/api/".concat(this.props.section,"/get").concat(e.location.search);$.getJSON(n).done((function(n,r,o){var i=t.state.filter;if(i&&null!=i&&e.location.search&&null!=e.location.search){var a=on.parse(e.location.search);for(var s in i)if(i.hasOwnProperty(s)&&null!=i[s]){var c="";a[s]&&(c=a[s]),i[s].value=c}}if(null!=n.filter)for(var l in n.filter)i[l]=n.filter[l];t.setState({gallery:n.gallery,galleryOf:n.galleryOf,filter:i},(function(){sn.updateScrollPosition(!0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.props.location.pathname;e+=t.buildQuerystring(t.state.filter,0),t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname+this.buildQuerystring(this.state.filter,e);this.props.history.push(t)}},{key:"buildBaseUrl",value:function(){return this.props.location.pathname+this.buildQuerystring(this.state.filter,null)}},{key:"render",value:function(){if(this.state.loadStatus!=c.LoadStatus.Loaded)return u().createElement(hn,null);if(this.state.loadStatus==c.LoadStatus.Loaded&&null==this.state.gallery)return u().createElement("div",{className:"no-content"},"No Content Found");var e=this.buildBaseUrl();return u().createElement(dr,{marginTop:!0},u().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange,embeddedNav:this.props.embeddedNav}),u().createElement(pb,{gallery:this.state.gallery,galleryOf:this.state.galleryOf,onPageChanged:this.handleNewPage,baseUrl:e},"share"==this.props.section&&this.state.viewer&&!0===this.state.viewer.isSignedIn&&u().createElement(xb,{inline:this.state.gallery.totalPages>1})))}}])&&Db(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function Lb(e){return Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lb(e)}function Bb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Lb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Lb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Lb(i)?i:String(i)),r)}var o,i}function Ub(e,t,n){return t&&Fb(e.prototype,t),n&&Fb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qb(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kb(e,t)}function Kb(e,t){return Kb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kb(e,t)}function Vb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Wb(e);if(t){var o=Wb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Lb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zb(e)}(this,n)}}function zb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wb(e){return Wb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wb(e)}var Hb=Je(function(e){qb(n,e);var t=Vb(n);function n(e){return Bb(this,n),t.call(this,e)}return Ub(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))})),$("#globalFooter").removeClass("hide")}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(Ge,null,u().createElement($e,{path:"/watch/:product/heroes",component:function(e){return u().createElement(Gb,{section:"watch/".concat(e.match.params.product,"/heroes")})}}),u().createElement($e,{path:"/watch/media"},u().createElement(Jb,null)),u().createElement($e,{path:"/watch"},u().createElement($b,null)))}}]),n}(u().Component)),$b=function(e){qb(n,e);var t=Vb(n);function n(e){var r;return Bb(this,n),(r=t.call(this,e)).getData=r.getData.bind(zb(r)),r.state={hasLoaded:!1,heroes:null,media:null},r}return Ub(n,[{key:"componentDidMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/watch/get-landing").done((function(t,n,r){e.setState({heroes:t.heroes,media:t.media,hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return!1===this.state.hasLoaded?u().createElement(hn,null):u().createElement(u().Fragment,null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Become a Better Artist"))),u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,"Modo Heroes"),u().createElement(nt,{className:"cta",to:"/watch/modo/heroes"},"View All")),u().createElement(Gv,{galleryData:this.state.heroes,galleryOf:"Project"})),u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,"Latest Videos"),u().createElement(nt,{className:"cta",to:"/watch/media"},"View All")),u().createElement(Gv,{galleryData:this.state.media,galleryOf:"Project"})))}}]),n}(u().Component);function Gb(e){return u().createElement(u().Fragment,null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Modo Heroes"),u().createElement("h3",null,"Where Modo skills are a superpower"))),u().createElement(Ab,{type:"Training",section:e.section}))}function Jb(e){return u().createElement(u().Fragment,null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Become a Better Artist"))),u().createElement(Ab,{type:"Training",section:"watch"}))}const Qb=function(e){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Watch | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(Qe,null,u().createElement(Hb,null)))};function Yb(e){return Yb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yb(e)}function Xb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Yb(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Yb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Yb(i)?i:String(i)),r)}var o,i}function Zb(e,t){return Zb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zb(e,t)}function eg(e){return eg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eg(e)}const tg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eg(r);if(o){var n=eg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Yb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("nav",{className:"full-width-tabs"},u().createElement("div",{className:"mobile-options-wrapper"},u().createElement("ul",{className:"tftabs"},this.props.tabs.map((function(e,t){return u().createElement("li",{key:t},e)})))))}}])&&Xb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function ng(e){return ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ng(e)}function rg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ng(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ng(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ng(i)?i:String(i)),r)}var o,i}function og(e,t){return og=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},og(e,t)}function ig(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ag(e){return ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ag(e)}var sg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&og(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ag(r);if(o){var n=ag(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ng(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ig(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(ig(t)),t.state={profileFollowCount:t.props.profileFollowCount,isFollowed:t.props.isFollowed},t}return t=a,(n=[{key:"onClick",value:function(e){e.preventDefault(),$.ajax({type:"POST",url:"/api/social/follow",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,profile:this.props.profile,value:!this.state.isFollowed}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isFollowed:e.value,profileFollowCount:e.result})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("div",{className:"follow-wrapper"},this.state.isFollowed?u().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-close",onClick:this.onClick},"Stop Following"):u().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-add",onClick:this.onClick},"Follow"),u().createElement("span",{className:"followers icon icon-before icon-account",title:"Followers"},this.state.profileFollowCount))}}])&&rg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);sg.propTypes={consumer:d().string.isRequired,profile:d().string.isRequired,isFollowed:d().bool},sg.defaultProps={isFollowed:!1};const cg=sg;function lg(e){return lg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lg(e)}function ug(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==lg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==lg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===lg(i)?i:String(i)),r)}var o,i}function pg(e,t,n){return t&&fg(e.prototype,t),n&&fg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dg(e,t)}function dg(e,t){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dg(e,t)}function yg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vg(e);if(t){var o=vg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===lg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mg(e)}(this,n)}}function mg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vg(e){return vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vg(e)}var bg=function(e){hg(n,e);var t=yg(n);function n(e){var r;ug(this,n),(r=t.call(this,e)).onMetricsChange=r.onMetricsChange.bind(mg(r)),r.profileFollowCount=r.props.profile.metrics.profileFollow;var o=r.props.profile.metrics;return delete o.profileFollow,r.state={metrics:o},r}return pg(n,[{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.profile;!0===e.viewer.canEdit&&e.url;var t=null;if(e.viewer.isSignedIn&&!e.viewer.canEdit){var n=!1;null!=e.viewer.actions&&null!=e.viewer.actions.follow&&(n=e.viewer.actions.follow.value),t=u().createElement(cg,{consumer:"Profile",profile:e.name,isFollowed:n,profileFollowCount:this.profileFollowCount,onChange:this.onMetricsChange})}else t=u().createElement("div",{className:"follow-wrapper"},u().createElement("span",{className:"followers icon icon-before icon-account"},this.profileFollowCount," Followers"));var r={backgroundImage:"url(".concat(e.avatarUrl,")")};return u().createElement("section",{className:"profile-details-section"},u().createElement(rn,{title:e.name}),u().createElement("div",{className:"main"},u().createElement("div",{className:"intro centred clearfix"},u().createElement("div",{className:"user-info"},u().createElement("div",{className:"profile"},u().createElement("div",{className:"profile-image",style:r}),u().createElement("p",{className:"profile-name"},e.name," ",!0===e.viewer.canEdit&&u().createElement("a",{href:e.url+"/edit",className:"icon icon-after icon-refresh edit"},"Edit")," ",e.viewer.e&&e.viewer.e.link&&u().createElement("a",{href:e.viewer.e.link,className:"icon icon-after icon-arrow edit"},"Account")),!1,!1,u().createElement("p",{className:"profile-joined"},"Joined ",e.joined),!1),null!=e.badges&&u().createElement(gg,{badges:e.badges}),u().createElement("div",{className:"profile-stats clearfix"},u().createElement(Ar,{metrics:this.state.metrics,displayClass:"dark"})),u().createElement("div",{className:"profile-ctas"},t)))))}}]),n}(u().Component);bg.propTypes={profile:d().object.isRequired};var gg=function(e){hg(n,e);var t=yg(n);function n(e){return ug(this,n),t.call(this,e)}return pg(n,[{key:"render",value:function(){var e=this;if(null==this.props.badges)return null;var t=Object.keys(this.props.badges).map((function(t,n){return e.props.badges[t].map((function(e,t){return u().createElement("li",{key:n+":"+t},u().createElement("span",{className:e.badge},e.name))}))}));return u().createElement("ul",{className:"profile-badges list-inline"},t)}}]),n}(u().Component);gg.propTypes={badges:d().object.isRequired};const wg=bg;function Sg(e){return Sg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sg(e)}function Eg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Sg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Sg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Sg(i)?i:String(i)),r)}var o,i}function Og(e,t){return Og=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Og(e,t)}function _g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pg(e){return Pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pg(e)}var kg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Og(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Pg(r);if(o){var n=Pg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Sg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _g(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleDelete=t.handleDelete.bind(_g(t)),t.handleUnpublish=t.handleUnpublish.bind(_g(t)),t}return t=a,n=[{key:"handleDelete",value:function(e){this.props.onDelete(this.props.type,e)}},{key:"handleUnpublish",value:function(e){this.props.onUnpublish(this.props.type,e)}},{key:"render",value:function(){var e=this.props.viewer.isOwner?u().createElement("a",{href:"/project/new",className:"edit-cta icon icon-after icon-add"},"Upload new project"):null,t=this.props.projectGallery.hasMore?u().createElement("button",{type:"button",className:"load-more",onClick:this.props.onViewAll.bind(null,this.props.profile.urlSafeName,this.props.type)},"View all"):null,n=this.props.projectGallery.data.map((function(e,t){return u().createElement(Ho,{key:e.id,project:e,showProfile:!1})}));return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,this.props.label),u().createElement("p",{className:"project-count"},this.props.projectGallery.totalRecords," Projects"),e),u().createElement("div",{className:"content-section"},u().createElement(ls,null,u().createElement("div",null,n)),t))}}],n&&Eg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);kg.propTypes={projectGallery:d().object.isRequired,viewer:d().object,profile:d().object,type:d().string,label:d().string,onViewAll:d().func,onDelete:d().func,onUnpublish:d().func};const jg=kg;function Cg(e){return Cg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cg(e)}function Tg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Cg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Cg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Cg(i)?i:String(i)),r)}var o,i}function xg(e,t){return xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xg(e,t)}function Rg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dg(e){return Dg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dg(e)}const Ng=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xg(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dg(r);if(o){var n=Dg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Cg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rg(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onViewAll=t.onViewAll.bind(Rg(t)),t.state={hasLoaded:!1,profile:null,viewer:null,projectDictionaries:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/profile/"+this.props.profile.routeName+"/projects").done((function(t){e.setState({hasLoaded:!0,profile:t.profile,viewer:t.viewer,projectDictionaries:t.projectDictionaries})})).fail((function(t){e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"onViewAll",value:function(e,t){var n=this;$.getJSON("/api/profile/"+e+"/projects/"+t).done((function(e){var r=n.state.projectDictionaries;r[t].data=r[t].data.concat(e.projectDictionaries.data),r[t].hasMore=!1,n.setState({projectDictionaries:r})})).fail((function(e){}))}},{key:"render",value:function(){if(!this.state.hasLoaded)return u().createElement(hn,null);var e=null,t=[];if(null!=this.state.projectDictionaries)for(var n in TFWeb.Enums.ProjectTypes){var r=n.toLowerCase();this.state.projectDictionaries.hasOwnProperty(r)&&t.push(u().createElement(jg,{key:n,onViewAll:this.onViewAll,viewer:this.state.viewer,profile:this.state.profile,projectGallery:this.state.projectDictionaries[r],label:n,type:r}))}else e=this.state.viewer.isOwner?u().createElement("div",{className:"subsection no-content"},u().createElement("a",{href:"/project/new"},"+ Start your portfolio by sharing a project today!")):u().createElement("div",{className:"subsection no-content"},u().createElement("p",null,this.state.profile.name," hasn't shared any projects.  Encourage them to start their portfolio today."));return u().createElement("div",null,e,t)}}])&&Tg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Mg(e){return Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mg(e)}function Ig(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Mg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Mg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Mg(i)?i:String(i)),r)}var o,i}function Ag(e,t){return Ag=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ag(e,t)}function Lg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bg(e){return Bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bg(e)}const Fg=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ag(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bg(r);if(o){var n=Bg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Mg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lg(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).addQuerystring=t.addQuerystring.bind(Lg(t)),t.getData=t.getData.bind(Lg(t)),t.handleFilterChange=t.handleFilterChange.bind(Lg(t)),t.handleNewPage=t.handleNewPage.bind(Lg(t)),t.hasLoaded=!1,t.mode=t.props.mode,t.parsedQS=on.parse(t.props.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.state={pagedData:null,viewer:null,filter:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=on.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this,n="/api/profile/".concat(this.props.profile.routeName,"/").concat(this.mode.toLowerCase()).concat(e.location.search),r=!this.hasLoaded;$.getJSON(n).done((function(e,n,o){t.hasLoaded=!0,t.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){if(!r){var e=document.querySelector("div.app");e&&e.scrollIntoView()}}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"render",value:function(){if(!1===this.hasLoaded)return u().createElement(hn,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return u().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Topics":e=u().createElement(ha,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage});break;case"Posts":e=u().createElement(fv,{posts:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage})}return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-filter"},u().createElement("h3",null,"Forum ",this.mode),u().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&Ig(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));function Ug(e){return Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ug(e)}function qg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Ug(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ug(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Ug(i)?i:String(i)),r)}var o,i}function Kg(e,t){return Kg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kg(e,t)}function Vg(e){return Vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vg(e)}var zg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kg(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Vg(r);if(o){var n=Vg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ug(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?product=").concat(encodeURIComponent(t.product));return u().createElement("span",{key:n,className:"tag product"},u().createElement("a",{href:r},u().createElement("img",{src:t.logo,alt:t.product})))}return u().createElement("span",{key:n,className:"tag product"},u().createElement("img",{src:t.logo,alt:t.product}))}));return u().createElement("div",null,this.props.children?this.props.children:u().createElement("h4",null,TFWeb.Resources.UI.Products),u().createElement("div",{className:"tags"},t))}}])&&qg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);zg.propTypes={list:d().array,path:d().string},zg.defaultProps={list:[]};const Wg=zg;function Hg(e){return Hg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hg(e)}function $g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Hg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Hg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Hg(i)?i:String(i)),r)}var o,i}function Jg(e,t,n){return t&&Gg(e.prototype,t),n&&Gg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yg(e,t)}function Yg(e,t){return Yg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yg(e,t)}function Xg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zg(e);if(t){var o=Zg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Hg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Zg(e){return Zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zg(e)}u().Component;var ew=function(e){Qg(n,e);var t=Xg(n);function n(e){return $g(this,n),t.call(this,e)}return Jg(n,[{key:"componentDidMount",value:function(){$("body").attr("class","profile-details editable")}},{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Profile",titleTemplate:"%s | Foundry Community"}),u().createElement(nw,null),u().createElement(wg,{profile:this.props.profile}),u().createElement(Qe,null,u().createElement(tw,{profile:this.props.profile})))}}]),n}(u().Component),tw=Je(function(e){Qg(n,e);var t=Xg(n);function n(e){return $g(this,n),t.call(this,e)}return Jg(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){var e=this,t=[u().createElement(lt,{to:"/profile/".concat(this.props.profile.routeName),isActive:function(){return e.props.location.pathname==e.props.profile.url},activeClassName:"selected"},"Portfolio"),u().createElement(lt,{to:"/profile/".concat(this.props.profile.routeName,"/topics"),activeClassName:"selected"},"Topics"),u().createElement(lt,{to:"/profile/".concat(this.props.profile.routeName,"/posts"),activeClassName:"selected"},"Posts")];return u().createElement("div",null,u().createElement(tg,{tabs:t}),u().createElement(Ge,null,u().createElement($e,{path:"/profile/:name/posts"},u().createElement(Fg,{mode:"Posts",profile:this.props.profile})),u().createElement($e,{path:"/profile/:name/topics"},u().createElement(Fg,{mode:"Topics",profile:this.props.profile})),u().createElement($e,{path:"/profile/:name/about"},u().createElement(Ng,{profile:this.props.profile})),u().createElement($e,{exact:!0,path:"/profile/:name"},u().createElement(Ng,{profile:this.props.profile}))))}}]),n}(u().Component)),nw=function(e){Qg(n,e);var t=Xg(n);function n(){return $g(this,n),t.apply(this,arguments)}return Jg(n,[{key:"render",value:function(){return u().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}})}}]),n}(u().Component);const rw=ew;function ow(e){return ow="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ow(e)}function iw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ow(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ow(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ow(i)?i:String(i)),r)}var o,i}function aw(e,t){return aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aw(e,t)}function sw(e){return sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sw(e)}const cw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=sw(r);if(o){var n=sw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ow(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Share | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discover Assets"))),u().createElement(Qe,null,u().createElement($e,{path:"/share"},u().createElement(Ab,{type:"Asset",section:"share"}))))}}])&&iw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component),lw=function(e){return u().createElement("div",{className:"app"},u().createElement(rn,{defaultTitle:"Explore | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discover Portfolios"))),u().createElement(Qe,null,u().createElement($e,{path:"/explore"},u().createElement(Ab,{type:"Portfolio",section:"explore"}))))},uw=function(e){return u().createElement(u().Fragment,null,u().createElement(rn,null,u().createElement("title",null,"Cattery FAQ"),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin,"/cattery/faq")})),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,u().createElement("img",{src:"/common/img/logos/Cattery_BlackYellow.svg"})," FAQ"))),u().createElement("div",{className:"content-section"},u().createElement("ul",{className:"faq"},u().createElement("li",null,u().createElement("h4",null,"What is Cattery?"),u().createElement("p",null,"There are thousands of amazing open source machine learning models available for use, but getting them into Nuke can be tricky. As of Nuke 13.1 it’s possible to convert image to image models in PyTorch’s TorchScript format into .cat files that can be run natively in the Inference node, but the conversion process does require some time and engineering knowledge (",u().createElement("a",{href:"https://learn.foundry.com/nuke/developers/14.0/catfilecreationreferenceguide/index.html"},"NUKE's .cat File Creation Guide"),"). So we thought someone should save everyone the hassle and do it once and for all! And that’s Cattery - a library of open-source machine learning models already converted to .cat files to run natively inside Nuke.")),u().createElement("li",null,u().createElement("h4",null,"Can I use Cattery models for commercial use?"),u().createElement("p",null,"All the .cat files in Cattery are converted from open source machine learning models with licenses that allow for commercial use, however the datasets they are trained on may be unknown or have non-commercial licenses. ")),u().createElement("li",null,u().createElement("h4",null,"If the data doesn’t allow commercial use, surely I can’t use these commercially?"),u().createElement("p",null,"Well, maybe. The legal situation around machine learning models is both unclear and fast changing. Ultimately, it is a decision for the user and their legal departments to decide on how they wish to use the models and their comfort level with any associated risk.")),u().createElement("li",null,u().createElement("h4",null,"But it says the models are provided under a BSD-3 clause license, doesn’t it?"),u().createElement("p",null,"Foundry’s work converting the models into the .cat format are covered by the BSD-3 clause license that allows for commercial use, but the underlying models are still governed by their own licenses.")),u().createElement("li",null,u().createElement("h4",null,"Where can I see the licenses for the models?"),u().createElement("p",null,"The download page for each model links to the original GitHub repo that the model was ported from. The repo will have a license file that refers to the model and the model weights. However, this repo may include other repos which will have their own license files. Additionally, the academic papers that the models are based on tend to refer to the datasets they are trained on, which will have additional license information.")),u().createElement("li",null,u().createElement("h4",null,"Jeez, that’s a lot of different licenses, isn’t it? "),u().createElement("p",null,"It can be, unfortunately!")),u().createElement("li",null,u().createElement("h4",null,"Which Nuke versions do Cattery models run in?"),u().createElement("p",null,"Most of the models run in Nuke 13.1 onwards, but a few require later versions of PyTorch that are only available in Nuke 14.0 onwards. The specific requirements for each model can be found next to its download link."),u().createElement("p",null,"The Cattery toolbar is only available in Nuke 14.0 onwards.")),u().createElement("li",null,u().createElement("h4",null,"How do I install the models?"),u().createElement("p",null,"The install instructions can be found under the Instructions tab next to the Downloads area on each .cat file page.")),u().createElement("li",null,u().createElement("h4",null,"Can I contribute to Cattery?"),u().createElement("p",null,"Yes! We’ll be opening up Cattery to user submissions soon. If you’re interested in being one of the initial contributors, please email ",u().createElement("a",{href:"mailto:cattery@foundry.com"},"cattery@foundry.com"))))))};function fw(e){return fw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fw(e)}function pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==fw(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==fw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===fw(i)?i:String(i)),r)}var o,i}function hw(e,t){return hw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hw(e,t)}function dw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yw(e){return yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yw(e)}var mw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yw(r);if(o){var n=yw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===fw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dw(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleTabClick=t.handleTabClick.bind(dw(t)),t.setTab=t.setTab.bind(dw(t)),t.state={selectedIndex:t.props.selectedIndex},t}return t=a,(n=[{key:"handleTabClick",value:function(e,t){t.preventDefault(),t.stopPropagation(),this.setTab(e)}},{key:"setTab",value:function(e){this.setState({selectedIndex:e})}},{key:"render",value:function(){var e=this,t=[];if(Array.isArray(this.props.children))for(var n=0;n<this.props.children.length;n++)this.props.children[n].props.visible&&t.push(this.props.children[n]);else t.push(this.props.children);return u().createElement("div",{className:this.props.className},u().createElement("ul",{className:"tftabs"},t.map((function(n,r){if(n.props.visible){var o="".concat(e.state.selectedIndex==r?"selected":"");return u().createElement("li",{key:r,className:1==t.length?"single":""},u().createElement("a",{href:"#",className:o,onClick:e.handleTabClick.bind(null,r)},n.props.label))}}))),t[this.state.selectedIndex])}}])&&pw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);mw.propTypes={selectedIndex:d().number,children:d().oneOfType([d().array,d().element]).isRequired,className:d().string},mw.defaultProps={selectedIndex:0,className:""};const vw=mw;function bw(e){return bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bw(e)}function gw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==bw(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===bw(i)?i:String(i)),r)}var o,i}function ww(e,t){return ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ww(e,t)}function Sw(e){return Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sw(e)}var Ew=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ww(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sw(r);if(o){var n=Sw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===bw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"tftabs-panel"},this.props.children)}}])&&gw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ew.propTypes={label:d().string.isRequired,children:d().node.isRequired},Ew.defaultProps={visible:!0};const Ow=Ew;function _w(e){return _w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_w(e)}function Pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_w(i)?i:String(i)),r)}var o,i}function kw(e,t){return kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kw(e,t)}function jw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cw(e){return Cw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cw(e)}var Tw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cw(r);if(o){var n=Cw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jw(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(jw(t)),t.state={isLiked:t.props.isLiked},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/like",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isLiked}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isLiked:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("likes",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link like".concat(this.state.isLiked?" active":"");return u().createElement("span",null,u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"))}}])&&Pw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Tw.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,isLiked:d().bool,onChange:d().func},Tw.defaultProps={isLiked:!1};const xw=Tw;function Rw(e){return Rw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rw(e)}function Dw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rw(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rw(i)?i:String(i)),r)}var o,i}function Nw(e,t){return Nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nw(e,t)}function Mw(e){return Mw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mw(e)}var Iw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mw(r);if(o){var n=Mw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),e=Object.assign({},e),t.state={uniqueness:(Math.random()+"").replace(".",""),value:e.value||0,stars:[],halfStar:{at:Math.floor(e.value),hidden:e.half&&e.value%1<.5}},t.state.config={count:e.count,size:e.size,char:e.char,color1:e.color1,color2:e.color2,half:e.half,edit:e.edit},t}return t=a,n=[{key:"componentDidMount",value:function(){this.setState({stars:this.getStars(this.state.value)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({stars:this.getStars(e.value),value:e.value,halfStar:{at:Math.floor(e.value),hidden:this.state.config.half&&e.value%1<.5}})}},{key:"isDecimal",value:function(e){return e%1!=0}},{key:"getRate",value:function(){return this.state.config.half?Math.floor(this.state.value):Math.round(this.state.value)}},{key:"getStars",value:function(e){void 0===e&&(e=this.getRate());for(var t=[],n=0;n<this.state.config.count;n++)t.push({active:n<=e-1});return t}},{key:"mouseOver",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o=Number(e.target.getAttribute("data-index"));if(n.half){var i=this.moreThanHalf(e,n.size);r.hidden=i,i&&(o+=1),r.at=o}else o+=1;this.setState({stars:this.getStars(o)})}}},{key:"moreThanHalf",value:function(e,t){var n=e.target,r=e.clientX-n.getBoundingClientRect().left;return(r=Math.round(Math.abs(r)))>t/2}},{key:"mouseLeave",value:function(){var e=this.state,t=e.value,n=e.halfStar,r=e.config;r.edit&&(r.half&&(n.hidden=!this.isDecimal(t),n.at=Math.floor(this.state.value)),this.setState({stars:this.getStars()}))}},{key:"clicked",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o,i=Number(e.target.getAttribute("data-index"));if(n.half){var a=this.moreThanHalf(e,n.size);r.hidden=a,a&&(i+=1),o=a?i:i+.5,r.at=i}else o=i+=1;this.setState({value:o,stars:this.getStars(i)}),this.props.onChange(o)}}},{key:"renderHalfStarStyleElement",value:function(){var e=this.state,t=e.config,n=e.uniqueness;return u().createElement("style",{dangerouslySetInnerHTML:{__html:Bw(t.color2,n)}})}},{key:"renderStars",value:function(){var e=this,t=this.state,n=t.halfStar,r=t.stars,o=t.uniqueness,i=t.config,a=i.color1,s=i.color2,c=i.size,l=i.char,f=i.half,p=i.edit;return r.map((function(t,r){var i="";f&&!n.hidden&&n.at===r&&(i="react-stars-".concat(o));var h=Object.assign({},Lw,{color:t.active?s:a,cursor:p?"pointer":"default",fontSize:"".concat(c,"px")});return u().createElement("span",{className:i,style:h,key:r,"data-index":r,"data-forhalf":l,onMouseOver:e.mouseOver.bind(e),onMouseMove:e.mouseOver.bind(e),onMouseLeave:e.mouseLeave.bind(e),onClick:e.clicked.bind(e)},l)}))}},{key:"render",value:function(){var e=this.props.className;return u().createElement("span",{className:e,style:Aw},this.state.config.half?this.renderHalfStarStyleElement():"",this.renderStars())}}],n&&Dw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Iw.propTypes={className:d().string,edit:d().bool,half:d().bool,value:d().number,count:d().number,char:d().string,size:d().number,color1:d().string,color2:d().string},Iw.defaultProps={edit:!0,half:!0,value:0,count:5,char:"★",size:15,color1:"gray",color2:"#ffd700",onChange:function(){}};var Aw={overflow:"hidden",position:"relative"},Lw={position:"relative",overflow:"hidden",cursor:"pointer",display:"block",float:"left"},Bw=function(e,t){return"\n    .react-stars-".concat(t,":before {\n      position: absolute;\n      overflow: hidden;\n      display: block;\n      z-index: 1;\n      top: 0; left: 0;\n      width: 50%;\n      content: attr(data-forhalf);\n      color: ").concat(e,";\n  }")};const Fw=Iw;function Uw(e){return Uw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uw(e)}function qw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Uw(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Uw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Uw(i)?i:String(i)),r)}var o,i}function Kw(e,t){return Kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kw(e,t)}function Vw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zw(e){return zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zw(e)}var Ww=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zw(r);if(o){var n=zw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Uw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vw(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onChange=t.onChange.bind(Vw(t)),t.state={rating:t.props.rating},t}return t=a,(n=[{key:"onChange",value:function(e){$.ajax({type:"POST",url:"/api/social/rate/",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({rating:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("rating",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement(Fw,{className:"rate",value:this.state.rating,onChange:this.onChange,count:5,half:!1,size:24,color1:"rgba(255,255,255,.5)",color2:"#FCB434"})}}])&&qw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ww.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,rating:d().number,onChange:d().func},Ww.defaultProps={rating:null};const Hw=Ww;function $w(e){return $w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$w(e)}function Gw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==$w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==$w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===$w(i)?i:String(i)),r)}var o,i}function Jw(e,t){return Jw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jw(e,t)}function Qw(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yw(e){return Yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yw(e)}var Xw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Yw(r);if(o){var n=Yw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Qw(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(Qw(t)),t.state={isWatched:t.props.isWatched},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isWatched}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isWatched:e.value}),null!=e.result&&e.result>=0&&this.props.onChange("watch",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link watch".concat(this.state.isWatched?" active":"");return u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Watch")}}])&&Gw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function Zw(e){return Zw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zw(e)}function eS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Zw(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Zw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Zw(i)?i:String(i)),r)}var o,i}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tS(e,t)}function nS(e){return nS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nS(e)}Xw.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,isWatched:d().bool},Xw.defaultProps={isWatched:!1};var rS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=nS(r);if(o){var n=nS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Zw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){var r="".concat(e.props.path,"?").concat(t.value);return u().createElement("span",{key:n,className:"tag category"},u().createElement("a",{href:r},t.text))}));return u().createElement("div",null,u().createElement("h4",null,TFWeb.Resources.UI.Categories),u().createElement("div",{className:"tags"},t))}}])&&eS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);rS.propTypes={list:d().array,path:d().string.isRequired},rS.defaultProps={list:[]};const oS=rS;function iS(e){return iS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iS(e)}function aS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==iS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==iS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===iS(i)?i:String(i)),r)}var o,i}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sS(e,t)}function cS(e){return cS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cS(e)}var lS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cS(r);if(o){var n=cS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===iS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?tags=").concat(encodeURIComponent(t));return u().createElement("span",{key:n,className:"tag"},u().createElement("a",{href:r},t))}return u().createElement("span",{key:n,className:"tag"},t)})),n=null!=this.props.label&&"undefined"!=this.props.label?this.props.label:TFWeb.Resources.UI.Tags;return u().createElement("div",null,u().createElement("h4",null,n),u().createElement("div",{className:"tags"},t))}}])&&aS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);lS.propTypes={list:d().array,path:d().string,label:d().string},lS.defaultProps={list:[]};const uS=lS;function fS(e){return fS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fS(e)}function pS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==fS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==fS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===fS(i)?i:String(i)),r)}var o,i}function hS(e,t){return hS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hS(e,t)}function dS(e){return dS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dS(e)}var yS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dS(r);if(o){var n=dS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===fS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"extension-download asset-download"},u().createElement("div",{className:"info"},u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",null,u().createElement("p",{className:"title"},this.props.content.title),u().createElement("span",{className:"format"},this.props.content.resourceFormat),u().createElement("table",null,u().createElement("tbody",null,u().createElement("tr",null,u().createElement("td",null,u().createElement("span",null,"File Size:")),u().createElement("td",null,u().createElement("span",null,this.props.content.size))),u().createElement("tr",null,u().createElement("td",null,u().createElement("span",null,"Compatibility:")),u().createElement("td",null,u().createElement("ul",null,this.props.content.productReleases.map((function(e,t){return u().createElement("li",{key:t},e)}))))),u().createElement("tr",null,u().createElement("td",{colSpan:"2"},this.props.children)))))))}}])&&pS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);yS.propTypes={content:d().object};const mS=yS;function vS(e){return vS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vS(e)}function bS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==vS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==vS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===vS(i)?i:String(i)),r)}var o,i}function gS(e,t){return gS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gS(e,t)}function wS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SS(e){return SS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SS(e)}const ES=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=SS(r);if(o){var n=SS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===vS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wS(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onAction=t.onAction.bind(wS(t)),t.state={hasLoaded:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/legal/agreement/".concat(this.props.license)).done((function(t,n,r){e.title=t.title,e.text=t.text,e.setState({hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onAction",value:function(e){!0===e?$.ajax({type:"POST",url:"/api/legal/agreement/".concat(this.props.license),contentType:"application/json; charset=utf-8",data:JSON.stringify({agree:e}),dataType:"json",context:this}).done((function(t,n,r){this.props.onAction(this.props.license,e,t)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})):this.props.onAction(e,null)}},{key:"render",value:function(){return this.state.hasLoaded?u().createElement("div",{className:"license-agreement"},u().createElement("h1",null,this.title),u().createElement("div",{className:"license-view"},u().createElement("div",{dangerouslySetInnerHTML:sn.createMarkup(this.text)})),u().createElement("div",{style:{textAlign:"right"}},u().createElement("button",{style:{marginRight:"5px"},onClick:this.onAction.bind(null,!1)},"Cancel"),u().createElement("button",{className:"btn-primary",style:{paddingLeft:"60px",paddingRight:"60px"},onClick:this.onAction.bind(null,!0)},"I Agree"))):null}}])&&bS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function OS(e){return OS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OS(e)}function _S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==OS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==OS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===OS(i)?i:String(i)),r)}var o,i}function PS(e,t){return PS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PS(e,t)}function kS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jS(e){return jS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jS(e)}var CS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=jS(r);if(o){var n=jS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===OS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kS(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onDownload=t.onDownload.bind(kS(t)),t.handleTOS=t.handleTOS.bind(kS(t)),t.closeTOS=t.closeTOS.bind(kS(t)),t.DownloadType={Download:1,Cart:2},t.download=null,t.tos=[],t.state={showTOS:!1,tos:null},t}return t=a,n=[{key:"onDownload",value:function(e,t){var n=this.props.list[e];return this.download={type:this.DownloadType.Download,index:e,format:t},this.setState({showTOS:!0,tos:n.license}),!1}},{key:"doDownload",value:function(e,t){var n=this.props.list[e],r="/extension/".concat(this.props.projectID,"/content/").concat(n.data,"/download");null!=t&&(r+="?format=".concat(t)),window.location.replace(r)}},{key:"handleTOS",value:function(e,t,n){for(var r=this,o=0;o<=this.props.list.length-1;o++)this.props.list[o].license==e&&(this.props.list[o].viewer.licenseAgreement=n);this.setState({showTOS:!1,tos:null},(function(){if(t&&null!=r.download)switch(r.download.type){case r.DownloadType.Download:r.doDownload(r.download.index,r.download.format);break;case r.DownloadType.Cart:r.addToCart(r.download.index)}}))}},{key:"closeTOS",value:function(){!0===this.state.showTOS&&this.setState({showTOS:!1})}},{key:"render",value:function(){var e=[];return this.props.list.forEach((function(t,n){var r=[];this.props.viewer.isSignedIn?r.push(u().createElement("li",{key:"d"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,null)},"Download"))):r=u().createElement("li",null,u().createElement("a",{href:this.props.viewer.signInUrl,className:"button btn-small icon icon-after icon-download"},"Sign in to download")),e.push(u().createElement(mS,{key:t.id,content:t},u().createElement("ul",{className:"files"},r)))}),this),u().createElement(u().Fragment,null,u().createElement("div",{className:"share-downloads"},e),this.state.showTOS&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!1,onClose:this.closeTOS,contentStyle:{backgroundColor:"white",padding:"40px"}},u().createElement(ES,{id:6,license:this.state.tos,onAction:this.handleTOS})))}}],n&&_S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);CS.propTypes={projectID:d().number,list:d().array,viewer:d().object};const TS=CS;function xS(e){return xS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xS(e)}function RS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==xS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==xS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===xS(i)?i:String(i)),r)}var o,i}function DS(e,t){return DS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DS(e,t)}function NS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MS(e){return MS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MS(e)}var IS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=MS(r);if(o){var n=MS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===xS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return NS(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).initValue=t.initValue.bind(NS(t)),t.validate=t.validate.bind(NS(t)),t.valid=t.valid.bind(NS(t)),t.getValue=t.getValue.bind(NS(t)),t.setValue=t.setValue.bind(NS(t)),t.onChange=t.onChange.bind(NS(t)),t.handleFocus=t.handleFocus.bind(NS(t)),t.handleBlur=t.handleBlur.bind(NS(t)),t.changeLocale=t.changeLocale.bind(NS(t)),t.state={currentCulture:Object.keys(TFGlobal.cultures)[0],value:t.initValue(t.props.value),validate:!1,isValid:!0,showValidation:!1},t}return t=a,n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"initValue",value:function(e){var t=null!=e?e:{};return Object.keys(TFGlobal.cultures).forEach((function(e){t.hasOwnProperty(e)||(t[e]="")})),t}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value.en}},{key:"getValue",value:function(){var e=JSON.parse(JSON.stringify(this.state.value));return Object.keys(e).forEach((function(t){""==e[t]&&delete e[t]})),e}},{key:"setValue",value:function(e){var t=this.initValue(e);this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=JSON.parse(JSON.stringify(this.state.value));n[this.state.currentCulture]=e.target.value,this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(e.target.value)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"changeLocale",value:function(e){this.setState({currentCulture:e})}},{key:"render",value:function(){var e=this,t="localized-string-editor form-group";!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=u().createElement(fi,{message:this.props.helpMessage})):n=u().createElement(fi,{message:this.props.requiredErrorMessage});var r,o=Object.keys(TFGlobal.cultures).map((function(t,n){var r=t==e.state.currentCulture?"active":"";return""!=e.state.value[t]&&(r+=" hasText"),u().createElement("li",{key:n},u().createElement("a",{onClick:e.changeLocale.bind(null,t),className:r},TFGlobal.cultures[t]))}));return r=1==this.props.rows?u().createElement("input",{name:this.props.name,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}):u().createElement("textarea",{name:this.props.name,type:"text",rows:this.props.rows,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),u().createElement("div",{className:t},u().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),u().createElement("div",null,r,u().createElement("ul",null,o)),n,this.props.children)}}],n&&RS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);IS.propTypes={value:d().object,rows:d().number,name:d().string,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},IS.defaultProps={rows:5,required:!1,requiredErrorMessage:"input required."};const AS=IS;function LS(e){return LS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LS(e)}function BS(){return BS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BS.apply(this,arguments)}function FS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function US(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==LS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==LS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===LS(i)?i:String(i)),r)}var o,i}function qS(e,t,n){return t&&US(e.prototype,t),n&&US(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function KS(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VS(e,t)}function VS(e,t){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VS(e,t)}function zS(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=HS(e);if(t){var o=HS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===LS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return WS(e)}(this,n)}}function WS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HS(e){return HS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HS(e)}var $S=function(e){KS(n,e);var t=zS(n);function n(e){var r;return FS(this,n),(r=t.call(this,e)).validate=r.validate.bind(WS(r)),r.valid=r.valid.bind(WS(r)),r.getTags=r.getTags.bind(WS(r)),r.updateTags=r.updateTags.bind(WS(r)),r.onDelete=r.onDelete.bind(WS(r)),r.getTagIndex=r.getTagIndex.bind(WS(r)),r.handleKeyDown=r.handleKeyDown.bind(WS(r)),r.setInputWidth=r.setInputWidth.bind(WS(r)),r.resetInput=r.resetInput.bind(WS(r)),r.onBlur=r.onBlur.bind(WS(r)),r.handleGroupFocus=r.handleGroupFocus.bind(WS(r)),r.handleGroupBlur=r.handleGroupBlur.bind(WS(r)),r.inputDefaultLength=16,r.inputCharWidth=8,r.state={tags:r.props.tags?r.props.tags:[],highlightIndex:null,inputWidth:r.inputDefaultLength*r.inputCharWidth,validate:!1,isValid:!0===r.props.required&&null!=r.props.tags&&r.props.tags.length>0,showValidation:!1,hasFocus:!1},r}return qS(n,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.tags&&this.state.tags.length>0}},{key:"getTags",value:function(){return this.state.tags}},{key:"updateTags",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];-1==this.state.tags.indexOf(r)&&t.push(r)}if(t.length>0){var o=this.state.tags.concat(t);this.setState({tags:o})}}},{key:"onDelete",value:function(e){var t=this.state.tags;t.splice(e,1),this.setState({tags:t,isValid:this.valid()})}},{key:"getTagIndex",value:function(e){for(var t=0;t<this.state.tags.length;t++)if(this.state.tags[t].toLowerCase()==e.toLowerCase())return t;return null}},{key:"handleKeyDown",value:function(e){var t=this,n=this.refs.input.value;if(188==e.keyCode){e.preventDefault();var r=this.getTagIndex(n);if(null==r){var o=this.state.tags;o.push(n),this.setState({tags:o,isValid:this.valid()}),this.resetInput()}else this.setState({highlightIndex:r}),this.setInputWidth(n.length),setTimeout((function(){t.setState({highlightIndex:null})}),1e3)}else 27==e.keyCode?(e.preventDefault(),this.resetInput()):this.setInputWidth(n.length)}},{key:"setInputWidth",value:function(e){if(e>this.inputDefaultLength){var t=e*this.inputCharWidth;t>this.state.inputWidth&&this.setState({inputWidth:t})}}},{key:"resetInput",value:function(){this.setState({inputWidth:this.inputDefaultLength*this.inputCharWidth}),this.refs.input.value=""}},{key:"onBlur",value:function(){this.resetInput()}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.state.tags.map((function(t,n){var r="";return e.state.highlightIndex==n&&(r+="highlight"),u().createElement(GS,{key:t,className:r,data:t,onDelete:e.onDelete.bind(null,n)})})),n={style:{width:this.state.inputWidth}},r="tag-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(r+=" has-focus"):r+=" has-error";var o="active";!0===this.props.required&&(o+=" required");var i=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(i=u().createElement(fi,{message:this.props.helpMessage})):i=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:r,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:o},this.props.label),u().createElement("div",null,t,u().createElement("input",BS({type:"text",ref:"input",placeholder:this.props.placeholder,onKeyDown:this.handleKeyDown,onBlur:this.onBlur},n))),i)}}]),n}(u().Component);$S.propTypes={tags:d().array,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string},$S.defaultProps={label:"Tags",placeholder:"Add New Tag...",helpMessage:"Enter tags separated by a comma.",required:!1,requiredErrorMessage:"At least one item is required"};var GS=function(e){KS(n,e);var t=zS(n);function n(){return FS(this,n),t.apply(this,arguments)}return qS(n,[{key:"render",value:function(){return u().createElement("span",{className:this.props.className},this.props.data," ",u().createElement("button",{type:"button",className:"close",onClick:this.props.onDelete},u().createElement("span",null,"×")))}}]),n}(u().Component);const JS=$S;function QS(e){return QS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QS(e)}function YS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==QS(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==QS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===QS(i)?i:String(i)),r)}var o,i}function XS(e,t){return XS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XS(e,t)}function ZS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e){return eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eE(e)}const tE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eE(r);if(o){var n=eE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===QS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ZS(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(ZS(t)),t.handleCancel=t.handleCancel.bind(ZS(t)),t.handleSubmit=t.handleSubmit.bind(ZS(t)),t.form=null,t.state={loadStatus:c.LoadStatus.PreLoad},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/"+this.props.id).done((function(t,n,r){e.form=t,e.setState({loadStatus:c.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){this.refs.titleLocalizations.validate()&&this.refs.product.validate()&&this.refs.category.validate()&&(this.form.titleLocalizations=this.refs.titleLocalizations.getValue(),this.form.descriptionLocalizations=this.refs.descriptionLocalizations.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),$.ajax({type:"POST",url:"/admintia/api/project/"+this.props.id,data:this.form,dataType:"json",context:this}).done((function(e,t,n){window.location.replace(e.data.url)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})))}},{key:"render",value:function(){return this.state.loadStatus!=c.LoadStatus.Loaded?u().createElement(hn,null):u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12",style:{marginBottom:"20px"}},u().createElement(AS,{ref:"titleLocalizations",label:"Title",placeholder:"Name your project...",value:this.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."})),u().createElement("div",{className:"col-md-12"},u().createElement(AS,{ref:"descriptionLocalizations",label:"Project Description",placeholder:"Project description...",value:this.form.descriptionLocalizations,rows:10,required:!1,requiredErrorMessage:"English description required at minimum."})),u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),u().createElement("div",{className:"col-md-12"},u().createElement(JS,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData}))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}])&&YS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function nE(e){return nE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nE(e)}function rE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==nE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==nE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===nE(i)?i:String(i)),r)}var o,i}function oE(e,t){return oE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oE(e,t)}function iE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aE(e){return aE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aE(e)}const sE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=aE(r);if(o){var n=aE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===nE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return iE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(iE(t)),t.handleEditClick=t.handleEditClick.bind(iE(t)),t.handleEditCancel=t.handleEditCancel.bind(iE(t)),t.handleEditComplete=t.handleEditComplete.bind(iE(t)),t.state={showPanel:!1,showEdit:!1,showSpam:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"render",value:function(){return u().createElement("div",{className:"topic-editor clearfix"},u().createElement("ul",{className:"list-inline"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Project")),this.props.project.viewer.eMessage&&u().createElement("li",{className:"emessage"},this.props.project.viewer.eMessage)),this.state.showEdit&&u().createElement(tE,{id:this.props.project.id,onCancel:this.handleEditCancel}))}}])&&rE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function cE(e){return cE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cE(e)}function lE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==cE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==cE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===cE(i)?i:String(i)),r)}var o,i}function uE(e,t){return uE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uE(e,t)}function fE(e){return fE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fE(e)}var pE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fE(r);if(o){var n=fE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.licenses||0==this.props.licenses.length)return null;var e=[];return this.props.licenses.forEach((function(t,n){var r="";for(n=0;n<t.entities.length;n++)n>0&&(n<t.entities.length-1?r+=", ":n==t.entities.length-1&&(r+=" & ")),r+=t.entities[n];e.push(u().createElement("li",{key:n},u().createElement("span",null,r)," ",t.entities.length>1?"are":"is"," shared under the ",u().createElement("a",{href:t.url},t.title)," license."))})),u().createElement("ul",{className:"license-smalltext-view"},e)}}])&&lE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);pE.propTypes={licenses:d().array};const hE=pE;function dE(e){return dE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dE(e)}function yE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==dE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===dE(i)?i:String(i)),r)}var o,i}function mE(e,t){return mE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mE(e,t)}function vE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bE(e){return bE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bE(e)}var gE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bE(r);if(o){var n=bE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===dE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return vE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getView=t.getView.bind(vE(t)),t.onMetricsChange=t.onMetricsChange.bind(vE(t)),t.state={hasLoaded:!1,project:null,metrics:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getView(),$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"getView",value:function(){var e="/api/cattery/view/".concat(this.props.match.params.id),t=this;$.getJSON(e).done((function(e,n,r){t.setState({project:e,metrics:e.metrics,hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onMetricsChange",value:function(e,t){var n=no()(this.state.metrics);n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this;if(!1===this.state.hasLoaded)return u().createElement(hn,null);var t=this.state.project,n=null;if(!0===t.viewer.isSignedIn){var r=!1;null!=t.viewer.actions&&(null!=t.viewer.actions.like&&(r=t.viewer.actions.like.value),null!=t.viewer.actions.watch&&t.viewer.actions.watch.value),n=[],!1===t.viewer.isOwner&&n.push(u().createElement(xw,{key:0,consumer:"Project",id:t.id,isLiked:r,onChange:this.onMetricsChange}))}var o=null;return!0===t.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===t.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement(u().Fragment,null,u().createElement(rn,null,u().createElement("title",null,"Cattery - ",this.state.project.title),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.project.url)})),u().createElement("div",{className:"extension-view"},u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:sn.createMarkup(t.title)}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(al,null),u().createElement("time",null,"Published ",t.publishedDT),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"})),t.viewer.e&&u().createElement(sE,{project:t})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(Nd,{gallery:t.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(t.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Description"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.description)}),u().createElement(oS,{list:t.categories,path:this.props.filterPath}),!1,u().createElement(Wg,{list:t.products,path:this.props.filterPath})))),u().createElement(vw,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(Ow,{label:"Downloads",visible:!0},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(TS,{list:t.content,projectID:t.id,viewer:t.viewer})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"License and Acknowledgment"),t.license&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.license)})))),u().createElement(Ow,{label:"Instructions",visible:t.installation||t.usage},u().createElement("div",{className:"project-info-container"},t.installation&&u().createElement(u().Fragment,null,u().createElement("h4",null,"Install"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.installation)})),t.usage&&u().createElement(u().Fragment,null,u().createElement("h4",null,"How To Use"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.usage)})))))))}}])&&yE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);gE.propTypes={project:d().object,filterPath:d().string},gE.defaultProps={filterPath:"/cattery"};const wE=Je(gE);function SE(e){return SE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SE(e)}function EE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==SE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==SE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===SE(i)?i:String(i)),r)}var o,i}function OE(e,t){return OE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OE(e,t)}function _E(e){return _E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_E(e)}var PE=Je(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_E(r);if(o){var n=_E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===SE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(Ge,null,u().createElement($e,{exact:!0,strict:!0,path:"/cattery/faq"},u().createElement(uw,null)),u().createElement($e,{path:"/cattery/:id/:slug?"},u().createElement(wE,null)),u().createElement($e,{path:"/cattery"},u().createElement(u().Fragment,null,u().createElement(rn,null,u().createElement("title",null,"Cattery"),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin,"/cattery")})),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,u().createElement("img",{src:"/common/img/logos/Cattery_BlackYellow.svg"})),u().createElement("p",null,"A library of open-source machine learning models converted to .cat files to run natively inside Nuke."),u().createElement("p",null,"The .cat files in this library are all subject to the ",u().createElement("a",{href:"/license/bsd3clause"},"BSD 3-Clause license"),". Foundry does not certify or approve, nor are we responsible for, the licensing or legal framework to the underlying pre-trained model, associated training data, and dependencies. The User should undertake independent investigation of the underlying files in so far as it is relevant to the User's intended use."),u().createElement("p",null,"Additional information can be found in our ",u().createElement("a",{href:"/cattery/faq"},"Cattery FAQ"),"."))),u().createElement("div",{className:"content-section"},u().createElement(Ab,{type:"Cattery",section:"cattery"})))))}}])&&EE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component));const kE=function(e){return $("#globalFooter").removeClass("hide"),u().createElement("div",{className:"app cattery"},u().createElement(rn,{defaultTitle:"Cattery | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(Qe,null,u().createElement(PE,null)))};function jE(e){return jE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jE(e)}function CE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==jE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==jE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===jE(i)?i:String(i)),r)}var o,i}function TE(e,t){return TE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TE(e,t)}function xE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RE(e){return RE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RE(e)}var DE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=RE(r);if(o){var n=RE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(xE(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=[];e.content.forEach((function(e,n){t.push(u().createElement(kd,{key:e.id,content:e}))}),this);var n=null;if(!0===this.props.isSignedIn){var r=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(r=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),n=[],!1===e.viewer.isOwner&&n.push(u().createElement(xw,{key:0,consumer:"Project",id:e.id,isLiked:r,onChange:this.onMetricsChange}))}var o=null;return!0===e.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:sn.createMarkup(e.title)}),u().createElement(Uo,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(al,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(sE,{project:e})))),u().createElement("div",{className:"portfolio-project-gallery"},t),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(e.description)})),u().createElement("div",{className:"project-info-block-section"},u().createElement(oS,{list:e.categories,path:this.props.filterPath}),u().createElement(uS,{list:e.tags,path:this.props.filterPath}),u().createElement(Wg,{list:e.products,path:this.props.filterPath})))))}}])&&CE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);DE.propTypes={project:d().object,isSignedIn:d().bool,filterPath:d().string},DE.defaultProps={isSignedIn:!1,filterPath:"/explore"};const NE=DE;function ME(e){return ME="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ME(e)}function IE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ME(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ME(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ME(i)?i:String(i)),r)}var o,i}function AE(e,t){return AE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},AE(e,t)}function LE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BE(e){return BE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},BE(e)}var FE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&AE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=BE(r);if(o){var n=BE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ME(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return LE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getData=t.getData.bind(LE(t)),t.state={hasLoaded:!1,collections:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){null!=this.props.projectID&&this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/playlist/containing/"+this.props.projectID).done((function(t,n,r){e.setState({hasLoaded:!0,collections:t.collections})})).fail((function(e,t,n){}))}},{key:"render",value:function(){if(!1===this.state.hasLoaded||!0===this.state.hasLoaded&&null===this.state.collections)return null;var e=this.state.collections.map((function(e,t){return u().createElement(ys,{key:e.id,collection:e})}));return u().createElement("div",{className:"subsection project"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,"Courses and Playlists containing this video")),u().createElement("div",{className:"content-section"},u().createElement(ls,null,u().createElement("div",null,e))))}}])&&IE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);FE.propTypes={projectID:d().number};const UE=FE;function qE(e){return qE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qE(e)}function KE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==qE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==qE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===qE(i)?i:String(i)),r)}var o,i}function VE(e,t){return VE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VE(e,t)}function zE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WE(e){return WE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WE(e)}var HE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=WE(r);if(o){var n=WE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===qE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(zE(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===this.props.isSignedIn){var n=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(n=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===this.props.project.viewer.isOwner&&t.push(u().createElement(xw,{key:0,consumer:"Project",id:e.id,isLiked:n,onChange:this.onMetricsChange}))}var r=null;return!0===e.isFeatured?r=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},r,u().createElement("h2",{dangerouslySetInnerHTML:sn.createMarkup(e.title)}),u().createElement(Uo,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},t,u().createElement(al,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(sE,{project:e})))),u().createElement("div",{className:"training-project-gallery"},u().createElement(kd,{display:"hero",content:e.content[0]})),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(e.description)})),u().createElement("div",{className:"project-info-block-section"},u().createElement(oS,{list:e.categories,path:this.props.filterPath}),u().createElement(uS,{list:e.tags,path:this.props.filterPath}),u().createElement(Wg,{list:e.products,path:this.props.filterPath})))),u().createElement(UE,{projectID:e.id}))}}])&&KE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);HE.propTypes={project:d().object,isSignedIn:d().bool,filterPath:d().string},HE.defaultProps={isSignedIn:!1,filterPath:"/watch"};const $E=HE;function GE(e){return GE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GE(e)}function JE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==GE(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==GE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===GE(i)?i:String(i)),r)}var o,i}function QE(e,t){return QE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QE(e,t)}function YE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XE(e){return XE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},XE(e)}var ZE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=XE(r);if(o){var n=XE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===GE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return YE(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getTOS=t.getTOS.bind(YE(t)),t.addToCart=t.addToCart.bind(YE(t)),t.onDownload=t.onDownload.bind(YE(t)),t.handleTOS=t.handleTOS.bind(YE(t)),t.closeTOS=t.closeTOS.bind(YE(t)),t.DownloadType={Download:1,Cart:2},t.download=null,t.tos=[],t.state={showTOS:!1,tos:null},t}return t=a,n=[{key:"getTOS",value:function(e){}},{key:"addToCart",value:function(e){var t=this.props.list[e];if(null==t.viewer.licenseAgreement)return this.download={type:this.DownloadType.Cart,index:e,format:null},this.setState({showTOS:!0,tos:t.license}),!1;this.refs.cart.addToCart(t.data)}},{key:"onDownload",value:function(e,t){var n=this.props.list[e];if(null==n.viewer.licenseAgreement)return this.download={type:this.DownloadType.Download,index:e,format:t},this.setState({showTOS:!0,tos:n.license}),!1;var r="/share/".concat(this.props.projectID,"/content/").concat(n.data,"/download");null!=t&&(r+="?format=".concat(t)),window.location.replace(r)}},{key:"handleTOS",value:function(e,t,n){for(var r=this,o=0;o<=this.props.list.length-1;o++)this.props.list[o].license==e&&(this.props.list[o].viewer.licenseAgreement=n);this.setState({showTOS:!1,tos:null},(function(){if(t&&null!=r.download)switch(r.download.type){case r.DownloadType.Download:r.onDownload(r.download.index,r.download.format);break;case r.DownloadType.Cart:r.addToCart(r.download.index)}}))}},{key:"closeTOS",value:function(){!0===this.state.showTOS&&this.setState({showTOS:!1})}},{key:"render",value:function(){var e=[];return this.props.list.forEach((function(t,n){var r=[];if(this.props.viewer.isSignedIn||this.props.viewer.isDassault){var o,i=t.niceFormat;"ModoPackage"===t.format&&(o=u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,"zip")},"Download as Zip")),r.push(u().createElement("li",{key:"d"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,null)},"Download ",i),o)),this.props.viewer.isSignedIn&&r.push(u().createElement("li",{key:"c"},u().createElement("button",{type:"button",className:"button btn-small",onClick:this.addToCart.bind(null,n)},"Add to Download Cart")))}else r=u().createElement("li",null,u().createElement("a",{href:this.props.viewer.signInUrl,className:"button btn-small icon icon-after icon-download"},"Sign in to download"));e.push(u().createElement(bb,{key:t.id,content:t},u().createElement("ul",{className:"files"},r)))}),this),u().createElement("div",{style:{position:"relative"}},u().createElement("h4",{className:"clearfix"},"Downloads ",!0===this.props.viewer.isSignedIn&&u().createElement(xb,{ref:"cart",inline:!0})),u().createElement("div",{className:"share-downloads"},e),this.state.showTOS&&u().createElement(I,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!1,onClose:this.closeTOS,contentStyle:{backgroundColor:"white",padding:"40px"}},u().createElement(ES,{id:6,license:this.state.tos,onAction:this.handleTOS})))}}],n&&JE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);ZE.propTypes={projectID:d().number,list:d().array,viewer:d().object};const eO=ZE;function tO(e){return tO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tO(e)}function nO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==tO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==tO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===tO(i)?i:String(i)),r)}var o,i}function rO(e,t){return rO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rO(e,t)}function oO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iO(e){return iO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iO(e)}var aO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=iO(r);if(o){var n=iO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===tO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oO(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(oO(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===e.viewer.isSignedIn){var n=null;null!=e.viewer.actions&&(null!=e.viewer.actions.rate&&(n=e.viewer.actions.rate.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===e.viewer.isOwner&&t.push(u().createElement(Hw,{key:0,consumer:"Project",id:e.id,rating:n}))}var r=null;return!0===e.isFeatured?r=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},r,u().createElement("h2",{dangerouslySetInnerHTML:sn.createMarkup(e.title)}),u().createElement(Uo,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},t,u().createElement(al,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(sE,{project:e})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(Nd,{gallery:e.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(e.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(e.description)}),u().createElement(eO,{list:e.content,projectID:e.id,viewer:e.viewer}),u().createElement(oS,{list:e.categories,path:this.props.filterPath}),u().createElement(uS,{list:e.tags,path:this.props.filterPath}),u().createElement(Wg,{list:e.products,path:this.props.filterPath}),u().createElement(hE,{licenses:e.licenses})))))}}])&&nO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);aO.propTypes={project:d().object,filterPath:d().string},aO.defaultProps={filterPath:"/share"};const sO=aO;function cO(e){return cO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cO(e)}function lO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==cO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==cO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===cO(i)?i:String(i)),r)}var o,i}function uO(e,t){return uO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uO(e,t)}function fO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pO(e){return pO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pO(e)}var hO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pO(r);if(o){var n=pO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===cO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fO(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(fO(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this,t=this.props.project,n=null;if(!0===t.viewer.isSignedIn){var r=null;null!=t.viewer.actions&&(null!=t.viewer.actions.rate&&(r=t.viewer.actions.rate.value),null!=t.viewer.actions.watch&&t.viewer.actions.watch.value),n=[],!1===t.viewer.isOwner&&n.push(u().createElement(Hw,{key:0,consumer:"Project",id:t.id,rating:r}))}var o=null;return!0===t.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===t.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement("div",{className:"extension-view"},u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:sn.createMarkup(t.title)}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(al,null),u().createElement("time",null,"Published ",t.publishedDT),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"})),t.viewer.e&&u().createElement(sE,{project:t})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(Nd,{gallery:t.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(t.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Description"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.description)}),u().createElement(oS,{list:t.categories,path:this.props.filterPath}),!1,u().createElement(Wg,{list:t.products,path:this.props.filterPath})))),u().createElement(vw,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(Ow,{label:"Downloads",visible:!0},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(TS,{list:t.content,projectID:t.id,viewer:t.viewer})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"License and Acknowledgment"),t.license&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.license)})))),u().createElement(Ow,{label:"Instructions",visible:t.installation||t.usage},u().createElement("div",{className:"project-info-container"},t.installation&&u().createElement(u().Fragment,null,u().createElement("h4",null,"Install"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.installation)})),t.usage&&u().createElement(u().Fragment,null,u().createElement("h4",null,"How To Use"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(t.usage)}))))))}}])&&lO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);hO.propTypes={project:d().object,filterPath:d().string},hO.defaultProps={filterPath:"/cattery"};const dO=hO;function yO(e){return yO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yO(e)}function mO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==yO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==yO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===yO(i)?i:String(i)),r)}var o,i}function bO(e,t,n){return t&&vO(e.prototype,t),n&&vO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wO(e,t)}function wO(e,t){return wO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wO(e,t)}function SO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=OO(e);if(t){var o=OO(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===yO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return EO(e)}(this,n)}}function EO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OO(e){return OO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OO(e)}var _O=function(e){gO(n,e);var t=SO(n);function n(e){var r;return mO(this,n),(r=t.call(this,e)).setup=r.setup.bind(EO(r)),r.handleCancel=r.handleCancel.bind(EO(r)),r.handleSubmit=r.handleSubmit.bind(EO(r)),r.onCourseTypeChange=r.onCourseTypeChange.bind(EO(r)),r.state={form:r.props.form?r.props.form:null,loadStatus:r.props.form?c.LoadStatus.Loaded:c.LoadStatus.PreLoad},r}return bO(n,[{key:"componentDidMount",value:function(){null==this.state.form&&this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.form!==this.state.form&&this.setState({form:e.form})}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/collection/"+this.props.id).done((function(t,n,r){e.setState({form:t,loadStatus:c.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel&&this.props.onCancel()}},{key:"handleSubmit",value:function(){var e=this;if(this.refs.titleLocalizations.validate()){var t=this.refs.pac.getSelectedOptions(),n={courseType:this.refs.courseType.getValue(),titleLocalizations:this.refs.titleLocalizations.getValue(),coverDescriptionLocalizations:this.refs.coverDescriptionLocalizations.getValue(),descriptionLocalizations:this.refs.descriptionLocalizations.getValue(),productData:t.productData,categoryData:t.categoryData,tagData:this.refs.tags.getTags()};$.ajax({type:"POST",url:"/admintia/api/collection/"+this.props.id,data:n,dataType:"json",context:this}).done((function(t,n,r){e.props.onSubmit&&e.props.onSubmit(t.data.form),alerts.success("updated")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"onCourseTypeChange",value:function(e){var t=no()(this.state.form);t.courseType=e,this.setState({form:t})}},{key:"render",value:function(){if(this.state.loadStatus!=c.LoadStatus.Loaded)return u().createElement(hn,null);var e=10,t="Full Description",n="Full (overview) description...";switch(this.state.form.courseType){case"Article":e=30,t="Article Body",n="Article body...";break;case"Link":e=1,t="Target Url",n="Target url the course card will link to (absolute url, not relative)..."}return u().createElement("div",{className:"admin-collection-form clearfix"},u().createElement("div",{className:"row",style:{marginBottom:"20px",borderBottom:"1px solid #EEE"}},u().createElement("div",{className:"col-md-12"},u().createElement(ev,{ref:"courseType",name:"courseType",label:"Course Type",options:this.state.form.courseTypeOptions,value:this.state.form.courseType,onChange:this.onCourseTypeChange}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(AS,{ref:"titleLocalizations",label:"Title",placeholder:"Name your collection...",value:this.state.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(AS,{ref:"coverDescriptionLocalizations",label:"Cover Description",placeholder:"Cover (simple) description...",value:this.state.form.coverDescriptionLocalizations,rows:5,required:!1,requiredErrorMessage:"English cover description required at minimum."}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(AS,{ref:"descriptionLocalizations",label:t,placeholder:n,value:this.state.form.descriptionLocalizations,rows:e,required:!1,requiredErrorMessage:"English description required at minimum."}))),u().createElement(PO,{ref:"pac",form:this.state.form}),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(JS,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.state.form.tagData}))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Changes"))))}}]),n}(u().Component),PO=function(e){gO(n,e);var t=SO(n);function n(e){var r;return mO(this,n),(r=t.call(this,e)).getSelectedOptions=r.getSelectedOptions.bind(EO(r)),r.handleProductChange=r.handleProductChange.bind(EO(r)),r.handleCategoryChange=r.handleCategoryChange.bind(EO(r)),r.state={productData:r.props.form?r.props.form.productData:null,categoryOptions:r.props.form?r.props.form.categoryOptions:null,categoryData:r.props.form?r.props.form.categoryData:null},r}return bO(n,[{key:"getSelectedOptions",value:function(){return{productData:this.refs.product.getSelectedOptions(),categoryData:this.refs.category.getSelectedOptions()}}},{key:"handleProductChange",value:function(e){$.ajax({type:"GET",url:"/admintia/api/common/get-categories",traditional:!0,data:{products:null==e?void 0:e.map((function(e){return e.value}))},context:this}).done((function(t,n,r){this.setState({productData:e,categoryOptions:t})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleCategoryChange",value:function(e){this.setState({categoryData:e})}},{key:"render",value:function(){return u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!1,options:this.props.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.productData,onChange:this.handleProductChange})),u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!1,options:this.state.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.categoryData,onChange:this.handleCategoryChange})))}}]),n}(u().Component);_O.propTypes={id:d().number.isRequired,form:d().object,onCancel:d().func,onSubmit:d().func};const kO=_O;function jO(e){return jO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jO(e)}function CO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==jO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==jO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===jO(i)?i:String(i)),r)}var o,i}function TO(e,t){return TO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TO(e,t)}function xO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RO(e){return RO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RO(e)}const DO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=RO(r);if(o){var n=RO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xO(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(xO(t)),t.handleEditClick=t.handleEditClick.bind(xO(t)),t.handleEditCancel=t.handleEditCancel.bind(xO(t)),t.handleEditComplete=t.handleEditComplete.bind(xO(t)),t.state={showPanel:!1,showEdit:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/collection/e").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(e){window.location.reload(!0)}},{key:"render",value:function(){return u().createElement("div",{className:"topic-editor clearfix"},u().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Collection"),this.state.showEdit&&u().createElement(kO,{id:this.props.id,onSubmit:this.handleEditComplete,onCancel:this.handleEditCancel}))}}])&&CO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function NO(e){return NO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},NO(e)}function MO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==NO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==NO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===NO(i)?i:String(i)),r)}var o,i}function IO(e,t){return IO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IO(e,t)}function AO(e){return AO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},AO(e)}var LO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=AO(r);if(o){var n=AO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===NO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.duration)return null;var e=sn.niceDuration(this.props.duration);return u().createElement("div",{className:"duration clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Length),u().createElement("div",{className:"length",dangerouslySetInnerHTML:sn.createMarkup(e)}))}}])&&MO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);LO.propTypes={duration:d().number};const BO=LO;function FO(e){return FO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FO(e)}function UO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==FO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==FO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===FO(i)?i:String(i)),r)}var o,i}function qO(e,t){return qO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qO(e,t)}function KO(e){return KO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KO(e)}const VO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=KO(r);if(o){var n=KO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===FO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=null,o=null;t.video.attributes.duration&&(r=sn.niceDuration(t.video.attributes.duration),!t.viewer||!0!==t.viewer.hasWatchedAll||null!=t.viewer.timestamp&&0!=t.viewer.timestamp?t.viewer&&null!=t.viewer.timestamp&&0!=t.viewer.timestamp&&(o=100*(t.viewer.timestamp/t.video.attributes.duration).toFixed(2)):o=100);var i="".concat(e.props.playerUrl,"?start=").concat(n);return u().createElement("li",{key:n},u().createElement("a",{href:i},u().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),u().createElement("div",{className:"info-container"},u().createElement("div",{className:"info"},u().createElement("span",{className:"title",dangerouslySetInnerHTML:sn.createMarkup(t.title)}),t.viewer&&1==t.viewer.hasWatchedAll&&u().createElement("span",{className:"watched fa fa-check-circle-o"}),null!=r&&u().createElement("span",{className:"duration"},r)),null!=o&&u().createElement(of,{percentComplete:o}))))}));return u().createElement("div",{className:"curriculum"},u().createElement("ol",null,t))}}])&&UO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function zO(e){return zO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zO(e)}function WO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==zO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==zO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===zO(i)?i:String(i)),r)}var o,i}function HO(e,t){return HO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HO(e,t)}function $O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GO(e){return GO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GO(e)}var JO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=GO(r);if(o){var n=GO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===zO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $O(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onDownload=t.onDownload.bind($O(t)),t}return t=a,n=[{key:"onDownload",value:function(e){var t=this.props.files[e],n="/collection/".concat(this.props.id,"/content/").concat(t.id,"/download");window.location.replace(n)}},{key:"render",value:function(){var e=this;if(null==this.props.files||0==this.props.files.length)return null;var t=this.props.files.map((function(t,n){return u().createElement("li",{onClick:e.onDownload.bind(null,n),key:n},u().createElement("div",{className:"title"},t.title),t.attributes&&t.attributes.size&&u().createElement("div",{className:"filesize icon icon-after icon-download"},sn.niceFileSize(t.attributes.size)))}));return u().createElement("ul",{className:"playlist-files"},t)}}],n&&WO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);JO.propTypes={id:d().number.isRequired,files:d().array};const QO=JO;function YO(e){return YO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YO(e)}function XO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==YO(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==YO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===YO(i)?i:String(i)),r)}var o,i}function ZO(e,t){return ZO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZO(e,t)}function e_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t_(e){return t_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},t_(e)}var n_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=t_(r);if(o){var n=t_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===YO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return e_(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEditContentClick=t.handleEditContentClick.bind(e_(t)),t.startingIndex=0,t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"handleEditContentClick",value:function(){this.setState({mode:this.Modes.Edit})}},{key:"render",value:function(){var e=this,t="Watch Playlist";return this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?t="Watch Again":(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(t="Continue Watching")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.title)}),this.props.collection.viewer.e&&u().createElement(DO,{id:this.props.collection.id}))),u().createElement("div",{className:"playlist-header"},u().createElement("div",{className:"teaser"},null!=this.props.collection.teaser?u().createElement(kd,{display:"hero",content:this.props.collection.teaser}):u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("div",{className:"info playlist-data"},u().createElement(BO,{duration:this.props.collection.attributes.duration}),!1,u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},t))),u().createElement(vw,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(Ow,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.description)}),u().createElement(VO,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),u().createElement(uS,{list:this.props.collection.tags,path:this.props.filterPath}),u().createElement(Wg,{list:this.props.collection.products,path:this.props.filterPath})),u().createElement(Ow,{label:TFWeb.Resources.UI.Files,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},u().createElement(QO,{id:this.props.collection.id,files:this.props.collection.files}))))}}])&&XO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);n_.propTypes={collection:d().object,filterPath:d().string},n_.defaultProps={filterPath:"/watch"};const r_=n_;function o_(e){return o_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o_(e)}function i_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==o_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==o_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===o_(i)?i:String(i)),r)}var o,i}function a_(e,t){return a_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a_(e,t)}function s_(e){return s_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s_(e)}var c_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=s_(r);if(o){var n=s_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===o_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list)return null;var e=this.props.list.map((function(e,t){return u().createElement("li",{key:t},u().createElement("a",{href:e.url},e.title))}));return u().createElement("div",{className:"gallery-membership"},"Course in ",u().createElement("ul",null,e))}}])&&i_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);c_.propTypes={list:d().array};const l_=c_;function u_(e){return u_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u_(e)}function f_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==u_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==u_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===u_(i)?i:String(i)),r)}var o,i}function p_(e,t){return p_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p_(e,t)}function h_(e){return h_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h_(e)}const d_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h_(r);if(o){var n=h_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===u_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null,t=null,n=null;return this.props.bannerImage&&(e={backgroundImage:"url(".concat(this.props.bannerImage.fileName,")")},t="bannerBkgImg",n={paddingTop:"70px"}),u().createElement("section",{id:"heroBanner",className:t,style:e},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper",style:n},u().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:sn.createMarkup(this.props.title)}),this.props.children)))}}])&&f_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);function y_(e){return y_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y_(e)}function m_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==y_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==y_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===y_(i)?i:String(i)),r)}var o,i}function v_(e,t){return v_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v_(e,t)}function b_(e){return b_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b_(e)}var g_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b_(r);if(o){var n=b_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===y_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"instructors clearfix"},u().createElement("h4",null,this.props.list.length>1?TFWeb.Resources.UI.Instructors:TFWeb.Resources.UI.Instructor),u().createElement("div",{className:"instructor"},e))}}])&&m_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);g_.propTypes={list:d().array},g_.defaultProps={list:[]};const w_=g_;function S_(e){return S_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S_(e)}function E_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==S_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==S_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===S_(i)?i:String(i)),r)}var o,i}function O_(e,t){return O_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O_(e,t)}function __(e){return __=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},__(e)}var P_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=__(r);if(o){var n=__(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===S_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"captions clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Captions),u().createElement("div",{className:"closed-captions"},e))}}])&&E_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);P_.propTypes={list:d().array},P_.defaultProps={list:[]};const k_=P_;function j_(e){return j_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j_(e)}function C_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==j_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==j_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===j_(i)?i:String(i)),r)}var o,i}function T_(e,t){return T_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},T_(e,t)}function x_(e){return x_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x_(e)}var R_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=x_(r);if(o){var n=x_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===j_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"releases clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.VersionRequired),u().createElement("div",{className:"software"},e))}}])&&C_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);R_.propTypes={list:d().array},R_.defaultProps={list:[]};const D_=R_;function N_(e){return N_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N_(e)}function M_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==N_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==N_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===N_(i)?i:String(i)),r)}var o,i}function I_(e,t){return I_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I_(e,t)}function A_(e){return A_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A_(e)}var L_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A_(r);if(o){var n=A_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===N_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.experienceLevel||"None"==this.props.experienceLevel)return null;var e=TFWeb.Resources.UI.getString("Experience.".concat(this.props.experienceLevel));return u().createElement("div",{className:"experience clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Level),u().createElement("div",{className:"experience-level",dangerouslySetInnerHTML:sn.createMarkup(e)}))}}])&&M_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);L_.propTypes={experienceLevel:d().string};const B_=L_;function F_(e){return F_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F_(e)}function U_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==F_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==F_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===F_(i)?i:String(i)),r)}var o,i}function K_(e,t,n){return t&&q_(e.prototype,t),n&&q_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function V_(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z_(e,t)}function z_(e,t){return z_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},z_(e,t)}function W_(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$_(e);if(t){var o=$_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===F_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return H_(e)}(this,n)}}function H_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $_(e){return $_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$_(e)}var G_=function(e){V_(n,e);var t=W_(n);function n(e){var r;return U_(this,n),(r=t.call(this,e)).onMetricsChange=r.onMetricsChange.bind(H_(r)),r.viewDownloads=r.viewDownloads.bind(H_(r)),r.startingIndex=0,r.state={metrics:r.props.collection.metrics},r}return K_(n,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"viewDownloads",value:function(){this.tabs.setTab(1)}},{key:"render",value:function(){var e=this,t=this.props.collection,n=null;if(!0===t.viewer.isSignedIn){var r=null;null!=t.viewer.actions&&null!=t.viewer.actions.rate&&(r=t.viewer.actions.rate.value),(n=[]).push(u().createElement(Hw,{key:0,consumer:"Collection",id:t.id,rating:r}))}var o=null;if(null!=this.props.collection.playlist&&this.props.collection.playlist.length>0){var i=TFWeb.Resources.UI.CoursePlayButton.StartTheCourse;this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?i=TFWeb.Resources.UI.CoursePlayButton.WatchAgain:(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(i=TFWeb.Resources.UI.CoursePlayButton.ContinueWatching)),o=u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},i)}else null!=this.props.collection.files&&this.props.collection.files.length>0&&(o=u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.viewDownloads},"View Course Files"));var a=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(a=this.props.collection.bulletPoints.map((function(e,t){var n=e.type.toLowerCase()+" clearfix";return u().createElement("div",{className:n,key:t},u().createElement("h4",null,e.title),u().createElement("div",{className:"length",dangerouslySetInnerHTML:sn.createMarkup(e.text)}))})));var s;return s=null!=this.props.collection.teaser?u().createElement(kd,{display:"hero",content:this.props.collection.teaser},!1):u().createElement(J_,{src:this.props.collection.thumbUrl,playerUrl:this.props.collection.playerUrl,showButton:"Standard"==this.props.collection.courseType&&null!=this.props.collection.playlist&&this.props.collection.playlist.length>0}),u().createElement("div",{className:"course"},u().createElement(d_,{title:this.props.collection.title,bannerImage:this.props.collection.bannerImage},u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(al,null),u().createElement(l_,{list:this.props.collection.galleryMembership}),u().createElement(Ar,{metrics:this.state.metrics,displayClass:"light"}))),u().createElement("div",{className:"playlist-header"},this.props.collection.galleryReturnNav&&u().createElement("div",{className:"gallery-link"},u().createElement("a",{href:this.props.collection.galleryReturnNav.url,className:"icon icon-before icon-backarrow"},this.props.collection.galleryReturnNav.text)),u().createElement("div",{className:"teaser"},u().createElement("div",null,s)),u().createElement("div",{className:"info playlist-data"},u().createElement(w_,{list:this.props.collection.instructors}),u().createElement(B_,{experienceLevel:this.props.collection.experienceLevel}),u().createElement(BO,{duration:this.props.collection.attributes.duration}),u().createElement(D_,{list:this.props.collection.productReleases}),u().createElement(k_,{list:this.props.collection.captions}),!1,a,o)),u().createElement(vw,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(Ow,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&u().createElement("div",{className:"course-body",dangerouslySetInnerHTML:sn.createMarkup(this.props.collection.description)}),u().createElement(VO,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),!1,!1),u().createElement(Ow,{label:TFWeb.Resources.UI.CourseFiles,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},u().createElement(QO,{id:this.props.collection.id,files:this.props.collection.files}))))}}]),n}(u().Component);G_.propTypes={collection:d().object,filterPath:d().string},G_.defaultProps={filterPath:"/watch"};var J_=function(e){V_(n,e);var t=W_(n);function n(){return U_(this,n),t.apply(this,arguments)}return K_(n,[{key:"render",value:function(){return u().createElement("div",{className:"teaser-image"},u().createElement("img",{src:this.props.src}),this.props.showButton&&u().createElement("a",{className:"play-button",href:this.props.playerUrl}))}}]),n}(u().Component);J_.propTypes={src:d().string,playerUrl:d().string,showButton:d().bool},J_.defaultProps={showButton:!1};const Q_=G_;var Y_=o(9248);function X_(e){return X_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X_(e)}function Z_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==X_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==X_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===X_(i)?i:String(i)),r)}var o,i}function tP(e,t,n){return t&&eP(e.prototype,t),n&&eP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rP(e,t)}function rP(e,t){return rP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rP(e,t)}function oP(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=aP(e);if(t){var o=aP(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===X_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return iP(e)}(this,n)}}function iP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aP(e){return aP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aP(e)}var sP=function(e){nP(n,e);var t=oP(n);function n(e){var r;return Z_(this,n),(r=t.call(this,e)).handleResize=r.handleResize.bind(iP(r)),r.handleUnload=r.handleUnload.bind(iP(r)),r.setMediaDimensions=r.setMediaDimensions.bind(iP(r)),r.onPlaylistClick=r.onPlaylistClick.bind(iP(r)),r.setIndex=r.setIndex.bind(iP(r)),r.setTimestamp=r.setTimestamp.bind(iP(r)),r.captureTimestamp=r.captureTimestamp.bind(iP(r)),r.getCurrentTime=r.getCurrentTime.bind(iP(r)),r.onReady=r.onReady.bind(iP(r)),r.onStart=r.onStart.bind(iP(r)),r.onPlay=r.onPlay.bind(iP(r)),r.onProgress=r.onProgress.bind(iP(r)),r.onPause=r.onPause.bind(iP(r)),r.onSeek=r.onSeek.bind(iP(r)),r.onEnded=r.onEnded.bind(iP(r)),r.handleReplayVideo=r.handleReplayVideo.bind(iP(r)),r.handleNextVideo=r.handleNextVideo.bind(iP(r)),r.onCancel=r.onCancel.bind(iP(r)),r.playingNextTitle=r.playingNextTitle.bind(iP(r)),r.onTogglePlaylist=r.onTogglePlaylist.bind(iP(r)),r.playerState={Video:"Video",Next:"Next",Completed:"Completed"},r.videoPlayer=null,r.mediaWidth=null,r.mediaHeight=null,r.firstPlay=!0,r.elapsedTimeInterval=10,r.state={playerState:r.playerState.Video,index:r.props.collection.viewer&&r.props.collection.viewer.startIndex?r.props.collection.viewer.startIndex:0,showPlaylist:!0},r}return tP(n,[{key:"componentDidMount",value:function(){this.setMediaDimensions()}},{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&(window.addEventListener("resize",this.handleResize),window.addEventListener("unload",this.handleUnload))}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.handleResize),window.removeEventListener("unload",this.handleUnload))}},{key:"componentDidUpdate",value:function(){this.setMediaDimensions()}},{key:"handleResize",value:function(e){this.setMediaDimensions()}},{key:"handleUnload",value:function(e){this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"setMediaDimensions",value:function(){this.mediaWidth=this.media.offsetWidth;var e=.5625*this.media.offsetWidth;this.mediaHeight=e}},{key:"onPlaylistClick",value:function(e){this.captureTimestamp(),this.setIndex(e)}},{key:"setIndex",value:function(e){if(e!=this.state.index){var t=this.playerState.Video;null==e&&(t=this.playerState.Completed),this.setState({playerState:t,index:e})}}},{key:"setTimestamp",value:function(e){if(this.props.collection.viewer.isSignedIn&&null!=e&&0!=e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n].index;this.props.collection.playlist[r].viewer.timestamp=e[n].seconds,!0===e[n].hasEnded&&(this.props.collection.playlist[r].viewer.hasWatchedAll=!0),t.push({p:this.props.collection.playlist[r].id,pc:this.props.collection.playlist[r].viewer.hasWatchedAll,t:e[n].seconds})}var o=this.props.collection.viewer.hasWatchedAll;if(!o)for(o=!0,n=0;n<=this.props.collection.playlist.length-1;n++)if(!1===this.props.collection.playlist[n].viewer.hasWatchedAll){o=!1;break}var i={id:this.props.collection.id,plc:o,pt:t};$.ajax({type:"POST",url:"/api/playlist/timestamp",contentType:"application/json; charset=utf-8",data:JSON.stringify(i),dataType:"json",context:this})}}},{key:"captureTimestamp",value:function(){this.player&&this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"getCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.getCurrentTime();return null==e&&(e=0),e}},{key:"onReady",value:function(){this.player&&1==this.firstPlay&&null!=this.props.collection.viewer&&null!=this.props.collection.viewer.timestamp&&this.player.seekTo(Math.floor(this.props.collection.viewer.timestamp),"seconds"),this.firstPlay=!1}},{key:"onStart",value:function(){}},{key:"onPlay",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onProgress",value:function(e){e&&e.playedSeconds&&!isNaN(e.playedSeconds)&&!isNaN(this.currentTime)&&Math.abs(Math.trunc(e.playedSeconds)-this.currentTime)>=this.elapsedTimeInterval&&(this.currentTime=Math.trunc(e.playedSeconds),this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}]))}},{key:"onPause",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onSeek",value:function(e){this.currentTime=e,this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onEnded",value:function(){var e=[{index:this.state.index,seconds:0,hasEnded:!0}],t=this.state.index+1,n=t>this.props.collection.playlist.length-1;n||e.push({index:t,seconds:0,hasEnded:!1}),this.setTimestamp(e),n?this.setIndex(null):this.setState({playerState:this.playerState.Next})}},{key:"handleReplayVideo",value:function(){this.setState({playerState:this.playerState.Video})}},{key:"handleNextVideo",value:function(){this.setIndex(this.state.index+1)}},{key:"onCancel",value:function(){}},{key:"playingNextTitle",value:function(){return this.state.index+1>this.props.collection.playlist.length-1?"":this.props.collection.playlist[this.state.index+1].title}},{key:"onTogglePlaylist",value:function(){this.setState({showPlaylist:!this.state.showPlaylist},(function(){this.setMediaDimensions()}))}},{key:"render",value:function(){var e=this,t=null,n=null;switch(this.state.playerState){case this.playerState.Video:var r=this.props.collection.playlist[this.state.index],o=r.video,i=null,a={};switch(o.format){case"Vimeo":i="https://vimeo.com/"+o.data;break;case"Wistia":i="https://home.wistia.com/medias/"+o.data;break;case"YouTube":i="https://www.youtube.com/watch?v="+o.data,a={youtube:{playerVars:{rel:0}}}}t=u().createElement(Y_.ZP,{ref:function(t){e.player=t},url:i,config:a,controls:!0,playing:!0,onReady:this.onReady,onStart:this.onStart,onPlay:this.onPlay,onProgress:this.onProgress,onPause:this.onPause,onSeek:this.onSeek,onEnded:this.onEnded,loop:!1,width:"100%",height:"100%",className:"react-player"}),n=u().createElement("div",{className:"media-description"},u().createElement("h4",null,r.title));break;case this.playerState.Next:t=u().createElement(uP,{secondsRemaining:5,title:this.playingNextTitle(),message:"The video will automatically start in {time} seconds",onNext:this.handleNextVideo,onCancel:this.onCancel,onReplay:this.handleReplayVideo,width:this.mediaWidth,height:this.mediaHeight});break;case this.playerState.Completed:t=u().createElement(cP,{title:this.props.collection.title,url:this.props.collection.url,width:this.mediaWidth,height:this.mediaHeight})}return null==t?null:u().createElement("div",{className:"playlist-viewer",ref:function(t){e.viewer=t}},u().createElement("div",{className:"media-container"},u().createElement("div",{className:"controls",ref:function(t){e.controls=t}},u().createElement("h3",null,u().createElement("a",{href:this.props.collection.url,className:"icon icon-before icon-backarrow icon-color-white"},this.props.collection.title)),!1),u().createElement("div",{className:"media",ref:function(t){e.media=t}},u().createElement("div",{ref:function(t){e.mediaContainer=t},className:"player-wrapper"},t)),n),u().createElement("div",{className:"playlist-container"},u().createElement(lP,{playlist:this.props.collection.playlist,currentIndex:this.state.index,onPlaylistClick:this.onPlaylistClick})))}}]),n}(u().Component),cP=function(e){nP(n,e);var t=oP(n);function n(){return Z_(this,n),t.apply(this,arguments)}return tP(n,[{key:"render",value:function(){var e={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"};return u().createElement("div",{className:"playlist-dialog playlist-completed",style:e},u().createElement("div",null,"Congratulations. You have completed ",u().createElement("span",null,this.props.title)),u().createElement("a",{href:this.props.url,className:"button"},"Return to overview"))}}]),n}(u().Component),lP=function(e){nP(n,e);var t=oP(n);function n(e){var r;return Z_(this,n),(r=t.call(this,e)).scrollToItem=r.scrollToItem.bind(iP(r)),r.state={showPlaylist:!0},r}return tP(n,[{key:"componentDidMount",value:function(){this.scrollToItem()}},{key:"componentDidUpdate",value:function(e,t){this.scrollToItem()}},{key:"scrollToItem",value:function(){if(!($(document).width()<=1024)){var e=document.getElementsByClassName("now-playing");null!=e&&e.length>0&&(sn.isOnScreen(e[0])||e[0].scrollIntoView({behavior:"smooth",block:"center"}))}}},{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=n==e.props.currentIndex?"now-playing":"",o=null;return t.video.attributes.duration&&(o=sn.niceDuration(t.video.attributes.duration)),u().createElement("li",{key:n,className:r,onClick:e.props.onPlaylistClick.bind(null,n)},u().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),u().createElement("div",{className:"info"},u().createElement("h4",{dangerouslySetInnerHTML:sn.createMarkup(t.title)}),null!=o&&u().createElement("span",{className:"duration"},o)))})),n="playlist-items".concat(this.state.showPlaylist?"":" collapsed");return u().createElement("div",{className:n},u().createElement("ol",null,t))}}]),n}(u().Component),uP=function(e){nP(n,e);var t=oP(n);function n(e){var r;return Z_(this,n),(r=t.call(this,e)).tick=r.tick.bind(iP(r)),r.onReplay=r.onReplay.bind(iP(r)),r.onCancel=r.onCancel.bind(iP(r)),r.onNext=r.onNext.bind(iP(r)),r.format=r.format.bind(iP(r)),r.state={secondsRemaining:null},r}return tP(n,[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onNext&&this.props.onNext())}},{key:"onReplay",value:function(){this.props.onReplay&&this.props.onReplay()}},{key:"onCancel",value:function(){var e=this;clearInterval(this.interval),this.setState({secondsRemaining:null},(function(){e.props.onCancel&&e.props.onCancel()}))}},{key:"onNext",value:function(){this.props.onNext&&this.props.onNext()}},{key:"format",value:function(e,t){if(""==e||null==t)return e;var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=null;null!=this.state.secondsRemaining&&(e="".concat(this.state.secondsRemaining%60));var t={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"},n=this.props.title?"Playing Next: ".concat(this.props.title):null;return u().createElement("div",{className:"playlist-dialog playing-next",style:t},u().createElement("div",null,null!=n&&n,null!=e&&u().createElement("span",null,this.format(this.props.message,{time:e})," ",u().createElement("button",{className:"btn-small",disabled:null==e,onClick:this.onCancel},"Cancel")," ")),u().createElement("div",null,u().createElement("button",{className:"btn-primary icon icon-before icon-refresh",onClick:this.onReplay},"Replay"),u().createElement("button",{className:"btn-primary icon icon-after icon-arrow",onClick:this.onNext},"Next")))}}]),n}(u().Component);const fP=sP;function pP(e){return pP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pP(e)}function hP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==pP(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==pP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===pP(i)?i:String(i)),r)}var o,i}function dP(e,t){return dP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dP(e,t)}function yP(e){return yP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yP(e)}var mP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yP(r);if(o){var n=yP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===pP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"button-group"},this.props.currentStage>1&&u().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage-1),className:"btn-default icon icon-before icon-backarrow"},"Back"),u().createElement("button",{id:"btnCancel",type:"button",onClick:this.props.onCancel,className:"btn-default"},"Cancel"),this.props.currentStage<this.props.totalStages&&u().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage+1),className:"btn-default icon icon-after icon-arrow"},"Continue"))}}])&&hP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);mP.propTypes={currentStage:d().number.isRequired,totalStages:d().number.isRequired,onChange:d().func,onCancel:d().func};const vP=mP;function bP(e){return bP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bP(e)}function gP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==bP(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==bP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===bP(i)?i:String(i)),r)}var o,i}function wP(e,t){return wP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wP(e,t)}function SP(e){return SP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SP(e)}var EP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=SP(r);if(o){var n=SP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===bP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.stages.map((function(t,n){var r="";return n+1===e.props.currentStage&&(r="active"),u().createElement("li",{key:n,className:r},t)}));return u().createElement("ol",{className:"steps"},t)}}])&&gP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);EP.propTypes={stages:d().array.isRequired,currentStage:d().number.isRequired};const OP=EP;function _P(e){return _P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_P(e)}function PP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==_P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===_P(i)?i:String(i)),r)}var o,i}function kP(e,t){return kP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kP(e,t)}function jP(e){return jP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jP(e)}var CP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=jP(r);if(o){var n=jP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.stages.length;return u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement(OP,{stages:this.props.stages,currentStage:this.props.currentStage})),u().createElement("div",{className:"col-md-6 text-right button-row"},u().createElement(vP,{currentStage:this.props.currentStage,totalStages:e,onChange:this.props.onChange,onCancel:this.props.onCancel})))}}])&&PP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);CP.propTypes={stages:d().array.isRequired,currentStage:d().number.isRequired,onChange:d().func,onCancel:d().func};const TP=CP;function xP(e){return xP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xP(e)}function RP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==xP(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==xP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===xP(i)?i:String(i)),r)}var o,i}function DP(e,t){return DP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DP(e,t)}function NP(e){return NP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NP(e)}var MP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=NP(r);if(o){var n=NP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===xP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return u().createElement("div",{className:"tfnode placeholder-node"},u().createElement("hr",null),u().createElement("div",null,!0===this.props.showContent?u().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddContent},u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),this.props.title," Content"):null,!0===this.props.showText?u().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddText},u().createElement("strong",null,"A"),u().createElement("br",null),this.props.title," Text"):null))}}])&&RP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);MP.propTypes={showContent:d().bool,showText:d().bool,onAddContent:d().func,onAddText:d().func},MP.defaultProps={showContent:!0,showText:!0};const IP=MP;var AP=o(7704);function LP(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function BP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LP(n,!0).forEach((function(t){FP(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function FP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const UP=function(e,t){if(null==e)return t;for(var n=(p=2,function(e){if(Array.isArray(e))return e}(f=t)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(f,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),r=n[0],o=n[1],i=BP({},r),a=function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(o),s=0,c=Object.keys(e);s<c.length;s++){var l=c[s];if(r.hasOwnProperty(l)){var u=r[l];i[l]=BP({},u,{},e[l])}else i[l]=e[l],a.push(l)}var f,p;return[i,a]};var qP={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};const KP=function(e){if(null==e)return e;for(var t={},n=!1,r=0,o=Object.keys(e);r<o.length;r++){var i=o[r],a=i;qP.hasOwnProperty(i)&&(a=qP[i],n=!0),t[a]=e[i]}return n?t:e};var VP=/^(moz|ms|o|webkit)-/,zP=/^\d+$/,WP=/([A-Z])/g,HP={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const $P=function(e){return Object.keys(e).map((function(t){var n=function(e,t){var n;return"string"==typeof t?n=zP.test(t):(n=!0,t=String(t)),n&&"0"!==t&&!0!==HP[e]?t+"px":t}(t,e[t]),r=function(e){return e.replace(WP,"-$1").toLowerCase().replace(VP,"-$1-")}(t);return"".concat(r,": ").concat(n)})).join("; ")};var GP,JP,QP,YP={UNSTYLED:"unstyled",HEADER_ONE:"header-one",HEADER_TWO:"header-two",HEADER_THREE:"header-three",HEADER_FOUR:"header-four",HEADER_FIVE:"header-five",HEADER_SIX:"header-six",UNORDERED_LIST_ITEM:"unordered-list-item",ORDERED_LIST_ITEM:"ordered-list-item",BLOCKQUOTE:"blockquote",PULLQUOTE:"pullquote",CODE:"code-block",ATOMIC:"atomic"},XP="LINK",ZP="IMAGE",ek="BOLD",tk="CODE",nk="ITALIC",rk="STRIKETHROUGH",ok="UNDERLINE",ik=o(46),ak=new ik.OrderedSet;function sk(e,t){for(var n=ak,r=ak,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getStyle():ak,a>0&&!(0,ik.is)(n,r)&&(o.push([e.slice(i,a),r]),i=a)}return o.push([e.slice(i),n]),o}function ck(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function lk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ck(n,!0).forEach((function(t){pk(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ck(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uk(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function fk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hk=ek,dk=tk,yk=nk,mk=rk,vk=ok,bk="<br>",gk=/^data-([a-z0-9-]+)$/,wk=(pk(GP={},hk,{element:"strong"}),pk(GP,dk,{element:"code"}),pk(GP,yk,{element:"em"}),pk(GP,mk,{element:"del"}),pk(GP,vk,{element:"u"}),GP),Sk=[hk,yk,vk,mk,dk],Ek=(pk(JP={},XP,{url:"href",href:"href",rel:"rel",target:"target",title:"title",className:"class"}),pk(JP,ZP,{src:"src",height:"height",width:"width",alt:"alt",className:"class"}),JP),Ok=(pk(QP={},XP,(function(e,t){for(var n=Ek.hasOwnProperty(e)?Ek[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:gk.test(s)&&(o[s]=c)}return o})),pk(QP,ZP,(function(e,t){for(var n=Ek.hasOwnProperty(e)?Ek[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:gk.test(s)&&(o[s]=c)}return o})),QP);function _k(e,t){switch(e){case YP.HEADER_ONE:return["h1"];case YP.HEADER_TWO:return["h2"];case YP.HEADER_THREE:return["h3"];case YP.HEADER_FOUR:return["h4"];case YP.HEADER_FIVE:return["h5"];case YP.HEADER_SIX:return["h6"];case YP.UNORDERED_LIST_ITEM:case YP.ORDERED_LIST_ITEM:return["li"];case YP.BLOCKQUOTE:return["blockquote"];case YP.CODE:return["pre","code"];case YP.ATOMIC:return["figure"];default:return null===t?[]:[t||"p"]}}var Pk=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pk(this,"blocks",void 0),pk(this,"contentState",void 0),pk(this,"currentBlock",void 0),pk(this,"indentLevel",void 0),pk(this,"output",void 0),pk(this,"totalBlocks",void 0),pk(this,"wrapperTag",void 0),pk(this,"options",void 0),pk(this,"inlineStyles",void 0),pk(this,"inlineStyleFn",void 0),pk(this,"styleOrder",void 0),null==n&&(n={}),this.contentState=t,this.options=n;var r=uk(UP(n.inlineStyles,[wk,Sk]),2),o=r[0],i=r[1];this.inlineStyles=o,this.inlineStyleFn=n.inlineStyleFn,this.styleOrder=i}var t,n;return t=e,(n=[{key:"generate",value:function(){for(this.output=[],this.blocks=this.contentState.getBlocksAsArray(),this.totalBlocks=this.blocks.length,this.currentBlock=0,this.indentLevel=0,this.wrapperTag=null;this.currentBlock<this.totalBlocks;)this.processBlock();return this.closeWrapperTag(),this.output.join("").trim()}},{key:"processBlock",value:function(){var e=this.options,t=e.blockRenderers,n=e.defaultBlockTag,r=this.blocks[this.currentBlock],o=r.getType(),i=function(e){switch(e){case YP.UNORDERED_LIST_ITEM:return"ul";case YP.ORDERED_LIST_ITEM:return"ol";default:return null}}(o);this.wrapperTag!==i&&(this.wrapperTag&&this.closeWrapperTag(),i&&this.openWrapperTag(i)),this.indent();var a=null!=t&&t.hasOwnProperty(o)?t[o]:null,s=a?a(r):null;if(null!=s)return this.output.push(s),this.output.push("\n"),void(this.currentBlock+=1);this.writeStartTag(r,n),this.output.push(this.renderBlockContent(r));var c=this.getNextBlock();if(function(e){switch(e){case YP.UNORDERED_LIST_ITEM:case YP.ORDERED_LIST_ITEM:return!0;default:return!1}}(o)&&c&&c.getDepth()===r.getDepth()+1){this.output.push("\n");var l=this.wrapperTag;this.wrapperTag=null,this.indentLevel+=1,this.currentBlock+=1,this.processBlocksAtDepth(c.getDepth()),this.wrapperTag=l,this.indentLevel-=1,this.indent()}else this.currentBlock+=1;this.writeEndTag(r,n)}},{key:"processBlocksAtDepth",value:function(e){for(var t=this.blocks[this.currentBlock];t&&t.getDepth()===e;)this.processBlock(),t=this.blocks[this.currentBlock];this.closeWrapperTag()}},{key:"getNextBlock",value:function(){return this.blocks[this.currentBlock+1]}},{key:"writeStartTag",value:function(e,t){var n,r=_k(e.getType(),t);if(this.options.blockStyleFn){var o=this.options.blockStyleFn(e)||{},i=o.attributes,a=o.style;if(i=KP(i),null!=a){var s=$P(a);i=null==i?{style:s}:lk({},i,{style:s})}n=kk(i)}else n="";var c=!0,l=!1,u=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var h=f.value;this.output.push("<".concat(h).concat(n,">"))}}catch(e){l=!0,u=e}finally{try{c||null==p.return||p.return()}finally{if(l)throw u}}}},{key:"writeEndTag",value:function(e,t){var n=_k(e.getType(),t);if(1===n.length)this.output.push("</".concat(n[0],">\n"));else{var r=[],o=!0,i=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;r.unshift("</".concat(l,">"))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}this.output.push(r.join("")+"\n")}}},{key:"openWrapperTag",value:function(e){this.wrapperTag=e,this.indent(),this.output.push("<".concat(e,">\n")),this.indentLevel+=1}},{key:"closeWrapperTag",value:function(){var e=this.wrapperTag;e&&(this.indentLevel-=1,this.indent(),this.output.push("</".concat(e,">\n")),this.wrapperTag=null)}},{key:"indent",value:function(){this.output.push("  ".repeat(this.indentLevel))}},{key:"withCustomInlineStyles",value:function(e,t){if(!this.inlineStyleFn)return e;var n=this.inlineStyleFn(t);if(!n)return e;var r=n.element,o=void 0===r?"span":r,i=n.attributes,a=n.style,s=kk(lk({},i,{style:a&&$P(a)}));return"<".concat(o).concat(s,">").concat(e,"</").concat(o,">")}},{key:"renderBlockContent",value:function(e){var t=this,n=e.getType(),r=e.getText();return""===r?bk:function(e,t){for(var n=null,r=null,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getEntity():null,a>0&&n!==r&&(o.push([r,sk(e.slice(i,a),t.slice(i,a))]),i=a)}return o.push([n,sk(e.slice(i),t.slice(i))]),o}(r=this.preserveWhitespace(r),e.getCharacterList()).map((function(e){var r,o=uk(e,2),i=o[0],a=o[1].map((function(e){var r=uk(e,2),o=r[0],i=r[1],a=function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split(" ").join("&nbsp;").split("\n").join(bk+"\n")}(o),s=!0,c=!1,l=void 0;try{for(var u,f=t.styleOrder[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var p=u.value;if((p!==dk||n!==YP.CODE)&&i.has(p)){var h=t.inlineStyles[p],d=h.element,y=h.attributes,m=h.style;if(null==d&&(d="span"),y=KP(y),null!=m){var v=$P(m);y=null==y?{style:v}:lk({},y,{style:v})}var b=kk(y);a="<".concat(d).concat(b,">").concat(a,"</").concat(d,">")}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}return t.withCustomInlineStyles(a,i)})).join(""),s=i?t.contentState.getEntity(i):null,c=null==s?null:s.getType().toUpperCase();if(null!=s&&t.options.entityStyleFn&&(r=t.options.entityStyleFn(s))){var l=r,u=l.element,f=l.attributes,p=l.style;if(null==u&&(u="span"),f=KP(f),null!=p){var h=$P(p);f=null==f?{style:h}:lk({},f,{style:h})}var d=kk(f);return"<".concat(u).concat(d,">").concat(a,"</").concat(u,">")}if(null!=c&&c===XP){var y=kk(Ok.hasOwnProperty(c)?Ok[c](c,s):null);return"<a".concat(y,">").concat(a,"</a>")}if(null!=c&&c===ZP){var m=kk(Ok.hasOwnProperty(c)?Ok[c](c,s):null);return"<img".concat(m,"/>")}return a})).join("")}},{key:"preserveWhitespace",value:function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r++)" "!==e[r]||0!==r&&r!==t-1&&" "!==e[r-1]?n[r]=e[r]:n[r]=" ";return n.join("")}}])&&fk(t.prototype,n),e}();function kk(e){if(null==e)return"";for(var t=[],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],i=e[o];null!=i&&t.push(" ".concat(o,'="').concat((i+"").split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;"),'"'))}return t.join("")}function jk(e,t,n){for(var r=e.text,o=e.characterMeta,i=t.length,a=n.length,s=[],c=o.slice(0,0),l=0,u=r.indexOf(t);-1!==u;)s.push(r.slice(l,u)+n),c=c.concat(o.slice(l,u),Ck(o.slice(u,u+1),a)),l=u+i,u=r.indexOf(t,l);return s.push(r.slice(l)),c=c.concat(o.slice(l)),{text:s.join(""),characterMeta:c}}function Ck(e,t){for(var n=e.slice(0,0);t-- >0;)n=n.concat(e);return n}var Tk="unstyled",xk="header-one",Rk="header-two",Dk="header-three",Nk="header-four",Mk="header-five",Ik="header-six",Ak="unordered-list-item",Lk="ordered-list-item",Bk="blockquote",Fk="code-block",Uk="atomic",qk="LINK",Kk="IMAGE",Vk="BOLD",zk="CODE",Wk="ITALIC",Hk="STRIKETHROUGH",$k="UNDERLINE";new ik.OrderedSet;var Gk={a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,var:1,video:1,wbr:1,acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1},Jk={area:1,base:1,br:1,col:1,colgroup:1,command:1,dl:1,embed:1,head:1,hgroup:1,hr:1,iframe:1,img:1,input:1,keygen:1,link:1,meta:1,ol:1,optgroup:1,option:1,param:1,script:1,select:1,source:1,style:1,table:1,tbody:1,textarea:1,tfoot:1,thead:1,title:1,tr:1,track:1,ul:1,wbr:1,basefont:1,dialog:1,dir:1,isindex:1},Qk={img:1};function Yk(e){return Yk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yk(e)}function Xk(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function Zk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ej(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tj=/^data:/i,nj=(0,ik.OrderedSet)(),rj=new AP.ContentBlock({key:(0,AP.genKey)(),text:"",type:Tk,characterList:(0,ik.List)(),depth:0}),oj=/(\r\n|\r|\n)/g,ij="\r",aj=/^data-([a-z0-9-]+)$/,sj={a:{href:"url",rel:"rel",target:"target",title:"title"},img:{src:"src",alt:"alt",width:"width",height:"height"}},cj=function(e,t){var n={};if(sj.hasOwnProperty(e))for(var r=sj[e],o=0;o<t.attributes.length;o++){var i=t.attributes[o],a=i.name,s=i.value;if("string"==typeof s){var c=s;r.hasOwnProperty(a)?n[r[a]]=c:aj.test(a)&&(n[a]=c)}}return n},lj={a:function(e,t,n){var r,o=cj(t,n);if(null!=(r=o.url)&&!r.match(tj))return e.createEntity(qk,o)},img:function(e,t,n){var r=cj(t,n);if(null!=r.src)return e.createEntity(Kk,r)}},uj=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ej(this,"contentStateForEntities",void 0),ej(this,"blockStack",void 0),ej(this,"blockList",void 0),ej(this,"depth",void 0),ej(this,"options",void 0),ej(this,"inlineCreators",{Style:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return{type:"STYLE",style:e}})),Entity:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return{type:"ENTITY",entityKey:t.createEntity(e,fj(n),r)}}}),this.options=n,this.contentStateForEntities=AP.ContentState.createFromBlockArray([]),this.blockStack=[],this.blockList=[],this.depth=0}var t,n;return t=e,n=[{key:"process",value:function(e){this.processBlockElement(e);var t=[];return this.blockList.forEach((function(e){var n=function(e){var t="",n=(0,ik.Seq)();return e.forEach((function(e){t+=e.text,n=n.concat(e.characterMeta)})),{text:t,characterMeta:n}}(e.textFragments),r=n.text,o=n.characterMeta,i=!1;if(r===ij&&(i=!0,r=""),"pre"===e.tagName){var a=function(e,t){return"\n"===e.charAt(0)&&(e=e.slice(1),t=t.slice(1)),{text:e,characterMeta:t}}(r,o);r=a.text,o=a.characterMeta}else{var s=function(e,t){var n=function(e,t){for(;" "===e.charAt(0);)e=e.slice(1),t=t.slice(1);return{text:e,characterMeta:t}}(e=e.replace(/[ \t\n]/g," "),t),r=function(e,t){for(;" "===e.slice(-1);)e=e.slice(0,-1),t=t.slice(0,-1);return{text:e,characterMeta:t}}(e=n.text,t=n.characterMeta);e=r.text,t=r.characterMeta;for(var o=e.length;o--;)" "===e.charAt(o)&&" "===e.charAt(o-1)&&(e=e.slice(0,o)+e.slice(o+1),t=t.slice(0,o).concat(t.slice(o+1)));var i=jk({text:e,characterMeta:t},"\r ",ij),a=jk({text:e=i.text,characterMeta:t=i.characterMeta}," \r",ij);return{text:e=a.text,characterMeta:t=a.characterMeta}}(r,o);r=s.text,o=s.characterMeta}((r=r.split(ij).join("\n")).length||i)&&t.push(new AP.ContentBlock({key:(0,AP.genKey)(),text:r,type:e.type,characterList:o.toList(),depth:e.depth,data:e.data?(0,ik.Map)(e.data):(0,ik.Map)()}))})),t.length||(t=[rj]),AP.ContentState.createFromBlockArray(t,this.contentStateForEntities.getEntityMap())}},{key:"getBlockTypeFromTagName",value:function(e){var t=this.options.blockTypes;if(t&&t[e])return t[e];switch(e){case"li":return"ol"===this.blockStack.slice(-1)[0].tagName?Lk:Ak;case"blockquote":return Bk;case"h1":return xk;case"h2":return Rk;case"h3":return Dk;case"h4":return Nk;case"h5":return Mk;case"h6":return Ik;case"pre":return Fk;case"figure":return Uk;default:return Tk}}},{key:"processBlockElement",value:function(e){if(e){var t,n,r=this.options.customBlockFn,o=e.nodeName.toLowerCase();if(r){var i=r(e);null!=i&&(t=i.type,n=i.data)}var a=!0;if(null==t&&(a=!1,t=this.getBlockTypeFromTagName(o)),t===Fk){var s=e.getAttribute("data-language");s&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xk(n,!0).forEach((function(t){ej(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{language:s}))}var c=function(e){switch(e){case Ak:case Lk:return!0;default:return!1}}(t),l=!Jk.hasOwnProperty(o);if(!a&&t===Tk){var u=this.blockStack.slice(-1)[0];u&&(t=u.type)}var f={tagName:o,textFragments:[],type:t,styleStack:[nj],entityStack:[null],depth:c?this.depth:0,data:n};l&&(this.blockList.push(f),c&&(this.depth+=1)),this.blockStack.push(f),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),this.blockStack.pop(),l&&c&&(this.depth-=1)}}},{key:"processInlineElement",value:function(e){var t=e.nodeName.toLowerCase();if("br"!==t){var n=this.blockStack.slice(-1)[0],r=n.styleStack.slice(-1)[0],o=n.entityStack.slice(-1)[0],i=this.options.customInlineFn,a=i?i(e,this.inlineCreators):null;if(null!=a)switch(a.type){case"STYLE":r=r.add(a.style);break;case"ENTITY":o=a.entityKey}else r=function(e,t,n){switch(t){case"b":case"strong":return e.add(Vk);case"i":case"em":return e.add(Wk);case"u":case"ins":return e.add($k);case"code":return e.add(zk);case"s":case"del":return e.add(Hk);default:return n&&n[t]?e.add(n[t]):e}}(r,t,this.options.elementStyles),lj.hasOwnProperty(t)&&(o=lj[t](this,t,e)||o);n.styleStack.push(r),n.entityStack.push(o),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),Qk.hasOwnProperty(t)&&this.processText(" "),n.entityStack.pop(),n.styleStack.pop()}else this.processText(ij)}},{key:"processTextNode",value:function(e){var t=e.nodeValue;t=(t=t.replace(oj,"\n")).split("​").join(ij),this.processText(t)}},{key:"processText",value:function(e){var t=this.blockStack.slice(-1)[0],n=t.styleStack.slice(-1)[0],r=t.entityStack.slice(-1)[0],o=AP.CharacterMetadata.create({style:n,entity:r}),i=(0,ik.Repeat)(o,e.length);t.textFragments.push({text:e,characterMeta:i})}},{key:"processNode",value:function(e){if(1===e.nodeType){var t=e,n=t.nodeName.toLowerCase();Gk.hasOwnProperty(n)?this.processInlineElement(t):this.processBlockElement(t)}else 3===e.nodeType&&this.processTextNode(e)}},{key:"createEntity",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return this.contentStateForEntities=this.contentStateForEntities.createEntity(e,n,t),this.contentStateForEntities.getLastCreatedEntityKey()}}],n&&Zk(t.prototype,n),e}();function fj(e){var t={};if(null!==e&&"object"===Yk(e)&&!Array.isArray(e))for(var n=e,r=0,o=Object.keys(n);r<o.length;r++){var i=o[r],a=n[i];"string"==typeof a&&(t[i]=a)}return t}function pj(e){var t;return"undefined"!=typeof DOMParser?t=(new DOMParser).parseFromString(e,"text/html"):(t=document.implementation.createHTMLDocument("")).documentElement&&(t.documentElement.innerHTML=e),t.body||t.createElement("body")}var hj={};function dj(e){return dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dj(e)}function yj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==dj(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===dj(i)?i:String(i)),r)}var o,i}function vj(e,t,n){return t&&mj(e.prototype,t),n&&mj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bj(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gj(e,t)}function gj(e,t){return gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gj(e,t)}function wj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Sj(e);if(t){var o=Sj(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===dj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Sj(e){return Sj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sj(e)}var Ej=function(e){bj(n,e);var t=wj(n);function n(e){var r;return yj(this,n),(r=t.call(this,e)).state={editorState:r._setHTML(),hasFocus:!1},r.focus=function(){return r._handleFocus()},r.blur=function(){return r._handleBlur()},r.onChange=function(e){return r.setState({editorState:e})},r.handleKeyCommand=function(e){return r._handleKeyCommand(e)},r.toggleBlockType=function(e){return r._toggleBlockType(e)},r.toggleInlineStyle=function(e){return r._toggleInlineStyle(e)},r.getHTML=function(){return r._getHTML()},r}return vj(n,[{key:"componentDidMount",value:function(){this._handleFocus()}},{key:"_handleFocus",value:function(){this.setState({hasFocus:!0}),this.refs.editor.focus()}},{key:"_handleBlur",value:function(){this.setState({hasFocus:!1})}},{key:"_handleKeyCommand",value:function(e){var t=this.state.editorState,n=AP.RichUtils.handleKeyCommand(t,e);return!!n&&(this.onChange(n),!0)}},{key:"_toggleBlockType",value:function(e){this.onChange(AP.RichUtils.toggleBlockType(this.state.editorState,e))}},{key:"_toggleInlineStyle",value:function(e){this.onChange(AP.RichUtils.toggleInlineStyle(this.state.editorState,e))}},{key:"_setHTML",value:function(){if(this.props.importValue){var e=(t=this.props.importValue,r=(n=hj).parser,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["parser"]),null==r&&(r=pj),function(e,t){return new uj(t).process(e)}(r(t),o));return AP.EditorState.createWithContent(e)}return AP.EditorState.createEmpty();var t,n,r,o}},{key:"_getHTML",value:function(){return e=this.state.editorState.getCurrentContent(),new Pk(e,undefined).generate();var e}},{key:"render",value:function(){var e=this.state.editorState;return u().createElement("div",{className:"RichEditor-root"},!0===this.state.hasFocus?u().createElement("div",{className:"text-node-controls",onClick:this.focus},u().createElement(Tj,{editorState:e,onToggle:this.toggleInlineStyle}),u().createElement(jj,{editorState:e,onToggle:this.toggleBlockType})):null,u().createElement("div",{className:"RichEditor-editor",onClick:this.focus,onFocus:this.focus,onBlur:this.blur},u().createElement(AP.Editor,{blockStyleFn:_j,customStyleMap:Oj,editorState:e,handleKeyCommand:this.handleKeyCommand,onChange:this.onChange,ref:"editor",spellCheck:!0})))}}]),n}(u().Component),Oj={CODE:{backgroundColor:"rgba(0, 0, 0, 0.05)",fontFamily:'"Inconsolata", "Menlo", "Consolas", monospace',fontSize:16,padding:2}};function _j(e){return"blockquote"===e.getType()?"RichEditor-blockquote":null}var Pj=function(e){bj(n,e);var t=wj(n);function n(){var e;return yj(this,n),(e=t.call(this)).onToggle=function(t){t.preventDefault(),e.props.onToggle(e.props.style)},e}return vj(n,[{key:"render",value:function(){var e="RichEditor-styleButton";return this.props.active&&(e+=" RichEditor-activeButton"),u().createElement("span",{className:e,onMouseDown:this.onToggle},this.props.label)}}]),n}(u().Component),kj=[{label:"Blockquote",style:"blockquote"}],jj=function(e){var t=e.editorState,n=t.getSelection(),r=t.getCurrentContent().getBlockForKey(n.getStartKey()).getType();return u().createElement("span",{className:"RichEditor-controls"},kj.map((function(t){return u().createElement(Pj,{key:t.label,active:t.style===r,label:t.label,onToggle:e.onToggle,style:t.style})})))},Cj=[{label:"Bold",style:"BOLD"},{label:"Italic",style:"ITALIC"}],Tj=function(e){var t=e.editorState.getCurrentInlineStyle();return u().createElement("span",{className:"RichEditor-controls"},Cj.map((function(n){return u().createElement(Pj,{key:n.label,active:t.has(n.style),label:n.label,onToggle:e.onToggle,style:n.style})})))};const xj=Ej;function Rj(e){return Rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rj(e)}function Dj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Rj(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Rj(i)?i:String(i)),r)}var o,i}function Nj(e,t){return Nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nj(e,t)}function Mj(e){return Mj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mj(e)}var Ij=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mj(r);if(o){var n=Mj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Rj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=!0===this.props.showDelete?u().createElement("button",{type:"button",className:"btn",onClick:this.props.onDelete},this.props.deleteButtonLabel," ",u().createElement("i",{className:"glyphicon glyphicon-remove"})):null,t=!0===this.props.showReplace?u().createElement("button",{type:"button",className:"btn",onClick:this.props.onReplace},this.props.replaceButtonLabel," ",u().createElement("i",{className:"glyphicon glyphicon-repeat"})):null;return u().createElement("div",{className:"controls"},e,t,null!=this.props.index&&this.props.index>0?u().createElement("button",{type:"button",className:"btn",title:"Move Up",onClick:this.props.onMoveUp},"Move Up ",u().createElement("i",{className:"glyphicon glyphicon-arrow-up"})):null,null!=this.props.index&&this.props.index<this.props.indexOf-1?u().createElement("button",{type:"button",className:"btn",title:"Move Down",onClick:this.props.onMoveDown},"Move Down ",u().createElement("i",{className:"glyphicon glyphicon-arrow-down"})):null)}}])&&Dj(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Ij.propTypes={index:d().number,indexOf:d().number,showDelete:d().bool,showReplace:d().bool,deleteButtonLabel:d().string,replaceButtonLabel:d().string,onDelete:d().func,onReplace:d().func,onMoveUp:d().func,onMoveDown:d().func},Ij.defaultProps={index:null,showDelete:!1,showReplace:!1,deleteButtonLabel:"Remove",replaceButtonLabel:"Replace"};const Aj=Ij;function Lj(e){return Lj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lj(e)}function Bj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Lj(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Lj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Lj(i)?i:String(i)),r)}var o,i}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fj(e,t)}function Uj(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qj(e){return qj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qj(e)}var Kj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=qj(r);if(o){var n=qj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Lj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uj(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Uj(t)),t.valid=t.valid.bind(Uj(t)),t.getNodes=t.getNodes.bind(Uj(t)),t.getContent=t.getContent.bind(Uj(t)),t.hasContent=t.hasContent.bind(Uj(t)),t.onSave=t.onSave.bind(Uj(t)),t.tryAddStagingNode=t.tryAddStagingNode.bind(Uj(t)),t.getStagingIndex=t.getStagingIndex.bind(Uj(t)),t.onAddText=t.onAddText.bind(Uj(t)),t.onAddContent=t.onAddContent.bind(Uj(t)),t.onAcceptContent=t.onAcceptContent.bind(Uj(t)),t.onDeleteNode=t.onDeleteNode.bind(Uj(t)),t.onMoveUpNode=t.onMoveUpNode.bind(Uj(t)),t.onMoveDownNode=t.onMoveDownNode.bind(Uj(t)),t.updateNodeOrder=t.updateNodeOrder.bind(Uj(t)),t.deleteContentItem=t.deleteContentItem.bind(Uj(t)),t.getContentItem=t.getContentItem.bind(Uj(t)),t._content=t.props.importContent?t.props.importContent:[],t._nodes=t.props.importNodes?t.props.importNodes:[],t.tryAddStagingNode(),t.state={nodes:t._nodes,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this.onSave(),this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onSave",value:function(){var e=this.getStagingIndex();null!=e&&this._nodes.splice(e,1);for(var t=0;t<this._nodes.length;t++)if("Text"==this._nodes[t].type){var n=this.refs[this._nodes[t].id].getHTML();this._nodes[t].data=n}}},{key:"tryAddStagingNode",value:function(){if(!this.hasContent()){var e={id:sn.generateUID(),type:"Staging",usage:null,data:null,children:null};this._nodes.unshift(e)}}},{key:"getStagingIndex",value:function(){for(var e=0;e<this._nodes.length;e++)if("Staging"==this._nodes[e].type)return e;return null}},{key:"onAddText",value:function(e,t){null!=t&&t.preventDefault();var n={id:sn.generateUID(),type:"Text",usage:"Content",data:"",children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault();var n={id:sn.generateUID(),type:"Staging",usage:null,data:null,children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAcceptContent",value:function(e,t){var n=[],r=this;e.forEach((function(e){r._content.push(e);var t={id:sn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)}));var o=this._nodes.length,i=this.getStagingIndex();null!==i&&(o=i+1);var a=this._nodes;this._nodes=a.slice(0,o).concat(n).concat(a.slice(o)),t&&this._nodes.splice(i,1),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);"Content"==n[0].type&&this.deleteContentItem(n[0].data),this.tryAddStagingNode(),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"deleteContentItem",value:function(e){for(var t=0;t<this._content.length;t++)this._content[t].id==e&&this._content.splice(t,1)}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[],n=null,r=null;return this.state.nodes.forEach((function(e,o){switch(n=o,"Staging"==e.type||null!=r&&"Staging"==r.type||t.push(u().createElement(IP,{key:sn.generateUID(),title:"Insert",onAddText:this.onAddText.bind(null,o),onAddContent:this.onAddContent.bind(null,o)})),e.type){case"Staging":t.push(u().createElement("div",{className:"tfnode",key:e.id},this.hasContent()?u().createElement(Aj,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Cancel Content Upload",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}):null,u().createElement(rh,{groupsAllowed:["Portfolio"],onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))));break;case"Text":t.push(u().createElement("div",{className:"tfnode text-node",key:e.id},u().createElement(Aj,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Text",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),u().createElement(xj,{ref:e.id,importValue:e.data})));break;case"Content":var i=this.getContentItem(e.data);t.push(u().createElement("div",{className:"tfnode content-node",key:e.id},u().createElement(Aj,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),u().createElement(kd,{ref:e.id,key:e.id,content:i})))}r=e}),this),null!=n&&"Staging"!=this.state.nodes[n].type&&t.push(u().createElement(IP,{key:sn.generateUID(),title:"Add",onAddText:this.onAddText.bind(null,null),onAddContent:this.onAddContent.bind(null,null)})),u().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:u().createElement(fi,{message:"At least one content item (image/video) is required"}))}}],n&&Bj(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Kj.propTypes={fileSizeLimit:d().number,importContent:d().array,importNodes:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},Kj.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const Vj=Kj;function zj(e){return zj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zj(e)}function Wj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==zj(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==zj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===zj(i)?i:String(i)),r)}var o,i}function Hj(e,t){return Hj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hj(e,t)}function $j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gj(e){return Gj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gj(e)}var Jj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gj(r);if(o){var n=Gj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===zj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $j(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind($j(t)),t.valid=t.valid.bind($j(t)),t.getNodes=t.getNodes.bind($j(t)),t.getContent=t.getContent.bind($j(t)),t.hasContent=t.hasContent.bind($j(t)),t.onStagingCancel=t.onStagingCancel.bind($j(t)),t.onAddContent=t.onAddContent.bind($j(t)),t.onAcceptContent=t.onAcceptContent.bind($j(t)),t.getContentItem=t.getContentItem.bind($j(t)),t._content=t.props.importContent?t.props.importContent:[],t._nodes=t.props.importNodes?t.props.importNodes:[],t.state={nodes:t._nodes,showStaging:!t.hasContent(),isValid:t.valid(),showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onStagingCancel",value:function(){this.setState({showStaging:!1})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault(),this.setState({showStaging:!0})}},{key:"onAcceptContent",value:function(e,t){var n=[];e.forEach((function(e){var t={id:sn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)})),this._content=e,this._nodes=n,this.setState({nodes:this._nodes,isValid:this.valid(),showStaging:!1})}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[];if(this.state.showStaging)t.push(u().createElement("div",{className:"tfnode",key:0},this.hasContent()?u().createElement(Aj,{showReplace:!0,onReplace:this.onStagingCancel,replaceButtonLabel:"Cancel Replace"}):null,u().createElement(rh,{groupsAllowed:["Training"],allowMultipleFiles:!1,onAccept:this.onAcceptContent,autoAcceptContent:!0,closeAfterAutoAcceptContent:!0},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop a video or click in this area to upload"))));else{var n=this.getContentItem(this.state.nodes[0].data);t.push(u().createElement("div",{className:"tfnode content-node",key:1},u().createElement(Aj,{showReplace:!0,onReplace:this.onAddContent.bind(null,null,null),replaceButtonLabel:"Replace Video"}),u().createElement(kd,{content:n})))}return u().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:u().createElement(fi,{message:"At least one content item (image/video) is required"}))}}])&&Wj(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);Jj.propTypes={fileSizeLimit:d().number,importContent:d().array,importNodes:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},Jj.defaultProps={required:!1,requiredErrorMessage:"At least on content item is required."};const Qj=Jj;function Yj(e){return Yj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yj(e)}function Xj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==Yj(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Yj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===Yj(i)?i:String(i)),r)}var o,i}function eC(e,t,n){return t&&Zj(e.prototype,t),n&&Zj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nC(e,t)}function nC(e,t){return nC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nC(e,t)}function rC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=iC(e);if(t){var o=iC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Yj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oC(e)}(this,n)}}function oC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iC(e){return iC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iC(e)}var aC=function(e){tC(n,e);var t=rC(n);function n(e){var r;Xj(this,n),(r=t.call(this,e)).getThumbnailData=r.getThumbnailData.bind(oC(r)),r.getContentIndex=r.getContentIndex.bind(oC(r)),r.updateContent=r.updateContent.bind(oC(r)),r.onSelectThumbnail=r.onSelectThumbnail.bind(oC(r)),r.onAcceptCrop=r.onAcceptCrop.bind(oC(r)),r.onShowCrop=r.onShowCrop.bind(oC(r)),r.onCancelCrop=r.onCancelCrop.bind(oC(r));var o=null;return null!=r.props.content&&(o=null!=r.props.contentThumbnail?r.getContentIndex(r.props.content,r.props.contentThumbnail.id):0),r.state={content:null!=r.props.content?r.props.content:[],selectedContentIndex:o,showImageCropModal:!1,crop:null!=r.props.contentThumbnail?r.props.contentThumbnail.crop:null},r}return eC(n,[{key:"getThumbnailData",value:function(){return null==this.state.selectedContentIndex?null:{id:this.state.content[this.state.selectedContentIndex].id,crop:this.state.crop}}},{key:"getContentIndex",value:function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null}},{key:"updateContent",value:function(e){var t=null,n=null;e.length>0&&null!=this.state.content&&this.state.content.length>0&&(null!=this.state.selectedContentIndex&&(t=this.state.content[this.state.selectedContentIndex].id),null!=t&&(n=this.getContentIndex(e,t))),null==n&&e.length>0&&(n=0),this.setState({content:e,selectedContentIndex:n})}},{key:"onSelectThumbnail",value:function(e,t){this.setState({selectedContentIndex:t,crop:null})}},{key:"onAcceptCrop",value:function(e){this.setState({crop:e,showImageCropModal:!1})}},{key:"onShowCrop",value:function(){this.setState({showImageCropModal:!0})}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){!0!==this.state.showValidation||this.state.isValid,this.props.required;var e=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(e=u().createElement(HelpBlock,{message:this.props.helpMessage})):e=u().createElement(HelpBlock,{message:this.props.requiredErrorMessage});var t=null!=this.state.content&&this.state.content.length>0&&null!=this.state.selectedContentIndex?this.state.content[this.state.selectedContentIndex].id:null;return u().createElement("div",{className:"form-group thumbnail-editor clearfix"},u().createElement("label",{className:"static"},this.props.label),u().createElement("div",null,u().createElement(cC,{size:this.props.size,id:t,crop:this.state.crop}),u().createElement("div",{className:"controls",style:{marginLeft:this.props.size.width+10}},u().createElement("ul",{className:"list-unstyled"},this.state.content.length>1&&u().createElement("li",null,u().createElement(sC,{content:this.state.content,onSelectThumbnail:this.onSelectThumbnail})),u().createElement("li",null,u().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowCrop},"Edit Thumbnail")))),e),this.state.showImageCropModal&&u().createElement(I,null,u().createElement(Gd,{src:this.state.content[this.state.selectedContentIndex].coverUrl,size:this.props.size,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}]),n}(u().Component);aC.propTypes={size:d().object.isRequired,content:d().array,contentThumbnail:d().object,label:d().string.isRequired,helpMessage:d().string};var sC=function(e){tC(n,e);var t=rC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return eC(n,[{key:"render",value:function(){var e=[],t=this;return this.props.content.forEach((function(n,r){e.push(u().createElement("div",{key:n.id,onClick:t.props.onSelectThumbnail.bind(null,n.id,r)},u().createElement("img",{style:{width:"200px",height:"auto"},src:n.thumbUrl})))})),u().createElement(eo,{wrapperTag:"div",actionTag:"button",actionLabel:"Select Cover Image",options:e,dropdownClassName:"thumbnails"})}}]),n}(u().Component);sC.propTypes={content:d().array.isRequired,onSelectThumbnail:d().func.isRequired};var cC=function(e){tC(n,e);var t=rC(n);function n(){return Xj(this,n),t.apply(this,arguments)}return eC(n,[{key:"render",value:function(){var e={width:this.props.size.width,height:this.props.size.height},t="/project/cover?id="+this.props.id;return null!=this.props.crop&&(t+="&x="+this.props.crop.x+"&y="+this.props.crop.y+"&w="+this.props.crop.width+"&h="+this.props.crop.height),u().createElement("div",{className:"thumb",style:e},null!=this.props.id?u().createElement("img",{src:t}):null)}}]),n}(u().Component);cC.propTypes={size:d().object.isRequired,id:d().number,crop:d().object};const lC=aC;function uC(e){return uC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uC(e)}function fC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==uC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==uC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===uC(i)?i:String(i)),r)}var o,i}function pC(e,t){return pC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pC(e,t)}function hC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dC(e){return dC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dC(e)}var yC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dC(r);if(o){var n=dC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===uC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hC(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(hC(t)),t.valid=t.valid.bind(hC(t)),t.getValue=t.getValue.bind(hC(t)),t.setValue=t.setValue.bind(hC(t)),t.onChange=t.onChange.bind(hC(t)),t.handleFocus=t.handleFocus.bind(hC(t)),t.handleBlur=t.handleBlur.bind(hC(t)),t.state={value:null!=t.props.value?t.props.value:"",validate:!1,isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=u().createElement(fi,{message:this.props.helpMessage}):e+=" no-help":t=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},u().createElement("label",{className:"dynamic for-textarea",htmlFor:this.props.name},this.props.label),u().createElement("textarea",{name:this.props.name,rows:this.props.rows,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&fC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);yC.propTypes={name:d().string,rows:d().number,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},yC.defaultProps={rows:7,required:!1,requiredErrorMessage:"input required."};const mC=yC;function vC(e){return vC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vC(e)}function bC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==vC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==vC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===vC(i)?i:String(i)),r)}var o,i}function wC(e,t,n){return t&&gC(e.prototype,t),n&&gC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EC(e,t)}function EC(e,t){return EC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},EC(e,t)}function OC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=PC(e);if(t){var o=PC(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===vC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _C(e)}(this,n)}}function _C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PC(e){return PC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},PC(e)}var kC=function(e){SC(n,e);var t=OC(n);function n(e){var r;return bC(this,n),(r=t.call(this,e)).changeStage=r.changeStage.bind(_C(r)),r.processLastStage=r.processLastStage.bind(_C(r)),r.editCancel=r.editCancel.bind(_C(r)),r.onContentDelete=r.onContentDelete.bind(_C(r)),r.onPublishToProfileChange=r.onPublishToProfileChange.bind(_C(r)),r.onPublishToForumChange=r.onPublishToForumChange.bind(_C(r)),r.onPublishAsHeroChange=r.onPublishAsHeroChange.bind(_C(r)),r.onSubmit=r.onSubmit.bind(_C(r)),r.stages=["Upload Content","Add Info","Publish"],r.form=r.props.form,r.state={currentStage:1},r}return wC(n,[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.deliverablesContentData=this.refs.contentEditor.getContent(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==Id(this.form.deliverablesContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=this.refs.contentEditor.validate();break;case 2:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),t=this.refs.title.validate()&&this.refs.description.validate()&&this.refs.product.validate()&&this.refs.category.validate();break;case 3:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){if(this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue(),"Portfolio"==this.props.projectType){var e=this.refs.publishToForum.getValue();if(this.form.publishedToForumFL=e.checked,this.form.publishedToForumID=e.forumID,!this.refs.publishToForum.validate())return!1}return"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(this.form.publishAsHeroFL=this.refs.publishAsHero.getValue()),!0}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onPublishToForumChange",value:function(e){}},{key:"onPublishAsHeroChange",value:function(e){}},{key:"onSubmit",value:function(){var e=!0;if(3==this.state.currentStage&&(e=this.processLastStage()),"Portfolio"==this.props.projectType&&!e)return!1;var t={deliverablesContentNodes:this.form.deliverablesContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,productData:this.form.productData,categoryData:this.form.categoryData,tagData:this.form.tagData,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()};"Portfolio"==this.props.projectType&&(t.publishedToForumFL=this.form.publishedToForumFL,t.publishedToForumID=this.form.publishedToForumID),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(t.publishAsHeroFL=this.form.publishAsHeroFL);var n=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit/"),data:t}).done((function(e,t,r){alerts.success("Project Saved"),window.location.replace(n.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:switch(this.props.projectType){case"Portfolio":e=u().createElement(Vj,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0});break;case"Training":e=u().createElement(Qj,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0})}break;case 2:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Um,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(lC,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.deliverablesContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),u().createElement("div",{className:"col-md-6"},u().createElement(Oi,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),u().createElement("div",{className:"col-md-12"},u().createElement(JS,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData})));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",null,u().createElement("legend",null,"Project Status"),u().createElement(ev,{ref:"status",name:"status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue}))),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($m,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))),"Portfolio"==this.props.projectType&&u().createElement(jC,{ref:"publishToForum",checked:this.form.publishedToForumFL,forumID:this.form.publishedToForumID,options:this.form.publishedToForumOptions,forumPath:this.form.publishedToForumPath,topicUrl:this.form.publishedToForumTopicUrl}),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&1==this.form.viewer.isHero&&u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Foundry Heroes"),u().createElement($m,{ref:"publishAsHero",name:"publishAsHero",label:"Allow Publish As Hero Project",value:this.form.publishAsHeroFL,onChange:this.onPublishAsHeroChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(TP,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}]),n}(u().Component);kC.propTypes={form:d().object.isRequired,projectType:d().string.isRequired};var jC=function(e){SC(n,e);var t=OC(n);function n(e){var r;return bC(this,n),(r=t.call(this,e)).validate=r.validate.bind(_C(r)),r.valid=r.valid.bind(_C(r)),r.getValue=r.getValue.bind(_C(r)),r.onCheckboxChange=r.onCheckboxChange.bind(_C(r)),r.onForumChange=r.onForumChange.bind(_C(r)),r.checked=r.props.checked,r.forumID=r.props.forumID,r.state={disabled:!r.props.checked,isValid:!0,showValidation:!1},r}return wC(n,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){if(!1===this.checked||null!=this.props.forumPath)return!0;var e=!1;return!0===this.checked&&(e=this.refs.forumSelect.validate()),!0===this.checked&&e&&null!=this.forumID}},{key:"getValue",value:function(){return{checked:this.checked,forumID:this.forumID}}},{key:"onCheckboxChange",value:function(e){this.checked=e,this.setState({disabled:!e})}},{key:"onForumChange",value:function(e){this.forumID=e}},{key:"render",value:function(){var e;return e=null!=this.props.forumPath?u().createElement("div",{className:"project-publish-forum"},u().createElement("p",null,"Forum: ",u().createElement("a",{href:this.props.forumPath.url},this.props.forumPath.name)),u().createElement("p",null,"Topic: ",u().createElement("a",{href:this.props.topicUrl},"Link"))):u().createElement(Lf,{ref:"forumSelect",value:this.props.forumID,options:this.props.options,required:!0,requiredErrorMessage:"Forum selection required to publish to forum",disabled:this.state.disabled,onChange:this.onForumChange}),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($m,{ref:"checkbox",name:"publishToForum",label:"Publish To Forum",value:this.props.checked,onChange:this.onCheckboxChange})),u().createElement("div",{className:"col-md-6"},e))}}]),n}(u().Component);const CC=kC;function TC(e){return TC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TC(e)}function xC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==TC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==TC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===TC(i)?i:String(i)),r)}var o,i}function RC(e,t){return RC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RC(e,t)}function DC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NC(e){return NC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NC(e)}var MC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=NC(r);if(o){var n=NC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===TC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return DC(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(DC(t)),t.openInput=t.openInput.bind(DC(t)),t.inputChange=t.inputChange.bind(DC(t)),t.onEditThumbnail=t.onEditThumbnail.bind(DC(t)),t.onAcceptCrop=t.onAcceptCrop.bind(DC(t)),t.onCancelCrop=t.onCancelCrop.bind(DC(t)),t.imageCropSize=null,t.thumbCropData=null,t.state={src:t.props.src,showImageCropModal:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"openInput",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"inputChange",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/replace"),contentType:!1,data:n,processData:!1}).done((function(e,t,n){r.setState({src:e.thumbUrl},(function(){this.props.onChange&&this.props.onChange(e)}))})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"onEditThumbnail",value:function(){this.setState({showImageCropModal:!0})}},{key:"onAcceptCrop",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,n,r){var o=Utils.clone(this.props.content);o.thumbUrl=e,t.setState({showImageCropModal:!1,src:e},(function(){this.props.onChange&&this.props.onChange(o)}))})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.setState({showImageCropModal:!1})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){var e=this,t={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.inputChange},n=[];return n.push(u().createElement("button",{key:0,onClick:this.openInput},"Replace Content Cover")),n.push(u().createElement("button",{key:1,onClick:this.onEditThumbnail.bind(null,this.props.id)},"Edit Thumbnail")),u().createElement("div",{className:"cover-editor"},u().createElement("img",{className:"no-drag",src:this.state.src}),u().createElement("div",{className:"edit"},n),u().createElement("input",t),this.state.showImageCropModal&&u().createElement(I,null,u().createElement(Gd,{src:this.props.content.coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}])&&xC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);MC.propTypes={content:d().object,id:d().number,src:d().string,onChange:d().func};const IC=MC;function AC(e){return AC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AC(e)}function LC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==AC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==AC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===AC(i)?i:String(i)),r)}var o,i}function BC(e,t){return BC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BC(e,t)}function FC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UC(e){return UC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},UC(e)}var qC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=UC(r);if(o){var n=UC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===AC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return FC(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(FC(t)),t.getContentForm=t.getContentForm.bind(FC(t)),t.getTags=t.getTags.bind(FC(t)),t.getProducts=t.getProducts.bind(FC(t)),t.onContentChange=t.onContentChange.bind(FC(t)),t.state={content:t.props.content,contentForm:null!=t.props.contentForm?t.props.contentForm:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){if(null==this.state.contentForm){var e=this;$.ajax({type:"GET",url:"/staging/asset",data:{itemID:this.state.content.id},context:this}).done((function(t){var n=t;null!=n.categoryData&&0!=n.categoryData.length||null!=n.productData&&0!=n.productData.length||null!=n.tagData&&0!=n.tagData.length||null==n.defaultProductData||!(n.defaultProductData.length>0)||(n.productData=n.defaultProductData),e.setState({contentForm:n})}))}}},{key:"validate",value:function(){var e=this.refs.category.validate(),t=this.refs.product.validate();return e&&t}},{key:"getContentForm",value:function(){return this.state.contentForm}},{key:"getTags",value:function(){return this.refs.tags.getTags()}},{key:"getProducts",value:function(){return this.refs.product.getSelectedOptions()}},{key:"onContentChange",value:function(e){var t=this;this.setState({content:e},(function(){t.props.onContentChange&&t.props.onContentChange(e)}))}},{key:"render",value:function(){return u().createElement("div",{className:"tfnode asset-node"},u().createElement("div",{style:{textAlign:"right"}},this.props.children),u().createElement("div",{className:"details"},u().createElement("h4",null,u().createElement("span",{className:"content-type"},this.state.content.type)," ",this.state.content.title)),u().createElement("div",{className:"editors"},u().createElement(IC,{content:this.state.content,id:this.state.content.id,src:this.state.content.thumbUrl,onChange:this.onContentChange}),u().createElement("div",{className:"data-editors"},null!=this.state.contentForm&&u().createElement(Oi,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.state.contentForm.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.contentForm.productData}),null!=this.state.contentForm&&u().createElement(Oi,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.state.contentForm.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.contentForm.categoryData}),null!=this.state.contentForm&&u().createElement(JS,{ref:"tags",label:"Content Tags",placeholder:"Add Tag...",tags:this.state.contentForm.tagData}))))}}])&&LC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);qC.propTypes={content:d().object.isRequired,contentForm:d().object,onContentChange:d().func};const KC=qC;function VC(e){return VC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VC(e)}function zC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==VC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==VC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===VC(i)?i:String(i)),r)}var o,i}function WC(e,t){return WC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WC(e,t)}function HC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $C(e){return $C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$C(e)}var GC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$C(r);if(o){var n=$C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===VC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return HC(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(HC(t)),t.valid=t.valid.bind(HC(t)),t.getNodes=t.getNodes.bind(HC(t)),t.getContent=t.getContent.bind(HC(t)),t.getContentForms=t.getContentForms.bind(HC(t)),t.getExtraInfo=t.getExtraInfo.bind(HC(t)),t.hasContent=t.hasContent.bind(HC(t)),t.onAcceptContent=t.onAcceptContent.bind(HC(t)),t.onDeleteNode=t.onDeleteNode.bind(HC(t)),t.onMoveUpNode=t.onMoveUpNode.bind(HC(t)),t.onMoveDownNode=t.onMoveDownNode.bind(HC(t)),t.updateNodeOrder=t.updateNodeOrder.bind(HC(t)),t.getContentForm=t.getContentForm.bind(HC(t)),t.onContentChange=t.onContentChange.bind(HC(t)),t._content=t.props.contentData?t.props.contentData:[],t._contentForms=t.props.contentForms?t.props.contentForms:[],t._nodes=t.props.contentNodes?t.props.contentNodes:[],t.state={nodes:t._nodes,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){var e=this,t=!0;return Object.keys(this.refs).forEach((function(n){var r=e.refs[n].validate();t=t&&r})),!1===this.props.required||!0===this.props.required&&this.hasContent()&&t}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"getContentForms",value:function(){var e=this,t=[];return Object.keys(this.refs).forEach((function(n){t.push(e.refs[n].getContentForm())})),t}},{key:"getExtraInfo",value:function(){var e=this,t=[],n=[];return Object.keys(this.refs).forEach((function(r){t=t.concat(e.refs[r].getTags()),n=n.concat(e.refs[r].getProducts())})),{tags:sn.arrayUnique(t),products:sn.arrayUnique(n)}}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onAcceptContent",value:function(e,t){var n=this;e.forEach((function(e){n._content.push(e);var t={id:sn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n._nodes.push(t)})),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);if("Content"==n[0].type){var r=n[0].data;Ad(this._content,r),this.props.onDelete&&this.props.onDelete(r)}this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"getContentForm",value:function(e){for(var t=0;t<this._contentForms.length;t++)if(this._contentForms[t].id==e)return this._contentForms[t];return null}},{key:"onContentChange",value:function(e){var t=Id(this._content,e.id);null!=t&&(this._content[t]=e)}},{key:"render",value:function(){var e="tfnode-editor";!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid||(e+=" has-error");var t=[];return this.state.nodes.forEach((function(e,n){if("Content"===e.type){var r=Md(this._content,e.data),o=this.getContentForm(e.data);t.push(u().createElement(KC,{ref:e.id,key:"c:"+e.id,content:r,contentForm:o,onContentChange:this.onContentChange},u().createElement(Aj,{index:n,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,n),onMoveUp:this.onMoveUpNode.bind(null,n),onMoveDown:this.onMoveDownNode.bind(null,n)})))}t.push(u().createElement("div",{key:"p:"+n,className:"tfnode placeholder-node",style:{marginBottom:"20px"}},u().createElement("hr",null)))}),this),u().createElement("div",{className:e},t,u().createElement(rh,{groupsAllowed:["Asset"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid?null:u().createElement(fi,{message:"At least one content item (image/video) is required"}))}}],n&&zC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);GC.propTypes={fileSizeLimit:d().number,contentNodes:d().array,contentData:d().array,contentForms:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func,onDelete:d().func},GC.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const JC=GC;function QC(e){return QC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QC(e)}function YC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==QC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==QC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===QC(i)?i:String(i)),r)}var o,i}function XC(e,t){return XC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XC(e,t)}function ZC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eT(e){return eT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eT(e)}var tT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eT(r);if(o){var n=eT(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===QC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ZC(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).changeStage=t.changeStage.bind(ZC(t)),t.processLastStage=t.processLastStage.bind(ZC(t)),t.updateSupportContent=t.updateSupportContent.bind(ZC(t)),t.editCancel=t.editCancel.bind(ZC(t)),t.onContentDelete=t.onContentDelete.bind(ZC(t)),t.onPublishToProfileChange=t.onPublishToProfileChange.bind(ZC(t)),t.onSubmit=t.onSubmit.bind(ZC(t)),t.stages=["Upload Asset","Upload Example Gallery","Add Info","Publish"],t.form=t.props.form,t.projectTagsAndProducts=null,t.state={currentStage:1},t}return t=a,(n=[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.contentForms=this.refs.contentEditor.getContentForms();var r=this.refs.contentEditor.getContent();this.form.supportContentData=this.updateSupportContent(r),this.projectTagsAndProducts=this.refs.contentEditor.getExtraInfo(),(null==this.form.title||""==this.form.title)&&null!=r&&r.length>0&&(this.form.title=r[0].title),t=this.refs.contentEditor.validate();break;case 2:this.form.supportContentData=this.refs.supportContentEditor.getContent().content,this.form.supportContentNodes=this.refs.supportContentEditor.getNodes(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==Id(this.form.supportContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=!0;break;case 3:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),t=this.refs.title.validate()&&this.refs.description.validate();break;case 4:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue()}},{key:"updateSupportContent",value:function(e){for(var t=this.form.supportContentData,n=[],r=0;r<e.length;r++){for(var o=!1,i=0;i<t.length;i++)t[i].id==e[r].id&&(t[i]=e[r],t[i].isStatic=!0,o=!0);o||(e[r].isStatic=!0,n.push(e[r]))}return n.length>0&&(t=t.concat(n)),t}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){Ad(this.form.supportContentData,e)}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onSubmit",value:function(){4==this.state.currentStage&&this.processLastStage();var e={deliverablesContentNodes:this.form.deliverablesContentNodes,contentForms:this.form.contentForms.map((function(e){return Ld(e)})),supportContentNodes:this.form.supportContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,commentsStatus:this.form.commentsStatusOptions.selectedValue,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()},t=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit-asset"),data:e}).done((function(e,n,r){alerts.success("Project Saved"),window.location.replace(t.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:e=u().createElement(JC,{ref:"contentEditor",contentNodes:this.form.deliverablesContentNodes,contentData:this.form.deliverablesContentData,contentForms:this.form.contentForms,onDelete:this.onContentDelete,required:!0});break;case 2:e=u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Example Gallery"),u().createElement("p",null,"Add images and video examples to show off the shared asset.  Drag thumbnails to change the order."),u().createElement(Qy,{ref:"supportContentEditor",content:this.form.supportContentData}));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Um,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(lC,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.supportContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-12 project-info"},u().createElement(uS,{list:this.projectTagsAndProducts.tags,label:"Project Tags"}),u().createElement(uS,{list:this.projectTagsAndProducts.products.map((function(e){return e.text})),label:"Project Products"})));break;case 4:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(ev,{ref:"status",name:"status",label:"Project Status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue})),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($m,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Share Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(TP,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])&&YC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);tT.propTypes={form:d().object.isRequired};const nT=tT;function rT(e){return rT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rT(e)}function oT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==rT(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==rT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===rT(i)?i:String(i)),r)}var o,i}function aT(e,t,n){return t&&iT(e.prototype,t),n&&iT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sT(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cT(e,t)}function cT(e,t){return cT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cT(e,t)}function lT(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=fT(e);if(t){var o=fT(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===rT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return uT(e)}(this,n)}}function uT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fT(e){return fT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fT(e)}var pT=function(e){sT(n,e);var t=lT(n);function n(e){var r;return oT(this,n),(r=t.call(this,e)).validate=r.validate.bind(uT(r)),r.valid=r.valid.bind(uT(r)),r.getSelectedOptions=r.getSelectedOptions.bind(uT(r)),r.handleProductChange=r.handleProductChange.bind(uT(r)),r.handleChange=r.handleChange.bind(uT(r)),r.getRelease=r.getRelease.bind(uT(r)),r.getSelectedReleaseIndex=r.getSelectedReleaseIndex.bind(uT(r)),r.onDelete=r.onDelete.bind(uT(r)),r.onUpdateOrder=r.onUpdateOrder.bind(uT(r)),r.onBiasUpdate=r.onBiasUpdate.bind(uT(r)),r.handleGroupFocus=r.handleGroupFocus.bind(uT(r)),r.handleGroupBlur=r.handleGroupBlur.bind(uT(r)),r.releasePlaceholderValue=null!=r.props.releasePlaceholderOption?r.props.releasePlaceholderOption.value:null,r.state={visibleReleases:r.props.releases.filter((function(e){return e.productID==r.props.productOptions[0].value})),selectedReleases:r.props.selectedReleases?r.props.selectedReleases:[],validate:!1,isValid:!0===r.props.required&&null!=r.props.selectedReleases&&r.props.selectedReleases.length>0,showValidation:!1,hasFocus:!1},r}return aT(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){null!=e.selectedReleases&&e.selectedReleases!==this.state.selectedReleases&&this.setState({selectedReleases:e.selectedReleases?e.selectedReleases:[]})}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.selectedReleases&&this.state.selectedReleases.length>0}},{key:"getSelectedOptions",value:function(){return this.state.selectedReleases}},{key:"handleProductChange",value:function(){var e=this;this.setState({visibleReleases:this.props.releases.filter((function(t){return t.productID==e.refs.product.value}))})}},{key:"handleChange",value:function(){var e=this.refs.select.value,t=this.getRelease(e);if(e!=this.releasePlaceholderValue&&null==this.getSelectedReleaseIndex(e)){var n=this.state.selectedReleases;n.push(t),this.setState({selectedReleases:n,isValid:this.valid()}),this.releasePlaceholderValue&&(this.refs.select.value,this.releasePlaceholderValue)}}},{key:"getRelease",value:function(e){for(var t=0;t<this.props.releases.length;t++)if(this.props.releases[t].id==e)return this.props.releases[t];return null}},{key:"getSelectedReleaseIndex",value:function(e){for(var t=0;t<this.state.selectedReleases.length;t++)if(this.state.selectedReleases[t].id==e)return t;return null}},{key:"onDelete",value:function(e){var t=this.state.selectedReleases;t.splice(e,1),this.setState({selectedReleases:t,isValid:this.valid()})}},{key:"onUpdateOrder",value:function(e,t){var n=this.state.selectedReleases;n.splice(t,0,n.splice(e,1)[0]),this.setState({selectedReleases:n})}},{key:"onBiasUpdate",value:function(e,t){var n=this.state.selectedReleases;n[e].bias=t,this.setState({selectedReleases:n})}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.state.visibleReleases.map((function(t,n){var r=!1;return null!==e.getSelectedReleaseIndex(t.id)&&(r=!0),u().createElement("option",{key:t.id,value:t.id,disabled:r},t.versionName," ",t.releaseName)})),n="form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(n+=" has-focus"):n+=" has-error";var r="static";!0===this.props.required&&(r+=" required");var o=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(o=u().createElement(fi,{message:this.props.helpMessage})):o=u().createElement(fi,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:n,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:r},this.props.label),u().createElement("div",{className:"multiselect-editor product-release"},u().createElement("select",{ref:"product",onChange:this.handleProductChange},null!=this.props.productPlaceholderOption&&u().createElement("option",{key:this.props.productPlaceholderOption.value,value:this.props.productPlaceholderOption.value,disabled:!1},this.props.productPlaceholderOption.text),this.props.productOptions.map((function(e,t){return u().createElement("option",{key:e.value,value:e.value},e.text)}))),u().createElement("select",{ref:"select",value:this.releasePlaceholderValue,onChange:this.handleChange},null!=this.props.releasePlaceholderOption&&u().createElement("option",{key:this.props.releasePlaceholderOption.value,value:this.props.releasePlaceholderOption.value,disabled:!1},this.props.releasePlaceholderOption.text),t),u().createElement(hT,{data:this.state.selectedReleases,onBiasUpdate:this.onBiasUpdate,onUpdateOrder:this.onUpdateOrder,onDelete:this.onDelete})),o)}}]),n}(u().Component);pT.propTypes={productOptions:d().array.isRequired,productPlaceholderOption:d().object,releasePlaceholderOption:d().object,releases:d().array.isRequired,selectedReleases:d().array,label:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string},pT.defaultProps={productPlaceholderOption:{text:"Select product *",value:""},releasePlaceholderOption:{text:"Select software release *",value:""},required:!1,requiredErrorMessage:"At least one item is required"};var hT=function(e){sT(n,e);var t=lT(n);function n(e){var r;return oT(this,n),(r=t.call(this,e)).dragStart=r.dragStart.bind(uT(r)),r.dragOver=r.dragOver.bind(uT(r)),r.dragEnter=r.dragEnter.bind(uT(r)),r.dragEnd=r.dragEnd.bind(uT(r)),r.onBiasUpdate=r.onBiasUpdate.bind(uT(r)),r.placeholder=document.createElement("li"),r.placeholder.className="placeholder",r.dragged=null,r}return aT(n,[{key:"dragStart",value:function(e){this.dragged=e.currentTarget,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("Text",e.currentTarget.id)}},{key:"dragOver",value:function(e){if(e.preventDefault(),this.dragged.style.display="none","placeholder"!=e.target.className&&"LI"==e.target.nodeName){this.over=e.target;var t=e.pageY-$(this.over).offset().top,n=this.over.offsetHeight/2,r=e.target.parentNode;"OL"==r.nodeName&&(t>n?(this.nodePlacement="after",r.insertBefore(this.placeholder,e.target.nextElementSibling)):(this.nodePlacement="before",r.insertBefore(this.placeholder,e.target)))}}},{key:"dragEnter",value:function(e){e.preventDefault()}},{key:"dragEnd",value:function(e){this.dragged.style.display="block",this.dragged.parentNode.removeChild(this.placeholder);var t=Number(this.dragged.dataset.id),n=Number(this.over.dataset.id);t<n&&n--,"after"==this.nodePlacement&&n++,this.props.onUpdateOrder(t,n)}},{key:"onBiasUpdate",value:function(e,t){this.props.onBiasUpdate(e,t.target.value)}},{key:"render",value:function(){var e=this;if(null===this.props.data&&0===this.props.data.length)return null;var t=this;return u().createElement("ol",{onDragOver:this.dragOver,onDragEnter:this.dragEnter},this.props.data.map((function(n,r){return u().createElement("li",{"data-id":r,key:r,draggable:!0,onDragEnd:t.dragEnd,onDragStart:t.dragStart},u().createElement("span",{className:"drag-handle glyphicon glyphicon-option-vertical"}),n.versionName," ",n.releaseName,u().createElement("select",{ref:"bias",value:null==n.bias?"":n.bias,onChange:e.onBiasUpdate.bind(e,r)},u().createElement("option",{key:0,value:"None"},"no modifier"),u().createElement("option",{key:10,value:"AndEarlier"},"and earlier"),u().createElement("option",{key:20,value:"AndLater"},"and later")),u().createElement("button",{type:"button",className:"close",onClick:t.props.onDelete.bind(null,r)},u().createElement("span",null,"×")))})))}}]),n}(u().Component);const dT=pT;function yT(e){return yT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yT(e)}function mT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==yT(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==yT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===yT(i)?i:String(i)),r)}var o,i}function vT(e,t){return vT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vT(e,t)}function bT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gT(e){return gT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gT(e)}var wT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vT(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gT(r);if(o){var n=gT(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===yT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bT(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(bT(t)),t.getContentForm=t.getContentForm.bind(bT(t)),t.getTags=t.getTags.bind(bT(t)),t.getProducts=t.getProducts.bind(bT(t)),t.getProductReleases=t.getProductReleases.bind(bT(t)),t.onContentChange=t.onContentChange.bind(bT(t)),t.state={content:t.props.content,contentForm:null!=t.props.contentForm?t.props.contentForm:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){if(null==this.state.contentForm){var e=this;$.ajax({type:"GET",url:"/staging/extension",data:{itemID:this.state.content.id},context:this}).done((function(t){var n=t;null!=n.categoryData&&0!=n.categoryData.length||null!=n.productData&&0!=n.productData.length||null!=n.tagData&&0!=n.tagData.length||null==n.defaultProductData||!(n.defaultProductData.length>0)||(n.productData=n.defaultProductData),e.setState({contentForm:n})}))}}},{key:"validate",value:function(){var e=this.refs.productReleases.validate(),t=this.refs.category.validate();return e&&t}},{key:"getContentForm",value:function(){var e=no()(this.state.contentForm);return e.productReleaseData=this.getProductReleases(),e.productData=e.productReleaseData.map((function(t){return e.productOptions.find((function(e){return e.value==t.productID}))})),e}},{key:"getTags",value:function(){return this.refs.tags.getTags()}},{key:"getProducts",value:function(){return this.refs.productReleases.getSelectedOptions().map((function(e){return this.state.contentForm.productOptions.find((function(t){return t.value==e.productID}))}))}},{key:"getProductReleases",value:function(){return this.refs.productReleases.getSelectedOptions()}},{key:"onContentChange",value:function(e){var t=this;this.setState({content:e},(function(){t.props.onContentChange&&t.props.onContentChange(e)}))}},{key:"render",value:function(){return u().createElement("div",{className:"tfnode asset-node"},u().createElement("div",{style:{textAlign:"right"}},this.props.children),u().createElement("div",{className:"details"},u().createElement("h4",null,u().createElement("span",{className:"content-type"},this.state.content.type)," ",this.state.content.title)),u().createElement("div",{className:"editors"},u().createElement(IC,{content:this.state.content,id:this.state.content.id,src:this.state.content.thumbUrl,onChange:this.onContentChange}),u().createElement("div",{className:"data-editors"},null!=this.state.contentForm&&u().createElement(dT,{ref:"productReleases",name:"productReleases",required:!0,requiredErrorMessage:"At least one software release is required.",productOptions:this.state.contentForm.productOptions,releases:this.state.contentForm.productReleaseList,selectedReleases:this.state.contentForm.productReleaseData}),null!=this.state.contentForm&&u().createElement(Oi,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.state.contentForm.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.contentForm.categoryData}),null!=this.state.contentForm&&u().createElement(JS,{ref:"tags",label:"Content Tags",placeholder:"Add Tag...",tags:this.state.contentForm.tagData}))))}}])&&mT(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);wT.propTypes={content:d().object.isRequired,contentForm:d().object,onContentChange:d().func};const ST=wT;function ET(e){return ET="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ET(e)}function OT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==ET(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ET(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===ET(i)?i:String(i)),r)}var o,i}function _T(e,t){return _T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_T(e,t)}function PT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kT(e){return kT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kT(e)}var jT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_T(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=kT(r);if(o){var n=kT(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ET(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return PT(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(PT(t)),t.valid=t.valid.bind(PT(t)),t.getNodes=t.getNodes.bind(PT(t)),t.getContent=t.getContent.bind(PT(t)),t.getContentForms=t.getContentForms.bind(PT(t)),t.getExtraInfo=t.getExtraInfo.bind(PT(t)),t.hasContent=t.hasContent.bind(PT(t)),t.onAcceptContent=t.onAcceptContent.bind(PT(t)),t.onDeleteNode=t.onDeleteNode.bind(PT(t)),t.onMoveUpNode=t.onMoveUpNode.bind(PT(t)),t.onMoveDownNode=t.onMoveDownNode.bind(PT(t)),t.updateNodeOrder=t.updateNodeOrder.bind(PT(t)),t.getContentForm=t.getContentForm.bind(PT(t)),t.onContentChange=t.onContentChange.bind(PT(t)),t._content=t.props.contentData?t.props.contentData:[],t._contentForms=t.props.contentForms?t.props.contentForms:[],t._nodes=t.props.contentNodes?t.props.contentNodes:[],t.state={nodes:t._nodes,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){var e=this,t=!0;return Object.keys(this.refs).forEach((function(n){var r=e.refs[n].validate();t=t&&r})),!1===this.props.required||!0===this.props.required&&this.hasContent()&&t}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"getContentForms",value:function(){var e=this,t=[];return Object.keys(this.refs).forEach((function(n){t.push(e.refs[n].getContentForm())})),t}},{key:"getExtraInfo",value:function(){var e=this,t=[],n=[];return Object.keys(this.refs).forEach((function(r){t=t.concat(e.refs[r].getTags()),n=n.concat(e.refs[r].getProducts())})),{tags:sn.arrayUnique(t),products:sn.arrayUnique(n)}}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onAcceptContent",value:function(e,t){var n=this;e.forEach((function(e){n._content.push(e);var t={id:sn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n._nodes.push(t)})),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);if("Content"==n[0].type){var r=n[0].data;Ad(this._content,r),this.props.onDelete&&this.props.onDelete(r)}this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"getContentForm",value:function(e){for(var t=0;t<this._contentForms.length;t++)if(this._contentForms[t].id==e)return this._contentForms[t];return null}},{key:"onContentChange",value:function(e){var t=Id(this._content,e.id);null!=t&&(this._content[t]=e)}},{key:"render",value:function(){var e="tfnode-editor";!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid||(e+=" has-error");var t=[];return this.state.nodes.forEach((function(e,n){if("Content"===e.type){var r=Md(this._content,e.data),o=this.getContentForm(e.data);t.push(u().createElement(ST,{ref:e.id,key:"c:"+e.id,content:r,contentForm:o,onContentChange:this.onContentChange},u().createElement(Aj,{index:n,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,n),onMoveUp:this.onMoveUpNode.bind(null,n),onMoveDown:this.onMoveDownNode.bind(null,n)})))}t.push(u().createElement("div",{key:"p:"+n,className:"tfnode placeholder-node",style:{marginBottom:"20px"}},u().createElement("hr",null)))}),this),u().createElement("div",{className:e},t,u().createElement(rh,{closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid?null:u().createElement(fi,{message:"At least one content item (image/video) is required"}))}}],n&&OT(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);jT.propTypes={fileSizeLimit:d().number,contentNodes:d().array,contentData:d().array,contentForms:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func,onDelete:d().func},jT.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const CT=jT;function TT(e){return TT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TT(e)}function xT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==TT(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==TT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===TT(i)?i:String(i)),r)}var o,i}function RT(e,t){return RT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RT(e,t)}function DT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NT(e){return NT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NT(e)}var MT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RT(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=NT(r);if(o){var n=NT(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===TT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return DT(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).changeStage=t.changeStage.bind(DT(t)),t.processLastStage=t.processLastStage.bind(DT(t)),t.updateSupportContent=t.updateSupportContent.bind(DT(t)),t.editCancel=t.editCancel.bind(DT(t)),t.onContentDelete=t.onContentDelete.bind(DT(t)),t.onPublishToProfileChange=t.onPublishToProfileChange.bind(DT(t)),t.onSubmit=t.onSubmit.bind(DT(t)),t.getExtraInfo=t.getExtraInfo.bind(DT(t)),t.stages=["Upload Content","Upload Example Gallery","Add Info","Publish"],t.form=t.props.form,t.projectTagsAndProducts=null,t.state={currentStage:1},t}return t=a,(n=[{key:"getExtraInfo",value:function(e){for(var t=[],n=[],r=0;r<e.length;r++)t=t.concat(e[r].tagData),n=n.concat(e[r].productData);return{tags:sn.arrayUnique(t),products:sn.arrayUnique(n)}}},{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.contentForms=this.refs.contentEditor.getContentForms();var r=this.refs.contentEditor.getContent();this.form.supportContentData=this.updateSupportContent(r),this.projectTagsAndProducts=this.getExtraInfo(this.form.contentForms),(null==this.form.title||""==this.form.title)&&null!=r&&r.length>0&&(this.form.title=r[0].title),t=this.refs.contentEditor.validate();break;case 2:this.form.supportContentData=this.refs.supportContentEditor.getContent().content,this.form.supportContentNodes=this.refs.supportContentEditor.getNodes(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==Id(this.form.supportContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=!0;break;case 3:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.shortDescription=this.refs.shortDescription.getValue(),this.form.description=this.refs.description.getValue(),this.form.installation=this.refs.installation.getValue(),this.form.usage=this.refs.usage.getValue(),this.form.license=this.refs.license.getValue(),t=this.refs.title.validate()&&this.refs.shortDescription.validate()&&this.refs.description.validate();break;case 4:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue()}},{key:"updateSupportContent",value:function(e){for(var t=this.form.supportContentData,n=[],r=0;r<e.length;r++){for(var o=!1,i=0;i<t.length;i++)t[i].id==e[r].id&&(t[i]=e[r],t[i].isStatic=!0,o=!0);o||(e[r].isStatic=!0,n.push(e[r]))}return n.length>0&&(t=t.concat(n)),t}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){Ad(this.form.supportContentData,e)}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onSubmit",value:function(){4==this.state.currentStage&&this.processLastStage();var e={deliverablesContentNodes:this.form.deliverablesContentNodes,contentForms:this.form.contentForms.map((function(e){return Bd(e)})),supportContentNodes:this.form.supportContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,shortDescription:this.form.shortDescription,description:this.form.description,installation:this.form.installation,usage:this.form.usage,license:this.form.license,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,commentsStatus:this.form.commentsStatusOptions.selectedValue,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()},t=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit-extension"),data:e}).done((function(e,n,r){alerts.success("Project Saved"),window.location.replace(t.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:e=u().createElement(CT,{ref:"contentEditor",contentNodes:this.form.deliverablesContentNodes,contentData:this.form.deliverablesContentData,contentForms:this.form.contentForms,onDelete:this.onContentDelete,required:!0});break;case 2:e=u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Example Gallery"),u().createElement("p",null,"Add images and video examples to show off the shared asset.  Drag thumbnails to change the order."),u().createElement(Qy,{ref:"supportContentEditor",content:this.form.supportContentData}));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Um,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(lC,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.supportContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"shortDescription",label:"Short Description *",placeholder:"Short project description to be shown in the gallery...",value:this.form.shortDescription,rows:3,required:!0,requiredErrorMessage:"Short description required."})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"description",label:"Description *",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"license",label:"License Information",placeholder:"license...",value:this.form.license,rows:10,required:!1})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"installation",label:"Install Instructions",placeholder:"How to install...",value:this.form.installation,rows:10,required:!1})),u().createElement("div",{className:"col-md-12"},u().createElement(mC,{ref:"usage",label:"How To Use",placeholder:"Describe how to use...",value:this.form.usage,rows:10,required:!1})),u().createElement("div",{className:"col-md-12 project-info"},u().createElement(uS,{list:this.projectTagsAndProducts.tags,label:"Project Tags"}),u().createElement(uS,{list:this.projectTagsAndProducts.products.map((function(e){return e.text})),label:"Project Products"})));break;case 4:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(ev,{ref:"status",name:"status",label:"Project Status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue})),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($m,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,this.form.projectType," Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(TP,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])&&xT(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);MT.propTypes={form:d().object.isRequired};const IT=MT;function AT(e){return AT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AT(e)}function LT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==AT(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==AT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===AT(i)?i:String(i)),r)}var o,i}function BT(e,t){return BT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BT(e,t)}function FT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UT(e){return UT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},UT(e)}var qT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BT(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=UT(r);if(o){var n=UT(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===AT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return FT(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(FT(t)),t.onChange=t.onChange.bind(FT(t)),t.doQuery=t.doQuery.bind(FT(t)),t.startRename=t.startRename.bind(FT(t)),t.cancelRename=t.cancelRename.bind(FT(t)),t.getValue=t.getValue.bind(FT(t)),t.state={doRename:!1,value:t.props.value,status:null,helpMessage:t.props.helpMessage},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=p()(this.doQuery,500)}},{key:"validate",value:function(e){return/^[\u00C0-\u1FFF\u2C00-\uD7FF\w\. -]{3,50}$/gi.exec(e)}},{key:"onChange",value:function(){var e=this.refs.name.value;e.trim()!=this.props.value?this.validate(e.trim())?this.doQuery(e):this.setState({value:e,status:"Error",helpMessage:"Profile name must be between 3 to 50 characters in length and only contain alphanumeric characters."}):this.setState({value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"doQuery",value:function(e){var t=this,n="Error",r="Name Not Available";$.ajax({url:"/api/profile/checkrename",type:"POST",data:{name:e.trim()}}).done((function(e){!0===e.available&&(n="Success",r="Name Available.  Profile will be renamed to <strong>"+e.name+"</strong> after save.")})).fail((function(e){alerts.error(e.error)})).always((function(){t.setState({value:e,status:n,helpMessage:r})}))}},{key:"startRename",value:function(){this.setState({doRename:!0})}},{key:"cancelRename",value:function(){this.setState({doRename:!1,value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"getValue",value:function(){return!0===this.state.doRename&&"Success"===this.state.status&&this.validate(this.state.value)&&this.state.value!=this.props.value?this.state.value:null}},{key:"render",value:function(){if(this.state.doRename){var e="profile-name-editor form-group";if(null!=this.state.status)switch(this.state.status){case"Success":e+=" has-success";break;case"Error":e+=" has-error"}return u().createElement("div",{className:e},u().createElement("label",{className:"static"},"Profile Name"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"name",className:"form-control",defaultValue:this.props.value,onChange:this.onChange,style:{width:"100%"}}),u().createElement("div",{className:"input-group-btn"},u().createElement("button",{type:"button",className:"btn btn-primary",onClick:this.cancelRename},"Cancel Rename"))),u().createElement("span",{className:"help-block",dangerouslySetInnerHTML:{__html:this.state.helpMessage}}))}return u().createElement("div",{className:"profile-name-editor form-group"},u().createElement("label",{className:"static"},"Profile Name"),u().createElement("div",{className:"static-input"},this.props.value," ",u().createElement("button",{type:"button",className:"btn-link icon icon-after icon-refresh",onClick:this.startRename},"Rename Profile")))}}])&&LT(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);qT.propTypes={helpMessage:d().string},qT.defaultProps={helpMessage:"Rename will only occur after save if the above input is valid."};const KT=qT;function VT(e){return VT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VT(e)}function zT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,i=void 0,i=function(e,t){if("object"!==VT(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==VT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===VT(i)?i:String(i)),r)}var o,i}function WT(e,t){return WT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WT(e,t)}function HT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $T(e){return $T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$T(e)}var GT=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WT(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$T(r);if(o){var n=$T(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===VT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return HT(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getValue=t.getValue.bind(HT(t)),t.open=t.open.bind(HT(t)),t.change=t.change.bind(HT(t)),t.state={hasAvatar:t.props.hasAvatar,avatarUrl:t.props.avatarUrl},t}return t=a,(n=[{key:"getValue",value:function(){}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"change",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/profile/"+this.props.profileRouteName+"/avatar",contentType:!1,processData:!1,data:n}).done((function(e,t,n){r.setState({hasAvatar:e.hasAvatar,avatarUrl:e.avatarUrl})})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"render",value:function(){var e=this,t=this.state.hasAvatar?"Replace Image":"Add Image",n={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.change};return u().createElement("div",{className:"profile-avatar-editor form-group"},u().createElement("label",{className:"static"},"Avatar"),u().createElement("img",{className:"circle",src:this.state.avatarUrl}),u().createElement("button",{type:"button",onClick:this.open,className:"btn-link icon icon-after icon-refresh"},t),u().createElement("input",n))}}])&&zT(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(u().Component);GT.propTypes={hasAvatar:d().bool.isRequired,avatarUrl:d().string};const JT=GT})(),i})()));
