@kbss-cvut/s-forms 0.7.1-beta-b00a1cf.0 → 0.7.1-beta-c22f5eb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/components/Answer.d.ts +13 -13
  2. package/dist/components/DefaultInput.d.ts +39 -39
  3. package/dist/components/FormManager.d.ts +23 -23
  4. package/dist/components/FormWindow.d.ts +3 -3
  5. package/dist/components/HelpIcon.d.ts +20 -20
  6. package/dist/components/IconOverlay.d.ts +17 -17
  7. package/dist/components/LinkIcon.d.ts +20 -20
  8. package/dist/components/MaskedInput.d.ts +41 -42
  9. package/dist/components/MediaContent.d.ts +5 -6
  10. package/dist/components/PrefixIcon.d.ts +21 -21
  11. package/dist/components/Question.d.ts +86 -86
  12. package/dist/components/QuestionStatic.d.ts +9 -9
  13. package/dist/components/SForms.d.ts +3 -3
  14. package/dist/components/answer/CheckboxAnswer.d.ts +23 -23
  15. package/dist/components/answer/DateTimeAnswer.d.ts +12 -12
  16. package/dist/components/answer/InputAnswer.d.ts +25 -25
  17. package/dist/components/answer/MaskedInputAnswer.d.ts +13 -13
  18. package/dist/components/answer/SelectAnswer.d.ts +27 -27
  19. package/dist/components/answer/TypeaheadAnswer.d.ts +13 -13
  20. package/dist/components/comment/CommentForm.d.ts +8 -8
  21. package/dist/components/comment/CommentList.d.ts +6 -7
  22. package/dist/components/comment/CommentView.d.ts +13 -13
  23. package/dist/components/comment/QuestionCommentIcon.d.ts +9 -9
  24. package/dist/components/wizard/HorizontalWizardNav.d.ts +14 -14
  25. package/dist/components/wizard/VerticalWizardNav.d.ts +14 -14
  26. package/dist/components/wizard/Wizard.d.ts +2 -2
  27. package/dist/components/wizard/WizardStep.d.ts +25 -25
  28. package/dist/constants/Constants.d.ts +127 -127
  29. package/dist/contexts/ConfigurationContext.d.ts +15 -15
  30. package/dist/contexts/FormGenContext.d.ts +13 -13
  31. package/dist/contexts/FormQuestionsContext.d.ts +12 -12
  32. package/dist/contexts/IntlContextProvider.d.ts +8 -8
  33. package/dist/model/DefaultFormGenerator.d.ts +8 -8
  34. package/dist/model/FormGenerator.d.ts +20 -20
  35. package/dist/model/QuestionAnswerProcessor.d.ts +44 -44
  36. package/dist/model/ValidatorFactory.d.ts +5 -5
  37. package/dist/s-forms.cjs +1 -1
  38. package/dist/s-forms.cjs.map +1 -1
  39. package/dist/s-forms.d.ts +16 -16
  40. package/dist/s-forms.js +1 -1
  41. package/dist/s-forms.js.map +1 -1
  42. package/dist/s-forms.modern.js +1 -1
  43. package/dist/s-forms.modern.js.map +1 -1
  44. package/dist/s-forms.umd.js +1 -1
  45. package/dist/s-forms.umd.js.map +1 -1
  46. package/dist/stories/Answer.stories.d.ts +12 -12
  47. package/dist/stories/CommentForm.stories.d.ts +3 -3
  48. package/dist/stories/HelpIcon.stories.d.ts +4 -4
  49. package/dist/stories/LinkIcon.stories.d.ts +3 -3
  50. package/dist/stories/PrefixIcon.stories.d.ts +3 -3
  51. package/dist/stories/Question.stories.d.ts +11 -11
  52. package/dist/stories/QuestionCommentIcon.stories.d.ts +4 -4
  53. package/dist/stories/SForms.stories.d.ts +8 -8
  54. package/dist/styles/icons/ArrowRight.d.ts +2 -2
  55. package/dist/styles/icons/CaretSquareDown.d.ts +4 -4
  56. package/dist/styles/icons/CaretSquareUp.d.ts +4 -4
  57. package/dist/styles/icons/Close.d.ts +2 -2
  58. package/dist/styles/icons/CommentBubble.d.ts +2 -2
  59. package/dist/styles/icons/ExternalLink.d.ts +2 -2
  60. package/dist/styles/icons/InfoCircle.d.ts +2 -2
  61. package/dist/styles/icons/QuestionCircle.d.ts +2 -2
  62. package/dist/styles/icons/RecycleBin.d.ts +2 -2
  63. package/dist/styles/icons/index.d.ts +4 -4
  64. package/dist/util/FormUtils.d.ts +40 -40
  65. package/dist/util/JsonLdFramingUtils.d.ts +16 -16
  66. package/dist/util/JsonLdObjectMap.d.ts +5 -5
  67. package/dist/util/JsonLdObjectUtils.d.ts +32 -32
  68. package/dist/util/Logger.d.ts +5 -5
  69. package/dist/util/MaskMapper.d.ts +12 -12
  70. package/dist/util/Utils.d.ts +15 -15
  71. package/package.json +5 -6
  72. package/dist/components/answer/OptimizedMenuList.d.ts +0 -5
