1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[996],{65358:function(e,t,n){n.d(t,{Z:function(){return g}});var r=n(4111),a=n(51438),i=n(52951),o=n(88029),s=n(5950),c=n(67294),l=n(45697),u=n.n(l),d=n(18446),h=n.n(d),p=n(78718),f=n.n(p),m=function(){function e(){(0,a.Z)(this,e),this.validations={required:{validate:function(e){return/.*\S.*/.test(e||"")},message:function(){return"The field is required"}},email:{validate:function(e){return/\S+@\S+\.\S+/.test(e||"")},message:function(){return"The field should be an email"}},url:{validate:function(e){return/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/.test(e||"")},message:function(){return"The field should be an url: http://example.com"}},unique:{validate:function(e,t,n){return n.filter((function(n){return n[t]===e})).length<=1},message:function(e){return"".concat(e," fields can not have the same value")}},min:{validate:function(e,t){return parseFloat(e)>=parseFloat(t)},message:function(e){return"The field should be greater than ".concat(e)}},max:{validate:function(e,t){return parseFloat(e)<=parseFloat(t)},message:function(e){return"The field should be lower than ".concat(e)}},equal:{validate:function(e,t,n){return e===n},message:function(e){return e}}}}return(0,i.Z)(e,[{key:"validate",value:function(e,t){var n=this;return e.map((function(e){var r,a="";if("string"===typeof e){var i=n.validations[e];r=i.validate(t),a=i.message()}if("object"===typeof e){var o=n.validations[e.type];r=o.validate(t,e.condition,e.data),a=o.message(e.condition)}return{valid:r,error:r?null:{message:a}}}))}}]),e}(),v=function(e){(0,o.Z)(n,e);var t=(0,s.Z)(n);function n(e){var i;return(0,a.Z)(this,n),(i=t.call(this,e)).state={value:i.props.properties.default||"",valid:null,error:[]},i.validator=new m,i.triggerChange=i.triggerChange.bind((0,r.Z)(i)),i.triggerValidate=i.triggerValidate.bind((0,r.Z)(i)),i}return(0,i.Z)(n,[{key:"componentDidMount",value:function(){this.state.value&&this.state.value.length&&this.triggerValidate()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this,n=Object.prototype.hasOwnProperty.call(e.properties,"value"),r=e.properties.value!==this.state.value;n&&r&&this.setState({value:e.properties.value},(function(){t.triggerValidate()}))}},{key:"componentDidUpdate",value:function(e){var t=f()(e,["properties","validations"]),n=f()(this.props,["properties","validations"]);h()(t,n)||this.triggerValidate()}},{key:"triggerValidate",value:function(){var e,t,n=this,r=this.props.validations,a=this.state,i=a.validations,o=a.value,s=i||r,c=Array.isArray(o)?o.length>0:o;if(s&&(c||-1!==s.indexOf("required"))){var l=this.validator.validate(s,o);e=l.every((function(e){return e.valid})),t=e?[]:l.map((function(e){return e.error}))}else e=!!c||null,t=[];this.setState({valid:e,error:t},(function(){n.props.onValid&&n.props.onValid(e,t)}))}},{key:"isValid",value:function(){return this.state.valid}}]),n}(c.Component);v.propTypes={properties:u().object.isRequired,validations:u().array,onValid:u().func};var g=v},58261:function(e,t,n){var r=n(4111),a=n(51438),i=n(52951),o=n(14924),s=n(88029),c=n(26042),l=n(69396),u=n(5950),d=n(85893),h=(n(67294),n(45697)),p=n.n(h),f=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){var e;return(0,a.Z)(this,n),e=t.apply(this,arguments),(0,o.Z)((0,r.Z)(e),"state",{value:e.props.properties.default}),e}return(0,i.Z)(n,[{key:"triggerChange",value:function(e){var t=this;this.setState({value:e.currentTarget.value},(function(){t.triggerValidate(),t.props.onChange&&t.props.onChange(t.state.value)}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.properties,a=t.options,i=this.state.value;return(0,d.jsx)("div",{className:"c-radio-box ".concat(this.props.className),children:a.map((function(t){return(0,d.jsxs)("div",{className:"c-radio",children:[(0,d.jsx)("input",(0,l.Z)((0,c.Z)({},r),{type:"radio",name:n,id:"radio-".concat(n,"-").concat(t.value),value:t.value,checked:t.value===i,onChange:e.triggerChange})),(0,d.jsxs)("label",{htmlFor:"radio-".concat(n,"-").concat(t.value),children:[(0,d.jsx)("span",{}),t.label]})]},"".concat(t.value))}))})}}]),n}(n(65358).Z);f.propTypes={name:p().string.isRequired,options:p().array.isRequired,properties:p().object.isRequired,className:p().string,onChange:p().func},t.Z=f},51405:function(e,t,n){n.d(t,{ZP:function(){return j}});var r={};n.r(r),n.d(r,{fetchShortUrl:function(){return m},resetShortLinks:function(){return p},setError:function(){return h}
1,setLoading:function(){return d},setShortLinks:function(){return u}});var a,i=n(26042),o=n(16517),s=n(17638),c=n(17474),l=n(83454),u=(0,s.createAction)("SET_SHARE_SHORT_LINKS"),d=(0,s.createAction)("SET_SHARE_SHORT_LINKS_LOADING"),h=(0,s.createAction)("SET_SHARE_SHORT_LINKS_ERROR"),p=(0,s.createAction)("RESET_SHARE_SHORT_LINKS"),f=new c.Sk(l.env.NEXT_PUBLIC_BITLY_TOKEN),m=(0,s.createThunkAction)("SHARE_SHORT_URL_FETCH_DATA",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){t(d(!0)),t(h(null)),f.shorten(e.longUrl).then((function(e){var n=e.link;t(d(!1)),t(h(null)),t(u({link:n}))})).catch((function(e){t(d(!1)),t(h(e))}))}})),v=n(14924),g=n(69396),y={shortLinks:{},loading:!1,error:null},b=(a={},(0,v.Z)(a,u,(function(e,t){return(0,g.Z)((0,i.Z)({},e),{shortLinks:(0,i.Z)({},e.shortLinks,t.payload)})})),(0,v.Z)(a,d,(function(e,t){return(0,g.Z)((0,i.Z)({},e),{loading:t.payload})})),(0,v.Z)(a,h,(function(e,t){return(0,g.Z)((0,i.Z)({},e),{error:t.payload})})),(0,v.Z)(a,p,(function(){return y})),n(85893)),k=n(67294),Z=n(16938),_=n(7561),x=n(24470),S=function(e){var t=e.links,n=void 0===t?{}:t,r=e.shortLinks,a=e.resetShortLinks,o=e.analytics,s=void 0===o?{facebook:function(){},twitter:function(){},email:function(){},copy:function(){}}:o,c=(0,k.useRef)({}),l=(0,k.useState)({}),u=l[0],d=l[1];(0,k.useEffect)((function(){return n.link,function(){a()}}),[n.link,a]);var h=function(e){c.current[e].select();try{document.execCommand("copy"),d((0,g.Z)((0,i.Z)({},u),(0,v.Z)({},e,!0))),s.copy(e),setTimeout((function(){d((0,g.Z)((0,i.Z)({},u),(0,v.Z)({},e,!1)))}),1e3)}catch(t){Z.Rt.warning("Oops, unable to copy")}},p=(0,x.$G)(["modals","common"]).t;return(0,b.jsxs)("div",{className:"c-share-modal",children:[(0,b.jsx)("h2",{children:p("modals:share_modal.Share")}),(0,b.jsx)("div",{className:"share-content",children:Object.keys(n).map((function(e){var t="share-".concat(e),a=r&&r[e]||n[e];switch(e){case"link":return(0,b.jsxs)("div",{className:"c-field",children:[(0,b.jsx)("label",{htmlFor:t,children:p("modals:share_modal.public_url")}),(0,b.jsxs)("div",{className:"share-input-container",children:[(0,b.jsx)("input",{ref:function(t){return c.current[e]=t},id:t,name:t,className:"share-input",value:a,readOnly:!0}),(0,b.jsxs)("div",{className:"share-buttons",children:[(0,b.jsx)("a",{className:"c-btn -secondary -compressed -square",href:"mailto:?subject=Shared from AgriAdapt&body= I thought you'd be interested in what I found on AgriAdapt: ".concat(a),onClick:function(){return s.email(e)},children:(0,b.jsx)(_.Z,{name:"icon-email",className:"-small"})}),(0,b.jsx)("a",{className:"c-btn -secondary -compressed -square",href:"http://www.facebook.com/sharer/sharer.php?u=".concat(a),target:"_blank",rel:"noopener noreferrer",onClick:function(){return s.facebook(e)},children:(0,b.jsx)(_.Z,{name:"icon-facebook",className:"-small"})}),(0,b.jsx)("a",{className:"c-btn -secondary -compressed -square",href:"https://twitter.com/share?url=".concat(a,"&text=").concat(encodeURIComponent(document.title)),target:"_blank",rel:"noopener noreferrer",onClick:function(){return s.twitter(e)},children:(0,b.jsx)(_.Z,{name:"icon-twitter",className:"-small"})}),(0,b.jsx)("a",{className:"c-btn -secondary -compressed",tabIndex:0,role:"button",onClick:function(){return h(e)},children:u[e]?p("modals:share_modal.copied"):p("modals:share_modal.copy_link")})]})]})]},e);case"embed":return(0,b.jsxs)("div",{className:"c-field",children:[(0,b.jsx)("label",{htmlFor:t,children:p("modals:share_modal.code_to_embed")}),(0,b.jsxs)("div",{className:"share-input-container",children:[(0,b.jsx)("input",{ref:function(t){return c.current[e]=t},id:t,name:t,className:"share-input",value:'<iframe src="'.concat(a,'" width="100%" height="500px" frameBorder="0" />'),readOnly:!0}),(0,b.jsx)("div",{className:"share-buttons",children:(0,b.jsx)("a",{className:"c-btn -secondary -compressed",tabIndex:0,role:"button",onClick:function(){return h(e)},children:u[e]?p("modals:share_modal.copied"):p("modals:share_modal.copy_link")})})]})]},e);default:return null}}))})]})},j=(0,o.connect)((function(e){return(0,i.Z)({},e.shareModal)}),r)(S)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.