index of
/
home
/
thefkyzp
/
www
/
wp-content
/
plugins
/
forminator
/
addons
/
pro
/
gutenberg
/
js
/
File: /home/thefkyzp/www/wp-content/plugins/forminator/addons/pro/gutenberg/js/quizzes-block.min.js
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}({2:function(module,exports){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(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}function _inherits(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)}var _createClass=function(){function e(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,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),__=wp.i18n.__,registerBlockType=wp.blocks.registerBlockType,Component=wp.element.Component,BlockEdit=function(_Component){function BlockEdit(){_classCallCheck(this,BlockEdit);var e=_possibleConstructorReturn(this,(BlockEdit.__proto__||Object.getPrototypeOf(BlockEdit)).apply(this,arguments));return e.update_id=e.update_id.bind(e),e.preview=e.preview.bind(e),e.state={loading:!1,markup:"",type:""},e}return _inherits(BlockEdit,_Component),_createClass(BlockEdit,[{key:"update_id",value:function(e){this.props.setAttributes({module_id:e})}},{key:"preview",value:function preview(attributes){var _this2=this,module_id=attributes.module_id;if(!this.state.loading){this.setState({loading:!0});var ajax_url=wpApiSettings.root+"forminator/v1/preview/quizzes/?module_id="+module_id;window.fetch(ajax_url).then(function(e){return e.json()}).then(function(data){data.success&&_this2.setState({markup:data.data.markup,type:data.data.type}),setTimeout(function(){window.jQuery("form.forminator-quiz-"+module_id).parent().find("script").each(function(){eval(jQuery(this).text())})},10),_this2.setState({loading:!1})}).catch(function(e){return{success:!1}})}}},{key:"componentDidMount",value:function(){var e=this.props.attributes;e.module_id&&this.preview(e)}},{key:"componentDidUpdate",value:function(e){var t=this.props.attributes;if(e.attributes.module_id!==t.module_id)return t.module_id?void this.preview(t):void this.setState({markup:"",type:""})}},{key:"update_alignment",value:function(e){this.props.setAttributes({alignment:e})}},{key:"open_settings",value:function(e,t){var n="";"knowledge"===t&&(n=frmnt_quiz_data.admin_url+"?page=forminator-knowledge-wizard&id="+e),"nowrong"===t&&(n=frmnt_quiz_data.admin_url+"?page=forminator-nowrong-wizard&id="+e),n&&(window.location.href=n)}},{key:"render",value:function(){var e=this,t=this.state,n=t.loading,o=t.markup,r=t.type,i=this.props,l=i.attributes,a=(i.setAttributes,i.isSelected),u=l.module_id,s=l.alignment,c=function(t){return e.update_id(t.target.value)},p=function(t){return e.update_alignment(t.target)},m=function(t){return e.open_settings(u,r)},d=frmnt_quiz_data.forms,f=[a&&wp.element.createElement(wp.blockEditor.InspectorControls,{key:"inspector"},wp.element.createElement(wp.components.SelectControl,{label:frmnt_quiz_data.l10n.choose_poll,value:u,options:d,onChange:this.update_id})),wp.element.createElement(wp.blockEditor.BlockControls,{key:"controls"},wp.element.createElement(wp.blockEditor.BlockAlignmentToolbar,{value:s,onChange:p}),!!u&&wp.element.createElement(wp.components.Toolbar,null,wp.element.createElement(wp.components.Button,{className:"components-toolbar__control",label:frmnt_quiz_data.l10n.customize_quiz,icon:"edit",onClick:m})))];return n?[f,wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(wp.components.Spinner,null),wp.element.createElement("span",null,frmnt_quiz_data.l10n.rendering))]:o?[f,wp.element.createElement(wp.element.RawHTML,{key:"markup"},o)]:[f,wp.element.createElement(wp.components.Placeholder,{key:"placeholder",className:"wp-block-embed"},wp.element.createElement("div",{className:"forminator-quizzes--placeholder",style:{margin:"0 auto 20px",lineHeight:"21px"}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"16",viewBox:"0 0 21 19",style:{verticalAlign:"middle",fill:"#444444"}},wp.element.createElement("path",{fillRule:"evenodd",d:"M13.5451769,1.48693014 L12.356375,0.277549982 L12.356375,0.277370522 C12.1589668,0.0776914902 11.8400315,0.0778709501 11.644035,0.277549982 L3.85388279,8.20010569 C3.75915623,8.29591605 3.70603717,8.42627017 3.70635606,8.5621361 C3.70635606,8.69900417 3.75882569,8.82773673 3.85388279,8.9241665 L5.04274349,10.1335467 C5.13711698,10.2296063 5.26521317,10.2835046 5.39873701,10.2833358 C5.53236272,10.2835841 5.66057917,10.2296798 5.75502464,10.1335467 L13.5451769,2.21099096 C13.7415263,2.01125211 13.7415263,1.68660918 13.5451769,1.48693014 Z M19.9111198,2.79064639 L18.7219062,1.58144568 C18.5259097,1.38176665 18.2059744,1.38176665 18.0099779,1.58144568 L7.67751904,12.0887621 C7.48116967,12.2884411 7.48116967,12.6132635 7.67751904,12.8129426 L8.86673268,14.0221433 C8.96108128,14.1182263 9.08920386,14.1720926 9.22272619,14.1718128 C9.35154738,14.1718128 9.48066267,14.1219828 9.57860207,14.0221433 L19.9111786,3.51464738 C20.107175,3.31514781 20.107175,2.99050488 19.9111786,2.79064639 L19.9111198,2.79064639 Z M3.06548538,12.612127 C2.98066339,12.5261058 2.86166556,12.4904532 2.74331477,12.5197649 C2.62715849,12.547545 2.53376958,12.6351195 2.49714279,12.7506102 L1.44463254,16.0325725 C1.4040862,16.157297 1.43633413,16.2946136 1.52792514,16.3872451 C1.61898925,16.4804231 1.75399238,16.5133047 1.8766835,16.4721894 L5.10438943,15.4017112 L5.10438943,15.4015318 C5.21787953,15.3643255 5.30393376,15.2694133 5.33120882,15.1513647 C5.35929029,15.0334893 5.32470763,14.9092629 5.24003401,14.8238504 L3.0655442,12.612127 L3.06548538,12.612127 Z M17.695866,8.01897085 L15.7484897,9.99937049 C15.6760825,10.0726186 15.6280511,10.1670889 15.6111393,10.2695174 C15.0349145,13.5837826 12.2153188,15.9893825 8.9066143,15.9893825 C8.57691443,15.9893825 8.24156759,15.9616859 7.8819859,15.9048569 C7.72563581,15.8795531 7.56110939,15.932733 7.44834674,16.0474079 L6.57312739,16.9374093 C6.44265917,17.0702694 6.39448358,17.2575657 6.4443062,17.4387604 C6.49412882,17.6202541 6.63147926,17.7552678 6.81141716,17.7999533 C7.49733836,17.9696708 8.20074162,18.0554422 8.90667313,18.0554444 C13.7857019,18.0554444 17.7552179,14.0187933 17.7552179,9.05702664 C17.7552179,8.85148525 17.7407476,8.64947324 17.7263949,8.44764069 L17.695866,8.01897085 Z M9.61448377,0.0884590833 L7.51793371,2.21888719 C7.44475857,2.29126935 7.34123105,2.32052131 7.24046817,2.34474839 C4.51304725,3.00085373 2.15938423,5.57323172 2.09544422,8.80231324 C2.0888561,9.13754431 2.08991491,9.46948527 2.13950224,9.83612182 C2.16161948,9.99554201 2.10650284,10.1619013 1.99179905,10.2746021 L1.1014035,11.1488709 C0.968464742,11.2792784 0.812291115,11.3312021 0.606236044,11.2711429 C0.400180972,11.2110836 0.288594769,11.06943 0.247830806,10.8857229 C0.0931277404,10.1871454 0.0364817131,9.46787013 0.065481185,8.73860498 C0.262948177,3.78144441 4.17987685,0.158448438 8.70673559,0.0590276622 C8.90884956,0.0546009851 8.93349617,0.0510117874 9.13172785,0.0691970557 L9.61454259,0.0884590833 L9.61448377,0.0884590833 Z"})),wp.element.createElement("strong",{style:{verticalAlign:"middle",marginLeft:10,color:"#444444",fontSize:13,letterSpacing:"-0.25px"}},frmnt_quiz_data.l10n.choose_quiz)),wp.element.createElement("form",null,wp.element.createElement("select",{value:u,onChange:c,style:{margin:"0 auto"}},d.map(function(e){return wp.element.createElement("option",{key:e.value,value:e.value},e.label)}))))]}}]),BlockEdit}(Component);registerBlockType("forminator/quizzes",{title:frmnt_quiz_data.l10n.quiz,description:frmnt_quiz_data.l10n.quiz_description,icon:function(){return wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"19",viewBox:"0 0 21 19"},wp.element.createElement("path",{fillRule:"evenodd",d:"M13.5451769,1.48693014 L12.356375,0.277549982 L12.356375,0.277370522 C12.1589668,0.0776914902 11.8400315,0.0778709501 11.644035,0.277549982 L3.85388279,8.20010569 C3.75915623,8.29591605 3.70603717,8.42627017 3.70635606,8.5621361 C3.70635606,8.69900417 3.75882569,8.82773673 3.85388279,8.9241665 L5.04274349,10.1335467 C5.13711698,10.2296063 5.26521317,10.2835046 5.39873701,10.2833358 C5.53236272,10.2835841 5.66057917,10.2296798 5.75502464,10.1335467 L13.5451769,2.21099096 C13.7415263,2.01125211 13.7415263,1.68660918 13.5451769,1.48693014 Z M19.9111198,2.79064639 L18.7219062,1.58144568 C18.5259097,1.38176665 18.2059744,1.38176665 18.0099779,1.58144568 L7.67751904,12.0887621 C7.48116967,12.2884411 7.48116967,12.6132635 7.67751904,12.8129426 L8.86673268,14.0221433 C8.96108128,14.1182263 9.08920386,14.1720926 9.22272619,14.1718128 C9.35154738,14.1718128 9.48066267,14.1219828 9.57860207,14.0221433 L19.9111786,3.51464738 C20.107175,3.31514781 20.107175,2.99050488 19.9111786,2.79064639 L19.9111198,2.79064639 Z M3.06548538,12.612127 C2.98066339,12.5261058 2.86166556,12.4904532 2.74331477,12.5197649 C2.62715849,12.547545 2.53376958,12.6351195 2.49714279,12.7506102 L1.44463254,16.0325725 C1.4040862,16.157297 1.43633413,16.2946136 1.52792514,16.3872451 C1.61898925,16.4804231 1.75399238,16.5133047 1.8766835,16.4721894 L5.10438943,15.4017112 L5.10438943,15.4015318 C5.21787953,15.3643255 5.30393376,15.2694133 5.33120882,15.1513647 C5.35929029,15.0334893 5.32470763,14.9092629 5.24003401,14.8238504 L3.0655442,12.612127 L3.06548538,12.612127 Z M17.695866,8.01897085 L15.7484897,9.99937049 C15.6760825,10.0726186 15.6280511,10.1670889 15.6111393,10.2695174 C15.0349145,13.5837826 12.2153188,15.9893825 8.9066143,15.9893825 C8.57691443,15.9893825 8.24156759,15.9616859 7.8819859,15.9048569 C7.72563581,15.8795531 7.56110939,15.932733 7.44834674,16.0474079 L6.57312739,16.9374093 C6.44265917,17.0702694 6.39448358,17.2575657 6.4443062,17.4387604 C6.49412882,17.6202541 6.63147926,17.7552678 6.81141716,17.7999533 C7.49733836,17.9696708 8.20074162,18.0554422 8.90667313,18.0554444 C13.7857019,18.0554444 17.7552179,14.0187933 17.7552179,9.05702664 C17.7552179,8.85148525 17.7407476,8.64947324 17.7263949,8.44764069 L17.695866,8.01897085 Z M9.61448377,0.0884590833 L7.51793371,2.21888719 C7.44475857,2.29126935 7.34123105,2.32052131 7.24046817,2.34474839 C4.51304725,3.00085373 2.15938423,5.57323172 2.09544422,8.80231324 C2.0888561,9.13754431 2.08991491,9.46948527 2.13950224,9.83612182 C2.16161948,9.99554201 2.10650284,10.1619013 1.99179905,10.2746021 L1.1014035,11.1488709 C0.968464742,11.2792784 0.812291115,11.3312021 0.606236044,11.2711429 C0.400180972,11.2110836 0.288594769,11.06943 0.247830806,10.8857229 C0.0931277404,10.1871454 0.0364817131,9.46787013 0.065481185,8.73860498 C0.262948177,3.78144441 4.17987685,0.158448438 8.70673559,0.0590276622 C8.90884956,0.0546009851 8.93349617,0.0510117874 9.13172785,0.0691970557 L9.61454259,0.0884590833 L9.61448377,0.0884590833 Z"}))},category:"embed",attributes:{module_id:{type:"string"},alignment:{type:"string",default:"none"}},supports:{customClassName:!1,className:!1,html:!1},transforms:{from:[{type:"shortcode",tag:["forminator_quiz"],attributes:{module_id:{type:"string",shortcode:function(e){return e.named.id}}}}]},edit:BlockEdit,save:function(e){var t=e.attributes,n=t.module_id;return n?wp.element.createElement("div",{class:"forminator-guttenberg"},'[forminator_quiz id="',n,'"]'):null}})}});