package/dist/s-forms.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export default SForms;
2
- import SForms from "./components/SForms";
3
- import Constants from "./constants/Constants";
4
- import JsonLdObjectUtils from "./util/JsonLdObjectUtils";
5
- import JsonLdFramingUtils from "./util/JsonLdFramingUtils";
6
- import JsonLdObjectMap from "./util/JsonLdObjectMap";
7
- import FormUtils from "./util/FormUtils";
8
- import Question from "./components/Question";
9
- import Answer from "./components/Answer";
10
- import HelpIcon from "./components/HelpIcon";
11
- import { ConfigurationContext } from "./contexts/ConfigurationContext";
12
- import { FormQuestionsContext } from "./contexts/FormQuestionsContext";
13
- import WizardStep from "./components/wizard/WizardStep";
14
- import QuestionStatic from "./components/QuestionStatic";
15
- import IntlContextProvider from "./contexts/IntlContextProvider.js";
16
- export { Constants, JsonLdObjectUtils, JsonLdFramingUtils, JsonLdObjectMap, FormUtils, Question, Answer, HelpIcon, ConfigurationContext, FormQuestionsContext, WizardStep, QuestionStatic, IntlContextProvider };
1
+ export default SForms;
2
+ import SForms from "./components/SForms";
3
+ import Constants from "./constants/Constants";
4
+ import JsonLdObjectUtils from "./util/JsonLdObjectUtils";
5
+ import JsonLdFramingUtils from "./util/JsonLdFramingUtils";
6
+ import JsonLdObjectMap from "./util/JsonLdObjectMap";
7
+ import FormUtils from "./util/FormUtils";
8
+ import Question from "./components/Question";
9
+ import Answer from "./components/Answer";
10
+ import HelpIcon from "./components/HelpIcon";
11
+ import { ConfigurationContext } from "./contexts/ConfigurationContext";
12
+ import { FormQuestionsContext } from "./contexts/FormQuestionsContext";
13
+ import WizardStep from "./components/wizard/WizardStep";
14
+ import QuestionStatic from "./components/QuestionStatic";
15
+ import IntlContextProvider from "./contexts/IntlContextProvider.js";
16
+ export { Constants, JsonLdObjectUtils, JsonLdFramingUtils, JsonLdObjectMap, FormUtils, Question, Answer, HelpIcon, ConfigurationContext, FormQuestionsContext, WizardStep, QuestionStatic, IntlContextProvider };
package/dist/s-forms.js CHANGED
@@ -1,2 +1,2 @@
1
- import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.some.js";import e,{useMemo as t,useState as n,useEffect as o,useContext as r,useRef as i,forwardRef as s}from"react";import a from"prop-types";import"core-js/modules/es.object.assign.js";import l from"jsonld";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.map.js";import u from"jsonld-utils";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/web.dom-collections.for-each.js";import c from"tsort";import"core-js/modules/es.number.max-safe-integer.js";import"core-js/modules/es.number.constructor.js";import p from"react-dom";import{Form as m,FormGroup as d,FormControl as h,FormText as f,OverlayTrigger as E,Tooltip as v,Col as g,Row as S,Button as A,Badge as _,Overlay as C,Popover as T,ListGroup as N,ListGroupItem as O,Card as I,Accordion as y,ButtonToolbar as w,Nav as b,NavItem as L,NavLink as R,Modal as H}from"react-bootstrap";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.every.js";import"core-js/modules/es.array.is-array.js";import"core-js/modules/es.array.find-index.js";import"core-js/modules/es.date.to-string.js";import D from"react-datepicker";import{format as V}from"date-fns";import"core-js/modules/es.object.get-own-property-names.js";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.slice.js";import U from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import"core-js/modules/web.timers.js";import x from"inputmask-core";import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.function.name.js";import j,{components as M}from"react-select";import{FixedSizeList as P}from"react-window";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.date.now.js";import"core-js/modules/es.array.splice.js";import{jsx as q,jsxs as Q}from"react/jsx-runtime";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.parse-int.js";import F from"javascript-time-ago";import z from"javascript-time-ago/locale/en";import k from"javascript-time-ago/locale/cs";import{motion as B}from"framer-motion";import{Rings as W}from"react-loader-spinner";import"core-js/modules/es.string.trim.js";import{useIntl as X,IntlProvider as G}from"react-intl";import Y from"classnames";import J from"react-bootstrap/Card";function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K.apply(this,arguments)}function Z(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$(e,t)}function ee(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ne(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return te(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)?te(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var oe,re=/*#__PURE__*/function(){function e(){}return e.log=function(e){console.log(e)},e.warn=function(e){console.warn?console.warn(e):console.log("WARNING: "+e)},e.error=function(e){console.error?console.error(e):console.log("ERROR: "+e)},e}(),ie=["children"],se=/*#__PURE__*/e.createContext({}),ae=function(n){var o=n.children,r=ee(n,ie),i=[],s=function(e,t){try{var n=i[e];return n&&n.length?Promise.resolve(n):Promise.resolve(r.fetchTypeAheadValues(t)).then(function(t){return t.length?new Promise(function(n){l.frame(t,{},null,function(t,o){var r,s=o["@graph"];return i.push(Object.assign({},s,((r={})[e]=s,r))),n(s)})}):(re.warn("No data received when loading options using id "+e),[])})}catch(e){return Promise.reject(e)}},a=function(e){return i[e]||[]},u=t(function(){return{loadFormOptions:s,getOptions:a}},[s,a]);/*#__PURE__*/return e.createElement(se.Provider,K({value:u},r),o)};ae.propTypes={children:a.element.isRequired,fetchTypeAheadValues:a.func};var le=function(){};oe=le,le.COLUMN_COUNT=12,le.INPUT_LENGTH_THRESHOLD=50,le.DATETIME_NUMBER_FORMAT="x",le.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",le.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",le.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",le.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",le.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",le.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",le.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",le.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",le.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",le.LAYOUT={FORM:"form",QUESTION_SECTION:"section",WIZARD_STEP:"wizard-step",DATE:"date",TIME:"time",DATETIME:"datetime",TEXT:"text",TEXTAREA:"textarea",CHECKBOX:"checkbox",QUESTION_TYPEAHEAD:"type-ahead",MASKED_INPUT:"masked-input",ANSWERABLE:"answerable",SPARQL:"sparql",TURTLE:"ttl",DISABLED:"disabled",HIDDEN:"hidden",COLLAPSED:"collapsed",EMPHASISED:"emphasised",EMPHASISE_ON_RELEVANT:"emphasise-on-relevant",CATEGORY:["category-1","category-2","category-3","category-4","category-5"]},le.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",le.VALUE_TYPE_CODE="code",le.VALUE_TYPE_TEXT="text",le.GENERATED_ROW_SIZE=1,le.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",le.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",le.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",le.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",le.HELP_DESCRIPTION="http://purl.org/dc/elements/1.1/description",le.SOURCE="http://purl.org/dc/elements/1.1/source",le.XSD={MAX_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxExclusive",MAX_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxInclusive",MIN_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#minExclusive",MIN_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#minInclusive",INT:"http://www.w3.org/2001/XMLSchema#int",INTEGER:"http://www.w3.org/2001/XMLSchema#integer",NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#negativeInteger",NON_NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",NON_POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#positiveInteger",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},le.STEP="http://onto.fel.cvut.cz/ontologies/form/step",le.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",le.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",le.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",le.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",le.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",le.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",le.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",le.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",le.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",le.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",le.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",le.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",le.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",le.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",le.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",le.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",le.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",le.REQUIRES_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/requires-answer-value",le.REQUIRES_DESCRIPTION="http://onto.fel.cvut.cz/ontologies/form/requires-description",le.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",le.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",le.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",le.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",le.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",le.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",le.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",le.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",le.PREFIX="http://www.w3.org/ns/shacl#prefix",le.NAMESPACE="http://www.w3.org/ns/shacl#namespace",le.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",le.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",le.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",le.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",le.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",le.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",le.RDFS_LABEL=u.RDFS_LABEL,le.RDFS_COMMENT=u.RDFS_COMMENT,le.DEFAULT_HAS_CHILD=u.DEFAULT_HAS_CHILD,le.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink"},le.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},le.DEFAULT_OPTIONS={icons:[{id:oe.ICONS.QUESTION_HELP,behavior:oe.ICON_BEHAVIOR.ENABLE},{id:oe.ICONS.QUESTION_COMMENTS,behavior:oe.ICON_BEHAVIOR.ON_HOVER},{id:oe.ICONS.QUESTION_LINK,behavior:oe.ICON_BEHAVIOR.ON_HOVER}]},le.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}};var ue=/*#__PURE__*/function(){function e(){}return e.getStringHash=function(e){var t=0,n=e?e.length:0;if(0===n)return t;for(var o=0;o<n;o++)t=(t<<5)-t+e.charCodeAt(o),t&=t;return t},e.asArray=function(e){return e?e.constructor===Array?e:[e]:[]},e.findQuestionById=function(t,n,o,r,i){if(o&&n["@id"]===t)return n;var s=e.asArray(n[le.HAS_SUBQUESTION]);if(r)for(var a,l=ne(s);!(a=l()).done;){var u=e.findQuestionById(t,a.value,!0,!1,!1);if(u)return u}if(i)for(var c,p=ne(s);!(c=p()).done;){var m=e.findQuestionById(t,c.value,!1,!0,!0);if(m)return m}return null},e}(),ce=/*#__PURE__*/function(){function e(){}return e.putObject=function(t,n){e.objectMap[t]=n},e.getObject=function(t){return e.objectMap[t]},e}();ce.objectMap={};var pe=/*#__PURE__*/function(){function e(){}return e.getFirstObject=function(e,t){var n=l.getValues(e,t);return 0===n.length?null:n[0]},e.compareValues=function(e,t){return t="object"==typeof t?t:{"@value":t},!!((e="object"==typeof e?e:{"@value":e})&&e["@value"]&&t&&t["@value"]&&("string"==typeof e["@value"]?e["@value"]:JSON.stringify(e["@value"]))===("string"==typeof t["@value"]?t["@value"]:JSON.stringify(t["@value"])))||l.compareValues(e,t)},e.toplogicalSort=function(e,t){var n;do{n=!1;for(var o=0;o<e.length;o++)for(var r=o;r<e.length;r++)if(e[o][t]&&("object"==typeof e[o][t]?e[o][t]["@id"]:e[o][t])===e[r]["@id"]){var i=e[o];e[o]=e[r],e[r]=i,n=!0;break}}while(n);return e},e.orderPreservingToplogicalSort=function(e,t){for(var n=c(),o={},r=function(){var r=e[i]["@id"];n.add(r),o[r]=e[i],ue.asArray(e[i][t]).map(function(e){return"object"==typeof e?e["@id"]:e}).map(function(e){return[e,r]}).forEach(function(e){return n.add(e)})},i=0;i<e.length;i++)r();for(var s=n.sort(),a=0;a<s.length;a++)e[a]=o[s[a]];return e},e.getCompareLocalizedLabelFunction=function(e){return function(t,n){var o=u.getLocalized(t[u.RDFS_LABEL],e),r=u.getLocalized(n[u.RDFS_LABEL],e);return o<r?-1:o>r?1:0}},e.orderByLocalizedLabels=function(t,n){return t.sort(e.getCompareLocalizedLabelFunction(n))},e.checkId=function(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(function(e){return e["@id"]===t}):e.constructor===Object?e["@id"]===t:void 0},e}(),me=/*#__PURE__*/function(){function e(){}return e.isForm=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.FORM)},e.isWizardStep=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.WIZARD_STEP)},e.isSection=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.QUESTION_SECTION)},e.isAnswerable=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.ANSWERABLE)},e.isTypeahead=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.QUESTION_TYPEAHEAD)},e.getPossibleValuesQuery=function(e){return u.getJsonAttValue(e,le.HAS_OPTIONS_QUERY)},e.isDisabled=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.DISABLED)},e.isHidden=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.HIDDEN)},e.isTextarea=function(t,n){return n&&n.length>le.INPUT_LENGTH_THRESHOLD&&!e.isTypeahead(t)||u.hasValue(t,le.LAYOUT_CLASS,le.LAYOUT.TEXTAREA)},e.isText=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.TEXT)},e.isCalendar=function(t){return e.isDate(t)||e.isTime(t)||e.isDateTime(t)},e.isDate=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.DATE)},e.isTime=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.TIME)},e.isDateTime=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.DATETIME)},e.isCheckbox=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.CHECKBOX)},e.isMaskedInput=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.MASKED_INPUT)},e.isSparqlInput=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.SPARQL)},e.isTurtleInput=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.TURTLE)},e.isCollapsed=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.COLLAPSED)},e.isEmphasised=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.EMPHASISED)},e.getCategory=function(e){return le.LAYOUT.CATEGORY.find(function(t){return u.hasValue(e,le.LAYOUT_CLASS,t)})},e.resolveValue=function(e){return e?e[le.HAS_OBJECT_VALUE]?e[le.HAS_OBJECT_VALUE]["@id"]:u.getJsonAttValue(e,le.HAS_DATA_VALUE):null},e.resolveValueObject=function(e){return e?e[le.HAS_OBJECT_VALUE]?ue.asArray(e[le.HAS_OBJECT_VALUE])[0]:e[le.HAS_DATA_VALUE]?ue.asArray(e[le.HAS_DATA_VALUE])[0]:null:null},e.isRelevant=function(t){if(!t[le.IS_RELEVANT_IF])return!0;for(var n,o=ne(ue.asArray(t[le.IS_RELEVANT_IF]));!(n=o()).done;)if(!e.testCondition(n.value))return!1;return!0},e.hasValidationLogic=function(e){return!!e[le.REQUIRES_ANSWER_VALUE]||!!e[le.REQUIRES_ANSWER]||!!e[le.REQUIRES_ANSWER_IF]},e.isValid=function(e){if(!1===e[le.HAS_VALID_ANSWER])return!1;for(var t,n=ne(ue.asArray(e[le.HAS_SUBQUESTION]));!(t=n()).done;)if(!1===this.isValid(t.value))return!1;return!0},e.testOrCondition=function(e){var t=e[le.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(var n,o=ne(this._getMappedObjectsArray(t));!(n=o()).done;)if(this.testCondition(n.value))return!0;return!1},e.testCondition=function(t){var n,o=t[le.ACCEPTS_VALIDATION_VALUE],r=t[le.ACCEPTS_ANSWER_VALUE],i=t[le.ACCEPTS],s=t[le.HAS_TESTED_QUESTION];if(t[le.HAS_SUB_CONDITION])return this.testOrCondition(t);if(o&&r&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),i&&s){var a=ue.asArray(i);if(1!==a.length&&console.warn("Support for multiple accepts values is not implemented !"),a[0]["@id"]===le.ANSWERED_QUESTION){(r||o)&&console.warn("Support for accepted answer/validations values is not implemented !");for(var u,c=ne(this._getMappedObjectsArray(s));!(u=c()).done;)if(!this.hasAnswer(u.value))return!1;return!0}console.warn("No support to accept question of type "+a[0]["@id"]+" !")}if(o&&s){var p=ue.asArray(o);(1!==p.length||!0!==p[0]&&"true"!==p[0])&&console.warn('Validation values other than "true" are not implemented !');for(var m,d=ne(ue.asArray(s));!(m=d()).done;){if(void 0===(n=ce.getObject(m.value["@id"])))return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(n))return!1}return!0}if(r&&s){n=ce.getObject(s["@id"]);for(var h,f=ne(ue.asArray(r));!(h=f()).done;){var E=h.value;if(!n)return console.warn("Question is not defined."),!0;if(!n.hasOwnProperty(le.HAS_ANSWER))return!1;var v=l.getValues(n,le.HAS_ANSWER);if(0===v.length)return!1;var g=e.resolveValueObject(v[0]);if(g&&E&&g.hasOwnProperty("@value")&&E.hasOwnProperty("@id")&&g["@value"]==E["@id"])return!0;if(pe.compareValues(g,E))return!0}}return!1},e._getMappedObjectsArray=function(e,t){return ue.asArray(e).map(function(e){var n=ce.getObject(e["@id"]);return void 0===n?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):n}).filter(function(e){return null!==e})},e.hasAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(le.HAS_ANSWER)){var n=l.getValues(t,le.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return!0}}for(var r,i=ne(ue.asArray(t[le.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasAnswer(r.value))return!0;return!1},e.resolveDateTimeFormat=function(t,n,o){return"number"==typeof n?le.DATETIME_NUMBER_FORMAT:e.isDate(t)?o.dateFormat:e.isTime(t)?o.timeFormat:o.dateTimeFormat},e}(),de={},he=[],fe=/*#__PURE__*/e.createContext({}),Ee=function(r){var i=n(r.data||de),s=i[0],a=i[1],l=n(r.formQuestions||he),u=l[0],c=l[1];o(function(){if(r.isFormValid){var e=me.isValid(s);r.isFormValid(e)}},[]),o(function(){a(r.data||de),c(r.formQuestions||he)},[r.data,r.formQuestions]);var p=function(e){e&&a(Object.assign({},s,e))},m=function(e,t){if(!(!t||e<0||e>=u.length)){var n=[].concat(u);if(n[e]=Object.assign({},n[e],t),c(n),r.isFormValid){var o=me.isValid(s);r.isFormValid(o)}}},d=function(){return s},h=function(e){return null==e?u:u[e]},f=t(function(){return{updateData:p,updateFormQuestionsData:m,getData:d,getFormQuestionsData:h}},[h,d]);/*#__PURE__*/return e.createElement(fe.Provider,K({value:f},r),r.children)};Ee.propTypes={children:a.element.isRequired,data:a.object.isRequired,formQuestions:a.array.isRequired,isFormValid:a.func};var ve=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={cursorPosition:0},n}Z(n,t);var o=n.prototype;return o.focus=function(){p.findDOMNode(this.input).focus()},o.getInputDOMNode=function(){return p.findDOMNode(this.input)},o.componentDidUpdate=function(e,t,n){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()},o.fieldDidExpand=function(e){return"textarea"===this.props.type&&"textarea"!==e.type},o.fieldDidShrink=function(e){return"text"===this.props.type&&"text"!==e.type},o.updateFieldCursorPosition=function(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)},o.saveCursorPosition=function(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})},o.render=function(){switch(this.props.type){case"radio":return this._renderRadio();case"checkbox":return this._renderCheckbox();case"select":return this._renderSelect();case"textarea":return this._renderTextArea();default:return this._renderInput()}},o._renderCheckbox=function(){var t=this;/*#__PURE__*/return e.createElement(m.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)},/*#__PURE__*/e.createElement(m.Check,K({type:"checkbox",ref:function(e){return t.input=e}},this.props,{label:this.props.label})))},o._renderRadio=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Check,K({type:"radio",ref:function(e){return t.input=e}},this.props,{label:this.props.label})))},o._renderSelect=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({as:"select",ref:function(e){return t.input=e}},this.props),this.props.children),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},o._renderLabel=function(){return this.props.label?/*#__PURE__*/e.createElement(m.Label,null,this.props.label):null},o._renderTextArea=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({ref:function(e){return t.input=e},as:"textarea"},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},o._renderHelp=function(){return this.props.help?/*#__PURE__*/e.createElement(f,null,this.props.help):null},o._renderInput=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,K({ref:function(e){return t.input=e},as:"input"},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},n}(e.Component);ve.propTypes={type:a.string,label:a.object,value:a.any,onChange:a.func,help:a.string,validation:a.oneOf(["success","warning","error"])},ve.defaultProps={type:"text"};var ge=["children"],Se=/*#__PURE__*/e.createContext({}),Ae={components:{inputComponent:ve},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm:ss",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},i18n:{"wizard.next":"Next","wizard.previous":"Previous","section.collapse":"Collapse","section.expand":"Expand"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableForwardSkip:!1,startingStep:0}},_e=function(n){var o=n.children,r=ee(n,ge),i=t(function(){return{inputComponent:r.components&&r.components.inputComponent||Ae.components.inputComponent,componentsOptions:Object.assign({},Ae.componentsOptions,r.componentsOptions),options:Object.assign({},Ae.options,r.options),mapComponent:r.mapComponent}},[r]);/*#__PURE__*/return e.createElement(Se.Provider,{value:i},o)};_e.propTypes={children:a.element.isRequired,components:a.object,mapComponent:a.func,options:a.object};var Ce,Te,Ne={"@graph":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":"form","http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["wizard-step","section"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["textarea"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_answer":{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/answer","http://onto.fel.cvut.cz/ontologies/documentation/has_data_value":""}}]}]}]},Oe=/*#__PURE__*/function(){function e(){}return e.generateForm=function(){return JSON.parse(JSON.stringify(Ne))},e}(),Ie={root:(Ce={},Ce[le.HAS_LAYOUT_CLASS]=le.FORM,Ce),expandProperties:[le.HAS_SUBQUESTION,le.IS_RELEVANT_IF,le.HAS_ANSWER,le.HAS_DECLARED_PREFIX,le.HAS_OPTION,le.HAS_COMMENT]},ye=/*#__PURE__*/function(){function e(){}return e.customFrame=function(e,t,n){if(arguments.length<2)return l.nextTick(function(){n(new TypeError("Could not frame, too few arguments."))});null===t&&(t=Ie),l.flatten(e,null,null,function(e,t){})},e.expandStructure=function(e){var t,n={};e["@graph"].forEach(function(e){n[e["@id"]]=e,me.isForm(e)&&(t=e)});try{this._expandGraph(t,Ie,n)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return n},e._expandGraph=function(e,t,n){var o,r,i,s=this;t.expandProperties.forEach(function(a){if(e.hasOwnProperty(a)){e[a]=ue.asArray(e[a]),o=e[a];for(var l=0;l<o.length;l++)i=s._getId(o[l]),void 0!==(r=n[i])?(o[l]=r,s._expandGraph(r,t,n)):console.warn("object with @id "+i+" was not defined in input data.")}})},e._getId=function(e){return"string"==typeof e?e:e["@id"]},e}();Te=ye,ye.compressStructure=function(e){var t=[],n=new Set;return(t=Te._compressGraph(e,t,n)).sort(function(e,t){return e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0})},ye._compressGraph=function(e,t,n){return n.has(e["@id"])||(t.push(e),n.add(e["@id"])),Ie.expandProperties.forEach(function(o){if(e.hasOwnProperty(o))for(var r=e[o],i=0;i<r.length;i++){var s=r[i];void 0!==s&&(r[i]=s,t=Te._compressGraph(s,t,n),e[o][i]={"@id":s["@id"]})}}),t};var we=/*#__PURE__*/function(){function e(){}return e.constructDefaultForm=function(t){var n=Oe.generateForm();return e._constructFormQuestions(n,t)},e.constructForm=function(t,n){return new Promise(function(o){return l.flatten(t,{},null,function(t,r){var i,s;t&&re.error(t);try{var a=e._constructFormQuestions(r,n);s=a[1],i={formQuestions:a[0]}}catch(t){var l=e.constructDefaultForm(n);s=l[1],i={formQuestions:l[0]}}return o([i,s])})})},e._constructFormQuestions=function(e,t){var n,o,r,i=[];if(void 0!==e["@graph"][0]["@id"]?(r=ye.expandStructure(e),Object.keys(r).map(function(e){ce.putObject(e,r[e])})):console.warn("default form is constructed."),!(o=(n=e["@graph"].find(function(e){return me.isForm(e)}))[le.HAS_SUBQUESTION]))throw re.error("Could not find any questions in the received data."),"No questions in the form";return(i=o.filter(function(e){return!(!me.isWizardStep(e)||me.isHidden(e))||(re.warn("Item is not a wizard step: "+e),!1)})).length||(re.log("Could not find any wizard steps in the received data. Building form without steps"),n[le.HAS_SUBQUESTION].forEach(function(e){return i.push(e)})),i.sort(pe.getCompareLocalizedLabelFunction(t)),pe.orderPreservingToplogicalSort(i,le.HAS_PRECEDING_QUESTION),[i,{root:n}]},e}(),be=/*#__PURE__*/function(){function e(){}return e.buildQuestionAnswerModel=function(t,n){var o,r={subQuestions:[]};if(t&&(r.uri=t.root["@id"],r.origin=u.getJsonAttValue(t.root,le.HAS_QUESTION_ORIGIN,"@id")),n)for(var i=0;i<n.length;i++)(o=e.processQuestionAnswerHierarchy(n[i]))&&r.subQuestions.push(o);return r},e.processQuestionAnswerHierarchy=function(t){return t?e._processQuestion(t):null},e._processQuestion=function(t){var n={};if(n.uri=t["@id"],n.origin=u.getJsonAttValue(t,le.HAS_QUESTION_ORIGIN,"@id"),t[le.HAS_SUBQUESTION]){n.subQuestions=[];for(var o=0;o<t[le.HAS_SUBQUESTION].length;o++)n.subQuestions.push(e._processQuestion(t[le.HAS_SUBQUESTION][o]))}if(t[le.HAS_ANSWER]){n.answers=[],Array.isArray(t[le.HAS_ANSWER])||(t[le.HAS_ANSWER]=[t[le.HAS_ANSWER]]);for(var r=0;r<t[le.HAS_ANSWER].length;r++)n.answers.push(e.processAnswer(t[le.HAS_ANSWER][r]))}if(t[le.HAS_COMMENT]){n.comments=[],Array.isArray(t[le.HAS_COMMENT])||(t[le.HAS_COMMENT]=[t[le.HAS_COMMENT]]);for(var i=0;i<t[le.HAS_COMMENT].length;i++)n.comments.push(e.processComment(t[le.HAS_COMMENT][i]))}return n},e.processComment=function(e){var t={};return t.author=u.getJsonAttValue(e,le.HAS_AUTHOR,"@id"),t.value=u.getJsonAttValue(e,le.HAS_COMMENT_VALUE),t.timestamp=u.getJsonAttValue(e,le.HAS_TIMESTAMP,"@id"),t},e.processAnswer=function(e){var t={};return t.uri=e["@id"],t.origin=u.getJsonAttValue(e,le.HAS_ANSWER_ORIGIN,"@id"),e[le.HAS_OBJECT_VALUE]?t.codeValue=u.getJsonAttValue(e,le.HAS_OBJECT_VALUE,"@id"):t.textValue=u.getJsonAttValue(e,le.HAS_DATA_VALUE),t},e.generateAnswer=function(e){var t={};return t[le.HAS_DATA_VALUE]="",t},e}(),Le=/*#__PURE__*/function(){function e(){}return e.resolveValidationProperties=function(e){var t={};return!1===e[le.HAS_VALID_ANSWER]&&(t.validation="error",t.help=e[le.HAS_VALIDATION_MESSAGE]),t},e}(),Re=function(t){var n=r(Se),o=n.componentsOptions,i=t.question;/*#__PURE__*/return e.createElement(n.inputComponent,Object.assign({},Le.resolveValidationProperties(i),{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,onChange:function(e){t.onChange(e.target.checked)},disabled:o.readOnly||me.isDisabled(i)}))};Re.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.bool]),onChange:a.func.isRequired,mouseHover:a.bool};var He=function(t){var n,o=r(Se).componentsOptions,i=me.resolveDateTimeFormat(t.question,t.value,o.dateTimeAnswer),s=me.isDate(t.question),a=me.isTime(t.question);n=a&&t.value?new Date("0 "+t.value):t.value?new Date(t.value):null;var l="x"===i?o.dateTimeAnswer.dateTimeFormat:i;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(D,{selected:n,placeholderText:l.toUpperCase(),onChange:function(e){t.onChange(i===le.DATETIME_NUMBER_FORMAT?Number(e):V(e,i))},showTimeSelect:!s,showTimeSelectOnly:a,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:l,className:"form-control",disabled:o.readOnly||me.isDisabled(t.question)}))};He.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var De=[le.XSD.INT,le.XSD.INTEGER,le.XSD.NON_NEGATIVE_INTEGER,le.XSD.NON_POSITIVE_INTEGER,le.XSD.NEGATIVE_INTEGER,le.XSD.POSITIVE_INTEGER],Ve={};Ve[le.XSD.NON_NEGATIVE_INTEGER]={min:0},Ve[le.XSD.NON_POSITIVE_INTEGER]={max:0},Ve[le.XSD.NEGATIVE_INTEGER]={max:-1},Ve[le.XSD.POSITIVE_INTEGER]={min:1};var Ue={"string-2":"prefixed",atom:"var"},xe=/*#__PURE__*/function(){function e(){}return e._resolveInputType=function(t,n){return me.isSparqlInput(t)||me.isTurtleInput(t)||me.isTextarea(t,n)?"textarea":e._isNumeric(t)?"number":"text"},e._isNumeric=function(e){for(var t=0,n=De.length;t<n;t++)if(u.hasValue(e,le.HAS_DATATYPE,De[t]))return!0;return!1},e.resolveInputProperties=function(t,n,o){var r={};switch(r.type=e._resolveInputType(t,n),r.type){case"textarea":r.rows=5;break;case"number":r=Object.assign({},r,e._resolveNumberRestrictions(t),this._resolveStepRestriction(t))}return r.disabled=o.readOnly||me.isDisabled(t),!1===t[le.HAS_VALID_ANSWER]&&(r.validation="error",r.help=t[le.HAS_VALIDATION_MESSAGE]),r},e._resolveStepRestriction=function(e){var t={};return void 0!==e[le.STEP]&&(t.step=u.getJsonAttValue(e,le.STEP)),t},e._resolveNumberRestrictions=function(e){var t={};return Object.getOwnPropertyNames(Ve).forEach(function(n){u.hasValue(e,le.HAS_DATATYPE,n)&&(t=Object.assign({},t,Ve[n]))}),void 0!==e[le.XSD.MIN_INCLUSIVE]&&(t.min=e[le.XSD.MIN_INCLUSIVE]),void 0!==e[le.XSD.MIN_EXCLUSIVE]&&(t.min=e[le.XSD.MIN_EXCLUSIVE]+1),void 0!==e[le.XSD.MAX_EXCLUSIVE]&&(t.max=e[le.XSD.MAX_EXCLUSIVE]-1),void 0!==e[le.XSD.MAX_INCLUSIVE]&&(t.max=e[le.XSD.MAX_INCLUSIVE]),t},e}(),je=function(t){var n=r(Se),o=n.inputComponent,i=n.componentsOptions,s=t.question,a=t.answer,l=t.value;return a[le.HAS_OBJECT_VALUE]&&a[le.HAS_OBJECT_VALUE][u.RDFS_LABEL]&&(l=u.getJsonAttValue(a[le.HAS_OBJECT_VALUE],u.RDFS_LABEL)),/*#__PURE__*/e.createElement(o,Object.assign({},xe.resolveInputProperties(s,l,i),{label:t.label,title:t.title,value:null==l?"":l,onChange:function(e){t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:function(e){if(t.sparql){var n=U.fromTextArea(e.target);n.setValue(l),n.on("change",function(){t.onChange(n.getValue())}),U.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,n){if(e.autocompleters.getTrie(n)&&e.options.autocompleters&&-1!==e.options.autocompleters.indexOf(n)){var o=e.getCursor(),r=e.getTokenAt(o);if("prefixed"===Ue[r.type]){var i=r.string.indexOf(":");if(-1!==i){var s=e.getPreviousNonWsToken(o.line,r).string.toUpperCase(),a=e.getTokenAt({line:o.line,ch:r.start});if("PREFIX"!==s&&("ws"===a.type||null==a.type)){var l=r.string.substring(0,i+1);if(null==e.getPrefixesFromQuery()[l.slice(0,-1)])if(t.question[le.HAS_DECLARED_PREFIX]&&t.question[le.HAS_DECLARED_PREFIX].filter(function(e){return e[le.PREFIX]===l.slice(0,-1)}).length){var u=t.question[le.HAS_DECLARED_PREFIX].filter(function(e){return e[le.PREFIX]===l.slice(0,-1)}),c={};c[u[0][le.PREFIX]]=u[0][le.NAMESPACE],e.addPrefixes(c)}else{var p=e.autocompleters.getTrie(n).autoComplete(l);p.length>0&&e.addPrefixes(p[0])}}}}}}}else if(t.turtle){console.log("TTL");var o=U.fromTextArea(e.target);o.setValue(l),o.on("change",function(){t.onChange(o.getValue())})}}}))};je.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var Me={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"},Pe=/*#__PURE__*/function(){function e(){}return e.mapMask=function(e){if(!e)return e;for(var t,n="",o=0,r=e.length;o<r;o++)t=e.charAt(o),n+=Me[t]?Me[t]:t;return n},e}(),qe=["size","placeholder"];function Qe(e){var t,n,o,r;if(void 0!==e.selectionStart)t=e.selectionStart,n=e.selectionEnd;else try{e.focus(),r=(o=e.createTextRange()).duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),r.setEndPoint("EndToStart",o),n=(t=r.text.length)+o.text.length}catch(e){}return{start:t,end:n}}var Fe=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this)._updatePattern=function(e){n.mask.setPattern(Pe.mapMask(e.mask),{value:n.mask.getRawValue(),selection:Qe(n.input)})},n._updateMaskSelection=function(){n.mask.selection=Qe(n.input)},n._updateInputSelection=function(){!function(e,t){var n;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),(n=e.createTextRange()).collapse(!0),n.moveStart("character",t.start),n.moveEnd("character",t.end-t.start),n.select())}catch(e){}}(n.input,n.mask.selection)},n._onChange=function(e){var t=n.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){var o=t.length-e.target.value.length;n._updateMaskSelection(),n.mask.selection.end=n.mask.selection.start+o,n.mask.backspace()}var r=n._getDisplayValue();e.target.value=r,r&&n._updateInputSelection()}n.props.onChange&&n.props.onChange(e)},n._onKeyDown=function(e){if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),n.mask.undo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),n.mask.redo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),n._updateMaskSelection(),n.mask.backspace())){var t=n._getDisplayValue();e.target.value=t,t&&n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)}},n._onKeyPress=function(e){e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),n._updateMaskSelection(),n.mask.input(e.key)&&(e.target.value=n.mask.getValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)))},n._onPaste=function(e){e.preventDefault(),n._updateMaskSelection(),n.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=n.mask.getValue(),setTimeout(n._updateInputSelection,0),n.props.onChange&&n.props.onChange(e))},n.mask=new x({pattern:Pe.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"}),n}Z(n,t);var o=n.prototype;return o.componentDidUpdate=function(e){e.mask!==this.props.mask&&this._updatePattern(this.props),e.mask!==this.props.mask&&e.value!==this.props.mask?this.mask.getValue()===this.mask.emptyValue?this.mask.setPattern(Pe.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(Pe.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(Pe.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.value!==this.props.value&&this.mask.setValue(this.props.value),e.mask!==this.props.mask&&this.mask.selection.start&&this._updateInputSelection()},o._getDisplayValue=function(){var e=this.mask.getValue();return e===this.mask.emptyValue?"":e},o.focus=function(){this.input.focus()},o.blur=function(){this.input.blur()},o.render=function(){var t=this,n=this.props,o=n.size,r=n.placeholder,i=ee(n,qe),s=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},i,{ref:function(e){e&&(t.input=e.input?p.findDOMNode(e.input):e)},maxLength:s,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.mask.emptyValue,size:o||s,value:this._getDisplayValue(),type:"text"}))},n}(e.Component);Fe.contextType=Se,Fe.propTypes={mask:a.string.isRequired},Fe.defaultProps={value:""};var ze=function(t){var n=r(Se).componentsOptions,o=t.question,i=t.value,s=u.getJsonAttValue(o,le.INPUT_MASK);return s?/*#__PURE__*/e.createElement(Fe,{mask:s,value:i,label:t.label,title:t.title,placeholder:s,onChange:function(e){return t.onChange(e.target.value)},disabled:n.readOnly||me.isDisabled(o)}):(re.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(je,t))};ze.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var ke=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}Z(n,t);var o=n.prototype;return o._generateSelectOptions=function(t){var n=[];t.sort(function(e,t){var n=u.getJsonAttValue(e,le.RDFS_LABEL),o=u.getJsonAttValue(t,le.RDFS_LABEL);return n<o?-1:n>o?1:0});for(var o=0;o<t.length;o++)n.push(/*#__PURE__*/e.createElement("option",{value:u.getJsonAttValue(t[o],le.RDFS_LABEL),key:"opt-"+o},u.getJsonAttValue(t[o],le.RDFS_LABEL)));return n},o.render=function(){var t=this,n=this.props.question;/*#__PURE__*/return e.createElement(this.context.inputComponent,{type:"select",label:this.props.label,value:this.props.value,title:this.props.title,onChange:function(e){t.props.onChange(e.target.value)},disabled:this.context.componentsOptions.readOnly||me.isDisabled(n)},this._generateSelectOptions(n[le.HAS_OPTION]))},n}(e.Component);ke.contextType=Se,ke.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};var Be=function(t){var n=t.options,o=t.children,r=t.maxHeight,i=(0,t.getValue)(),s=i&&i[0]?40*n.indexOf(i[0]):0;/*#__PURE__*/return e.createElement(P,{height:r,itemCount:o.length,itemSize:40,initialScrollOffset:s,width:""},function(t){/*#__PURE__*/return e.createElement("div",{className:"option-wrapper",style:t.style},o[t.index])})},We=function(e,t){return e?(e.sort(pe.getCompareLocalizedLabelFunction(t)),pe.orderPreservingToplogicalSort(e,le.HAS_PRECEDING_VALUE),u.processTypeaheadOptions(e,t)):[]},Xe=function(t){var i=ue.getStringHash(me.getPossibleValuesQuery(t.question)),s=r(se),a=r(Se),l=a.options.intl,u=n(!0),c=u[0],p=u[1],h=n(We(t.options,l)),f=h[0],E=h[1];o(function(){var e=!1,n=t.question;return!n[le.HAS_OPTION]&&me.getPossibleValuesQuery(n)?function(){try{var t=function(t,o){try{var r=Promise.resolve(s.loadFormOptions(i,me.getPossibleValuesQuery(n))).then(function(t){e||(p(!1),E(We(t,l)))})}catch(e){return o()}return r&&r.then?r.then(void 0,o):r}(0,function(){re.error("An error has occurred during loadFormOptions for query hash: "+i)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():(p(!1),E(We(n[le.HAS_OPTION],l))),function(){e=!0}},[]),o(function(){E(We(t.question[le.HAS_OPTION],l))},[l]);var v=M.Option;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,null,t.label),/*#__PURE__*/e.createElement(j,{options:f,isSearchable:!0,isLoading:c,isClearable:!0,isDisabled:c||a.componentsOptions.readOnly||me.isDisabled(t.question),value:f.filter(function(e){return e.id===t.value}),placeholder:"",getOptionLabel:function(e){return e.name},getOptionValue:function(e){return e.id},onChange:function(e){t.onChange(e?e.id:null)},components:{MenuList:Be,Option:function(t){var n=Object.assign({},t.innerProps,{title:t.data.description});/*#__PURE__*/return e.createElement(v,K({},t,{title:t.data.description,innerProps:n}))}}}))};Xe.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.oneOfType([a.string,a.object]).isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};var Ge=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-up",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 17.453c-0.172 0.344-0.516 0.547-0.891 0.547h-10c-0.375 0-0.719-0.203-0.891-0.547-0.172-0.328-0.141-0.734 0.078-1.031l5-7c0.187-0.266 0.484-0.422 0.812-0.422s0.625 0.156 0.812 0.422l5 7c0.219 0.297 0.25 0.703 0.078 1.031zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},Ye=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-down",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 10.547c0.172 0.328 0.141 0.734-0.078 1.031l-5 7c-0.187 0.266-0.484 0.422-0.812 0.422s-0.625-0.156-0.812-0.422l-5-7c-0.219-0.297-0.25-0.703-0.078-1.031 0.172-0.344 0.516-0.547 0.891-0.547h10c0.375 0 0.719 0.203 0.891 0.547zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},Je=function(){/*#__PURE__*/return e.createElement("svg",{className:"info-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,"info-circle"),/*#__PURE__*/e.createElement("path",{d:"M16 21.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-1.5v-8c0-0.281-0.219-0.5-0.5-0.5h-5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h1.5v5h-1.5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h7c0.281 0 0.5-0.219 0.5-0.5zM14 7.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},Ke=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("path",{d:"M14 21.5v-3c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v3c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM18 11c0-2.859-3-5-5.688-5-2.547 0-4.453 1.094-5.797 3.328-0.141 0.219-0.078 0.5 0.125 0.656l2.063 1.563c0.078 0.063 0.187 0.094 0.297 0.094 0.141 0 0.297-0.063 0.391-0.187 0.734-0.938 1.047-1.219 1.344-1.437 0.266-0.187 0.781-0.375 1.344-0.375 1 0 1.922 0.641 1.922 1.328 0 0.812-0.422 1.219-1.375 1.656-1.109 0.5-2.625 1.797-2.625 3.313v0.562c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5v0c0-0.359 0.453-1.125 1.188-1.547 1.188-0.672 2.812-1.578 2.812-3.953zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},Ze=function(t){var o=n("right"),r=o[0],i=o[1];/*#__PURE__*/return e.createElement("span",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?i("left"):i("right"))}(e)}},/*#__PURE__*/e.createElement(E,{overlay:/*#__PURE__*/e.createElement(v,{className:"tooltip-content",id:t.id},t.tooltipContent),placement:t.overlayPlacement||r},/*#__PURE__*/e.createElement("span",null,t.children)))};Ze.propTypes={tooltipContent:a.oneOfType([a.object.isRequired,a.string.isRequired]),id:a.string.isRequired,overlayPlacement:a.string,absolutePosition:a.bool},Ze.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var $e=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement(Ze,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(Ke,{className:t.iconClass})))};$e.propTypes={text:a.string.isRequired,iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},$e.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var et=function(){/*#__PURE__*/return e.createElement("svg",{className:"external-link-icon",width:"24",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M5,2 C5.55228,2 6,2.44772 6,3 C6,3.55228 5.55228,4 5,4 L4,4 L4,12 L12,12 L12,11 C12,10.4477 12.4477,10 13,10 C13.5523,10 14,10.4477 14,11 L14,12 C14,13.1046 13.1046,14 12,14 L4,14 C2.89543,14 2,13.1046 2,12 L2,4 C2,2.89543 2.89543,2 4,2 L5,2 Z M15,1 L15,5.99814453 C15,6.55043453 14.5523,6.99814453 14,6.99814453 C13.4477,6.99814453 13,6.55043453 13,5.99814453 L13,4.41419 L8.71571,8.69846 C8.32519,9.08899 7.69202,9.08899 7.3015,8.69846 C6.91097,8.30794 6.91097,7.67477 7.3015,7.28425 L11.5858,3 L9.99619141,3 C9.44391141,3 8.99619141,2.55228 8.99619141,2 C8.99619141,1.44772 9.44391141,1 9.99619141,1 L15,1 Z"}))},tt=function(t){/*#__PURE__*/return e.createElement(Ze,{tooltipContent:t.url["@id"]||t.url,id:"url-tooltip",overlayPlacement:t.overlayPlacement},/*#__PURE__*/e.createElement("a",{href:t.url["@id"]||t.url,target:"_blank",className:t.iconClassContainer},/*#__PURE__*/e.createElement(et,{className:t.iconClass})))};tt.propTypes={url:a.oneOfType([a.string.isRequired,a.object.isRequired]),iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},tt.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var nt=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-comment",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",width:"24",height:"28"},/*#__PURE__*/e.createElement("path",{d:"M30,1.5c-16.542,0-30,12.112-30,27c0,5.204,1.646,10.245,4.768,14.604c-0.591,6.537-2.175,11.39-4.475,13.689 c-0.304,0.304-0.38,0.769-0.188,1.153C0.275,58.289,0.625,58.5,1,58.5c0.046,0,0.092-0.003,0.139-0.01 c0.405-0.057,9.813-1.411,16.618-5.339C21.621,54.71,25.737,55.5,30,55.5c16.542,0,30-12.112,30-27S46.542,1.5,30,1.5z M16,32.5 c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S18.206,32.5,16,32.5z M30,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4 S32.206,32.5,30,32.5z M44,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,32.5,44,32.5z"}))},ot=function(){/*#__PURE__*/return e.createElement("svg",{className:"recycle-bin-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"15px",width:"15px",viewBox:"0 0 512 512"},/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("path",{d:"M331.636,69.818V0H180.364v69.818h-128v128h34.909V512h337.455V197.818h34.909v-128H331.636z M215.273,34.909h81.455\nv34.909h-81.455V34.909z M389.818,477.091H122.182V197.818h267.636V477.091z M424.727,162.909H87.273v-58.182h337.455V162.909z"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"168.727",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"308.364",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"238.545",y:"256",width:"34.909",height:"162.909"}))))},rt="Unknown author",it=function(t){var o=r(Se).options,i=n(!1),s=i[0],a=i[1],l=n(!1),u=l[0],c=l[1];F.addLocale(k),F.addLocale(z),F.setDefaultLocale(le.LANG.en.locale);var p,m=new F(o.intl.locale),d=function(){if(o&&o.users){var e=o.users.find(function(e){return e.id===o.currentUser});if(t.author)return e.label?e.label:h()}return rt},h=function(){return t.author["@id"].replace(/.*[#\/]/,"... ")},f=function(){a(!s)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:function(){c(!0)},onMouseLeave:function(){c(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:f,onMouseLeave:f},/*#__PURE__*/e.createElement(e.Fragment,null,s?/*#__PURE__*/e.createElement(e.Fragment,null,d(),/*#__PURE__*/e.createElement(tt,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():rt})):d())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},/*#__PURE__*/e.createElement(Ze,{id:"exact-time-overlay",tooltipContent:(p=new Date(parseInt(t.timestamp)),new Intl.DateTimeFormat(o.intl.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(p))},m.format(parseInt(t.timestamp)))),u?/*#__PURE__*/e.createElement(B.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:function(){t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(ot,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};it.propTypes={author:a.object,timestamp:a.string.isRequired,commentValue:a.string.isRequired,onDeleteQuestionComment:a.func.isRequired,onDeleteViewComment:a.func,index:a.number.isRequired};var st=function(e){var t=e.comments,r=e.onDeleteCommentClick,s=i(null),a=n(!1),l=a[0],u=a[1],c=function(){u(!0),setTimeout(function(){u(!1)},2e3)};return o(function(){null!==s.current&&(s.current.scrollTop=s.current.scrollHeight)},[JSON.stringify(t)]),q("span",{children:l?Q("div",{className:"comment-delete",children:[q(W,{color:"#00BFFF",height:80,width:80}),q("p",{children:"Deleting comment..."})]}):q("div",{className:"comment-list-items",ref:s,children:t.map(function(e,t){return q("div",{className:"comment-list-item",children:q(it,{commentValue:e[le.HAS_COMMENT_VALUE],author:e[le.HAS_AUTHOR]?e[le.HAS_AUTHOR]:null,timestamp:e[le.HAS_TIMESTAMP],onDeleteQuestionComment:r,onDeleteViewComment:c,index:t})},t)})})})},at=function(){/*#__PURE__*/return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},/*#__PURE__*/e.createElement("path",{d:"M6.185 4.843l11.927 7.157-11.927 7.157 2.982-7.157-2.982-7.157zm-4.185-4.843l5 12-5 12 20-12-20-12z"}))},lt="300px",ut=function(t){var r=n(""),s=r[0],a=r[1],l=i(null),u=X();o(function(){l.current.focus()},[]);var c=function(e){e.preventDefault(),t.onChange(s),a("")},p=function(){var e=l.current;e.style.height="auto",d(e)},d=function(e){e.style.height=e.scrollHeight+"px",parseInt(e.style.height)>parseInt(lt)&&(e.style.height=lt)};/*#__PURE__*/return e.createElement(m,{onSubmit:c,onKeyUp:function(e){"Enter"===e.key&&e.ctrlKey&&s.trim()&&c(e)},onClick:function(e){e.stopPropagation()}},/*#__PURE__*/e.createElement(m.Group,{className:"m-2",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(g,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(S,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(m.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:u.formatMessage({id:"comment.form.placeholder"}),required:!0,value:s,onChange:function(e){a(e.target.value)},ref:l,onKeyPress:p,onKeyDown:p}),/*#__PURE__*/e.createElement(A,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement(at,null)))))))};ut.propTypes={onChange:a.func.isRequired};var ct,pt=function(){/*#__PURE__*/return e.createElement("svg",{className:"close-icon",width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"}))},mt=function(t){var s=r(Se),a=i(null),l=i(null),u=i(null),c=n(!1),p=c[0],m=c[1],d=n("right"),h=d[0],f=d[1];o(function(){I(u.current)});var E=function(){m(!1)},g=function(){var e=t.question;return e[le.HAS_COMMENT]||(e[le.HAS_COMMENT]=[]),Array.isArray(e[le.HAS_COMMENT])||(e[le.HAS_COMMENT]=[e[le.HAS_COMMENT]]),e[le.HAS_COMMENT]},S=function(e){var n={};A(n,e),t.onChange(O(),n)},A=function(e,t){s.options.currentUser&&(e[le.HAS_AUTHOR]={"@id":s.options.currentUser}),e[le.HAS_COMMENT_VALUE]=t,e[le.HAS_TIMESTAMP]=Date.now().toString()},T=function(e){g().splice(e,1)},N=function(e){e.preventDefault(),e.stopPropagation()},O=function(){return g().length},I=function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?f("left"):f("right"))};/*#__PURE__*/return e.createElement("div",{ref:u,onClick:N},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:a,onClick:function(e){N(e),m(!p)}},/*#__PURE__*/e.createElement(nt,null),O()>0?/*#__PURE__*/e.createElement(_,{className:"comment-badge",pill:!0,variant:"primary"},O()):null),/*#__PURE__*/e.createElement(B.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:a.current,show:p,placement:h,rootClose:!1,onHide:E,container:l},function(t){/*#__PURE__*/return e.createElement(v,K({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:function(e){!function(e){"Escape"===e.key&&E()}(e)}},/*#__PURE__*/e.createElement(B.div,{className:"close-comment-icon",onClick:E,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(pt,null)),/*#__PURE__*/e.createElement(st,{comments:g(),onDeleteCommentClick:T}),/*#__PURE__*/e.createElement(ut,{onChange:S})))})))};mt.propTypes={question:a.object.isRequired,onChange:a.func.isRequired};var dt=/*#__PURE__*/function(){function t(){}return t.renderIcons=function(t,n,o,r){var i;i=n.icons?n.icons:le.DEFAULT_OPTIONS.icons;for(var s=[],a=this.renderQuestionHelp(t,n,o,r),l=this.renderQuestionComments(t,n,o,r),u=this.renderQuestionLink(t,n,o,r),c=0;c<i.length;c++)i[c].id===le.ICONS.QUESTION_COMMENTS&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},l)),i[c].id===le.ICONS.QUESTION_HELP&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},a)),i[c].id===le.ICONS.QUESTION_LINK&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},u));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},s)},t.renderQuestionHelp=function(e,t,n,o){return this.getIconComponentFromName(le.ICONS.QUESTION_HELP,e,t,n,o)},t.renderQuestionLink=function(e,t,n,o){return this.getIconComponentFromName(le.ICONS.QUESTION_LINK,e,t,n,o)},t.getIconComponentFromName=function(e,t,n,o,r){var i=this.getIconFromIconList(n.icons?n.icons:le.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(i,t,n,o,r)},t.getIconComponent=function(t,n,o,r,i){var s;if(t&&(t.behavior===le.ICON_BEHAVIOR.ON_HOVER||t.behavior===le.ICON_BEHAVIOR.ENABLE))return t.behavior===le.ICON_BEHAVIOR.ENABLE?(i=!0,s=""):s="emphasise-on-relevant-icon",t.id===le.ICONS.QUESTION_HELP&&n[le.HELP_DESCRIPTION]?i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement($e,{text:u.getLocalized(n[le.HELP_DESCRIPTION],o.intl),absolutePosition:!1})):null:t.id===le.ICONS.QUESTION_LINK&&n[le.SOURCE]?i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement(tt,{url:n[le.SOURCE]})):null:t.id===le.ICONS.QUESTION_COMMENTS&&i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement(mt,{question:n,onChange:r})):null},t}();ct=dt,dt.renderQuestionComments=function(e,t,n,o){return ct.getIconComponentFromName(le.ICONS.QUESTION_COMMENTS,e,t,n,o)},dt.getIconFromIconList=function(e,t){return e?e.find(function(e){return e.id===t}):null};var ht=function(t){var n,o,r=e.useContext(se),i=e.useContext(Se).options,s=function(e){var n=Object.assign({},t.answer);a(n,e),t.onChange(t.index,n)},a=function(e,n){null===n?(e[le.HAS_OBJECT_VALUE]=null,e[le.HAS_DATA_VALUE]=null):t.answer[le.HAS_OBJECT_VALUE]||me.isTypeahead(t.question)?e[le.HAS_OBJECT_VALUE]={"@id":n}:e[le.HAS_DATA_VALUE]={"@value":n}},l=t.question,c=me.resolveValue(t.answer),p=function(n){var o=u.getLocalized(n[le.RDFS_LABEL],i.intl);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,dt.renderIcons(t.question,i,t.onCommentChange,t.showIcon))}(l),m=u.getLocalized(l[le.RDFS_COMMENT],i.intl);return n=me.isTypeahead(l)?function(n,o,i){var a=ue.getStringHash(me.getPossibleValuesQuery(t.question)),l=r.getOptions(a)||[];/*#__PURE__*/return e.createElement(Xe,{question:t.question,answer:t.answer,label:o,title:i,value:n,onChange:s,options:l})}(c,p,m):(o=l)[le.HAS_OPTION]&&0!==o[le.HAS_OPTION].length?function(n,o,r){/*#__PURE__*/return e.createElement(ke,{question:t.question,label:o,title:r,value:n,onChange:s})}(c,p,m):me.isCalendar(l)?function(n,o,r){/*#__PURE__*/return e.createElement(He,{question:t.question,value:n,title:r,label:o,onChange:s})}(c,p,m):me.isCheckbox(l)?function(n,o,r){/*#__PURE__*/return e.createElement(Re,{label:o,title:r,value:n,onChange:s,question:t.question})}(c,p,m):me.isMaskedInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(ze,{label:o,title:r,value:n,onChange:s,question:t.question,answer:t.answer})}(c,p,m):me.isSparqlInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(je,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s,sparql:!0})}(c,p,m):me.isTurtleInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(je,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s,turtle:!0})}(c,p,m):function(n,o,r){/*#__PURE__*/return e.createElement(je,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s})}(c,p,m),n};ht.propTypes={answer:a.object.isRequired,question:a.object.isRequired,onChange:a.func.isRequired,onCommentChange:a.func.isRequired,index:a.number,icons:a.object};var ft=/*#__PURE__*/function(){function e(){}return e.createValidator=function(t,n){return t[le.REQUIRES_ANSWER]?me.isCheckbox(t)?e._generateRequiresAnswerCheckBoxValidator(t,n):e._generateRequiresAnswerValidator(t,n):function(){var e={};return e[le.HAS_VALID_ANSWER]=!0,delete e[le.HAS_VALIDATION_MESSAGE],e}},e._generateRequiresAnswerValidator=function(e,t){return function(n){var o=null;n[le.HAS_DATA_VALUE]?o=u.getJsonAttValue(n,le.HAS_DATA_VALUE):n[le.HAS_OBJECT_VALUE]&&(o=u.getJsonAttValue(n,le.HAS_OBJECT_VALUE,"@id"));var r=null!=o&&""!==o,i={};return i[le.HAS_VALID_ANSWER]=r,i[le.HAS_VALIDATION_MESSAGE]=r?null:u.getLocalized(e[u.RDFS_LABEL],t)+" is missing a value.",i}},e._generateRequiresAnswerCheckBoxValidator=function(e,t){return function(n){var o=null;n[le.HAS_DATA_VALUE]?o=u.getJsonAttValue(n,le.HAS_DATA_VALUE):n[le.HAS_OBJECT_VALUE]&&(o=u.getJsonAttValue(n,le.HAS_OBJECT_VALUE,"@id"));var r=null!=o&&""!==o&&!1!==o,i={};return i[le.HAS_VALID_ANSWER]=r,i[le.HAS_VALIDATION_MESSAGE]=r?null:u.getLocalized(e[u.RDFS_LABEL],t)+" must be checked.",i}},e}(),Et=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={prefixes:e.prefixes},n}return Z(n,t),n.prototype.render=function(){var t=/*#__PURE__*/e.createElement(T,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(N,null,this.state.prefixes.sort(function(e,t){return e[le.PREFIX]<t[le.PREFIX]?-1:1}).map(function(t){/*#__PURE__*/return e.createElement(O,{key:t[le.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[le.PREFIX]),": ",t[le.NAMESPACE])})));/*#__PURE__*/return e.createElement(E,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))},n}(e.Component);Et.propTypes={prefixes:a.array.isRequired,children:a.element.isRequired,iconClass:a.string},Et.defaultProps={iconClass:""};var vt=function(e){var t;return(t=e.question[le.HAS_MEDIA_CONTENT])?Array.isArray(t)?q("div",{className:"col-6",children:t.map(function(e,n){return q("div",{className:"row embed-responsive-21by9 media-content-video-container mb-3",children:q("iframe",{src:t[n],className:"embed-responsive-item",allowFullScreen:!0})},n)})}):q("div",{className:"col-6",children:q("iframe",{src:t,className:"embed-responsive-item",allowFullScreen:!0})}):null},gt=/*#__PURE__*/function(t){function n(e){var o;return(o=t.call(this,e)||this).handleAnswerChange=function(e,t){if(me.isSection(o.props.question)){var n=!!me.resolveValue(t);o.setState({expanded:n})}o._handleChange(le.HAS_ANSWER,e,t)},o.handleSubQuestionChange=function(e,t){o._handleChange(le.HAS_SUBQUESTION,e,t)},o.handleCommentChange=function(e,t){o._handleChange(le.HAS_COMMENT,e,t)},o._toggleCollapse=function(){o.props.collapsible&&o.setState({expanded:!o.state.expanded})},o._onMouseEnterHandler=function(){o.setState({showIcon:!0})},o._onMouseLeaveHandler=function(){o.setState({showIcon:!1})},o._getHeaderClassName=function(){var e=o.props.question,t=o.props.collapsible,r=[];return r.push(n.getEmphasizedOnRelevantClass(e),"question-header"),me.isWizardStep(e)&&r.push("wizard-step bg-primary text-white"),me.isEmphasised(e)&&r.push(n.getEmphasizedClass(e)),me.isSection(e)&&r.push("section-background"),t&&r.push("cursor-pointer"),o.isDebugged(e)&&r.push("show-irrelevant"),r},ce.putObject(e.question["@id"],e.question),o.state={validator:null,expanded:!me.isCollapsed(e.question),showIcon:!1},o}Z(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({validator:ft.createValidator(this.props.question,this.context.options.intl)})},o.componentDidUpdate=function(){var e=this.props.question,t=this.context.options.startingQuestionId,n=e[le.HAS_SUBQUESTION].find(function(e){return e["@id"]===t});if(me.isSection(e)&&me.isAnswerable(e)){var o=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(n)return null;this.state.expanded&&!o&&this.setState({expanded:!1})}},o._handleChange=function(e,t,n){var o=Object.assign({},this.props.question);if(o[e][t]=n,e===le.HAS_ANSWER){var r=this.state.validator(n);o=Object.assign({},o,r)}ce.putObject(o["@id"],o),this.props.onChange(this.props.index,o)},o.isDebugged=function(e){var t=this.context.options.startingQuestionId;return!me.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!ue.findQuestionById(t,e,!0,!1,!1))},o.render=function(){var t=this.props.question,n=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},n):me.isHidden(t)?null:me.isRelevant(t)?n:null},o.renderQuestion=function(t){if(me.isAnswerable(t)&&!me.isSection(t))/*#__PURE__*/return e.createElement("div",{id:t["@id"]},/*#__PURE__*/e.createElement("div",{className:"panel-title answerable-question"},this.renderAnswers()),/*#__PURE__*/e.createElement("div",{className:"answerable-subquestions"},this.renderSubQuestions()));if(me.isAnswerable(t))return this.renderAnswerableSection();if(me.isSection(t)){var o=this.props,r=o.collapsible,i=o.withoutCard,s=n._getQuestionCategoryClass(t);if(i)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());var a=u.getLocalized(t[u.RDFS_LABEL],this.context.options.intl),l=/*#__PURE__*/e.createElement(I.Body,{className:Y("p-3",s)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(y,{defaultActiveKey:this.state.expanded?void 0:a},/*#__PURE__*/e.createElement(I,{className:"mb-3"},/*#__PURE__*/e.createElement(y.Toggle,{as:I.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("h6",{className:"d-inline",id:t["@id"]},r&&!me.isWizardStep(t)&&this._renderCollapseToggle(),a),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(r?y.Collapse:e.Fragment,null,l))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())},o._renderQuestionContent=function(){var t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(vt,{key:this.props.question["@id"]+"-media",question:this.props.question})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t},o.renderQuestionIcons=function(){return dt.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon)},o.renderAnswerableSection=function(){var t=this.props.question,o=this.props.collapsible,r=n._getQuestionCategoryClass(t),i=this.getShowIrrelevantClassname(t),s=/*#__PURE__*/e.createElement(I.Body,{className:Y("p-3",r)},this.renderSubQuestions(i));/*#__PURE__*/return e.createElement(y,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(I,{className:"mb-3"},/*#__PURE__*/e.createElement(I.Header,{onClick:this._toggleCollapse,className:this._getHeaderClassName()},this.renderAnswers()),o?/*#__PURE__*/e.createElement(y.Collapse,{className:i,eventKey:t["@id"]},s):{cardBody:s}))},o.getShowIrrelevantClassname=function(e){return!this.context.options.debugMode&&!pe.checkId(e[le.HAS_SUBQUESTION],this.context.options.startingQuestionId)||me.hasAnswer(e)?"":"show-irrelevant"},o.renderAnswers=function(){for(var t,o=this.props.question,r=[],i=this._getAnswers(),s=0,a=i.length;s<a;s++)me.isTextarea(o,me.resolveValue(i[s]))||me.isSparqlInput(o)||me.isTurtleInput(o),t=Y("answer",n._getQuestionCategoryClass(o),n.getEmphasizedOnRelevantClass(o)),r.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+s,className:t,id:o["@id"],onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(ht,{index:s,answer:i[s],question:o,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon})),this._renderUnits(),this._renderPrefixes()));return r},o._getAnswers=function(){var e=this.props.question;return e[le.HAS_ANSWER]||(e[le.HAS_ANSWER]=[]),Array.isArray(e[le.HAS_ANSWER])||(e[le.HAS_ANSWER]=[e[le.HAS_ANSWER]]),0===e[le.HAS_ANSWER].length&&(e[le.HAS_ANSWER]=me.isSection(e)&&!me.isAnswerable(e)?[]:[be.generateAnswer(e)]),e[le.HAS_ANSWER]},o._getAnswerWidthStyle=function(){var e=Number(this.props.question[le.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:"calc("+e+"ch + 1.5rem + 2px)"}:{}},n._getAnswerClass=function(e,t){return t?"col-12":1===le.GENERATED_ROW_SIZE?"col-6":"col-"+le.COLUMN_COUNT/le.GENERATED_ROW_SIZE},n._getQuestionCategoryClass=function(e){var t=me.getCategory(e);return t?"question-"+t:""},n.getEmphasizedClass=function(e){return me.isEmphasised(e)?"bg-warning":""},n.getEmphasizedOnRelevantClass=function(e){return u.hasValue(e,le.LAYOUT_CLASS,le.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""},o._renderCollapseToggle=function(){var t=this.context.options,n=this.state.expanded?t.i18n["section.collapse"]:t.i18n["section.expand"];/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:n},/*#__PURE__*/e.createElement(this.state.expanded?Ge:Ye,{title:n}))},o._renderPrefixes=function(){var t=this.props.question;return t[le.HAS_DECLARED_PREFIX]&&t[le.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(Et,{prefixes:t[le.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(Je,null)):null},o._renderUnits=function(){var t=this.props.question;return t[le.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[le.HAS_UNIT]):null},o.renderSubQuestions=function(t){for(var o=[],r=this._getSubQuestions(),i=this.context.options.debugMode,s=this.context.options.startingQuestionId,a=0;a<r.length;a++){var l=r[a],u=this.context.mapComponent(l,n),c=null;(i||"show-irrelevant"!==t||ue.findQuestionById(s,l,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(u,{key:"sub-question-"+a,question:l,onChange:this.handleSubQuestionChange,index:a})),o.push(c)}return o},o._getSubQuestions=function(){var e=this.props.question;return e[le.HAS_SUBQUESTION]||(e[le.HAS_SUBQUESTION]=[]),Array.isArray(e[le.HAS_SUBQUESTION])||(e[le.HAS_SUBQUESTION]=[e[le.HAS_SUBQUESTION]]),pe.orderByLocalizedLabels(e[le.HAS_SUBQUESTION],this.context.options.intl),pe.orderPreservingToplogicalSort(e[le.HAS_SUBQUESTION],le.HAS_PRECEDING_QUESTION),e[le.HAS_SUBQUESTION]},o._getFirstAnswerValue=function(){return me.resolveValue(this._getAnswers()[0])},n}(e.Component);gt.contextType=Se,gt.propTypes={question:a.object.isRequired,onChange:a.func.isRequired,index:a.number,withoutCard:a.bool,collapsible:a.bool},gt.defaultProps={withoutCard:!1,collapsible:!0};var St=/*#__PURE__*/function(t){function n(n){var o;return(o=t.call(this,n)||this).onNextStep=function(){o.context.updateFormQuestionsData(o.props.index,o.context.getFormQuestionsData()),o.props.onNextStep()},o.onPreviousStep=function(){o.props.onPreviousStep()},o._renderWizardStepButtons=function(){/*#__PURE__*/return e.createElement(w,{className:"m-3 float-right"},!o.props.isFirstStep&&/*#__PURE__*/e.createElement(A,{className:"mr-2",onClick:o.onPreviousStep,variant:"primary",size:"sm"},o.props.options.i18n["wizard.previous"]),!o.props.isLastStep&&/*#__PURE__*/e.createElement(A,{onClick:o.onNextStep,variant:"primary",size:"sm"},o.props.options.i18n["wizard.next"]))},o.onChange=function(e,t){o.context.updateFormQuestionsData(o.props.index||e,Object.assign({},o.props.question,t))},o}return Z(n,t),n.prototype.render=function(){var t=this.context.getFormQuestionsData([this.props.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(gt,{question:t,onChange:this.onChange,collapsible:me.isAnswerable(t)}),this.props.options.wizardStepButtons&&this._renderWizardStepButtons())},n}(e.Component);St.propTypes={options:a.object.isRequired,question:a.object.isRequired,index:a.number.isRequired,onNextStep:a.func,onPreviousStep:a.func,mapComponent:a.func,isFirstStep:a.bool,isLastStep:a.bool},St.contextType=fe;var At=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,s=r(Se).options;/*#__PURE__*/return e.createElement(I.Header,null,/*#__PURE__*/e.createElement(b,{variant:"tabs",activeKey:i,onSelect:function(e){return o(parseInt(e))}},n.map(function(t,n){/*#__PURE__*/return e.createElement(L,{key:"nav"+n,id:"wizard-nav-"+n},/*#__PURE__*/e.createElement(R,{eventKey:n,active:n===i?"active":"",hidden:!s.debugMode&&!me.isRelevant(t),className:Y([s.debugMode&&!me.isRelevant(t)?"show-irrelevant":gt.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s.intl)))})))};At.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};var _t=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,s=r(Se).options;/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(N,null,n.map(function(t,n){/*#__PURE__*/return e.createElement(O,{hidden:!s.debugMode&&!me.isRelevant(t),key:"nav"+n,onClick:function(){return o(n)},id:"wizard-nav-"+n,action:!0,active:n===i?"active":"",variant:"default",className:Y([s.debugMode&&!me.isRelevant(t)?"show-irrelevant":gt.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s.intl))})))};_t.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};var Ct=function(e,t){var n=function e(n,o){return n?n["@id"]===t?o:ue.asArray(n[le.HAS_SUBQUESTION]).findIndex(function(t,n){return-1!==e(t,n)}):-1};return e.findIndex(function(e,t){return-1!==n(e,t)})},Tt=function(){var t=e.useContext(fe),n=e.useContext(Se),r=n.options,i=n.mapComponent,s=0;r.startingQuestionId?-1===(s=Ct(t.getFormQuestionsData(),r.startingQuestionId))&&(console.warn("Question with id "+r.startingQuestionId+" not found!"),s=0):r.startingStep&&(s=r.startingStep<t.getFormQuestionsData().length?r.startingStep:0);var a=e.useState(s),l=a[0],u=a[1],c=e.useState(!1),p=c[0],m=c[1];o(function(){if(r.startingQuestionId&&!p){var e=document.getElementById(r.startingQuestionId);e&&(e.scrollIntoView(),e.classList.add("text-danger"),m(!0))}});var d,h=null;t.getFormQuestionsData().length>1&&(d=t.getFormQuestionsData(),h=/*#__PURE__*/e.createElement(r.horizontalWizardNav?At:_t,{currentStep:l,steps:d,onNavigate:function(e){var n=t.getFormQuestionsData();e===l||e>=n.length||e>l&&!n[e].visited&&!r.enableForwardSkip||u(e)}}));var f,E,v=r.horizontalWizardNav;/*#__PURE__*/return e.createElement(I,{className:v?"":"flex-row p-3"},h,/*#__PURE__*/e.createElement("div",{className:v?"card-body p-3":h?"col-10 p-0 pl-3":"col-12 p-0"},(E=i(f=t.getFormQuestionsData()[l],St),/*#__PURE__*/e.createElement(E,{options:r,key:"step"+l,question:f,onNextStep:function(){var e=t.getFormQuestionsData();l!==e.length-1&&(e[l+1].visited=!0,u(function(e){return e+1}))},onPreviousStep:function(){0!==l&&u(function(e){return e-1})},mapComponent:i,index:l,isFirstStep:0===l,isLastStep:l===t.getFormQuestionsData().length-1}))))},Nt=/*#__PURE__*/e.forwardRef(function(t,n){var o=e.useContext(Se).options;/*#__PURE__*/return e.createElement(H,K({size:"xl",animation:!0},o.modalProps),/*#__PURE__*/e.createElement(H.Header,{closeButton:!0},/*#__PURE__*/e.createElement(H.Title,null,o.modalProps.title)),/*#__PURE__*/e.createElement(H.Body,{className:"overflow-hidden p-0"},t.children))});Nt.propTypes={children:a.element.isRequired};var Ot=/*#__PURE__*/function(t){function n(){for(var n,o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];return(n=t.call.apply(t,[this].concat(r))||this).getFormData=function(){var e=n.context.getData(),t=n.context.getFormQuestionsData();return be.buildQuestionAnswerModel(e,t)},n.getFormQuestionsData=function(){return n.context.getFormQuestionsData()},n.handleStepChange=function(e,t,o){n.context.updateFormQuestionsData(t,Object.assign({},e,o))},n.renderWizardlessForm=function(){var t=n.context.getFormQuestionsData();/*#__PURE__*/return e.createElement(J,{className:"p-3"},t.map(function(e,t){return n._mapQuestion(e,t)}))},n}Z(n,t);var o=n.prototype;return o._mapQuestion=function(t,n){var o=this,r=this.props.mapComponent(t,gt);/*#__PURE__*/return e.createElement(r,{key:t["@id"],question:t,onChange:function(e,n){return o.handleStepChange(t,e,n)},index:n})},o.render=function(){var t=this.props.modalView,n=this.context.getFormQuestionsData();if(!n.length)/*#__PURE__*/return e.createElement(J,{className:"p-3 font-italic"},"There are no questions available...");var o=n.every(function(e){return!me.isWizardStep(e)});return t?/*#__PURE__*/e.createElement(Nt,null,o?this.renderWizardlessForm():/*#__PURE__*/e.createElement(Tt,null)):o?this.renderWizardlessForm():/*#__PURE__*/e.createElement(Tt,null)},n}(e.Component);Ot.contextType=fe;var It=/*#__PURE__*/s(function(t,r){var i=n(!0),s=i[0],a=i[1],l=n(null),u=l[0],c=l[1],p=n(null),m=p[0],d=p[1];if(o(function(){!function(){try{return Promise.resolve(we.constructForm(t.form,t.options.intl)).then(function(e){var t=e[0],n=e[1];t.formQuestions.some(function(e){return me.isWizardStep(e)})&&(t.formQuestions[0].visited=!0),c(t),d(n),a(!1)})}catch(e){return Promise.reject(e)}}()},[t.form]),s)return t.loader||/*#__PURE__*/e.createElement(I,{className:"p-3 font-italic"},"Loading SForms...");var h=function(e,t){return function(n,o){if(!e)return o;for(var r,i=ne(e);!(r=i()).done;){var s=r.value,a=s.component;if((0,s.mapRule)(n,t))return a}return o}}(t.componentMapRules,m);/*#__PURE__*/return e.createElement(_e,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:h,options:t.options},/*#__PURE__*/e.createElement(ae,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(Ee,{data:m,formQuestions:u.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(Ot,{ref:r,modalView:t.options&&t.options.modalView,mapComponent:h}))))});It.propTypes={form:a.object.isRequired,options:a.object.isRequired,componentMapRules:a.array,components:a.object,componentsOptions:a.object,fetchTypeAheadValues:a.func,isFormValid:a.func,loader:a.element};var yt={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)"},wt={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)"},bt=/*#__PURE__*/e.createContext({}),Lt=function(e){var t=e.locale,n=void 0===t?navigator.language:t,o=wt;return n===le.LANG.cs.locale&&(o=yt),q(bt.Provider,{value:{locale:n,lang:o},children:q(G,{locale:n,messages:o,children:e.children})})};export{ht as Answer,Se as ConfigurationContext,le as Constants,fe as FormQuestionsContext,me as FormUtils,$e as HelpIcon,Lt as IntlContextProvider,ye as JsonLdFramingUtils,ce as JsonLdObjectMap,pe as JsonLdObjectUtils,gt as Question,dt as QuestionStatic,St as WizardStep,It as default};
1
+ import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.some.js";import e,{useMemo as t,useState as n,useEffect as o,useContext as r,useRef as i,forwardRef as s}from"react";import a from"prop-types";import"core-js/modules/es.object.assign.js";import l from"jsonld";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.map.js";import u from"jsonld-utils";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/web.dom-collections.for-each.js";import c from"tsort";import"core-js/modules/es.number.max-safe-integer.js";import"core-js/modules/es.number.constructor.js";import p from"react-dom";import{Form as m,FormGroup as d,FormControl as h,FormText as f,OverlayTrigger as E,Tooltip as v,Col as g,Row as S,Button as A,Badge as _,Overlay as C,Popover as T,ListGroup as N,ListGroupItem as I,Card as O,Accordion as y,ButtonToolbar as w,Nav as b,NavItem as L,NavLink as R,Modal as H}from"react-bootstrap";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.every.js";import"core-js/modules/es.array.is-array.js";import"core-js/modules/es.array.find-index.js";import"core-js/modules/es.date.to-string.js";import D from"react-datepicker";import{format as U}from"date-fns";import"core-js/modules/es.object.get-own-property-names.js";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.slice.js";import V from"yasgui-yasqe";import"@triply/yasgui/build/yasgui.min.css";import"core-js/modules/web.timers.js";import x from"inputmask-core";import{IntelligentTreeSelect as M}from"intelligent-tree-select/lib/components/IntelligentTreeSelect.js";import"intelligent-tree-select/lib/styles.css";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.date.now.js";import"core-js/modules/es.array.splice.js";import{jsx as P,jsxs as j}from"react/jsx-runtime";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.parse-int.js";import q from"javascript-time-ago";import Q from"javascript-time-ago/locale/en";import F from"javascript-time-ago/locale/cs";import{motion as z}from"framer-motion";import{Rings as k}from"react-loader-spinner";import"core-js/modules/es.string.trim.js";import{useIntl as B,IntlProvider as W}from"react-intl";import X from"classnames";import G from"react-bootstrap/Card";function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Y.apply(this,arguments)}function J(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,K(e,t)}function K(e,t){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},K(e,t)}function Z(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return $(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)?$(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var te,ne=/*#__PURE__*/function(){function e(){}return e.log=function(e){console.log(e)},e.warn=function(e){console.warn?console.warn(e):console.log("WARNING: "+e)},e.error=function(e){console.error?console.error(e):console.log("ERROR: "+e)},e}(),oe=["children"],re=/*#__PURE__*/e.createContext({}),ie=function(n){var o=n.children,r=Z(n,oe),i=[],s=function(e,t){try{var n=i[e];return n&&n.length?Promise.resolve(n):Promise.resolve(r.fetchTypeAheadValues(t)).then(function(t){return t.length?new Promise(function(n){l.frame(t,{},null,function(t,o){var r,s=o["@graph"];return i.push(Object.assign({},s,((r={})[e]=s,r))),n(s)})}):(ne.warn("No data received when loading options using id "+e),[])})}catch(e){return Promise.reject(e)}},a=function(e){return i[e]||[]},u=t(function(){return{loadFormOptions:s,getOptions:a}},[s,a]);/*#__PURE__*/return e.createElement(re.Provider,Y({value:u},r),o)};ie.propTypes={children:a.element.isRequired,fetchTypeAheadValues:a.func};var se=function(){};te=se,se.COLUMN_COUNT=12,se.INPUT_LENGTH_THRESHOLD=50,se.DATETIME_NUMBER_FORMAT="x",se.FORM="http://onto.fel.cvut.cz/ontologies/documentation/form",se.HAS_SUBQUESTION="http://onto.fel.cvut.cz/ontologies/documentation/has_related_question",se.HAS_ANSWER="http://onto.fel.cvut.cz/ontologies/documentation/has_answer",se.HAS_OPTION="http://onto.fel.cvut.cz/ontologies/form/has-possible-value",se.HAS_OPTIONS_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",se.HAS_VALUE_TYPE="http://onto.fel.cvut.cz/ontologies/form/has-value-type",se.IS_DISABLED="http://onto.fel.cvut.cz/ontologies/aviation/form-376/is-disabled",se.INPUT_MASK="http://onto.fel.cvut.cz/ontologies/form/has-input-mask",se.LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class",se.LAYOUT={FORM:"form",QUESTION_SECTION:"section",WIZARD_STEP:"wizard-step",DATE:"date",TIME:"time",DATETIME:"datetime",TEXT:"text",TEXTAREA:"textarea",CHECKBOX:"checkbox",QUESTION_TYPEAHEAD:"type-ahead",MASKED_INPUT:"masked-input",ANSWERABLE:"answerable",SPARQL:"sparql",TURTLE:"ttl",DISABLED:"disabled",HIDDEN:"hidden",COLLAPSED:"collapsed",EMPHASISED:"emphasised",EMPHASISE_ON_RELEVANT:"emphasise-on-relevant",CATEGORY:["category-1","category-2","category-3","category-4","category-5"]},se.HAS_INITIAL_INPUT_LENGTH="http://onto.fel.cvut.cz/ontologies/form-layout/has-initial-input-length",se.VALUE_TYPE_CODE="code",se.VALUE_TYPE_TEXT="text",se.GENERATED_ROW_SIZE=1,se.HAS_QUESTION_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-question-origin",se.HAS_ANSWER_ORIGIN="http://onto.fel.cvut.cz/ontologies/form/has-answer-origin",se.HAS_DATA_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_data_value",se.HAS_OBJECT_VALUE="http://onto.fel.cvut.cz/ontologies/documentation/has_object_value",se.HELP_DESCRIPTION="http://purl.org/dc/elements/1.1/description",se.SOURCE="http://purl.org/dc/elements/1.1/source",se.XSD={MAX_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxExclusive",MAX_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#maxInclusive",MIN_EXCLUSIVE:"http://www.w3.org/2001/XMLSchema#minExclusive",MIN_INCLUSIVE:"http://www.w3.org/2001/XMLSchema#minInclusive",INT:"http://www.w3.org/2001/XMLSchema#int",INTEGER:"http://www.w3.org/2001/XMLSchema#integer",NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#negativeInteger",NON_NEGATIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",NON_POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",POSITIVE_INTEGER:"http://www.w3.org/2001/XMLSchema#positiveInteger",BOOLEAN:"http://www.w3.org/2001/XMLSchema#boolean"},se.STEP="http://onto.fel.cvut.cz/ontologies/form/step",se.ACCEPTS_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-answer-value",se.ACCEPTS="http://onto.fel.cvut.cz/ontologies/form/accepts",se.HAS_DATATYPE="http://onto.fel.cvut.cz/ontologies/form/has-datatype",se.HAS_LAYOUT_CLASS="http://onto.fel.cvut.cz/ontologies/form/has-layout-class",se.HAS_POSSIBLE_VALUES_QUERY="http://onto.fel.cvut.cz/ontologies/form/has-possible-values-query",se.HAS_REQUIRED_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-required-value",se.HAS_TESTED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-tested-question",se.HAS_TESTED_FORM="http://onto.fel.cvut.cz/ontologies/form/has-tested-form",se.HAS_UNIT="http://onto.fel.cvut.cz/ontologies/form/has-unit",se.HAS_VALID_ANSWER="http://onto.fel.cvut.cz/ontologies/form/has-valid-answer",se.IS_RELEVANT_IF="http://onto.fel.cvut.cz/ontologies/form/is-relevant-if",se.ACCEPTS_VALIDATION_VALUE="http://onto.fel.cvut.cz/ontologies/form/accepts-validation-value",se.HAS_VALIDATION_MESSAGE="http://onto.fel.cvut.cz/ontologies/form/has-validation-message",se.NEGATIVE_CONDITION="http://onto.fel.cvut.cz/ontologies/form/negative-condition",se.REQUIRES_ANSWER="http://onto.fel.cvut.cz/ontologies/form/requires-answer",se.REQUIRES_ANSWER_DESCRIPTION_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-description-if",se.REQUIRES_ANSWER_IF="http://onto.fel.cvut.cz/ontologies/form/requires-answer-if",se.REQUIRES_ANSWER_VALUE="http://onto.fel.cvut.cz/ontologies/form/requires-answer-value",se.REQUIRES_DESCRIPTION="http://onto.fel.cvut.cz/ontologies/form/requires-description",se.HAS_PRECEDING_QUESTION="http://onto.fel.cvut.cz/ontologies/form/has-preceding-question",se.HAS_PRECEDING_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-preceding-value",se.HAS_MEDIA_CONTENT="http://onto.fel.cvut.cz/ontologies/form/has-media-content",se.CONDITION="http://onto.fel.cvut.cz/ontologies/form/condition",se.OR_CONDITION="http://onto.fel.cvut.cz/ontologies/form/or-condition",se.HAS_SUB_CONDITION="http://onto.fel.cvut.cz/ontologies/form/has-sub-condition",se.HAS_PATTERN="http://onto.fel.cvut.cz/ontologies/form-lt/has-pattern",se.HAS_DECLARED_PREFIX="http://onto.fel.cvut.cz/ontologies/form-spin/has-declared-prefix",se.PREFIX="http://www.w3.org/ns/shacl#prefix",se.NAMESPACE="http://www.w3.org/ns/shacl#namespace",se.HAS_COMMENT="http://onto.fel.cvut.cz/ontologies/form/has-comment",se.HAS_COMMENT_VALUE="http://onto.fel.cvut.cz/ontologies/form/has-comment-value",se.HAS_AUTHOR="http://onto.fel.cvut.cz/ontologies/form/has-author",se.HAS_TIMESTAMP="http://onto.fel.cvut.cz/ontologies/form/has-timestamp",se.NOT_ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/not-answered-question",se.ANSWERED_QUESTION="http://onto.fel.cvut.cz/ontologies/form/answered-question",se.RDFS_LABEL=u.RDFS_LABEL,se.RDFS_COMMENT=u.RDFS_COMMENT,se.DEFAULT_HAS_CHILD=u.DEFAULT_HAS_CHILD,se.ICONS={QUESTION_COMMENTS:"questionComments",QUESTION_HELP:"questionHelp",QUESTION_LINK:"questionLink"},se.ICON_BEHAVIOR={ENABLE:"enable",DISABLE:"disable",ON_HOVER:"onHover"},se.DEFAULT_OPTIONS={icons:[{id:te.ICONS.QUESTION_HELP,behavior:te.ICON_BEHAVIOR.ENABLE},{id:te.ICONS.QUESTION_COMMENTS,behavior:te.ICON_BEHAVIOR.ON_HOVER},{id:te.ICONS.QUESTION_LINK,behavior:te.ICON_BEHAVIOR.ON_HOVER}]},se.LANG={cs:{locale:"cs",label:"Čestina"},en:{locale:"en",label:"English"}};var ae=/*#__PURE__*/function(){function e(){}return e.getStringHash=function(e){var t=0,n=e?e.length:0;if(0===n)return t;for(var o=0;o<n;o++)t=(t<<5)-t+e.charCodeAt(o),t&=t;return t},e.asArray=function(e){return e?e.constructor===Array?e:[e]:[]},e.findQuestionById=function(t,n,o,r,i){if(o&&n["@id"]===t)return n;var s=e.asArray(n[se.HAS_SUBQUESTION]);if(r)for(var a,l=ee(s);!(a=l()).done;){var u=e.findQuestionById(t,a.value,!0,!1,!1);if(u)return u}if(i)for(var c,p=ee(s);!(c=p()).done;){var m=e.findQuestionById(t,c.value,!1,!0,!0);if(m)return m}return null},e}(),le=/*#__PURE__*/function(){function e(){}return e.putObject=function(t,n){e.objectMap[t]=n},e.getObject=function(t){return e.objectMap[t]},e}();le.objectMap={};var ue=/*#__PURE__*/function(){function e(){}return e.getFirstObject=function(e,t){var n=l.getValues(e,t);return 0===n.length?null:n[0]},e.compareValues=function(e,t){return t="object"==typeof t?t:{"@value":t},!!((e="object"==typeof e?e:{"@value":e})&&e["@value"]&&t&&t["@value"]&&("string"==typeof e["@value"]?e["@value"]:JSON.stringify(e["@value"]))===("string"==typeof t["@value"]?t["@value"]:JSON.stringify(t["@value"])))||l.compareValues(e,t)},e.toplogicalSort=function(e,t){var n;do{n=!1;for(var o=0;o<e.length;o++)for(var r=o;r<e.length;r++)if(e[o][t]&&("object"==typeof e[o][t]?e[o][t]["@id"]:e[o][t])===e[r]["@id"]){var i=e[o];e[o]=e[r],e[r]=i,n=!0;break}}while(n);return e},e.orderPreservingToplogicalSort=function(e,t){for(var n=c(),o={},r=function(){var r=e[i]["@id"];n.add(r),o[r]=e[i],ae.asArray(e[i][t]).map(function(e){return"object"==typeof e?e["@id"]:e}).map(function(e){return[e,r]}).forEach(function(e){return n.add(e)})},i=0;i<e.length;i++)r();for(var s=n.sort(),a=0;a<s.length;a++)e[a]=o[s[a]];return e},e.getCompareLocalizedLabelFunction=function(e){return function(t,n){var o=u.getLocalized(t[u.RDFS_LABEL],e),r=u.getLocalized(n[u.RDFS_LABEL],e);return o<r?-1:o>r?1:0}},e.orderByLocalizedLabels=function(t,n){return t.sort(e.getCompareLocalizedLabelFunction(n))},e.checkId=function(e,t){if(void 0!==e)return e.constructor===Array?!!e.find(function(e){return e["@id"]===t}):e.constructor===Object?e["@id"]===t:void 0},e}(),ce=/*#__PURE__*/function(){function e(){}return e.isForm=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.FORM)},e.isWizardStep=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.WIZARD_STEP)},e.isSection=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.QUESTION_SECTION)},e.isAnswerable=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.ANSWERABLE)},e.isTypeahead=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.QUESTION_TYPEAHEAD)},e.getPossibleValuesQuery=function(e){return u.getJsonAttValue(e,se.HAS_OPTIONS_QUERY)},e.isDisabled=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DISABLED)},e.isHidden=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.HIDDEN)},e.isTextarea=function(t,n){return n&&n.length>se.INPUT_LENGTH_THRESHOLD&&!e.isTypeahead(t)||u.hasValue(t,se.LAYOUT_CLASS,se.LAYOUT.TEXTAREA)},e.isText=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TEXT)},e.isCalendar=function(t){return e.isDate(t)||e.isTime(t)||e.isDateTime(t)},e.isDate=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DATE)},e.isTime=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TIME)},e.isDateTime=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.DATETIME)},e.isCheckbox=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.CHECKBOX)},e.isMaskedInput=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.MASKED_INPUT)},e.isSparqlInput=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.SPARQL)},e.isTurtleInput=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.TURTLE)},e.isCollapsed=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.COLLAPSED)},e.isEmphasised=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.EMPHASISED)},e.getCategory=function(e){return se.LAYOUT.CATEGORY.find(function(t){return u.hasValue(e,se.LAYOUT_CLASS,t)})},e.resolveValue=function(e){return e?e[se.HAS_OBJECT_VALUE]?e[se.HAS_OBJECT_VALUE]["@id"]:u.getJsonAttValue(e,se.HAS_DATA_VALUE):null},e.resolveValueObject=function(e){return e?e[se.HAS_OBJECT_VALUE]?ae.asArray(e[se.HAS_OBJECT_VALUE])[0]:e[se.HAS_DATA_VALUE]?ae.asArray(e[se.HAS_DATA_VALUE])[0]:null:null},e.isRelevant=function(t){if(!t[se.IS_RELEVANT_IF])return!0;for(var n,o=ee(ae.asArray(t[se.IS_RELEVANT_IF]));!(n=o()).done;)if(!e.testCondition(n.value))return!1;return!0},e.hasValidationLogic=function(e){return!!e[se.REQUIRES_ANSWER_VALUE]||!!e[se.REQUIRES_ANSWER]||!!e[se.REQUIRES_ANSWER_IF]},e.isValid=function(e){if(!1===e[se.HAS_VALID_ANSWER])return!1;for(var t,n=ee(ae.asArray(e[se.HAS_SUBQUESTION]));!(t=n()).done;)if(!1===this.isValid(t.value))return!1;return!0},e.testOrCondition=function(e){var t=e[se.HAS_SUB_CONDITION];t||console.warn("Or condition does not have any sub-condition !");for(var n,o=ee(this._getMappedObjectsArray(t));!(n=o()).done;)if(this.testCondition(n.value))return!0;return!1},e.testCondition=function(t){var n,o=t[se.ACCEPTS_VALIDATION_VALUE],r=t[se.ACCEPTS_ANSWER_VALUE],i=t[se.ACCEPTS],s=t[se.HAS_TESTED_QUESTION];if(t[se.HAS_SUB_CONDITION])return this.testOrCondition(t);if(o&&r&&console.warn("Support for validation and requirement constraints at same time is not implemented !"),i&&s){var a=ae.asArray(i);if(1!==a.length&&console.warn("Support for multiple accepts values is not implemented !"),a[0]["@id"]===se.ANSWERED_QUESTION){(r||o)&&console.warn("Support for accepted answer/validations values is not implemented !");for(var u,c=ee(this._getMappedObjectsArray(s));!(u=c()).done;)if(!this.hasAnswer(u.value))return!1;return!0}console.warn("No support to accept question of type "+a[0]["@id"]+" !")}if(o&&s){var p=ae.asArray(o);(1!==p.length||!0!==p[0]&&"true"!==p[0])&&console.warn('Validation values other than "true" are not implemented !');for(var m,d=ee(ae.asArray(s));!(m=d()).done;){if(void 0===(n=le.getObject(m.value["@id"])))return console.warn("Questions is not loaded in an object map."),!0;if(!1===this.isValid(n))return!1}return!0}if(r&&s){n=le.getObject(s["@id"]);for(var h,f=ee(ae.asArray(r));!(h=f()).done;){var E=h.value;if(!n)return console.warn("Question is not defined."),!0;if(!n.hasOwnProperty(se.HAS_ANSWER))return!1;var v=l.getValues(n,se.HAS_ANSWER);if(0===v.length)return!1;var g=e.resolveValueObject(v[0]);if(g&&E&&g.hasOwnProperty("@value")&&E.hasOwnProperty("@id")&&g["@value"]==E["@id"])return!0;if(ue.compareValues(g,E))return!0}}return!1},e._getMappedObjectsArray=function(e,t){return ae.asArray(e).map(function(e){var n=le.getObject(e["@id"]);return void 0===n?(console.warn((t||"Object")+' "'+e["@id"]+'" is not loaded in an object map.'),null):n}).filter(function(e){return null!==e})},e.hasAnswer=function(t){if(!t)return!1;if(t.hasOwnProperty(se.HAS_ANSWER)){var n=l.getValues(t,se.HAS_ANSWER);if(n.length){var o=e.resolveValueObject(n[0]);if(o&&(o["@value"]||o["@id"]))return!0}}for(var r,i=ee(ae.asArray(t[se.HAS_SUBQUESTION]));!(r=i()).done;)if(e.hasAnswer(r.value))return!0;return!1},e.resolveDateTimeFormat=function(t,n,o){return"number"==typeof n?se.DATETIME_NUMBER_FORMAT:e.isDate(t)?o.dateFormat:e.isTime(t)?o.timeFormat:o.dateTimeFormat},e}(),pe={},me=[],de=/*#__PURE__*/e.createContext({}),he=function(r){var i=n(r.data||pe),s=i[0],a=i[1],l=n(r.formQuestions||me),u=l[0],c=l[1];o(function(){if(r.isFormValid){var e=ce.isValid(s);r.isFormValid(e)}},[]),o(function(){a(r.data||pe),c(r.formQuestions||me)},[r.data,r.formQuestions]);var p=function(e){e&&a(Object.assign({},s,e))},m=function(e,t){if(!(!t||e<0||e>=u.length)){var n=[].concat(u);if(n[e]=Object.assign({},n[e],t),c(n),r.isFormValid){var o=ce.isValid(s);r.isFormValid(o)}}},d=function(){return s},h=function(e){return null==e?u:u[e]},f=t(function(){return{updateData:p,updateFormQuestionsData:m,getData:d,getFormQuestionsData:h}},[h,d]);/*#__PURE__*/return e.createElement(de.Provider,Y({value:f},r),r.children)};he.propTypes={children:a.element.isRequired,data:a.object.isRequired,formQuestions:a.array.isRequired,isFormValid:a.func};var fe=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={cursorPosition:0},n}J(n,t);var o=n.prototype;return o.focus=function(){p.findDOMNode(this.input).focus()},o.getInputDOMNode=function(){return p.findDOMNode(this.input)},o.componentDidUpdate=function(e,t,n){(this.fieldDidShrink(e)||this.fieldDidExpand(e))&&this.updateFieldCursorPosition()},o.fieldDidExpand=function(e){return"textarea"===this.props.type&&"textarea"!==e.type},o.fieldDidShrink=function(e){return"text"===this.props.type&&"text"!==e.type},o.updateFieldCursorPosition=function(){this.focus(),this.getInputDOMNode().setSelectionRange(this.state.cursorPosition,this.state.cursorPosition)},o.saveCursorPosition=function(e){this.props.onChange(e),this.setState({cursorPosition:e.target.selectionStart})},o.render=function(){switch(this.props.type){case"radio":return this._renderRadio();case"checkbox":return this._renderCheckbox();case"select":return this._renderSelect();case"textarea":return this._renderTextArea();default:return this._renderInput()}},o._renderCheckbox=function(){var t=this;/*#__PURE__*/return e.createElement(m.Group,{size:"small",controlId:Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)},/*#__PURE__*/e.createElement(m.Check,Y({type:"checkbox",ref:function(e){return t.input=e}},this.props,{label:this.props.label})))},o._renderRadio=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Check,Y({type:"radio",ref:function(e){return t.input=e}},this.props,{label:this.props.label})))},o._renderSelect=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,Y({as:"select",ref:function(e){return t.input=e}},this.props),this.props.children),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},o._renderLabel=function(){return this.props.label?/*#__PURE__*/e.createElement(m.Label,null,this.props.label):null},o._renderTextArea=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,Y({ref:function(e){return t.input=e},as:"textarea"},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},o._renderHelp=function(){return this.props.help?/*#__PURE__*/e.createElement(f,null,this.props.help):null},o._renderInput=function(){var t=this;/*#__PURE__*/return e.createElement(d,{size:"small"},this._renderLabel(),/*#__PURE__*/e.createElement(h,Y({ref:function(e){return t.input=e},as:"input"},this.props,{onChange:function(e){return t.saveCursorPosition(e)}})),this.props.validation&&/*#__PURE__*/e.createElement(h.Feedback,null),this._renderHelp())},n}(e.Component);fe.propTypes={type:a.string,label:a.object,value:a.any,onChange:a.func,help:a.string,validation:a.oneOf(["success","warning","error"])},fe.defaultProps={type:"text"};var Ee=["children"],ve=/*#__PURE__*/e.createContext({}),ge={components:{inputComponent:fe},componentsOptions:{dateTimeAnswer:{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm:ss",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},readOnly:!1},options:{intl:{locale:"en"},i18n:{"wizard.next":"Next","wizard.previous":"Previous","section.collapse":"Collapse","section.expand":"Expand"},modalView:!1,modalProps:{},horizontalWizardNav:!0,wizardStepButtons:!0,enableForwardSkip:!1,startingStep:0}},Se=function(n){var o=n.children,r=Z(n,Ee),i=t(function(){return{inputComponent:r.components&&r.components.inputComponent||ge.components.inputComponent,componentsOptions:Object.assign({},ge.componentsOptions,r.componentsOptions),options:Object.assign({},ge.options,r.options),mapComponent:r.mapComponent}},[r]);/*#__PURE__*/return e.createElement(ve.Provider,{value:i},o)};Se.propTypes={children:a.element.isRequired,components:a.object,mapComponent:a.func,options:a.object};var Ae,_e,Ce={"@graph":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":"form","http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["wizard-step","section"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_related_question":[{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/question","http://onto.fel.cvut.cz/ontologies/form-layout/has-layout-class":["textarea"],"http://www.w3.org/2000/01/rdf-schema#label":[{"@language":"en","@value":"Description"},{"@language":"cs","@value":"Popis"}],"http://onto.fel.cvut.cz/ontologies/documentation/has_answer":{"@type":"http://onto.fel.cvut.cz/ontologies/documentation/answer","http://onto.fel.cvut.cz/ontologies/documentation/has_data_value":""}}]}]}]},Te=/*#__PURE__*/function(){function e(){}return e.generateForm=function(){return JSON.parse(JSON.stringify(Ce))},e}(),Ne={root:(Ae={},Ae[se.HAS_LAYOUT_CLASS]=se.FORM,Ae),expandProperties:[se.HAS_SUBQUESTION,se.IS_RELEVANT_IF,se.HAS_ANSWER,se.HAS_DECLARED_PREFIX,se.HAS_OPTION,se.HAS_COMMENT]},Ie=/*#__PURE__*/function(){function e(){}return e.customFrame=function(e,t,n){if(arguments.length<2)return l.nextTick(function(){n(new TypeError("Could not frame, too few arguments."))});null===t&&(t=Ne),l.flatten(e,null,null,function(e,t){})},e.expandStructure=function(e){var t,n={};e["@graph"].forEach(function(e){n[e["@id"]]=e,ce.isForm(e)&&(t=e)});try{this._expandGraph(t,Ne,n)}catch(e){console.error("Error '"+e+"' occured, while trying to apply frame-ing with custom shape.")}return n},e._expandGraph=function(e,t,n){var o,r,i,s=this;t.expandProperties.forEach(function(a){if(e.hasOwnProperty(a)){e[a]=ae.asArray(e[a]),o=e[a];for(var l=0;l<o.length;l++)i=s._getId(o[l]),void 0!==(r=n[i])?(o[l]=r,s._expandGraph(r,t,n)):console.warn("object with @id "+i+" was not defined in input data.")}})},e._getId=function(e){return"string"==typeof e?e:e["@id"]},e}();_e=Ie,Ie.compressStructure=function(e){var t=[],n=new Set;return(t=_e._compressGraph(e,t,n)).sort(function(e,t){return e["@id"]&&t["@id"]?e["@id"].localeCompare(t["@id"]):0})},Ie._compressGraph=function(e,t,n){return n.has(e["@id"])||(t.push(e),n.add(e["@id"])),Ne.expandProperties.forEach(function(o){if(e.hasOwnProperty(o))for(var r=e[o],i=0;i<r.length;i++){var s=r[i];void 0!==s&&(r[i]=s,t=_e._compressGraph(s,t,n),e[o][i]={"@id":s["@id"]})}}),t};var Oe=/*#__PURE__*/function(){function e(){}return e.constructDefaultForm=function(t){var n=Te.generateForm();return e._constructFormQuestions(n,t)},e.constructForm=function(t,n){return new Promise(function(o){return l.flatten(t,{},null,function(t,r){var i,s;t&&ne.error(t);try{var a=e._constructFormQuestions(r,n);s=a[1],i={formQuestions:a[0]}}catch(t){var l=e.constructDefaultForm(n);s=l[1],i={formQuestions:l[0]}}return o([i,s])})})},e._constructFormQuestions=function(e,t){var n,o,r,i=[];if(void 0!==e["@graph"][0]["@id"]?(r=Ie.expandStructure(e),Object.keys(r).map(function(e){le.putObject(e,r[e])})):console.warn("default form is constructed."),!(o=(n=e["@graph"].find(function(e){return ce.isForm(e)}))[se.HAS_SUBQUESTION]))throw ne.error("Could not find any questions in the received data."),"No questions in the form";return(i=o.filter(function(e){return!(!ce.isWizardStep(e)||ce.isHidden(e))||(ne.warn("Item is not a wizard step: "+e),!1)})).length||(ne.log("Could not find any wizard steps in the received data. Building form without steps"),n[se.HAS_SUBQUESTION].forEach(function(e){return i.push(e)})),i.sort(ue.getCompareLocalizedLabelFunction(t)),ue.orderPreservingToplogicalSort(i,se.HAS_PRECEDING_QUESTION),[i,{root:n}]},e}(),ye=/*#__PURE__*/function(){function e(){}return e.buildQuestionAnswerModel=function(t,n){var o,r={subQuestions:[]};if(t&&(r.uri=t.root["@id"],r.origin=u.getJsonAttValue(t.root,se.HAS_QUESTION_ORIGIN,"@id")),n)for(var i=0;i<n.length;i++)(o=e.processQuestionAnswerHierarchy(n[i]))&&r.subQuestions.push(o);return r},e.processQuestionAnswerHierarchy=function(t){return t?e._processQuestion(t):null},e._processQuestion=function(t){var n={};if(n.uri=t["@id"],n.origin=u.getJsonAttValue(t,se.HAS_QUESTION_ORIGIN,"@id"),t[se.HAS_SUBQUESTION]){n.subQuestions=[];for(var o=0;o<t[se.HAS_SUBQUESTION].length;o++)n.subQuestions.push(e._processQuestion(t[se.HAS_SUBQUESTION][o]))}if(t[se.HAS_ANSWER]){n.answers=[],Array.isArray(t[se.HAS_ANSWER])||(t[se.HAS_ANSWER]=[t[se.HAS_ANSWER]]);for(var r=0;r<t[se.HAS_ANSWER].length;r++)n.answers.push(e.processAnswer(t[se.HAS_ANSWER][r]))}if(t[se.HAS_COMMENT]){n.comments=[],Array.isArray(t[se.HAS_COMMENT])||(t[se.HAS_COMMENT]=[t[se.HAS_COMMENT]]);for(var i=0;i<t[se.HAS_COMMENT].length;i++)n.comments.push(e.processComment(t[se.HAS_COMMENT][i]))}return n},e.processComment=function(e){var t={};return t.author=u.getJsonAttValue(e,se.HAS_AUTHOR,"@id"),t.value=u.getJsonAttValue(e,se.HAS_COMMENT_VALUE),t.timestamp=u.getJsonAttValue(e,se.HAS_TIMESTAMP,"@id"),t},e.processAnswer=function(e){var t={};return t.uri=e["@id"],t.origin=u.getJsonAttValue(e,se.HAS_ANSWER_ORIGIN,"@id"),e[se.HAS_OBJECT_VALUE]?t.codeValue=u.getJsonAttValue(e,se.HAS_OBJECT_VALUE,"@id"):t.textValue=u.getJsonAttValue(e,se.HAS_DATA_VALUE),t},e.generateAnswer=function(e){var t={};return t[se.HAS_DATA_VALUE]="",t},e}(),we=/*#__PURE__*/function(){function e(){}return e.resolveValidationProperties=function(e){var t={};return!1===e[se.HAS_VALID_ANSWER]&&(t.validation="error",t.help=e[se.HAS_VALIDATION_MESSAGE]),t},e}(),be=function(t){var n=r(ve),o=n.componentsOptions,i=t.question;/*#__PURE__*/return e.createElement(n.inputComponent,Object.assign({},we.resolveValidationProperties(i),{type:"checkbox",label:t.label,title:t.title,checked:!0===t.value||"true"===t.value,onChange:function(e){t.onChange(e.target.checked)},disabled:o.readOnly||ce.isDisabled(i)}))};be.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.bool]),onChange:a.func.isRequired,mouseHover:a.bool};var Le=function(t){var n,o=r(ve).componentsOptions,i=ce.resolveDateTimeFormat(t.question,t.value,o.dateTimeAnswer),s=ce.isDate(t.question),a=ce.isTime(t.question);n=a&&t.value?new Date("0 "+t.value):t.value?new Date(t.value):null;var l="x"===i?o.dateTimeAnswer.dateTimeFormat:i;/*#__PURE__*/return e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,{className:"w-100"},t.label),/*#__PURE__*/e.createElement(D,{selected:n,placeholderText:l.toUpperCase(),onChange:function(e){t.onChange(i===se.DATETIME_NUMBER_FORMAT?Number(e):U(e,i))},showTimeSelect:!s,showTimeSelectOnly:a,timeFormat:"HH:mm",timeIntervals:1,timeCaption:"Time",dateFormat:l,className:"form-control",disabled:o.readOnly||ce.isDisabled(t.question)}))};Le.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var Re=[se.XSD.INT,se.XSD.INTEGER,se.XSD.NON_NEGATIVE_INTEGER,se.XSD.NON_POSITIVE_INTEGER,se.XSD.NEGATIVE_INTEGER,se.XSD.POSITIVE_INTEGER],He={};He[se.XSD.NON_NEGATIVE_INTEGER]={min:0},He[se.XSD.NON_POSITIVE_INTEGER]={max:0},He[se.XSD.NEGATIVE_INTEGER]={max:-1},He[se.XSD.POSITIVE_INTEGER]={min:1};var De={"string-2":"prefixed",atom:"var"},Ue=/*#__PURE__*/function(){function e(){}return e._resolveInputType=function(t,n){return ce.isSparqlInput(t)||ce.isTurtleInput(t)||ce.isTextarea(t,n)?"textarea":e._isNumeric(t)?"number":"text"},e._isNumeric=function(e){for(var t=0,n=Re.length;t<n;t++)if(u.hasValue(e,se.HAS_DATATYPE,Re[t]))return!0;return!1},e.resolveInputProperties=function(t,n,o){var r={};switch(r.type=e._resolveInputType(t,n),r.type){case"textarea":r.rows=5;break;case"number":r=Object.assign({},r,e._resolveNumberRestrictions(t),this._resolveStepRestriction(t))}return r.disabled=o.readOnly||ce.isDisabled(t),!1===t[se.HAS_VALID_ANSWER]&&(r.validation="error",r.help=t[se.HAS_VALIDATION_MESSAGE]),r},e._resolveStepRestriction=function(e){var t={};return void 0!==e[se.STEP]&&(t.step=u.getJsonAttValue(e,se.STEP)),t},e._resolveNumberRestrictions=function(e){var t={};return Object.getOwnPropertyNames(He).forEach(function(n){u.hasValue(e,se.HAS_DATATYPE,n)&&(t=Object.assign({},t,He[n]))}),void 0!==e[se.XSD.MIN_INCLUSIVE]&&(t.min=e[se.XSD.MIN_INCLUSIVE]),void 0!==e[se.XSD.MIN_EXCLUSIVE]&&(t.min=e[se.XSD.MIN_EXCLUSIVE]+1),void 0!==e[se.XSD.MAX_EXCLUSIVE]&&(t.max=e[se.XSD.MAX_EXCLUSIVE]-1),void 0!==e[se.XSD.MAX_INCLUSIVE]&&(t.max=e[se.XSD.MAX_INCLUSIVE]),t},e}(),Ve=function(t){var n=r(ve),o=n.inputComponent,i=n.componentsOptions,s=t.question,a=t.answer,l=t.value;return a[se.HAS_OBJECT_VALUE]&&a[se.HAS_OBJECT_VALUE][u.RDFS_LABEL]&&(l=u.getJsonAttValue(a[se.HAS_OBJECT_VALUE],u.RDFS_LABEL)),/*#__PURE__*/e.createElement(o,Object.assign({},Ue.resolveInputProperties(s,l,i),{label:t.label,title:t.title,value:null==l?"":l,onChange:function(e){t.onChange(e.target.value),(t.sparql||t.turtle)&&(void 0).hide()},onFocus:function(e){if(t.sparql){var n=V.fromTextArea(e.target);n.setValue(l),n.on("change",function(){t.onChange(n.getValue())}),V.Autocompleters.prefixes.appendPrefixIfNeeded=function(e,n){if(e.autocompleters.getTrie(n)&&e.options.autocompleters&&-1!==e.options.autocompleters.indexOf(n)){var o=e.getCursor(),r=e.getTokenAt(o);if("prefixed"===De[r.type]){var i=r.string.indexOf(":");if(-1!==i){var s=e.getPreviousNonWsToken(o.line,r).string.toUpperCase(),a=e.getTokenAt({line:o.line,ch:r.start});if("PREFIX"!==s&&("ws"===a.type||null==a.type)){var l=r.string.substring(0,i+1);if(null==e.getPrefixesFromQuery()[l.slice(0,-1)])if(t.question[se.HAS_DECLARED_PREFIX]&&t.question[se.HAS_DECLARED_PREFIX].filter(function(e){return e[se.PREFIX]===l.slice(0,-1)}).length){var u=t.question[se.HAS_DECLARED_PREFIX].filter(function(e){return e[se.PREFIX]===l.slice(0,-1)}),c={};c[u[0][se.PREFIX]]=u[0][se.NAMESPACE],e.addPrefixes(c)}else{var p=e.autocompleters.getTrie(n).autoComplete(l);p.length>0&&e.addPrefixes(p[0])}}}}}}}else if(t.turtle){console.log("TTL");var o=V.fromTextArea(e.target);o.setValue(l),o.on("change",function(){t.onChange(o.getValue())})}}}))};Ve.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var xe={D:"1",M:"1",Y:"1",h:"1",m:"1",s:"1"},Me=/*#__PURE__*/function(){function e(){}return e.mapMask=function(e){if(!e)return e;for(var t,n="",o=0,r=e.length;o<r;o++)t=e.charAt(o),n+=xe[t]?xe[t]:t;return n},e}(),Pe=["size","placeholder"];function je(e){var t,n,o,r;if(void 0!==e.selectionStart)t=e.selectionStart,n=e.selectionEnd;else try{e.focus(),r=(o=e.createTextRange()).duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),r.setEndPoint("EndToStart",o),n=(t=r.text.length)+o.text.length}catch(e){}return{start:t,end:n}}var qe=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this)._updatePattern=function(e){n.mask.setPattern(Me.mapMask(e.mask),{value:n.mask.getRawValue(),selection:je(n.input)})},n._updateMaskSelection=function(){n.mask.selection=je(n.input)},n._updateInputSelection=function(){!function(e,t){var n;try{void 0!==e.selectionStart?(e.focus(),e.setSelectionRange(t.start,t.end)):(e.focus(),(n=e.createTextRange()).collapse(!0),n.moveStart("character",t.start),n.moveEnd("character",t.end-t.start),n.select())}catch(e){}}(n.input,n.mask.selection)},n._onChange=function(e){var t=n.mask.getValue();if(e.target.value!==t){if(e.target.value.length<t.length){var o=t.length-e.target.value.length;n._updateMaskSelection(),n.mask.selection.end=n.mask.selection.start+o,n.mask.backspace()}var r=n._getDisplayValue();e.target.value=r,r&&n._updateInputSelection()}n.props.onChange&&n.props.onChange(e)},n._onKeyDown=function(e){if(function(e){return e.ctrlKey&&90===e.keyCode}(e))e.preventDefault(),n.mask.undo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if(function(e){return e.ctrlKey&&89===e.keyCode}(e))e.preventDefault(),n.mask.redo()&&(e.target.value=n._getDisplayValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e));else if("Backspace"===e.key&&(e.preventDefault(),n._updateMaskSelection(),n.mask.backspace())){var t=n._getDisplayValue();e.target.value=t,t&&n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)}},n._onKeyPress=function(e){e.metaKey||e.altKey||e.ctrlKey||"Enter"===e.key||(e.preventDefault(),n._updateMaskSelection(),n.mask.input(e.key)&&(e.target.value=n.mask.getValue(),n._updateInputSelection(),n.props.onChange&&n.props.onChange(e)))},n._onPaste=function(e){e.preventDefault(),n._updateMaskSelection(),n.mask.paste(e.clipboardData.getData("Text"))&&(e.target.value=n.mask.getValue(),setTimeout(n._updateInputSelection,0),n.props.onChange&&n.props.onChange(e))},n.mask=new x({pattern:Me.mapMask(e.mask),value:e.value,formatCharacters:e.formatCharacters,placeholderChar:e.placeholderChar||"_"}),n}J(n,t);var o=n.prototype;return o.componentDidUpdate=function(e){e.mask!==this.props.mask&&this._updatePattern(this.props),e.mask!==this.props.mask&&e.value!==this.props.mask?this.mask.getValue()===this.mask.emptyValue?this.mask.setPattern(Me.mapMask(this.props.mask),{value:this.props.value}):this.mask.setPattern(Me.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.mask!==this.props.mask?this.mask.setPattern(Me.mapMask(this.props.mask),{value:this.mask.getRawValue()}):e.value!==this.props.value&&this.mask.setValue(this.props.value),e.mask!==this.props.mask&&this.mask.selection.start&&this._updateInputSelection()},o._getDisplayValue=function(){var e=this.mask.getValue();return e===this.mask.emptyValue?"":e},o.focus=function(){this.input.focus()},o.blur=function(){this.input.blur()},o.render=function(){var t=this,n=this.props,o=n.size,r=n.placeholder,i=Z(n,Pe),s=this.mask.pattern.length;/*#__PURE__*/return e.createElement(this.context.inputComponent,Object.assign({},i,{ref:function(e){e&&(t.input=e.input?p.findDOMNode(e.input):e)},maxLength:s,onChange:this._onChange,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onPaste:this._onPaste,placeholder:r||this.mask.emptyValue,size:o||s,value:this._getDisplayValue(),type:"text"}))},n}(e.Component);qe.contextType=ve,qe.propTypes={mask:a.string.isRequired},qe.defaultProps={value:""};var Qe=function(t){var n=r(ve).componentsOptions,o=t.question,i=t.value,s=u.getJsonAttValue(o,se.INPUT_MASK);return s?/*#__PURE__*/e.createElement(qe,{mask:s,value:i,label:t.label,title:t.title,placeholder:s,onChange:function(e){return t.onChange(e.target.value)},disabled:n.readOnly||ce.isDisabled(o)}):(ne.warn("Input mask not provided. Falling back to regular input."),/*#__PURE__*/e.createElement(Ve,t))};Qe.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.oneOfType([a.string,a.number]),onChange:a.func.isRequired};var Fe=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}J(n,t);var o=n.prototype;return o._generateSelectOptions=function(t){var n=[];t.sort(function(e,t){var n=u.getJsonAttValue(e,se.RDFS_LABEL),o=u.getJsonAttValue(t,se.RDFS_LABEL);return n<o?-1:n>o?1:0});for(var o=0;o<t.length;o++)n.push(/*#__PURE__*/e.createElement("option",{value:u.getJsonAttValue(t[o],se.RDFS_LABEL),key:"opt-"+o},u.getJsonAttValue(t[o],se.RDFS_LABEL)));return n},o.render=function(){var t=this,n=this.props.question;/*#__PURE__*/return e.createElement(this.context.inputComponent,{type:"select",label:this.props.label,value:this.props.value,title:this.props.title,onChange:function(e){t.props.onChange(e.target.value)},disabled:this.context.componentsOptions.readOnly||ce.isDisabled(n)},this._generateSelectOptions(n[se.HAS_OPTION]))},n}(e.Component);Fe.contextType=ve,Fe.propTypes={question:a.object.isRequired,label:a.object.isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};var ze=function(e,t){return e&&e.length?(e.sort(ue.getCompareLocalizedLabelFunction(t)),ue.orderPreservingToplogicalSort(e,se.HAS_PRECEDING_VALUE),u.processTypeaheadOptions(e,t)):[]},ke=function(t){var i=ae.getStringHash(ce.getPossibleValuesQuery(t.question)),s=r(re),a=r(ve),l=a.options.intl,u=n(!0),c=u[0],p=u[1],h=n(ze(t.options,l)),f=h[0],E=h[1];return o(function(){var e=!1,n=t.question;return!n[se.HAS_OPTION]&&ce.getPossibleValuesQuery(n)?function(){try{var t=function(t,o){try{var r=Promise.resolve(s.loadFormOptions(i,ce.getPossibleValuesQuery(n))).then(function(t){e||(p(!1),E(ze(t,l)))})}catch(e){return o()}return r&&r.then?r.then(void 0,o):r}(0,function(){ne.error("An error has occurred during loadFormOptions for query hash: "+i)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():(p(!1),E(ze(n[se.HAS_OPTION],l))),function(){e=!0}},[]),o(function(){E(ze(t.question[se.HAS_OPTION],l))},[l]),/*#__PURE__*/e.createElement(d,{size:"small"},/*#__PURE__*/e.createElement(m.Label,null,t.label),/*#__PURE__*/e.createElement(M,{valueKey:"name",labelKey:"name",valueIsControlled:!1,value:f.filter(function(e){return e.id===t.value}),multi:!1,options:f,isSearchable:!0,isLoading:c,isClearable:!0,isDisabled:c||a.componentsOptions.readOnly||ce.isDisabled(t.question),onChange:function(e){t.onChange(e?e.id:null)}}))};ke.propTypes={question:a.object.isRequired,answer:a.object.isRequired,label:a.oneOfType([a.string,a.object]).isRequired,title:a.string,value:a.string,onChange:a.func.isRequired};var Be=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-up",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 17.453c-0.172 0.344-0.516 0.547-0.891 0.547h-10c-0.375 0-0.719-0.203-0.891-0.547-0.172-0.328-0.141-0.734 0.078-1.031l5-7c0.187-0.266 0.484-0.422 0.812-0.422s0.625 0.156 0.812 0.422l5 7c0.219 0.297 0.25 0.703 0.078 1.031zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},We=function(t){/*#__PURE__*/return e.createElement("svg",{className:"caret-square-down",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,t.title||""),/*#__PURE__*/e.createElement("path",{d:"M17.891 10.547c0.172 0.328 0.141 0.734-0.078 1.031l-5 7c-0.187 0.266-0.484 0.422-0.812 0.422s-0.625-0.156-0.812-0.422l-5-7c-0.219-0.297-0.25-0.703-0.078-1.031 0.172-0.344 0.516-0.547 0.891-0.547h10c0.375 0 0.719 0.203 0.891 0.547zM20 21.5v-15c0-0.266-0.234-0.5-0.5-0.5h-15c-0.266 0-0.5 0.234-0.5 0.5v15c0 0.266 0.234 0.5 0.5 0.5h15c0.266 0 0.5-0.234 0.5-0.5zM24 6.5v15c0 2.484-2.016 4.5-4.5 4.5h-15c-2.484 0-4.5-2.016-4.5-4.5v-15c0-2.484 2.016-4.5 4.5-4.5h15c2.484 0 4.5 2.016 4.5 4.5z"}))},Xe=function(){/*#__PURE__*/return e.createElement("svg",{className:"info-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("title",null,"info-circle"),/*#__PURE__*/e.createElement("path",{d:"M16 21.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-1.5v-8c0-0.281-0.219-0.5-0.5-0.5h-5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h1.5v5h-1.5c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h7c0.281 0 0.5-0.219 0.5-0.5zM14 7.5v-2.5c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v2.5c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},Ge=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-circle",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"28",viewBox:"0 0 24 28"},/*#__PURE__*/e.createElement("path",{d:"M14 21.5v-3c0-0.281-0.219-0.5-0.5-0.5h-3c-0.281 0-0.5 0.219-0.5 0.5v3c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5zM18 11c0-2.859-3-5-5.688-5-2.547 0-4.453 1.094-5.797 3.328-0.141 0.219-0.078 0.5 0.125 0.656l2.063 1.563c0.078 0.063 0.187 0.094 0.297 0.094 0.141 0 0.297-0.063 0.391-0.187 0.734-0.938 1.047-1.219 1.344-1.437 0.266-0.187 0.781-0.375 1.344-0.375 1 0 1.922 0.641 1.922 1.328 0 0.812-0.422 1.219-1.375 1.656-1.109 0.5-2.625 1.797-2.625 3.313v0.562c0 0.281 0.219 0.5 0.5 0.5h3c0.281 0 0.5-0.219 0.5-0.5v0c0-0.359 0.453-1.125 1.188-1.547 1.188-0.672 2.812-1.578 2.812-3.953zM24 14c0 6.625-5.375 12-12 12s-12-5.375-12-12 5.375-12 12-12 12 5.375 12 12z"}))},Ye=function(t){var o=n("right"),r=o[0],i=o[1];/*#__PURE__*/return e.createElement("span",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?i("left"):i("right"))}(e)}},/*#__PURE__*/e.createElement(E,{overlay:/*#__PURE__*/e.createElement(v,{className:"tooltip-content",id:t.id},t.tooltipContent),placement:t.overlayPlacement||r},/*#__PURE__*/e.createElement("span",null,t.children)))};Ye.propTypes={tooltipContent:a.oneOfType([a.object.isRequired,a.string.isRequired]),id:a.string.isRequired,overlayPlacement:a.string,absolutePosition:a.bool},Ye.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var Je=function(t){var o=n("right"),r=o[1];/*#__PURE__*/return e.createElement("div",{ref:function(e){return function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?r("left"):r("right"))}(e)}},/*#__PURE__*/e.createElement(Ye,{id:"help-icon-tooltip-",overlayPlacement:t.overlayPlacement||o[0],absolutePosition:t.absolutePosition,tooltipContent:t.text},/*#__PURE__*/e.createElement(Ge,{className:t.iconClass})))};Je.propTypes={text:a.string.isRequired,iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Je.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var Ke=function(){/*#__PURE__*/return e.createElement("svg",{className:"external-link-icon",width:"24",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M5,2 C5.55228,2 6,2.44772 6,3 C6,3.55228 5.55228,4 5,4 L4,4 L4,12 L12,12 L12,11 C12,10.4477 12.4477,10 13,10 C13.5523,10 14,10.4477 14,11 L14,12 C14,13.1046 13.1046,14 12,14 L4,14 C2.89543,14 2,13.1046 2,12 L2,4 C2,2.89543 2.89543,2 4,2 L5,2 Z M15,1 L15,5.99814453 C15,6.55043453 14.5523,6.99814453 14,6.99814453 C13.4477,6.99814453 13,6.55043453 13,5.99814453 L13,4.41419 L8.71571,8.69846 C8.32519,9.08899 7.69202,9.08899 7.3015,8.69846 C6.91097,8.30794 6.91097,7.67477 7.3015,7.28425 L11.5858,3 L9.99619141,3 C9.44391141,3 8.99619141,2.55228 8.99619141,2 C8.99619141,1.44772 9.44391141,1 9.99619141,1 L15,1 Z"}))},Ze=function(t){/*#__PURE__*/return e.createElement(Ye,{tooltipContent:t.url["@id"]||t.url,id:"url-tooltip",overlayPlacement:t.overlayPlacement},/*#__PURE__*/e.createElement("a",{href:t.url["@id"]||t.url,target:"_blank",className:t.iconClassContainer},/*#__PURE__*/e.createElement(Ke,{className:t.iconClass})))};Ze.propTypes={url:a.oneOfType([a.string.isRequired,a.object.isRequired]),iconClassContainer:a.string,iconClass:a.string,overlayPlacement:a.string,absolutePosition:a.bool},Ze.defaultProps={iconClassContainer:"",iconClass:"",absolutePosition:!0};var $e=function(){/*#__PURE__*/return e.createElement("svg",{className:"question-comment",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",width:"24",height:"28"},/*#__PURE__*/e.createElement("path",{d:"M30,1.5c-16.542,0-30,12.112-30,27c0,5.204,1.646,10.245,4.768,14.604c-0.591,6.537-2.175,11.39-4.475,13.689 c-0.304,0.304-0.38,0.769-0.188,1.153C0.275,58.289,0.625,58.5,1,58.5c0.046,0,0.092-0.003,0.139-0.01 c0.405-0.057,9.813-1.411,16.618-5.339C21.621,54.71,25.737,55.5,30,55.5c16.542,0,30-12.112,30-27S46.542,1.5,30,1.5z M16,32.5 c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S18.206,32.5,16,32.5z M30,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4 S32.206,32.5,30,32.5z M44,32.5c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S46.206,32.5,44,32.5z"}))},et=function(){/*#__PURE__*/return e.createElement("svg",{className:"recycle-bin-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",height:"15px",width:"15px",viewBox:"0 0 512 512"},/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("path",{d:"M331.636,69.818V0H180.364v69.818h-128v128h34.909V512h337.455V197.818h34.909v-128H331.636z M215.273,34.909h81.455\nv34.909h-81.455V34.909z M389.818,477.091H122.182V197.818h267.636V477.091z M424.727,162.909H87.273v-58.182h337.455V162.909z"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"168.727",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"308.364",y:"256",width:"34.909",height:"162.909"}))),/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("g",null,/*#__PURE__*/e.createElement("rect",{x:"238.545",y:"256",width:"34.909",height:"162.909"}))))},tt="Unknown author",nt=function(t){var o=r(ve).options,i=n(!1),s=i[0],a=i[1],l=n(!1),u=l[0],c=l[1];q.addLocale(F),q.addLocale(Q),q.setDefaultLocale(se.LANG.en.locale);var p,m=new q(o.intl.locale),d=function(){if(o&&o.users){var e=o.users.find(function(e){return e.id===o.currentUser});if(t.author)return e.label?e.label:h()}return tt},h=function(){return t.author["@id"].replace(/.*[#\/]/,"... ")},f=function(){a(!s)};/*#__PURE__*/return e.createElement("div",{className:"comment-content",onMouseEnter:function(){c(!0)},onMouseLeave:function(){c(!1)}},/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col-auto comment-author",onMouseEnter:f,onMouseLeave:f},/*#__PURE__*/e.createElement(e.Fragment,null,s?/*#__PURE__*/e.createElement(e.Fragment,null,d(),/*#__PURE__*/e.createElement(Ze,{iconClassContainer:"emphasise-on-relevant-icon",url:t.author?Object.values(t.author).toString():tt})):d())),/*#__PURE__*/e.createElement("div",{className:"col-auto text-muted comment-timestamp"},/*#__PURE__*/e.createElement(Ye,{id:"exact-time-overlay",tooltipContent:(p=new Date(parseInt(t.timestamp)),new Intl.DateTimeFormat(o.intl.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).format(p))},m.format(parseInt(t.timestamp)))),u?/*#__PURE__*/e.createElement(z.div,{className:"comment-delete emphasise-on-relevant-icon",whileHover:{scale:1.2},whileTap:{scale:.9},onClick:function(){t.onDeleteQuestionComment(t.index),t.onDeleteViewComment()}},/*#__PURE__*/e.createElement(et,null)):null),/*#__PURE__*/e.createElement("div",{className:"row"},/*#__PURE__*/e.createElement("div",{className:"col comment-value"},t.commentValue)))};nt.propTypes={author:a.object,timestamp:a.string.isRequired,commentValue:a.string.isRequired,onDeleteQuestionComment:a.func.isRequired,onDeleteViewComment:a.func,index:a.number.isRequired};var ot=function(e){var t=e.comments,r=e.onDeleteCommentClick,s=i(null),a=n(!1),l=a[0],u=a[1],c=function(){u(!0),setTimeout(function(){u(!1)},2e3)};return o(function(){null!==s.current&&(s.current.scrollTop=s.current.scrollHeight)},[JSON.stringify(t)]),P("span",{children:l?j("div",{className:"comment-delete",children:[P(k,{color:"#00BFFF",height:80,width:80}),P("p",{children:"Deleting comment..."})]}):P("div",{className:"comment-list-items",ref:s,children:t.map(function(e,t){return P("div",{className:"comment-list-item",children:P(nt,{commentValue:e[se.HAS_COMMENT_VALUE],author:e[se.HAS_AUTHOR]?e[se.HAS_AUTHOR]:null,timestamp:e[se.HAS_TIMESTAMP],onDeleteQuestionComment:r,onDeleteViewComment:c,index:t})},t)})})})},rt=function(){/*#__PURE__*/return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},/*#__PURE__*/e.createElement("path",{d:"M6.185 4.843l11.927 7.157-11.927 7.157 2.982-7.157-2.982-7.157zm-4.185-4.843l5 12-5 12 20-12-20-12z"}))},it="300px",st=function(t){var r=n(""),s=r[0],a=r[1],l=i(null),u=B();o(function(){l.current.focus()},[]);var c=function(e){e.preventDefault(),t.onChange(s),a("")},p=function(){var e=l.current;e.style.height="auto",d(e)},d=function(e){e.style.height=e.scrollHeight+"px",parseInt(e.style.height)>parseInt(it)&&(e.style.height=it)};/*#__PURE__*/return e.createElement(m,{onSubmit:c,onKeyUp:function(e){"Enter"===e.key&&e.ctrlKey&&s.trim()&&c(e)},onClick:function(e){e.stopPropagation()}},/*#__PURE__*/e.createElement(m.Group,{className:"m-2",controlId:"formBasicComment"},/*#__PURE__*/e.createElement(g,{className:"col-lg-12 p-0"},/*#__PURE__*/e.createElement(S,{className:"container-fluid p-0 m-0"},/*#__PURE__*/e.createElement("div",{id:"comment-form"},/*#__PURE__*/e.createElement(m.Control,{className:"comment-form-control",name:"comment",as:"textarea",placeholder:u.formatMessage({id:"comment.form.placeholder"}),required:!0,value:s,onChange:function(e){a(e.target.value)},ref:l,onKeyPress:p,onKeyDown:p}),/*#__PURE__*/e.createElement(A,{className:"comment-form-button",variant:"primary",type:"submit"},/*#__PURE__*/e.createElement(rt,null)))))))};st.propTypes={onChange:a.func.isRequired};var at,lt=function(){/*#__PURE__*/return e.createElement("svg",{className:"close-icon",width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"}))},ut=function(t){var s=r(ve),a=i(null),l=i(null),u=i(null),c=n(!1),p=c[0],m=c[1],d=n("right"),h=d[0],f=d[1];o(function(){O(u.current)});var E=function(){m(!1)},g=function(){var e=t.question;return e[se.HAS_COMMENT]||(e[se.HAS_COMMENT]=[]),Array.isArray(e[se.HAS_COMMENT])||(e[se.HAS_COMMENT]=[e[se.HAS_COMMENT]]),e[se.HAS_COMMENT]},S=function(e){var n={};A(n,e),t.onChange(I(),n)},A=function(e,t){s.options.currentUser&&(e[se.HAS_AUTHOR]={"@id":s.options.currentUser}),e[se.HAS_COMMENT_VALUE]=t,e[se.HAS_TIMESTAMP]=Date.now().toString()},T=function(e){g().splice(e,1)},N=function(e){e.preventDefault(),e.stopPropagation()},I=function(){return g().length},O=function(e){e&&(e.getBoundingClientRect().x>window.innerWidth/2?f("left"):f("right"))};/*#__PURE__*/return e.createElement("div",{ref:u,onClick:N},/*#__PURE__*/e.createElement("span",{className:"comment-bubble",ref:a,onClick:function(e){N(e),m(!p)}},/*#__PURE__*/e.createElement($e,null),I()>0?/*#__PURE__*/e.createElement(_,{className:"comment-badge",pill:!0,variant:"primary"},I()):null),/*#__PURE__*/e.createElement(z.div,{className:"overlay-comment",ref:l,drag:!0,dragConstraints:{top:-50,left:-50,right:50,bottom:50}},/*#__PURE__*/e.createElement(C,{target:a.current,show:p,placement:h,rootClose:!1,onHide:E,container:l},function(t){/*#__PURE__*/return e.createElement(v,Y({className:"comment-tooltip"},t),/*#__PURE__*/e.createElement("span",{onKeyDown:function(e){!function(e){"Escape"===e.key&&E()}(e)}},/*#__PURE__*/e.createElement(z.div,{className:"close-comment-icon",onClick:E,whileHover:{scale:1.1,transition:{duration:.1}}},/*#__PURE__*/e.createElement(lt,null)),/*#__PURE__*/e.createElement(ot,{comments:g(),onDeleteCommentClick:T}),/*#__PURE__*/e.createElement(st,{onChange:S})))})))};ut.propTypes={question:a.object.isRequired,onChange:a.func.isRequired};var ct=/*#__PURE__*/function(){function t(){}return t.renderIcons=function(t,n,o,r){var i;i=n.icons?n.icons:se.DEFAULT_OPTIONS.icons;for(var s=[],a=this.renderQuestionHelp(t,n,o,r),l=this.renderQuestionComments(t,n,o,r),u=this.renderQuestionLink(t,n,o,r),c=0;c<i.length;c++)i[c].id===se.ICONS.QUESTION_COMMENTS&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},l)),i[c].id===se.ICONS.QUESTION_HELP&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},a)),i[c].id===se.ICONS.QUESTION_LINK&&s.push(/*#__PURE__*/e.createElement("li",{key:c,className:"icon-list-item"},u));/*#__PURE__*/return e.createElement("ol",{className:"icon-list-items"},s)},t.renderQuestionHelp=function(e,t,n,o){return this.getIconComponentFromName(se.ICONS.QUESTION_HELP,e,t,n,o)},t.renderQuestionLink=function(e,t,n,o){return this.getIconComponentFromName(se.ICONS.QUESTION_LINK,e,t,n,o)},t.getIconComponentFromName=function(e,t,n,o,r){var i=this.getIconFromIconList(n.icons?n.icons:se.DEFAULT_OPTIONS.icons,e);return this.getIconComponent(i,t,n,o,r)},t.getIconComponent=function(t,n,o,r,i){var s;if(t&&(t.behavior===se.ICON_BEHAVIOR.ON_HOVER||t.behavior===se.ICON_BEHAVIOR.ENABLE))return t.behavior===se.ICON_BEHAVIOR.ENABLE?(i=!0,s=""):s="emphasise-on-relevant-icon",t.id===se.ICONS.QUESTION_HELP&&n[se.HELP_DESCRIPTION]?i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement(Je,{text:u.getLocalized(n[se.HELP_DESCRIPTION],o.intl),absolutePosition:!1})):null:t.id===se.ICONS.QUESTION_LINK&&n[se.SOURCE]?i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement(Ze,{url:n[se.SOURCE]})):null:t.id===se.ICONS.QUESTION_COMMENTS&&i?/*#__PURE__*/e.createElement("div",{className:s},/*#__PURE__*/e.createElement(ut,{question:n,onChange:r})):null},t}();at=ct,ct.renderQuestionComments=function(e,t,n,o){return at.getIconComponentFromName(se.ICONS.QUESTION_COMMENTS,e,t,n,o)},ct.getIconFromIconList=function(e,t){return e?e.find(function(e){return e.id===t}):null};var pt=function(t){var n,o,r=e.useContext(re),i=e.useContext(ve).options,s=function(e){var n=Object.assign({},t.answer);a(n,e),t.onChange(t.index,n)},a=function(e,n){null===n?(e[se.HAS_OBJECT_VALUE]=null,e[se.HAS_DATA_VALUE]=null):t.answer[se.HAS_OBJECT_VALUE]||ce.isTypeahead(t.question)?e[se.HAS_OBJECT_VALUE]={"@id":n}:e[se.HAS_DATA_VALUE]={"@value":n}},l=t.question,c=ce.resolveValue(t.answer),p=function(n){var o=u.getLocalized(n[se.RDFS_LABEL],i.intl);/*#__PURE__*/return e.createElement("div",{className:"question-header"},o,ct.renderIcons(t.question,i,t.onCommentChange,t.showIcon))}(l),m=u.getLocalized(l[se.RDFS_COMMENT],i.intl);return n=ce.isTypeahead(l)?function(n,o,i){var a=ae.getStringHash(ce.getPossibleValuesQuery(t.question)),l=r.getOptions(a)||[];/*#__PURE__*/return e.createElement(ke,{question:t.question,answer:t.answer,label:o,title:i,value:n,onChange:s,options:l})}(c,p,m):(o=l)[se.HAS_OPTION]&&0!==o[se.HAS_OPTION].length?function(n,o,r){/*#__PURE__*/return e.createElement(Fe,{question:t.question,label:o,title:r,value:n,onChange:s})}(c,p,m):ce.isCalendar(l)?function(n,o,r){/*#__PURE__*/return e.createElement(Le,{question:t.question,value:n,title:r,label:o,onChange:s})}(c,p,m):ce.isCheckbox(l)?function(n,o,r){/*#__PURE__*/return e.createElement(be,{label:o,title:r,value:n,onChange:s,question:t.question})}(c,p,m):ce.isMaskedInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(Qe,{label:o,title:r,value:n,onChange:s,question:t.question,answer:t.answer})}(c,p,m):ce.isSparqlInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(Ve,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s,sparql:!0})}(c,p,m):ce.isTurtleInput(l)?function(n,o,r){/*#__PURE__*/return e.createElement(Ve,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s,turtle:!0})}(c,p,m):function(n,o,r){/*#__PURE__*/return e.createElement(Ve,{question:t.question,answer:t.answer,label:o,title:r,value:n,onChange:s})}(c,p,m),n};pt.propTypes={answer:a.object.isRequired,question:a.object.isRequired,onChange:a.func.isRequired,onCommentChange:a.func.isRequired,index:a.number,icons:a.object};var mt=/*#__PURE__*/function(){function e(){}return e.createValidator=function(t,n){return t[se.REQUIRES_ANSWER]?ce.isCheckbox(t)?e._generateRequiresAnswerCheckBoxValidator(t,n):e._generateRequiresAnswerValidator(t,n):function(){var e={};return e[se.HAS_VALID_ANSWER]=!0,delete e[se.HAS_VALIDATION_MESSAGE],e}},e._generateRequiresAnswerValidator=function(e,t){return function(n){var o=null;n[se.HAS_DATA_VALUE]?o=u.getJsonAttValue(n,se.HAS_DATA_VALUE):n[se.HAS_OBJECT_VALUE]&&(o=u.getJsonAttValue(n,se.HAS_OBJECT_VALUE,"@id"));var r=null!=o&&""!==o,i={};return i[se.HAS_VALID_ANSWER]=r,i[se.HAS_VALIDATION_MESSAGE]=r?null:u.getLocalized(e[u.RDFS_LABEL],t)+" is missing a value.",i}},e._generateRequiresAnswerCheckBoxValidator=function(e,t){return function(n){var o=null;n[se.HAS_DATA_VALUE]?o=u.getJsonAttValue(n,se.HAS_DATA_VALUE):n[se.HAS_OBJECT_VALUE]&&(o=u.getJsonAttValue(n,se.HAS_OBJECT_VALUE,"@id"));var r=null!=o&&""!==o&&!1!==o,i={};return i[se.HAS_VALID_ANSWER]=r,i[se.HAS_VALIDATION_MESSAGE]=r?null:u.getLocalized(e[u.RDFS_LABEL],t)+" must be checked.",i}},e}(),dt=/*#__PURE__*/function(t){function n(e){var n;return(n=t.call(this,e)||this).state={prefixes:e.prefixes},n}return J(n,t),n.prototype.render=function(){var t=/*#__PURE__*/e.createElement(T,{id:"prefixes",title:"Prefixes"},/*#__PURE__*/e.createElement(N,null,this.state.prefixes.sort(function(e,t){return e[se.PREFIX]<t[se.PREFIX]?-1:1}).map(function(t){/*#__PURE__*/return e.createElement(I,{key:t[se.PREFIX]},/*#__PURE__*/e.createElement("strong",null,t[se.PREFIX]),": ",t[se.NAMESPACE])})));/*#__PURE__*/return e.createElement(E,{trigger:"click",placement:"right",overlay:t},/*#__PURE__*/e.createElement("span",{className:this.props.iconClass},this.props.children))},n}(e.Component);dt.propTypes={prefixes:a.array.isRequired,children:a.element.isRequired,iconClass:a.string},dt.defaultProps={iconClass:""};var ht=function(e){var t;return(t=e.question[se.HAS_MEDIA_CONTENT])?Array.isArray(t)?P("div",{className:"col-6",children:t.map(function(e,n){return P("div",{className:"row embed-responsive-21by9 media-content-video-container mb-3",children:P("iframe",{src:t[n],className:"embed-responsive-item",allowFullScreen:!0})},n)})}):P("div",{className:"col-6",children:P("iframe",{src:t,className:"embed-responsive-item",allowFullScreen:!0})}):null},ft=/*#__PURE__*/function(t){function n(e){var o;return(o=t.call(this,e)||this).handleAnswerChange=function(e,t){if(ce.isSection(o.props.question)){var n=!!ce.resolveValue(t);o.setState({expanded:n})}o._handleChange(se.HAS_ANSWER,e,t)},o.handleSubQuestionChange=function(e,t){o._handleChange(se.HAS_SUBQUESTION,e,t)},o.handleCommentChange=function(e,t){o._handleChange(se.HAS_COMMENT,e,t)},o._toggleCollapse=function(){o.props.collapsible&&o.setState({expanded:!o.state.expanded})},o._onMouseEnterHandler=function(){o.setState({showIcon:!0})},o._onMouseLeaveHandler=function(){o.setState({showIcon:!1})},o._getHeaderClassName=function(){var e=o.props.question,t=o.props.collapsible,r=[];return r.push(n.getEmphasizedOnRelevantClass(e),"question-header"),ce.isWizardStep(e)&&r.push("wizard-step bg-primary text-white"),ce.isEmphasised(e)&&r.push(n.getEmphasizedClass(e)),ce.isSection(e)&&r.push("section-background"),t&&r.push("cursor-pointer"),o.isDebugged(e)&&r.push("show-irrelevant"),r},le.putObject(e.question["@id"],e.question),o.state={validator:null,expanded:!ce.isCollapsed(e.question),showIcon:!1},o}J(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({validator:mt.createValidator(this.props.question,this.context.options.intl)})},o.componentDidUpdate=function(){var e=this.props.question,t=this.context.options.startingQuestionId,n=e[se.HAS_SUBQUESTION].find(function(e){return e["@id"]===t});if(ce.isSection(e)&&ce.isAnswerable(e)){var o=this._getFirstAnswerValue();if(this.context.options.debugMode)return null;if(n)return null;this.state.expanded&&!o&&this.setState({expanded:!1})}},o._handleChange=function(e,t,n){var o=Object.assign({},this.props.question);if(o[e][t]=n,e===se.HAS_ANSWER){var r=this.state.validator(n);o=Object.assign({},o,r)}le.putObject(o["@id"],o),this.props.onChange(this.props.index,o)},o.isDebugged=function(e){var t=this.context.options.startingQuestionId;return!ce.isRelevant(e)&&(!!this.context.options.debugMode||null!=t&&!!ae.findQuestionById(t,e,!0,!1,!1))},o.render=function(){var t=this.props.question,n=this.renderQuestion(t);return this.isDebugged(t)?/*#__PURE__*/e.createElement("div",{className:"show-irrelevant"},n):ce.isHidden(t)?null:ce.isRelevant(t)?n:null},o.renderQuestion=function(t){if(ce.isAnswerable(t)&&!ce.isSection(t))/*#__PURE__*/return e.createElement("div",{id:t["@id"]},/*#__PURE__*/e.createElement("div",{className:"panel-title answerable-question"},this.renderAnswers()),/*#__PURE__*/e.createElement("div",{className:"answerable-subquestions"},this.renderSubQuestions()));if(ce.isAnswerable(t))return this.renderAnswerableSection();if(ce.isSection(t)){var o=this.props,r=o.collapsible,i=o.withoutCard,s=n._getQuestionCategoryClass(t);if(i)/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent());var a=u.getLocalized(t[u.RDFS_LABEL],this.context.options.intl),l=/*#__PURE__*/e.createElement(O.Body,{className:X("p-3",s)},this._renderQuestionContent());/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(y,{defaultActiveKey:this.state.expanded?void 0:a},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(y.Toggle,{as:O.Header,onClick:this._toggleCollapse,className:this._getHeaderClassName(),onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("h6",{className:"d-inline",id:t["@id"]},r&&!ce.isWizardStep(t)&&this._renderCollapseToggle(),a),this.renderQuestionIcons(),this.props.children),/*#__PURE__*/e.createElement(r?y.Collapse:e.Fragment,null,l))))}/*#__PURE__*/return e.createElement("div",null,this._renderQuestionContent())},o._renderQuestionContent=function(){var t=[];return this.state.expanded&&t.push(/*#__PURE__*/e.createElement(ht,{key:this.props.question["@id"]+"-media",question:this.props.question})),t.push(this.renderAnswers()),t.push(this.renderSubQuestions()),t},o.renderQuestionIcons=function(){return ct.renderIcons(this.props.question,this.context.options,this.handleCommentChange,this.state.showIcon)},o.renderAnswerableSection=function(){var t=this.props.question,o=this.props.collapsible,r=n._getQuestionCategoryClass(t),i=this.getShowIrrelevantClassname(t),s=/*#__PURE__*/e.createElement(O.Body,{className:X("p-3",r)},this.renderSubQuestions(i));/*#__PURE__*/return e.createElement(y,{activeKey:this.state.expanded?t["@id"]:void 0,className:"answerable-section"},/*#__PURE__*/e.createElement(O,{className:"mb-3"},/*#__PURE__*/e.createElement(O.Header,{onClick:this._toggleCollapse,className:this._getHeaderClassName()},this.renderAnswers()),o?/*#__PURE__*/e.createElement(y.Collapse,{className:i,eventKey:t["@id"]},s):{cardBody:s}))},o.getShowIrrelevantClassname=function(e){return!this.context.options.debugMode&&!ue.checkId(e[se.HAS_SUBQUESTION],this.context.options.startingQuestionId)||ce.hasAnswer(e)?"":"show-irrelevant"},o.renderAnswers=function(){for(var t,o=this.props.question,r=[],i=this._getAnswers(),s=0,a=i.length;s<a;s++)ce.isTextarea(o,ce.resolveValue(i[s]))||ce.isSparqlInput(o)||ce.isTurtleInput(o),t=X("answer",n._getQuestionCategoryClass(o),n.getEmphasizedOnRelevantClass(o)),r.push(/*#__PURE__*/e.createElement("div",{key:"row-item-"+s,className:t,id:o["@id"],onMouseEnter:this._onMouseEnterHandler,onMouseLeave:this._onMouseLeaveHandler},/*#__PURE__*/e.createElement("div",{className:"answer-content",style:this._getAnswerWidthStyle()},/*#__PURE__*/e.createElement(pt,{index:s,answer:i[s],question:o,onChange:this.handleAnswerChange,onCommentChange:this.handleCommentChange,showIcon:this.state.showIcon})),this._renderUnits(),this._renderPrefixes()));return r},o._getAnswers=function(){var e=this.props.question;return e[se.HAS_ANSWER]||(e[se.HAS_ANSWER]=[]),Array.isArray(e[se.HAS_ANSWER])||(e[se.HAS_ANSWER]=[e[se.HAS_ANSWER]]),0===e[se.HAS_ANSWER].length&&(e[se.HAS_ANSWER]=ce.isSection(e)&&!ce.isAnswerable(e)?[]:[ye.generateAnswer(e)]),e[se.HAS_ANSWER]},o._getAnswerWidthStyle=function(){var e=Number(this.props.question[se.HAS_INITIAL_INPUT_LENGTH]);return e?{flexGrow:0,maxWidth:"none",width:"calc("+e+"ch + 1.5rem + 2px)"}:{}},n._getAnswerClass=function(e,t){return t?"col-12":1===se.GENERATED_ROW_SIZE?"col-6":"col-"+se.COLUMN_COUNT/se.GENERATED_ROW_SIZE},n._getQuestionCategoryClass=function(e){var t=ce.getCategory(e);return t?"question-"+t:""},n.getEmphasizedClass=function(e){return ce.isEmphasised(e)?"bg-warning":""},n.getEmphasizedOnRelevantClass=function(e){return u.hasValue(e,se.LAYOUT_CLASS,se.LAYOUT.EMPHASISE_ON_RELEVANT)?"emphasise-on-relevant":""},o._renderCollapseToggle=function(){var t=this.context.options,n=this.state.expanded?t.i18n["section.collapse"]:t.i18n["section.expand"];/*#__PURE__*/return e.createElement("span",{onClick:this._toggleCollapse,title:n},/*#__PURE__*/e.createElement(this.state.expanded?Be:We,{title:n}))},o._renderPrefixes=function(){var t=this.props.question;return t[se.HAS_DECLARED_PREFIX]&&t[se.HAS_DECLARED_PREFIX].length?/*#__PURE__*/e.createElement(dt,{prefixes:t[se.HAS_DECLARED_PREFIX],iconClass:"help-icon-checkbox"},/*#__PURE__*/e.createElement(Xe,null)):null},o._renderUnits=function(){var t=this.props.question;return t[se.HAS_UNIT]?/*#__PURE__*/e.createElement("div",{className:"has-unit-label"},t[se.HAS_UNIT]):null},o.renderSubQuestions=function(t){for(var o=[],r=this._getSubQuestions(),i=this.context.options.debugMode,s=this.context.options.startingQuestionId,a=0;a<r.length;a++){var l=r[a],u=this.context.mapComponent(l,n),c=null;(i||"show-irrelevant"!==t||ae.findQuestionById(s,l,!0,!1,!1))&&(c=/*#__PURE__*/e.createElement(u,{key:"sub-question-"+a,question:l,onChange:this.handleSubQuestionChange,index:a})),o.push(c)}return o},o._getSubQuestions=function(){var e=this.props.question;return e[se.HAS_SUBQUESTION]||(e[se.HAS_SUBQUESTION]=[]),Array.isArray(e[se.HAS_SUBQUESTION])||(e[se.HAS_SUBQUESTION]=[e[se.HAS_SUBQUESTION]]),ue.orderByLocalizedLabels(e[se.HAS_SUBQUESTION],this.context.options.intl),ue.orderPreservingToplogicalSort(e[se.HAS_SUBQUESTION],se.HAS_PRECEDING_QUESTION),e[se.HAS_SUBQUESTION]},o._getFirstAnswerValue=function(){return ce.resolveValue(this._getAnswers()[0])},n}(e.Component);ft.contextType=ve,ft.propTypes={question:a.object.isRequired,onChange:a.func.isRequired,index:a.number,withoutCard:a.bool,collapsible:a.bool},ft.defaultProps={withoutCard:!1,collapsible:!0};var Et=/*#__PURE__*/function(t){function n(n){var o;return(o=t.call(this,n)||this).onNextStep=function(){o.context.updateFormQuestionsData(o.props.index,o.context.getFormQuestionsData()),o.props.onNextStep()},o.onPreviousStep=function(){o.props.onPreviousStep()},o._renderWizardStepButtons=function(){/*#__PURE__*/return e.createElement(w,{className:"m-3 float-right"},!o.props.isFirstStep&&/*#__PURE__*/e.createElement(A,{className:"mr-2",onClick:o.onPreviousStep,variant:"primary",size:"sm"},o.props.options.i18n["wizard.previous"]),!o.props.isLastStep&&/*#__PURE__*/e.createElement(A,{onClick:o.onNextStep,variant:"primary",size:"sm"},o.props.options.i18n["wizard.next"]))},o.onChange=function(e,t){o.context.updateFormQuestionsData(o.props.index||e,Object.assign({},o.props.question,t))},o}return J(n,t),n.prototype.render=function(){var t=this.context.getFormQuestionsData([this.props.index]);/*#__PURE__*/return e.createElement(e.Fragment,null,/*#__PURE__*/e.createElement(ft,{question:t,onChange:this.onChange,collapsible:ce.isAnswerable(t)}),this.props.options.wizardStepButtons&&this._renderWizardStepButtons())},n}(e.Component);Et.propTypes={options:a.object.isRequired,question:a.object.isRequired,index:a.number.isRequired,onNextStep:a.func,onPreviousStep:a.func,mapComponent:a.func,isFirstStep:a.bool,isLastStep:a.bool},Et.contextType=de;var vt=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,s=r(ve).options;/*#__PURE__*/return e.createElement(O.Header,null,/*#__PURE__*/e.createElement(b,{variant:"tabs",activeKey:i,onSelect:function(e){return o(parseInt(e))}},n.map(function(t,n){/*#__PURE__*/return e.createElement(L,{key:"nav"+n,id:"wizard-nav-"+n},/*#__PURE__*/e.createElement(R,{eventKey:n,active:n===i?"active":"",hidden:!s.debugMode&&!ce.isRelevant(t),className:X([s.debugMode&&!ce.isRelevant(t)?"show-irrelevant":ft.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s.intl)))})))};vt.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};var gt=function(t){var n=t.steps,o=t.onNavigate,i=t.currentStep,s=r(ve).options;/*#__PURE__*/return e.createElement("div",{className:"wizard-nav col-2 p-0"},/*#__PURE__*/e.createElement(N,null,n.map(function(t,n){/*#__PURE__*/return e.createElement(I,{hidden:!s.debugMode&&!ce.isRelevant(t),key:"nav"+n,onClick:function(){return o(n)},id:"wizard-nav-"+n,action:!0,active:n===i?"active":"",variant:"default",className:X([s.debugMode&&!ce.isRelevant(t)?"show-irrelevant":ft.getEmphasizedClass(t),"wizard-nav"])},u.getLocalized(t[u.RDFS_LABEL],s.intl))})))};gt.propTypes={currentStep:a.number.isRequired,steps:a.array.isRequired,onNavigate:a.func.isRequired};var St=function(e,t){var n=function e(n,o){return n?n["@id"]===t?o:ae.asArray(n[se.HAS_SUBQUESTION]).findIndex(function(t,n){return-1!==e(t,n)}):-1};return e.findIndex(function(e,t){return-1!==n(e,t)})},At=function(){var t=e.useContext(de),n=e.useContext(ve),r=n.options,i=n.mapComponent,s=0;r.startingQuestionId?-1===(s=St(t.getFormQuestionsData(),r.startingQuestionId))&&(console.warn("Question with id "+r.startingQuestionId+" not found!"),s=0):r.startingStep&&(s=r.startingStep<t.getFormQuestionsData().length?r.startingStep:0);var a=e.useState(s),l=a[0],u=a[1],c=e.useState(!1),p=c[0],m=c[1];o(function(){if(r.startingQuestionId&&!p){var e=document.getElementById(r.startingQuestionId);e&&(e.scrollIntoView(),e.classList.add("text-danger"),m(!0))}});var d,h=null;t.getFormQuestionsData().length>1&&(d=t.getFormQuestionsData(),h=/*#__PURE__*/e.createElement(r.horizontalWizardNav?vt:gt,{currentStep:l,steps:d,onNavigate:function(e){var n=t.getFormQuestionsData();e===l||e>=n.length||e>l&&!n[e].visited&&!r.enableForwardSkip||u(e)}}));var f,E,v=r.horizontalWizardNav;/*#__PURE__*/return e.createElement(O,{className:v?"":"flex-row p-3"},h,/*#__PURE__*/e.createElement("div",{className:v?"card-body p-3":h?"col-10 p-0 pl-3":"col-12 p-0"},(E=i(f=t.getFormQuestionsData()[l],Et),/*#__PURE__*/e.createElement(E,{options:r,key:"step"+l,question:f,onNextStep:function(){var e=t.getFormQuestionsData();l!==e.length-1&&(e[l+1].visited=!0,u(function(e){return e+1}))},onPreviousStep:function(){0!==l&&u(function(e){return e-1})},mapComponent:i,index:l,isFirstStep:0===l,isLastStep:l===t.getFormQuestionsData().length-1}))))},_t=/*#__PURE__*/e.forwardRef(function(t,n){var o=e.useContext(ve).options;/*#__PURE__*/return e.createElement(H,Y({size:"xl",animation:!0},o.modalProps),/*#__PURE__*/e.createElement(H.Header,{closeButton:!0},/*#__PURE__*/e.createElement(H.Title,null,o.modalProps.title)),/*#__PURE__*/e.createElement(H.Body,{className:"overflow-hidden p-0"},t.children))});_t.propTypes={children:a.element.isRequired};var Ct=/*#__PURE__*/function(t){function n(){for(var n,o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];return(n=t.call.apply(t,[this].concat(r))||this).getFormData=function(){var e=n.context.getData(),t=n.context.getFormQuestionsData();return ye.buildQuestionAnswerModel(e,t)},n.getFormQuestionsData=function(){return n.context.getFormQuestionsData()},n.handleStepChange=function(e,t,o){n.context.updateFormQuestionsData(t,Object.assign({},e,o))},n.renderWizardlessForm=function(){var t=n.context.getFormQuestionsData();/*#__PURE__*/return e.createElement(G,{className:"p-3"},t.map(function(e,t){return n._mapQuestion(e,t)}))},n}J(n,t);var o=n.prototype;return o._mapQuestion=function(t,n){var o=this,r=this.props.mapComponent(t,ft);/*#__PURE__*/return e.createElement(r,{key:t["@id"],question:t,onChange:function(e,n){return o.handleStepChange(t,e,n)},index:n})},o.render=function(){var t=this.props.modalView,n=this.context.getFormQuestionsData();if(!n.length)/*#__PURE__*/return e.createElement(G,{className:"p-3 font-italic"},"There are no questions available...");var o=n.every(function(e){return!ce.isWizardStep(e)});return t?/*#__PURE__*/e.createElement(_t,null,o?this.renderWizardlessForm():/*#__PURE__*/e.createElement(At,null)):o?this.renderWizardlessForm():/*#__PURE__*/e.createElement(At,null)},n}(e.Component);Ct.contextType=de;var Tt=/*#__PURE__*/s(function(t,r){var i=n(!0),s=i[0],a=i[1],l=n(null),u=l[0],c=l[1],p=n(null),m=p[0],d=p[1];if(o(function(){!function(){try{return Promise.resolve(Oe.constructForm(t.form,t.options.intl)).then(function(e){var t=e[0],n=e[1];t.formQuestions.some(function(e){return ce.isWizardStep(e)})&&(t.formQuestions[0].visited=!0),c(t),d(n),a(!1)})}catch(e){return Promise.reject(e)}}()},[t.form]),s)return t.loader||/*#__PURE__*/e.createElement(O,{className:"p-3 font-italic"},"Loading SForms...");var h=function(e,t){return function(n,o){if(!e)return o;for(var r,i=ee(e);!(r=i()).done;){var s=r.value,a=s.component;if((0,s.mapRule)(n,t))return a}return o}}(t.componentMapRules,m);/*#__PURE__*/return e.createElement(Se,{components:t.components,componentsOptions:t.componentsOptions,mapComponent:h,options:t.options},/*#__PURE__*/e.createElement(ie,{fetchTypeAheadValues:t.fetchTypeAheadValues},/*#__PURE__*/e.createElement(he,{data:m,formQuestions:u.formQuestions,isFormValid:t.isFormValid},/*#__PURE__*/e.createElement(Ct,{ref:r,modalView:t.options&&t.options.modalView,mapComponent:h}))))});Tt.propTypes={form:a.object.isRequired,options:a.object.isRequired,componentMapRules:a.array,components:a.object,componentsOptions:a.object,fetchTypeAheadValues:a.func,isFormValid:a.func,loader:a.element};var Nt={"comment.form.placeholder":"Sem napište své komentáře (Ctrl+Enter pro potvrzení)"},It={"comment.form.placeholder":"Write your comments here (Ctrl+Enter to confirm, Esc to cancel)"},Ot=/*#__PURE__*/e.createContext({}),yt=function(e){var t=e.locale,n=void 0===t?navigator.language:t,o=It;return n===se.LANG.cs.locale&&(o=Nt),P(Ot.Provider,{value:{locale:n,lang:o},children:P(W,{locale:n,messages:o,children:e.children})})};export{pt as Answer,ve as ConfigurationContext,se as Constants,de as FormQuestionsContext,ce as FormUtils,Je as HelpIcon,yt as IntlContextProvider,Ie as JsonLdFramingUtils,le as JsonLdObjectMap,ue as JsonLdObjectUtils,ft as Question,ct as QuestionStatic,Et as WizardStep,Tt as default};
2
2
  //# sourceMappingURL=s-forms.js.map