From 1aceaea8a02b4b9f26aaf339bcd1d07df8878d93 Mon Sep 17 00:00:00 2001 From: hdoupe Date: Tue, 1 Oct 2019 11:42:37 -0400 Subject: [PATCH 1/8] Swap to token auth for comp-api-user --- distributed/api/celery_app/__init__.py | 7 +++---- templates/base.html | 2 +- webapp/apps/comp/views/api.py | 8 +++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/distributed/api/celery_app/__init__.py b/distributed/api/celery_app/__init__.py index a36aa9ff..617d4e86 100644 --- a/distributed/api/celery_app/__init__.py +++ b/distributed/api/celery_app/__init__.py @@ -12,8 +12,7 @@ COMP_URL = os.environ.get("COMP_URL") -COMP_API_USER = os.environ.get("COMP_API_USER") -COMP_API_USER_PASS = os.environ.get("COMP_API_USER_PASS") +COMP_API_TOKEN = os.environ.get("COMP_API_TOKEN") CELERY_BROKER_URL = os.environ.get("CELERY_BROKER_URL", "redis://localhost:6379") CELERY_RESULT_BACKEND = os.environ.get( @@ -112,7 +111,7 @@ def post_results(sender=None, headers=None, body=None, **kwargs): resp = requests.put( f"{COMP_URL}/outputs/api/", json=kwargs["retval"], - auth=(COMP_API_USER, COMP_API_USER_PASS), + headers={"Authorization": f"Token {COMP_API_TOKEN}"}, ) print("resp", resp.status_code) if resp.status_code == 400: @@ -122,7 +121,7 @@ def post_results(sender=None, headers=None, body=None, **kwargs): resp = requests.put( f"{COMP_URL}/inputs/api/", json=kwargs["retval"], - auth=(COMP_API_USER, COMP_API_USER_PASS), + headers={"Authorization": f"Token {COMP_API_TOKEN}"}, ) print("resp", resp.status_code) if resp.status_code == 400: diff --git a/templates/base.html b/templates/base.html index 0f701f77..67c5f4bb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -62,7 +62,7 @@ Sign in - +
  • {{object.inputs.pretty_meta_parameters}}
  • - {% for sect, jsonobj in object.inputs.inputs_file.items %} + {% for sect, jsonobj in object.inputs.custom_adjustment.items %}
    • Inputs for section: {{sect}}

    • diff --git a/webapp/apps/comp/asyncsubmit.py b/webapp/apps/comp/asyncsubmit.py index 9b43ef71..f2a52d02 100755 --- a/webapp/apps/comp/asyncsubmit.py +++ b/webapp/apps/comp/asyncsubmit.py @@ -72,7 +72,7 @@ def submit(self): meta_parameters=self.valid_meta_params, adjustment=result["adjustment"], errors_warnings=result["errors_warnings"], - inputs_file=result["inputs_file"], + custom_adjustment=result["custom_adjustment"], project=self.project, owner=getattr(self.request.user, "profile", None), job_id=result["job_id"], diff --git a/webapp/apps/comp/meta_parameters.py b/webapp/apps/comp/meta_parameters.py index e85f70ad..d231c752 100755 --- a/webapp/apps/comp/meta_parameters.py +++ b/webapp/apps/comp/meta_parameters.py @@ -46,6 +46,9 @@ class MetaParameter: def translate_to_django(meta_parameters: dict) -> MetaParameters: + + # TODO: handle schema + meta_parameters.pop("schema", None) new_mp = {} for name, data in meta_parameters.items(): if data["type"] == "str" and "choice" in data["validators"]: diff --git a/webapp/apps/comp/models.py b/webapp/apps/comp/models.py index b7750bbb..b8417112 100755 --- a/webapp/apps/comp/models.py +++ b/webapp/apps/comp/models.py @@ -58,7 +58,7 @@ class Inputs(models.Model): # Validated GUI input that has been parsed to have the correct data types, # or JSON reform uploaded as file - inputs_file = JSONField(default=dict, blank=True, null=True) + custom_adjustment = JSONField(default=dict, blank=True, null=True) errors_warnings = JSONField(default=None, blank=True, null=True) @@ -121,7 +121,7 @@ def deserialized_inputs(self): @property def display_params(self): - return self.inputs_file or self.adjustment + return self.custom_adjustment or self.adjustment @property def pretty_meta_parameters(self): diff --git a/webapp/apps/comp/parser.py b/webapp/apps/comp/parser.py index d0a859ad..69d8e284 100755 --- a/webapp/apps/comp/parser.py +++ b/webapp/apps/comp/parser.py @@ -85,5 +85,5 @@ def parse_parameters(self): "queue_length": queue_length, "adjustment": adjustment, "errors_warnings": errors_warnings, - "inputs_file": None, + "custom_adjustment": None, } diff --git a/webapp/apps/comp/serializers.py b/webapp/apps/comp/serializers.py index 883f80be..9d3722d9 100755 --- a/webapp/apps/comp/serializers.py +++ b/webapp/apps/comp/serializers.py @@ -56,7 +56,7 @@ class Meta: "hashid", "meta_parameters", "adjustment", - "inputs_file", + "custom_adjustment", "errors_warnings", "job_id", "status", diff --git a/webapp/apps/comp/tests/test_asyncviews.py b/webapp/apps/comp/tests/test_asyncviews.py index 169e919e..4f910c3a 100755 --- a/webapp/apps/comp/tests/test_asyncviews.py +++ b/webapp/apps/comp/tests/test_asyncviews.py @@ -408,7 +408,8 @@ def test_outputs_api(db, api_client, profile, password): # Test data errors return 400 user = User.objects.get(username="comp-api-user") - api_client.login(username=user.username, password="heyhey2222") + # api_client.login(username=user.username, password="heyhey2222") + api_client.credentials(HTTP_AUTHORIZATION=f"Token {user.auth_token.key}") assert ( api_client.put("/outputs/api/", data={"bad": "data"}, format="json").status_code == 400 diff --git a/webapp/apps/comp/views/api.py b/webapp/apps/comp/views/api.py index 11d20f19..3dfca0b5 100755 --- a/webapp/apps/comp/views/api.py +++ b/webapp/apps/comp/views/api.py @@ -11,7 +11,7 @@ from rest_framework.response import Response from rest_framework import status -import s3like +import cs_storage from webapp.apps.users.models import Project @@ -167,7 +167,7 @@ def get(self, request, *args, **kwargs): if self.object.outputs: data = sim.data outputs = data["outputs"]["outputs"] - data["outputs"] = s3like.read_from_s3like(outputs) + data["outputs"] = cs_storage.read(outputs) return Response(data, status=status.HTTP_200_OK) elif self.object.traceback is not None: return Response(sim.data, status=status.HTTP_200_OK) @@ -240,7 +240,7 @@ def put(self, request, *args, **kwargs): # successful run if data["status"] == "SUCCESS": inputs.errors_warnings = data["errors_warnings"] - inputs.inputs_file = data.get("inputs_file", None) + inputs.custom_adjustment = data.get("custom_adjustment", None) inputs.status = "SUCCESS" if is_valid(inputs) else "INVALID" inputs.save() if inputs.status == "SUCCESS": diff --git a/webapp/apps/comp/views/views.py b/webapp/apps/comp/views/views.py index e835fcc9..913b3a5c 100755 --- a/webapp/apps/comp/views/views.py +++ b/webapp/apps/comp/views/views.py @@ -25,7 +25,8 @@ from rest_framework.response import Response from rest_framework import status -import s3like +import gcsfs +import cs_storage from webapp.settings import DEBUG @@ -44,7 +45,7 @@ from .core import AbstractRouterView, InputsMixin, GetOutputsObjectMixin -OBJ_STORAGE_URL = os.environ.get("OBJ_STORAGE_URL") +BUCKET = os.environ.get("BUCKET") class InputsMixin: @@ -270,7 +271,7 @@ def render_v0(self, request): def render_v1(self, request): renderable = {"renderable": self.object.outputs["outputs"]["renderable"]} - outputs = s3like.read_from_s3like(renderable) + outputs = cs_storage.read(renderable) return render( request, "comp/outputs/v1/sim_detail.html", @@ -294,8 +295,8 @@ def is_from_file(self): return False def inputs_to_display(self): - if hasattr(self.object.inputs, "inputs_file"): - return json.dumps(self.object.inputs.inputs_file, indent=2) + if hasattr(self.object.inputs, "custom_adjustment"): + return json.dumps(self.object.inputs.custom_adjustment, indent=2) else: return "" @@ -342,15 +343,13 @@ def render_v1(self, request): if request.GET.get("raw_json", False): return self.render_json() zip_loc = self.object.outputs["outputs"]["downloadable"]["ziplocation"] - endpoint = s3like.OBJ_STORAGE_EDGE.replace("https://", "") - url = f"https://{s3like.OBJ_STORAGE_BUCKET}.{endpoint}/{zip_loc}" - zip_resp = requests.get(url) - zip_data = BytesIO(zip_resp.content) - resp = HttpResponse(zip_data.getvalue(), content_type="application/zip") - resp[ - "Content-Disposition" - ] = f"attachment; filename={self.object.zip_filename()}" - return resp + fs = gcsfs.GCSFileSystem(BUCKET) + with fs.open(f"{BUCKET}/{zip_loc}", "rb") as f: + resp = HttpResponse(f, content_type="application/zip") + resp[ + "Content-Disposition" + ] = f"attachment; filename={self.object.zip_filename()}" + return resp def render_json(self): raw_json = json.dumps( From c7d7b7cbdda337340c672a92661a74e23e769d62 Mon Sep 17 00:00:00 2001 From: hdoupe Date: Wed, 2 Oct 2019 17:12:33 -0400 Subject: [PATCH 5/8] Simplify docker-compose.yml file --- docker-compose.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 21bd2c1d..d94d51d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,10 @@ -version: '3.7' +version: "3.7" services: db: image: postgres volumes: - postgres_data:/var/lib/postgresql/data/ - networks: - - distributed_worker_net webbase: build: context: ./ @@ -25,20 +23,13 @@ services: - DEBUG=True - WORKERS=${WORKERS}:5050 - LOCAL=True - - OBJ_STORAGE_EDGE=https://sfo2.cdn.digitaloceanspaces.com - - OBJ_STORAGE_BUCKET=compresults-dev + - BUCKET=cs-outputs-dev-1 ports: - "8000:8000" container_name: web depends_on: - db - webbase - networks: - - distributed_worker_net - -networks: - distributed_worker_net: - external: true volumes: postgres_data: From f6dddb7721cf044ba765f87043aedf0293d07d4b Mon Sep 17 00:00:00 2001 From: hdoupe Date: Wed, 2 Oct 2019 17:13:29 -0400 Subject: [PATCH 6/8] Update react client to ignore schema --- src/ParamTools.js | 8 ++++++++ static/js/inputs.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ParamTools.js b/src/ParamTools.js index 2d265612..92ba1220 100644 --- a/src/ParamTools.js +++ b/src/ParamTools.js @@ -218,6 +218,11 @@ function labelsToString(valueObject) { } export function convertToFormik(data) { + // TODO: handle schema. + if ("schema" in data.meta_parameters) { + delete data.meta_parameters["schema"]; + } + var initialValues = { adjustment: {}, meta_parameters: {} }; var sects = {}; var section_1 = ""; @@ -251,6 +256,9 @@ export function convertToFormik(data) { ); } for (const [param, param_data] of Object.entries(params)) { + if (param === "schema") { + continue; + } param_data["form_fields"] = {}; // Group by major section, section_1 and section_2. if ("section_1" in param_data) { diff --git a/static/js/inputs.js b/static/js/inputs.js index 9ae2171f..2e3c8736 100644 --- a/static/js/inputs.js +++ b/static/js/inputs.js @@ -129,4 +129,4 @@ e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e. * @license MIT * @namespace TraceKit */ -var Ae=Object(se.e)(),Me={_report:!1,_collectWindowErrors:!1,_computeStackTrace:!1,_linesOfContext:!1},Pe="?",Re=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function Fe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function De(){return"undefined"==typeof document||null==document.location?"":document.location.href}Me._report=function(){var e,t,n=[],r=null,o=null;function i(e,t,r){var o=null;if(!t||Me._collectWindowErrors){for(var i in n)if(Fe(n,i))try{n[i](e,t,r)}catch(e){o=e}if(o)throw o}}function a(t,n,r,a,s){var l=null;if(s=Object(ue.d)(s)?s.error:s,t=Object(ue.d)(t)?t.message:t,o)Me._computeStackTrace._augmentStackTraceWithInitialElement(o,n,r,t),u();else if(s&&Object(ue.c)(s))(l=Me._computeStackTrace(s)).mechanism="onerror",i(l,!0,s);else{var c,f={url:n,line:r,column:a},p=t;if("[object String]"==={}.toString.call(t)){var d=t.match(Re);d&&(c=d[1],p=d[2])}f.func=Pe,f.context=null,i(l={name:c,message:p,mode:"onerror",mechanism:"onerror",stack:[re.a({},f,{url:f.url||De()})]},!0,null)}return!!e&&e.apply(this,arguments)}function s(e){var t=e&&void 0!==e.reason?e.reason:e,n=Me._computeStackTrace(t);n.mechanism="onunhandledrejection",i(n,!0,t)}function u(){var e=o,t=r;o=null,r=null,i(e,!1,t)}function l(e){if(o){if(r===e)return;u()}var t=Me._computeStackTrace(e);throw o=t,r=e,setTimeout(function(){r===e&&u()},t.incomplete?2e3:0),e}return l._subscribe=function(e){n.push(e)},l._installGlobalHandler=function(){!0!==t&&(e=Ae.onerror,Ae.onerror=a,t=!0)},l._installGlobalUnhandledRejectionHandler=function(){Ae.onunhandledrejection=s},l}(),Me._computeStackTrace=function(){function e(e){if(!e||!e.stack)return null;for(var t,n,r,o=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack||[-a-z]+:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,u=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),c=[],f=/^(.*) is undefined$/.exec(e.message),p=0,d=l.length;p eval")>-1&&(t=s.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==p||n[5]||void 0===e.columnNumber||(c[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||Pe,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=Pe),r.context=null,c.push(r)}return c.length?(c[0]&&c[0].line&&!c[0].column&&f&&(c[0].column=null),{mode:"stack",name:e.name,message:e.message,stack:c}):null}function t(e,t,n,r){var o={url:t,line:n};if(o.url&&o.line){if(e.incomplete=!1,o.func||(o.func=Pe),o.context||(o.context=null),/ '([^']+)' /.exec(r)&&(o.column=null),e.stack.length>0&&e.stack[0].url===o.url){if(e.stack[0].line===o.line)return!1;if(!e.stack[0].line&&e.stack[0].func===o.func)return e.stack[0].line=o.line,e.stack[0].context=o.context,!1}return e.stack.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function n(e,r){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},l=!1,c=n.caller;c&&!l;c=c.caller)if(c!==qe&&c!==Me._report){if(i={url:null,func:Pe,args:[],line:null,column:null},c.name?i.func=c.name:(o=a.exec(c.toString()))&&(i.func=o[1]),void 0===i.func)try{i.func=o.input.substring(0,o.input.indexOf("{"))}catch(e){}u[""+c]?l=!0:u[""+c]=!0,s.push(i)}r&&s.splice(0,r);var f={mode:"callers",name:e.name,message:e.message,stack:s};return t(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function r(t,r){var o=null;r=null==r?0:+r;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s0&&n(!1)},e);Promise.all(t._buffer).then(function(){clearTimeout(r),n(!0)}).catch(function(){n(!0)})})},e}(),We=function(){function e(e){this.options=e,this._buffer=new $e(30),this.url=new xe(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new ge("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e}(),Ye=Object(se.e)(),Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype.sendEvent=function(e){var t={body:JSON.stringify(e),method:"POST",referrerPolicy:Ne()?"origin":""};return this._buffer.add(Ye.fetch(this.url,t).then(function(e){return{status:ke.fromHttpCode(e.status)}}))},t}(We),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype.sendEvent=function(e){var t=this;return this._buffer.add(new Promise(function(n,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&(200===o.status&&n({status:ke.fromHttpCode(o.status)}),r(o))},o.open("POST",t.url),o.send(JSON.stringify(e))}))},t}(We),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=re.a({},this._options.transportOptions,{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):Te()?new Ge(t):new Ke(t)},t.prototype.eventFromException=function(e,t){var n,r=this;if(Object(ue.d)(e)&&e.error)return e=e.error,n=Ve(qe(e)),_e.a.resolve(this._buildEvent(n,t));if(Object(ue.a)(e)||Object(ue.b)(e)){var o=e,i=o.name||(Object(ue.a)(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;return this.eventFromMessage(a,Oe.Error,t).then(function(e){return Object(se.a)(e,a),_e.a.resolve(r._buildEvent(e,t))})}if(Object(ue.c)(e))return n=Ve(qe(e)),_e.a.resolve(this._buildEvent(n,t));if(Object(ue.e)(e)&&t&&t.syntheticException)return n=function(e,t){var n=Object.keys(e).sort(),r={extra:{__serialized__:Object(me.c)(e)},message:"Non-Error exception captured with keys: "+fe(n)};if(t){var o=He(qe(t).stack);r.stacktrace={frames:o}}return r}(e,t.syntheticException),Object(se.a)(n,"Custom Object",void 0,{handled:!0,synthetic:!0,type:"generic"}),n.level=Oe.Error,_e.a.resolve(this._buildEvent(n,t));var s=e;return this.eventFromMessage(s,void 0,t).then(function(e){return Object(se.a)(e,""+s,void 0,{handled:!0,synthetic:!0,type:"generic"}),e.level=Oe.Error,_e.a.resolve(r._buildEvent(e,t))})},t.prototype._buildEvent=function(e,t){return re.a({},e,{event_id:t&&t.event_id})},t.prototype.eventFromMessage=function(e,t,n){void 0===t&&(t=Oe.Info);var r={event_id:n&&n.event_id,level:t,message:e};if(this._options.attachStacktrace&&n&&n.syntheticException){var o=He(qe(n.syntheticException).stack);r.stacktrace={frames:o}}return _e.a.resolve(r)},t}(Ce),Qe=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ze,t)||this}return re.b(t,e),t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",t.sdk=re.a({},t.sdk,{name:"sentry.javascript.browser",packages:re.e(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:"5.6.1"}]),version:"5.6.1"}),e.prototype._prepareEvent.call(this,t,n,r)},t.prototype.showReportDialog=function(e){void 0===e&&(e={});var t=Object(se.e)().document;if(t)if(this._isEnabled()){var n=e.dsn||this.getDsn();if(e.eventId)if(n){var r=t.createElement("script");r.async=!0,r.src=new xe(n).getReportDialogEndpoint(e),e.onLoad&&(r.onload=e.onLoad),(t.head||t.body).appendChild(r)}else ae.a.error("Missing `Dsn` option in showReportDialog call");else ae.a.error("Missing `eventId` option in showReportDialog call")}else ae.a.error("Trying to call showReportDialog with Sentry Client is disabled")},t}(Se);function Je(e){for(var t=[],n=1;n"}0!==t.length&&Object(ie.a)().addBreadcrumb({category:"ui."+e,message:t},{event:n,name:e})};st&&clearTimeout(st),t?st=setTimeout(r):r()}}}function lt(){return function(e){var t;try{t=e.target}catch(e){return}var n=t&&t.tagName;n&&("INPUT"===n||"TEXTAREA"===n||t.isContentEditable)&&(tt||ut("input")(e),clearTimeout(tt),tt=setTimeout(function(){tt=void 0},rt))}}function ct(e){for(var t,n=e,r=[],o=0,i=0,a=" > ".length;n&&o++<5&&!("html"===(t=ft(n))||o>1&&i+r.length*a+t.length>=80);)r.push(t),i+=t.length,n=n.parentNode;return r.reverse().join(" > ")}function ft(e){var t,n,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(t=e.className)&&Object(ue.h)(t))for(n=t.split(/\s+/),i=0;i"}catch(e){return""}}var ht,mt=Object(se.e)(),vt=function(){function e(t){this.name=e.id,this._options=re.a({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype._instrumentConsole=function(){"console"in mt&&["debug","info","warn","error","log","assert"].forEach(function(t){t in mt.console&&Object(me.a)(mt.console,t,function(n){return function(){for(var r=[],o=0;o2?t[2]:void 0;return r&&a(ht,String(r)),e.apply(this,t)}}},e.prototype._instrumentXHR=function(){if("XMLHttpRequest"in mt){var t=XMLHttpRequest.prototype;Object(me.a)(t,"open",function(e){return function(){for(var t=[],n=0;n"},handled:!0,type:"instrument"}},a)}):i.onreadystatechange=a,t.apply(this,r)}})}function n(e,t){e in t&&"function"==typeof t[e]&&Object(me.a)(t,e,function(t){return at(t,{mechanism:{data:{function:e,handler:t&&t.name||""},handled:!0,type:"instrument"}})})}},e.addBreadcrumb=function(t,n){Object(ie.a)().getIntegration(e)&&Object(ie.a)().addBreadcrumb(t,n)},e.prototype.setupOnce=function(){this._options.console&&this._instrumentConsole(),this._options.dom&&this._instrumentDOM(),this._options.xhr&&this._instrumentXHR(),this._options.fetch&&this._instrumentFetch(),this._options.history&&this._instrumentHistory()},e.id="Breadcrumbs",e}();function gt(e){try{var t=JSON.parse(e);vt.addBreadcrumb({category:"sentry",event_id:t.event_id,level:t.level||Oe.fromString("error"),message:Object(se.d)(t)},{event:t})}catch(e){ae.a.error("Error while adding sentry type breadcrumb")}}var yt=function(){function e(t){this.name=e.id,this._options=re.a({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,Le(function(t,n,r){if(!(ot>0)){var o=Object(ie.a)().getIntegration(e);o&&Object(ie.a)().captureEvent(o._eventFromGlobalHandler(t,r),{data:{stack:t},originalException:r})}}),this._options.onerror&&(ae.a.log("Global Handler attached: onerror"),Ie()),this._options.onunhandledrejection&&(ae.a.log("Global Handler attached: onunhandledrejection"),Ue())},e.prototype._eventFromGlobalHandler=function(e,t){if(!Object(ue.h)(e.message)&&"onunhandledrejection"!==e.mechanism){var n=e.message;e.message=n.error&&Object(ue.h)(n.error.message)?n.error.message:"No error message"}if("onunhandledrejection"===e.mechanism&&e.incomplete)return this._eventFromIncompleteRejection(e,t);var r=Ve(e),o={mode:e.mode};e.message&&(o.message=e.message),e.name&&(o.name=e.name);var i=Object(ie.a)().getClient(),a=i&&i.getOptions().maxValueLength||250,s=e.original?le(JSON.stringify(Object(me.b)(e.original)),a):"",u="onunhandledrejection"===e.mechanism?"UnhandledRejection":"Error";return Object(se.a)(r,s,u,{data:o,handled:!1,type:e.mechanism}),r},e.prototype._eventFromIncompleteRejection=function(e,t){var n={level:Oe.Error};return Object(ue.f)(t)?n.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+t}]}:(n.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with keys: "+fe(Object.keys(t).sort())}]},n.extra={__serialized__:Object(me.c)(t)}),n.exception.values&&n.exception.values[0]&&(n.exception.values[0].mechanism={data:re.a({incomplete:!0,mode:e.mode},e.message&&{message:e.message},e.name&&{name:e.name}),handled:!1,type:e.mechanism}),n},e.id="GlobalHandlers",e}(),bt="cause",xt=5,_t=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||bt,this._limit=t.limit||xt}return e.prototype.setupOnce=function(){Object(oe.b)(function(t,n){var r=Object(ie.a)().getIntegration(e);return r?r._handler(t,n):t})},e.prototype._handler=function(e,t){if(!(e.exception&&e.exception.values&&t&&t.originalException instanceof Error))return e;var n=this._walkErrorTree(t.originalException,this._key);return e.exception.values=re.e(n,e.exception.values),e},e.prototype._walkErrorTree=function(e,t,n){if(void 0===n&&(n=[]),!(e[t]instanceof Error)||n.length+1>=this._limit)return n;var r=Be(qe(e[t]));return this._walkErrorTree(e[t],t,re.e([r],n))},e.id="LinkedErrors",e}(),wt=Object(se.e)(),Et=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Object(oe.b)(function(t){if(Object(ie.a)().getIntegration(e)){if(!wt.navigator||!wt.location)return t;var n=t.request||{};return n.url=n.url||wt.location.href,n.headers=n.headers||{},n.headers["User-Agent"]=wt.navigator.userAgent,re.a({},t,{request:n})}return t})},e.id="UserAgent",e}(),kt=[new r.InboundFilters,new r.FunctionToString,new pt,new vt,new yt,new _t,new Et];var St=n(4),Ot=n(110),jt=n.n(Ot),Ct=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Tt}(e)}(e)};var Tt="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Nt(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Mt((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function At(e,t,n){return e.concat(t).map(function(e){return Nt(e,n)})}function Mt(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||At,n.isMergeableObject=n.isMergeableObject||Ct;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){r[t]=Nt(e[t],n)}),Object.keys(t).forEach(function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=Mt(e[o],t[o],n):r[o]=Nt(t[o],n)}),r}(e,t,n):Nt(t,n)}Mt.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return Mt(e,n,t)},{})};var Pt=Mt,Rt=n(145),Ft=n.n(Rt),Dt=n(230),Lt=n.n(Dt);var It=function(){this.__data__=[],this.size=0};var Ut=function(e,t){return e===t||e!=e&&t!=t};var qt=function(e,t){for(var n=e.length;n--;)if(Ut(e[n][0],t))return n;return-1},zt=Array.prototype.splice;var Bt=function(e){var t=this.__data__,n=qt(t,e);return!(n<0)&&(n==t.length-1?t.pop():zt.call(t,n,1),--this.size,!0)};var Vt=function(e){var t=this.__data__,n=qt(t,e);return n<0?void 0:t[n][1]};var Ht=function(e){return qt(this.__data__,e)>-1};var $t=function(e,t){var n=this.__data__,r=qt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Wt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=kr},Or={};Or["[object Float32Array]"]=Or["[object Float64Array]"]=Or["[object Int8Array]"]=Or["[object Int16Array]"]=Or["[object Int32Array]"]=Or["[object Uint8Array]"]=Or["[object Uint8ClampedArray]"]=Or["[object Uint16Array]"]=Or["[object Uint32Array]"]=!0,Or["[object Arguments]"]=Or["[object Array]"]=Or["[object ArrayBuffer]"]=Or["[object Boolean]"]=Or["[object DataView]"]=Or["[object Date]"]=Or["[object Error]"]=Or["[object Function]"]=Or["[object Map]"]=Or["[object Number]"]=Or["[object Object]"]=Or["[object RegExp]"]=Or["[object Set]"]=Or["[object String]"]=Or["[object WeakMap]"]=!1;var jr=function(e){return pr(e)&&Sr(e.length)&&!!Or[fn(e)]};var Cr=function(e){return function(t){return e(t)}},Tr=n(39),Nr=Tr.a&&Tr.a.isTypedArray,Ar=Nr?Cr(Nr):jr,Mr=Object.prototype.hasOwnProperty;var Pr=function(e,t){var n=br(e),r=!n&&yr(e),o=!n&&!r&&Object(xr.a)(e),i=!n&&!r&&!o&&Ar(e),a=n||r||o||i,s=a?fr(e.length,String):[],u=s.length;for(var l in e)!t&&!Mr.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Er(l,u))||s.push(l);return s},Rr=Object.prototype;var Fr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Rr)};var Dr=function(e,t){return function(n){return e(t(n))}},Lr=Dr(Object.keys,Object),Ir=Object.prototype.hasOwnProperty;var Ur=function(e){if(!Fr(e))return Lr(e);var t=[];for(var n in Object(e))Ir.call(e,n)&&"constructor"!=n&&t.push(n);return t};var qr=function(e){return null!=e&&Sr(e.length)&&!yn(e)};var zr=function(e){return qr(e)?Pr(e):Ur(e)};var Br=function(e,t){return e&&cr(t,zr(t),e)};var Vr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Hr=Object.prototype.hasOwnProperty;var $r=function(e){if(!pn(e))return Vr(e);var t=Fr(e),n=[];for(var r in e)("constructor"!=r||!t&&Hr.call(e,r))&&n.push(r);return n};var Wr=function(e){return qr(e)?Pr(e,!0):$r(e)};var Yr=function(e,t){return e&&cr(t,Wr(t),e)},Gr=n(232);var Kr=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function ta(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o0?n.map(function(n){return t.runSingleFieldLevelValidation(n,Xi(e,n))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then(function(e){return e.reduce(function(e,t,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=ea(e,n[r],t)),e)},{})})},t.prototype.runValidateHandler=function(e){var t=this;return new Promise(function(n){var r=t.props.validate(e);void 0===r?n({}):Qi(r)?r.then(function(){n({})},function(e){n(e)}):n(r)})},t.prototype.render=function(){var e=this.props,t=e.component,n=e.render,r=e.children,o=this.getFormikBag(),i=this.getFormikContext();return Object(a.createElement)(Bi,{value:i},t?Object(a.createElement)(t,o):n?n(o):r?$i(r)?r(o):Zi(r)?null:a.Children.only(r):null)},t.defaultProps={validateOnChange:!0,validateOnBlur:!0,isInitialValid:!1,enableReinitialize:!1},t}(a.Component);function ra(e,t,n){var r=e.slice();return t.forEach(function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?Pt(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=Pt(e[o],t,n):-1===e.indexOf(t)&&r.push(t)}),r}var oa=Hi(function(e){function t(t){var n=e.call(this,t)||this;t.render,t.children,t.component;return n}return Object(re.b)(t,e),t.prototype.componentDidMount=function(){this.props.formik.registerField(this.props.name,this)},t.prototype.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,this)),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,this)},t.prototype.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},t.prototype.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.children,o=e.component,i=void 0===o?"input":o,s=e.formik,u=Object(re.d)(e,["validate","name","render","children","component","formik"]),l=(s.validate,s.validationSchema,Object(re.d)(s,["validate","validationSchema"])),c={value:"radio"===u.type||"checkbox"===u.type?u.value:Xi(s.values,t),name:t,onChange:s.handleChange,onBlur:s.handleBlur},f={field:c,form:l};if(n)return n(f);if($i(r))return r(f);if("string"==typeof i){var p=u.innerRef,d=Object(re.d)(u,["innerRef"]);return Object(a.createElement)(i,Object(re.a)({ref:p},c,d,{children:r}))}return Object(a.createElement)(i,Object(re.a)({},f,u,{children:r}))},t}(a.Component)),ia=Hi(function(e){var t=e.formik,n=t.handleReset,r=t.handleSubmit,o=Object(re.d)(e,["formik"]);return Object(a.createElement)("form",Object(re.a)({onReset:n,onSubmit:r},o))});ia.displayName="Form";var aa=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r.splice(t,1),r.splice(n,0,o),r},sa=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r[t]=r[n],r[n]=o,r},ua=function(e,t,n){var r=(e||[]).slice();return r.splice(t,0,n),r},la=function(e,t,n){var r=(e||[]).slice();return r[t]=n,r},ca=(a.Component,Hi(function(e){function t(t){var n=e.call(this,t)||this;t.render,t.children,t.component;return n}return Object(re.b)(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):Xi(this.props.formik.values,this.props.name)!==Xi(e.formik.values,this.props.name)||Xi(this.props.formik.errors,this.props.name)!==Xi(e.formik.errors,this.props.name)||Xi(this.props.formik.touched,this.props.name)!==Xi(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.props.formik.isSubmitting!==e.formik.isSubmitting},t.prototype.componentDidMount=function(){this.props.formik.registerField(this.props.name,this)},t.prototype.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,this)),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,this)},t.prototype.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},t.prototype.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.children,o=e.component,i=void 0===o?"input":o,s=e.formik,u=(e.shouldUpdate,Object(re.d)(e,["validate","name","render","children","component","formik","shouldUpdate"])),l=(s.validate,s.validationSchema,Object(re.d)(s,["validate","validationSchema"])),c={value:"radio"===u.type||"checkbox"===u.type?u.value:Xi(s.values,t),name:t,onChange:s.handleChange,onBlur:s.handleBlur},f={field:c,form:l};if(n)return n(f);if($i(r))return r(f);if("string"==typeof i){var p=u.innerRef,d=Object(re.d)(u,["innerRef"]);return Object(a.createElement)(i,Object(re.a)({ref:p},c,d,{children:r}))}return Object(a.createElement)(i,Object(re.a)({},f,u,{children:r}))},t}(a.Component))),fa=Hi(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(re.b)(t,e),t.prototype.shouldComponentUpdate=function(e){return Xi(this.props.formik.errors,this.props.name)!==Xi(e.formik.errors,this.props.name)||Xi(this.props.formik.touched,this.props.name)!==Xi(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},t.prototype.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,o=e.children,i=e.name,s=Object(re.d)(e,["component","formik","render","children","name"]),u=Xi(n.touched,i),l=Xi(n.errors,i);return u&&l?r?$i(r)?r(l):null:o?$i(o)?o(l):null:t?Object(a.createElement)(t,s,l):l:null},t}(a.Component)),pa=n(75),da=n.n(pa),ha=n(26);function ma(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function va(e){return e.split(" ").join("-")}function ga(e){return"boolean"==typeof e?e?"True":"False":e}function ya(e){for(var t=0,n=Object.entries(e);t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}xa.a.registerLanguage("python",wa.a),xa.a.registerLanguage("json",ka.a);var za=n(419);xa.a.initHighlightingOnLoad();new za({highlight:function(e,t){t&&xa.a.getLanguage(t);try{return xa.a.highlight(t,e).value}catch(e){}try{return xa.a.highlightAuto(e).value}catch(e){}return""}});function Ba(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null!=e.target.value&&""!==e.target.value?e.target.value:n;e.target.value="boolean"==typeof r?!r:"true"!==r,t(e)}var Va=function(e){var t=e.field,n=e.form,r=(n.touched,n.errors,qa(e,["field","form"])),o=r.placeholder?"":"fader";null!=t.value&&(o="true"===t.value.toString()?"":"fader");var i="btn btn-checkbox ".concat(o);return s.a.createElement(La,Ua({className:i},t,r,{placeholder:r.placeholder.toString(),key:"".concat(t.name,"-button"),type:"checkbox",value:t.value,onClick:function(e){e.preventDefault(),Ba(e,t.onChange,r.placeholder)}}),"CPI"," ")},Ha=function(e){var t=e.msg;e.props;return s.a.createElement("small",{className:"form-text text-muted"},t)},$a=function(e){var t=e.msg;e.props;return s.a.createElement("p",{className:"form-text font-weight-bold",style:{color:"#dc3545",fontSize:"80%"}},t)},Wa=function(e){var t,n=e.field,r=e.form,o=qa(e,["field","form"]);t=n.value?Array.isArray(n.value)?n.value.join(","):n.value:"";var i=Ia(s.a.useState(t),2),a=i[0],u=i[1];return s.a.createElement(s.a.Fragment,null,s.a.createElement("input",{className:"form-control",list:"datalist-".concat(n.name),id:"datalist-".concat(n.name,"-choice"),placeholder:o.placeholder,name:n.name,onChange:function(e){return u(e.target.value)},onBlur:function(e){r.setFieldValue(n.name,e.target.value),r.setFieldTouched(n.name,!0)},value:a,style:o.style}),s.a.createElement("datalist",{id:"datalist-".concat(n.name)},o.options))};function Ya(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=function(e){return e.map(function(e){return s.a.createElement("option",{key:e.toString(),value:e},e.toString())})};return"bool"==t.type?r=["true","false"]:t.validators&&t.validators.choice&&t.validators.choice.choices&&(r=t.validators.choice.choices),r?i?s.a.createElement(ca,{name:e,component:Wa,options:a(r),placeholder:n,style:o}):s.a.createElement(ca,{name:e,className:"form-control",component:"select",placeholder:n,style:o},a(t.validators.choice.choices)):s.a.createElement(ca,{className:"form-control",name:e,placeholder:n,style:o})}var Ga=n(31),Ka=n(74),Za=n.n(Ka),Qa=n(236),Ja=n.n(Qa),Xa=!1,es=s.a.createContext(null),ts="unmounted",ns="exited",rs="entering",os="entered",is=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=ns,r.appearStatus=rs):o=os:o=t.unmountOnExit||t.mountOnEnter?ts:ns,r.state={status:o},r.nextCallback=null,r}Object(Ga.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ts?{status:ns}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==rs&&n!==os&&(t=rs):n!==rs&&n!==os||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=i.a.findDOMNode(this);t===rs?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===ns&&this.setState({status:ts})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context?this.context.isMounting:t,i=this.getTimeouts(),a=o?i.appear:i.enter;!t&&!r||Xa?this.safeSetState({status:os},function(){n.props.onEntered(e)}):(this.props.onEnter(e,o),this.safeSetState({status:rs},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,a,function(){n.safeSetState({status:os},function(){n.props.onEntered(e,o)})})}))},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();n&&!Xa?(this.props.onExit(e),this.safeSetState({status:"exiting"},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:ns},function(){t.props.onExited(e)})})})):this.safeSetState({status:ns},function(){t.props.onExited(e)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;e&&!r?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ts)return null;var t=this.props,n=t.children,r=Object(Sa.a)(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return s.a.createElement(es.Provider,{value:null},n(e,r));var o=s.a.Children.only(n);return s.a.createElement(es.Provider,{value:null},s.a.cloneElement(o,r))},t}(s.a.Component);function as(){}is.contextType=es,is.propTypes={},is.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:as,onEntering:as,onEntered:as,onExit:as,onExiting:as,onExited:as},is.UNMOUNTED=0,is.EXITED=1,is.ENTERING=2,is.ENTERED=3,is.EXITING=4;var ss,us=is,ls=n(109),cs=n.n(ls);function fs(e){e.offsetHeight}var ps=((ss={})[rs]="show",ss[os]="show",ss),ds=s.a.forwardRef(function(e,t){var n=e.className,r=e.children,o=Object(Sa.a)(e,["className","children"]),i=Object(a.useCallback)(function(e){fs(e),o.onEnter&&o.onEnter(e)},[o]);return s.a.createElement(us,Object(p.a)({ref:t,addEndListener:cs.a},o,{onEnter:i}),function(e,t){return s.a.cloneElement(r,Object(p.a)({},t,{className:ja()("fade",n,r.props.className,ps[e])}))})});ds.defaultProps={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},ds.displayName="Fade";var hs=ds,ms={transition:hs,rootClose:!1,show:!1,placement:"top"};function vs(e){var t=e.children,n=e.transition,r=Object(Sa.a)(e,["children","transition"]);return n=!0===n?hs:n||null,s.a.createElement(Ja.a,Object(p.a)({},r,{transition:n}),function(e){var r=e.props,i=e.arrowProps,a=e.show,u=Object(Sa.a)(e,["props","arrowProps","show"]);return function(e,t){var n=e.ref,r=t.ref;e.ref=n.__wrapped||(n.__wrapped=function(e){return n(Object(o.findDOMNode)(e))}),t.ref=r.__wrapped||(r.__wrapped=function(e){return r(Object(o.findDOMNode)(e))})}(r,i),"function"==typeof t?t(Object(p.a)({},u,{},r,{show:a,arrowProps:i})):s.a.cloneElement(t,Object(p.a)({},u,{},r,{arrowProps:i,className:ja()(t.props.className,!n&&a&&"show"),style:Object(p.a)({},t.props.style,{},r.style)}))})}vs.defaultProps=ms;var gs=vs,ys=function(e){function t(){return e.apply(this,arguments)||this}return Object(Ga.a)(t,e),t.prototype.render=function(){return this.props.children},t}(s.a.Component),bs=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}},xs=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).getTarget=function(){return i.a.findDOMNode(r.trigger.current)},r.handleShow=function(){clearTimeout(r._timeout),r._hoverState="show";var e=bs(r.props.delay);e.show?r._timeout=setTimeout(function(){"show"===r._hoverState&&r.show()},e.show):r.show()},r.handleHide=function(){clearTimeout(r._timeout),r._hoverState="hide";var e=bs(r.props.delay);e.hide?r._timeout=setTimeout(function(){"hide"===r._hoverState&&r.hide()},e.hide):r.hide()},r.handleFocus=function(e){var t=r.getChildProps().onFocus;r.handleShow(e),t&&t(e)},r.handleBlur=function(e){var t=r.getChildProps().onBlur;r.handleHide(e),t&&t(e)},r.handleClick=function(e){var t=r.getChildProps().onClick;r.state.show?r.hide():r.show(),t&&t(e)},r.handleMouseOver=function(e){r.handleMouseOverOut(r.handleShow,e,"fromElement")},r.handleMouseOut=function(e){return r.handleMouseOverOut(r.handleHide,e,"toElement")},r.trigger=s.a.createRef(),r.state={show:!!t.defaultShow},r.ariaModifier={enabled:!0,order:900,fn:function(e){var t=e.instance.popper,n=r.getTarget();if(!r.state.show||!n)return e;var o=t.getAttribute("role")||"";return t.id&&"tooltip"===o.toLowerCase()&&n.setAttribute("aria-describedby",t.id),e}},r}Object(Ga.a)(t,e);var n=t.prototype;return n.componentWillUnmount=function(){clearTimeout(this._timeout)},n.getChildProps=function(){return s.a.Children.only(this.props.children).props},n.handleMouseOverOut=function(e,t,n){var r=t.currentTarget,o=t.relatedTarget||t.nativeEvent[n];o&&o===r||Za()(r,o)||e(t)},n.hide=function(){this.setState({show:!1})},n.show=function(){this.setState({show:!0})},n.render=function(){var e=this.props,t=e.trigger,n=e.overlay,r=e.children,o=e.popperConfig,i=void 0===o?{}:o,u=Object(Sa.a)(e,["trigger","overlay","children","popperConfig"]);delete u.delay,delete u.defaultShow;var l=s.a.Children.only(r),c={},f=null==t?[]:[].concat(t);return-1!==f.indexOf("click")&&(c.onClick=this.handleClick),-1!==f.indexOf("focus")&&(c.onFocus=this.handleShow,c.onBlur=this.handleHide),-1!==f.indexOf("hover")&&(c.onMouseOver=this.handleMouseOver,c.onMouseOut=this.handleMouseOut),s.a.createElement(s.a.Fragment,null,s.a.createElement(ys,{ref:this.trigger},Object(a.cloneElement)(l,c)),s.a.createElement(gs,Object(p.a)({},u,{popperConfig:Object(p.a)({},i,{modifiers:Object(p.a)({},i.modifiers,{ariaModifier:this.ariaModifier})}),show:this.state.show,onHide:this.handleHide,target:this.getTarget}),n))},t}(s.a.Component);xs.defaultProps={defaultOverlayShown:!1,trigger:["hover","focus"]};var _s=xs,ws=(n(479),s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.placement,o=e.className,i=e.style,a=e.children,u=e.arrowProps,l=(e.scheduleUpdate,e.outOfBoundaries,Object(Sa.a)(e,["bsPrefix","placement","className","style","children","arrowProps","scheduleUpdate","outOfBoundaries"]));return n=Aa(n,"tooltip"),s.a.createElement("div",Object(p.a)({ref:t,style:i,role:"tooltip","x-placement":r,className:ja()(o,n,"bs-tooltip-"+r)},l),s.a.createElement("div",Object(p.a)({className:"arrow"},u)),s.a.createElement("div",{className:n+"-inner"},a))}));ws.defaultProps={placement:"right"},ws.displayName="Tooltip";var Es=ws,ks=n(143),Ss=n.n(ks),Os=function(e){return e[0].toUpperCase()+Ss()(e).slice(1)};function js(e,t){var n=void 0===t?{}:t,r=n.displayName,o=void 0===r?Os(e):r,i=n.Component,a=void 0===i?"div":i,u=n.defaultProps,l=s.a.forwardRef(function(t,n){var r=t.className,o=t.bsPrefix,i=t.as,u=void 0===i?a:i,l=Object(Sa.a)(t,["className","bsPrefix","as"]),c=Aa(o,e);return s.a.createElement(u,Object(p.a)({ref:n,className:ja()(r,c)},l))});return l.defaultProps=u,l.displayName=o,l}var Cs=function(e){return s.a.forwardRef(function(t,n){return s.a.createElement("div",Object(p.a)({},t,{ref:n,className:ja()(t.className,e)}))})},Ts=s.a.createContext(null),Ns=s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.className,o=e.variant,i=e.as,a=void 0===i?"img":i,u=Object(Sa.a)(e,["bsPrefix","className","variant","as"]),l=Aa(n,"card-img");return s.a.createElement(a,Object(p.a)({ref:t,className:ja()(o?l+"-"+o:l,r)},u))});Ns.displayName="CardImg",Ns.defaultProps={variant:null};var As=Ns,Ms=Cs("h5"),Ps=Cs("h6"),Rs=js("card-body"),Fs=s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.className,o=e.bg,i=e.text,u=e.border,l=e.body,c=e.children,f=e.as,d=void 0===f?"div":f,h=Object(Sa.a)(e,["bsPrefix","className","bg","text","border","body","children","as"]),m=Aa(n,"card"),v=Object(a.useMemo)(function(){return{cardHeaderBsPrefix:m+"-header"}},[m]);return s.a.createElement(Ts.Provider,{value:v},s.a.createElement(d,Object(p.a)({ref:t},h,{className:ja()(r,m,o&&"bg-"+o,i&&"text-"+i,u&&"border-"+u)}),l?s.a.createElement(Rs,null,c):c))});Fs.displayName="Card",Fs.defaultProps={body:!1},Fs.Img=As,Fs.Title=js("card-title",{Component:Ms}),Fs.Subtitle=js("card-subtitle",{Component:Ps}),Fs.Body=Rs,Fs.Link=js("card-link",{Component:"a"}),Fs.Text=js("card-text",{Component:"p"}),Fs.Header=js("card-header"),Fs.Footer=js("card-footer"),Fs.ImgOverlay=js("card-img-overlay");var Ds=Fs;function Ls(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Is(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Us=function(e){var t=e.param_data,n=e.checkbox,r=e.id,o=e.classes,i=void 0===o?"row has-statuses col-xs-12":o,a=s.a.createElement("div",null);return t.description&&(a=s.a.createElement(_s,{trigger:["hover","click"],overlay:s.a.createElement(Es,{id:"".concat(r,"-tooltip")},t.description)},s.a.createElement("span",{className:"d-inline-block"},s.a.createElement("label",null,s.a.createElement("i",{className:"fas fa-info-circle"}))))),s.a.createElement("div",{className:i},s.a.createElement("label",{id:r},t.title," ",a," ",n||null))},qs=function(e){var t=e.title,n=e.titleSize,r=e.titleClass,o=e.label,i=e.openDefault,a=void 0===i||i,u=Is(s.a.useState(a),2),l=u[0],c=u[1];return s.a.createElement("h1",{style:{fontSize:n},className:r||""},t,s.a.createElement("div",{className:"float-right"},s.a.createElement("button",{className:"btn collapse-button",type:"button","data-toggle":"collapse","data-target":"#".concat(va(t),"-collapse-").concat(o),"aria-expanded":"false","aria-controls":"".concat(va(t),"-collapse-").concat(o),style:{marginLeft:"20px"},onClick:function(e){return c(!l)}},s.a.createElement("i",{className:"far fa-".concat(l?"minus":"plus","-square"),style:{size:"5px"}}))))},zs=function(){return s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-sm-4"},s.a.createElement("ul",{className:"list-unstyled components sticky-top scroll-y"},s.a.createElement("li",null,s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"d-flex justify-content-center"},s.a.createElement(da.a,{type:"spokes",color:"#2b2c2d"})))))),s.a.createElement("div",{className:"col-sm-8"},s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"d-flex justify-content-center"},s.a.createElement(da.a,{type:"spokes",color:"#2b2c2d"})))))},Bs=s.a.memo(function(e){var t=e.meta_parameters,n=e.values,r=e.touched,o=e.resetInitialValues,i="meta_parameters"in r;return s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"form-group"},s.a.createElement("ul",{className:"list-unstyled components"},Object.entries(t).map(function(e,n){var r="".concat(e[0]),o="meta_parameters.".concat(r);return s.a.createElement("li",{key:o,className:"mb-3 mt-1"},s.a.createElement(Us,{param_data:t[r],id:o,classes:""}),Ya(o,e[1],ga(e[1].value[0].value)),s.a.createElement(fa,{name:o,render:function(e){return s.a.createElement($a,{msg:e})}}))}),s.a.createElement("li",null,i?s.a.createElement("p",{className:"form-text text-muted"},"Click Reset to update the default values of the parameters."):s.a.createElement("div",null)))),s.a.createElement("button",{name:"reset",className:"btn btn-block btn-outline-dark mt-3",onClick:function(e){e.preventDefault(),o(n)}},"Reset"))},function(e,t){return Object(ha.isEqual)(e.values,t.values)}),Vs=s.a.memo(function(e){var t=e.fieldName,n=e.placeholder,r=e.colClass,o=e.data,i=e.isTouched,a=e.extend,u=e.label,l=i?{backgroundColor:"rgba(102, 175, 233, 0.2)"}:{};return s.a.createElement("div",{className:r,key:va(t)},u?s.a.createElement("small",{style:{padding:0}},u):null,Ya(t,o,n,l,a),i?s.a.createElement("small",{className:"ml-2",style:{color:"#869191"}},"Default: ",n):null,s.a.createElement(fa,{name:t,render:function(e){return s.a.createElement($a,{msg:e})}}))}),Hs=s.a.memo(function(e){var t=e.param,n=e.msect,r=e.data,o=e.values,i=e.extend,a=e.meta_parameters;if(1==Object.keys(r.form_fields).length)var u="col-6";else if("bool"===r.type||r.validators&&r.validators.choice)u="col-md-auto";else u="col";if("checkbox"in r)var l=s.a.createElement(ca,{name:"adjustment.".concat(n,".").concat(t,".checkbox"),placeholder:r.checkbox,component:Va});else l=null;var c=s.a.createElement(Us,{param_data:r,checkbox:l,id:"adjustment.".concat(n,".").concat(t)});return s.a.createElement("div",{className:"container mb-3",style:{padding:"left 0"},key:t},c,s.a.createElement("div",{className:"form-row has-statuses",style:{marginLeft:"-20px"}},Object.entries(r.form_fields).map(function(e,l){var c=e[0],f=r.value[l],p=Object.entries(f).filter(function(e){return"value"!=e[0]&&!(e[0]in a)}).map(function(e){return e[1]}).join(","),d="adjustment.".concat(n,".").concat(t,".").concat(c),h=ga(e[1]),m=!1;return c in o&&(m=Array.isArray(o[c])?o[c].length>0:!!o[c]),s.a.createElement(Vs,{key:d,fieldName:d,placeholder:h,colClass:u,data:r,isTouched:m,extend:i,label:p})})))},function(e,t){return Object(ha.isEqual)(e.values,t.values)}),$s=s.a.memo(function(e){var t=e.section_2,n=e.param_list,r=e.msect,o=e.model_parameters,i=e.values,a=e.extend,u=e.meta_parameters,l=va(t);return s.a.createElement("div",{key:l,className:"mb-2"},s.a.createElement("h3",{className:"mb-1"},t),n.map(function(e){return s.a.createElement(Hs,{key:"".concat(e,"-component"),param:e,msect:r,data:o[r][e],values:i[e],extend:a,meta_parameters:u})}))},function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=e.param_list[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(!Object(ha.isEqual)(e.values[s],t.values[s]))return!1}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return!0}),Ws=s.a.memo(function(e){var t=e.section_1,n=e.section_2_dict,r=e.msect,o=e.model_parameters,i=e.values,a=e.extend,u=e.meta_parameters,l=va(t);return s.a.createElement("div",{className:"inputs-block",id:l,key:l},s.a.createElement("div",{className:"card card-body card-outer mb-3 shadow-sm",style:{padding:"1rem"}},s.a.createElement(qs,{title:t,titleSize:"2.5rem",label:"section-1"}),s.a.createElement("div",{className:"collapse show collapse-plus-minus",id:"".concat(va(t),"-collapse-section-1")},s.a.createElement("div",{className:"card card-body card-inner mb-3",style:{padding:"0rem"}},Object.entries(n).map(function(e,t){var n=e[0],l=e[1];return s.a.createElement($s,{key:"".concat(va(n),"-component"),section_2:n,param_list:l,msect:r,model_parameters:o,values:i,extend:a,meta_parameters:u})})))))},function(e,t){for(var n=0,r=Object.entries(e.section_2_dict);n1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;iau()(e).documentElement.clientHeight;this.setState({style:{paddingRight:t&&!n?cu()():void 0,paddingLeft:!t&&n?cu()():void 0}})}},n.render=function(){var e=this.props,t=e.bsPrefix,n=e.className,r=e.style,o=e.dialogClassName,i=e.children,a=e.dialogAs,u=e.show,l=e.animation,c=e.backdrop,f=e.keyboard,d=e.manager,h=e.onEscapeKeyDown,m=e.onShow,v=e.onHide,g=e.container,y=e.autoFocus,b=e.enforceFocus,x=e.restoreFocus,_=e.onEntered,w=e.onExit,E=e.onExiting,k=(e.onExited,e.onEntering,e.onEnter,e.onEntering,e.backdropClassName,Object(Sa.a)(e,["bsPrefix","className","style","dialogClassName","children","dialogAs","show","animation","backdrop","keyboard","manager","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","onEntered","onExit","onExiting","onExited","onEntering","onEnter","onEntering","backdropClassName"])),S=!0===c?this.handleClick:null,O=Object(p.a)({},r,{},this.state.style);return l||(O.display="block"),s.a.createElement(_u.Provider,{value:this.modalContext},s.a.createElement(pu.a,{show:u,backdrop:c,container:g,keyboard:f,autoFocus:y,enforceFocus:b,restoreFocus:x,onEscapeKeyDown:h,onShow:m,onHide:v,onEntered:_,onExit:w,onExiting:E,manager:d,ref:this.setModalRef,style:O,className:ja()(n,t),containerClassName:t+"-open",transition:l?Ru:void 0,backdropTransition:l?Fu:void 0,renderBackdrop:this.renderBackdrop,onClick:S,onMouseUp:this.handleMouseUp,onEnter:this.handleEnter,onEntering:this.handleEntering,onExited:this.handleExited},s.a.createElement(a,Object(p.a)({},k,{onMouseDown:this.handleDialogMouseDown,className:o}),i)))},t}(s.a.Component);Du.defaultProps=Pu;var Lu=function(e,t){"string"==typeof t&&(t={prefix:t});var n=e.prototype&&e.prototype.isReactComponent,r=t,o=r.prefix,i=r.forwardRefAs,a=void 0===i?n?"ref":"innerRef":i;return Ta()(function(t,n){var r=Object(p.a)({},t);r[a]=n;var i=Aa(r.bsPrefix,o);return s.a.createElement(e,Object(p.a)({},r,{bsPrefix:i}))},{displayName:"Bootstrap("+(e.displayName||e.name)+")"})}(Du,"modal");Lu.Body=du,Lu.Header=Eu,Lu.Title=ku,Lu.Footer=vu,Lu.Dialog=mu,Lu.TRANSITION_DURATION=300,Lu.BACKDROP_TRANSITION_DURATION=150;var Iu,Uu=Lu,qu={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};var zu=((Iu={})[ns]="collapse",Iu.exiting="collapsing",Iu[rs]="collapsing",Iu[os]="collapse show",Iu),Bu={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,dimension:"height",getDimensionValue:function(e,t){var n=t["offset"+e[0].toUpperCase()+e.slice(1)],r=qu[e];return n+parseInt(Cu()(t,r[0]),10)+parseInt(Cu()(t,r[1]),10)}},Vu=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o1&&void 0!==arguments[1]?arguments[1]:"year";"<"===e.value[0]&&(e.value.shift(),e[t]=e[t]-1);for(var n=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:"year";if(!e.length)return[];for(var r=[],o=0;o=e}}},wl=function(e){return{message:"Must be less than or equal to ${max}",name:"contrib.max",exclusive:!0,params:{max:e},test:function(t){return null==t||"*"===t||"<"===t||t<=e}}},El={message:"'<' can only be used as the first index and must be followed by one or more values.",name:"reverseOpValidator",exclusive:!0,params:{},test:function(e){if(!e||Array.isArray(e)&&0===e.lenghth)return!0;var t=e.indexOf("<");return!(t>0)&&((0!==t||1!==e.length)&&!(t>=0&&-1!==e.indexOf("<",t+1)))}},kl={message:hl,name:"contrib.integer",exclusive:!0,params:{},test:function(e){return null==e||"*"===e||"<"===e||Number.isInteger(e)}};function Sl(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(e){return r?St.array().of(e).transform(xl).compact(function(e){return null==e||""===e}).test(El):e},i="int"==(n=t.type)?St.number().typeError(hl).nullable().transform(bl).test(kl):"float"==n?St.number().typeError(ml).nullable().transform(bl):"bool"==n?St.bool().typeError(gl).nullable().transform(bl):"date"==n?St.date(vl).typeError(vl).nullable().transform(bl):St.string();if(!("validators"in t)||"bool"==t.type)return o(i);if("range"in t.validators){var a=null,s=null;"min"in t.validators.range&&((a=t.validators.range.min)in e||(i=i.test(_l(a)))),"max"in t.validators.range&&((s=t.validators.range.max)in e||(i=i.test(wl(s))))}return"choice"in t.validators&&(i=i.oneOf(Object(fl.union)(t.validators.choice.choices,[null,""]),yl)),o(i)}function Ol(e,t){var n=[];if(Object(ha.isEmpty)(t))return e;var r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){for(var u=a.value,l=[],c=0,f=Object.entries(t);c3&&void 0!==arguments[3]&&arguments[3],o=t.cast(e),i={},a={},s=0,u=Object.entries(o.meta_parameters);s0&&(a[m][x]=w)}}return[i,a]}function Nl(e){return(Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Al(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ml(e,t){for(var n=0;n0,c={"Unknown Parameters":{errors:{}}};if(l){var f=!0,p=!1,d=void 0;try{for(var h,m=this.state.unknownParams[Symbol.iterator]();!(f=(h=m.next()).done);f=!0){var v=h.value;c["Unknown Parameters"].errors[v]="This parameter is no longer used."}}catch(e){p=!0,d=e}finally{try{f||null==m.return||m.return()}finally{if(p)throw d}}}return this.state.initialServerErrors&&(t={serverErrors:this.state.initialServerErrors,status:"INVALID",editInputsUrl:this.state.editInputsUrl}),s.a.createElement("div",null,s.a.createElement(na,{initialValues:o,validationSchema:i,validateOnChange:!1,validateOnBlur:!0,enableReinitialize:!0,initialStatus:t,onSubmit:function(t,n){var r=Al(Tl(t,e.state.schema,Dl,e.state.extend),2),o=r[0],i=r[1];console.log("submitting"),console.log(i),console.log(o);var a=new FormData;a.append("adjustment",JSON.stringify(i)),a.append("meta_parameters",JSON.stringify(o)),a.append("client","web-beta"),e.props.doSubmit(a).then(function(t){console.log("success"),console.log(t.data.hashid),history.pushState(null,null,t.data.edit_inputs_url),n.setStatus({status:"PENDING",inputs_hashid:t.data.hashid,api_url:t.data.api_url,editInputsUrl:t.data.edit_inputs_url}),e.poll(n,t.data)}).catch(function(e){console.log("error",e),n.setSubmitting(!1),n.setStatus({status:null}),403==e.response.status&&n.setStatus({auth:"You must be logged in to publish a model."})})},render:function(t){var o=t.handleSubmit,f=t.handleChange,p=t.handleBlur,d=t.status,h=t.isSubmitting,m=t.errors,v=t.values,g=t.setFieldValue,y=t.touched;return s.a.createElement(ia,null,h?s.a.createElement(tl,null):s.a.createElement("div",null),d&&d.auth?s.a.createElement(ul,null):s.a.createElement("div",null),s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-sm-4"},s.a.createElement("ul",{className:"list-unstyled components sticky-top scroll-y"},s.a.createElement("li",null,s.a.createElement(Bs,{meta_parameters:n,values:v.meta_parameters,touched:y,resetInitialValues:e.resetInitialValues})),s.a.createElement("li",null,s.a.createElement(Gs,{sects:a})),s.a.createElement("li",null,s.a.createElement(sl,{handleSubmit:o,accessStatus:e.state.accessStatus})))),s.a.createElement("div",{className:"col-sm-8"},d&&"INVALID"===d.status&&d.serverErrors?s.a.createElement(Zs,{errorMsg:s.a.createElement("p",null,"Some fields have errors. These must be fixed before the simulation can be submitted. You may re-visit this page a later time by entering the following link:"," ",s.a.createElement("a",{href:d.editInputsUrl},d.editInputsUrl)),errors:d.serverErrors,model_parameters:r}):s.a.createElement("div",null),l?s.a.createElement(Zs,{errorMsg:s.a.createElement("p",null,"One or more parameters have been renamed or removed since this simulation was run on "+"".concat(e.state.creationDate," with version ").concat(e.state.modelVersion,". You may view the full simulation detail "),s.a.createElement("a",{href:e.state.detailAPIURL},"here.")),errors:c,model_parameters:{}}):s.a.createElement("div",null),s.a.createElement(Ks,{values:v,schema:i,tbLabelSchema:Dl,transformfunc:Tl,extend:u}),Object.entries(a).map(function(e,t){var i=e[0],a=e[1];return s.a.createElement(Ys,{key:"".concat(i,"-component"),msect:i,section_1_dict:a,meta_parameters:n,model_parameters:r,handleSubmit:o,handleChange:f,status:d,errors:m,values:v,setFieldValue:g,handleBlur:p,extend:u})}))))}}))}}])&&Ml(n.prototype,r),o&&Ml(n,o),t}();function Il(){return(Il=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?e[e.length-1].scope:void 0,n=a.a.clone(t);return this.getStack().push({client:this.getClient(),scope:n}),n},e.prototype.popScope=function(){return void 0!==this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=Object(o.g)(),i=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}i={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,r.a({},i,{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var i=this._lastEventId=Object(o.g)(),a=n;if(!n){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,r.a({},a,{event_id:i})),i},e.prototype.captureEvent=function(e,t){var n=this._lastEventId=Object(o.g)();return this._invokeClient("captureEvent",e,r.a({},t,{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop();if(n.scope&&n.client){var i=n.client.getOptions&&n.client.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,u=i.maxBreadcrumbs,l=void 0===u?30:u;if(!(l<=0)){var c=(new Date).getTime()/1e3,f=r.a({timestamp:c},e),p=s?Object(o.b)(function(){return s(f,t)}):f;null!==p&&n.scope.addBreadcrumb(p,Math.min(l,100))}}},e.prototype.setUser=function(e){var t=this.getStackTop();t.scope&&t.scope.setUser(e)},e.prototype.setTags=function(e){var t=this.getStackTop();t.scope&&t.scope.setTags(e)},e.prototype.setExtras=function(e){var t=this.getStackTop();t.scope&&t.scope.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop();t.scope&&t.client&&e(t.scope)},e.prototype.run=function(e){var t=c(this);try{e(this)}finally{c(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return i.a.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.traceHeaders=function(){var e=this.getStackTop();if(e.scope&&e.client){var t=e.scope.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}},e}();function l(){var e=Object(o.e)();return e.__SENTRY__=e.__SENTRY__||{hub:void 0},e}function c(e){var t=l(),n=d(t);return h(t,e),n}function f(){var t=l();p(t)&&!d(t).isOlderThan(s)||h(t,new u);try{var n=Object(o.c)(e,"domain").active;if(!n)return d(t);if(!p(n)||d(n).isOlderThan(s)){var r=d(t).getStackTop();h(n,new u(r.client,a.a.clone(r.scope)))}return d(n)}catch(e){return d(t)}}function p(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function d(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub?e.__SENTRY__.hub:(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new u,e.__SENTRY__.hub)}function h(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}}).call(this,n(99)(e))}]); \ No newline at end of file +var Ae=Object(se.e)(),Me={_report:!1,_collectWindowErrors:!1,_computeStackTrace:!1,_linesOfContext:!1},Pe="?",Re=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function Fe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function De(){return"undefined"==typeof document||null==document.location?"":document.location.href}Me._report=function(){var e,t,n=[],r=null,o=null;function i(e,t,r){var o=null;if(!t||Me._collectWindowErrors){for(var i in n)if(Fe(n,i))try{n[i](e,t,r)}catch(e){o=e}if(o)throw o}}function a(t,n,r,a,s){var l=null;if(s=Object(ue.d)(s)?s.error:s,t=Object(ue.d)(t)?t.message:t,o)Me._computeStackTrace._augmentStackTraceWithInitialElement(o,n,r,t),u();else if(s&&Object(ue.c)(s))(l=Me._computeStackTrace(s)).mechanism="onerror",i(l,!0,s);else{var c,f={url:n,line:r,column:a},p=t;if("[object String]"==={}.toString.call(t)){var d=t.match(Re);d&&(c=d[1],p=d[2])}f.func=Pe,f.context=null,i(l={name:c,message:p,mode:"onerror",mechanism:"onerror",stack:[re.a({},f,{url:f.url||De()})]},!0,null)}return!!e&&e.apply(this,arguments)}function s(e){var t=e&&void 0!==e.reason?e.reason:e,n=Me._computeStackTrace(t);n.mechanism="onunhandledrejection",i(n,!0,t)}function u(){var e=o,t=r;o=null,r=null,i(e,!1,t)}function l(e){if(o){if(r===e)return;u()}var t=Me._computeStackTrace(e);throw o=t,r=e,setTimeout(function(){r===e&&u()},t.incomplete?2e3:0),e}return l._subscribe=function(e){n.push(e)},l._installGlobalHandler=function(){!0!==t&&(e=Ae.onerror,Ae.onerror=a,t=!0)},l._installGlobalUnhandledRejectionHandler=function(){Ae.onunhandledrejection=s},l}(),Me._computeStackTrace=function(){function e(e){if(!e||!e.stack)return null;for(var t,n,r,o=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack||[-a-z]+:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,u=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),c=[],f=/^(.*) is undefined$/.exec(e.message),p=0,d=l.length;p eval")>-1&&(t=s.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==p||n[5]||void 0===e.columnNumber||(c[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||Pe,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=Pe),r.context=null,c.push(r)}return c.length?(c[0]&&c[0].line&&!c[0].column&&f&&(c[0].column=null),{mode:"stack",name:e.name,message:e.message,stack:c}):null}function t(e,t,n,r){var o={url:t,line:n};if(o.url&&o.line){if(e.incomplete=!1,o.func||(o.func=Pe),o.context||(o.context=null),/ '([^']+)' /.exec(r)&&(o.column=null),e.stack.length>0&&e.stack[0].url===o.url){if(e.stack[0].line===o.line)return!1;if(!e.stack[0].line&&e.stack[0].func===o.func)return e.stack[0].line=o.line,e.stack[0].context=o.context,!1}return e.stack.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function n(e,r){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},l=!1,c=n.caller;c&&!l;c=c.caller)if(c!==qe&&c!==Me._report){if(i={url:null,func:Pe,args:[],line:null,column:null},c.name?i.func=c.name:(o=a.exec(c.toString()))&&(i.func=o[1]),void 0===i.func)try{i.func=o.input.substring(0,o.input.indexOf("{"))}catch(e){}u[""+c]?l=!0:u[""+c]=!0,s.push(i)}r&&s.splice(0,r);var f={mode:"callers",name:e.name,message:e.message,stack:s};return t(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function r(t,r){var o=null;r=null==r?0:+r;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s0&&n(!1)},e);Promise.all(t._buffer).then(function(){clearTimeout(r),n(!0)}).catch(function(){n(!0)})})},e}(),We=function(){function e(e){this.options=e,this._buffer=new $e(30),this.url=new xe(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new ge("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e}(),Ye=Object(se.e)(),Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype.sendEvent=function(e){var t={body:JSON.stringify(e),method:"POST",referrerPolicy:Ne()?"origin":""};return this._buffer.add(Ye.fetch(this.url,t).then(function(e){return{status:ke.fromHttpCode(e.status)}}))},t}(We),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype.sendEvent=function(e){var t=this;return this._buffer.add(new Promise(function(n,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&(200===o.status&&n({status:ke.fromHttpCode(o.status)}),r(o))},o.open("POST",t.url),o.send(JSON.stringify(e))}))},t}(We),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re.b(t,e),t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=re.a({},this._options.transportOptions,{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):Te()?new Ge(t):new Ke(t)},t.prototype.eventFromException=function(e,t){var n,r=this;if(Object(ue.d)(e)&&e.error)return e=e.error,n=Ve(qe(e)),_e.a.resolve(this._buildEvent(n,t));if(Object(ue.a)(e)||Object(ue.b)(e)){var o=e,i=o.name||(Object(ue.a)(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;return this.eventFromMessage(a,Oe.Error,t).then(function(e){return Object(se.a)(e,a),_e.a.resolve(r._buildEvent(e,t))})}if(Object(ue.c)(e))return n=Ve(qe(e)),_e.a.resolve(this._buildEvent(n,t));if(Object(ue.e)(e)&&t&&t.syntheticException)return n=function(e,t){var n=Object.keys(e).sort(),r={extra:{__serialized__:Object(me.c)(e)},message:"Non-Error exception captured with keys: "+fe(n)};if(t){var o=He(qe(t).stack);r.stacktrace={frames:o}}return r}(e,t.syntheticException),Object(se.a)(n,"Custom Object",void 0,{handled:!0,synthetic:!0,type:"generic"}),n.level=Oe.Error,_e.a.resolve(this._buildEvent(n,t));var s=e;return this.eventFromMessage(s,void 0,t).then(function(e){return Object(se.a)(e,""+s,void 0,{handled:!0,synthetic:!0,type:"generic"}),e.level=Oe.Error,_e.a.resolve(r._buildEvent(e,t))})},t.prototype._buildEvent=function(e,t){return re.a({},e,{event_id:t&&t.event_id})},t.prototype.eventFromMessage=function(e,t,n){void 0===t&&(t=Oe.Info);var r={event_id:n&&n.event_id,level:t,message:e};if(this._options.attachStacktrace&&n&&n.syntheticException){var o=He(qe(n.syntheticException).stack);r.stacktrace={frames:o}}return _e.a.resolve(r)},t}(Ce),Qe=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ze,t)||this}return re.b(t,e),t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",t.sdk=re.a({},t.sdk,{name:"sentry.javascript.browser",packages:re.e(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:"5.6.1"}]),version:"5.6.1"}),e.prototype._prepareEvent.call(this,t,n,r)},t.prototype.showReportDialog=function(e){void 0===e&&(e={});var t=Object(se.e)().document;if(t)if(this._isEnabled()){var n=e.dsn||this.getDsn();if(e.eventId)if(n){var r=t.createElement("script");r.async=!0,r.src=new xe(n).getReportDialogEndpoint(e),e.onLoad&&(r.onload=e.onLoad),(t.head||t.body).appendChild(r)}else ae.a.error("Missing `Dsn` option in showReportDialog call");else ae.a.error("Missing `eventId` option in showReportDialog call")}else ae.a.error("Trying to call showReportDialog with Sentry Client is disabled")},t}(Se);function Je(e){for(var t=[],n=1;n"}0!==t.length&&Object(ie.a)().addBreadcrumb({category:"ui."+e,message:t},{event:n,name:e})};st&&clearTimeout(st),t?st=setTimeout(r):r()}}}function lt(){return function(e){var t;try{t=e.target}catch(e){return}var n=t&&t.tagName;n&&("INPUT"===n||"TEXTAREA"===n||t.isContentEditable)&&(tt||ut("input")(e),clearTimeout(tt),tt=setTimeout(function(){tt=void 0},rt))}}function ct(e){for(var t,n=e,r=[],o=0,i=0,a=" > ".length;n&&o++<5&&!("html"===(t=ft(n))||o>1&&i+r.length*a+t.length>=80);)r.push(t),i+=t.length,n=n.parentNode;return r.reverse().join(" > ")}function ft(e){var t,n,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(t=e.className)&&Object(ue.h)(t))for(n=t.split(/\s+/),i=0;i"}catch(e){return""}}var ht,mt=Object(se.e)(),vt=function(){function e(t){this.name=e.id,this._options=re.a({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype._instrumentConsole=function(){"console"in mt&&["debug","info","warn","error","log","assert"].forEach(function(t){t in mt.console&&Object(me.a)(mt.console,t,function(n){return function(){for(var r=[],o=0;o2?t[2]:void 0;return r&&a(ht,String(r)),e.apply(this,t)}}},e.prototype._instrumentXHR=function(){if("XMLHttpRequest"in mt){var t=XMLHttpRequest.prototype;Object(me.a)(t,"open",function(e){return function(){for(var t=[],n=0;n"},handled:!0,type:"instrument"}},a)}):i.onreadystatechange=a,t.apply(this,r)}})}function n(e,t){e in t&&"function"==typeof t[e]&&Object(me.a)(t,e,function(t){return at(t,{mechanism:{data:{function:e,handler:t&&t.name||""},handled:!0,type:"instrument"}})})}},e.addBreadcrumb=function(t,n){Object(ie.a)().getIntegration(e)&&Object(ie.a)().addBreadcrumb(t,n)},e.prototype.setupOnce=function(){this._options.console&&this._instrumentConsole(),this._options.dom&&this._instrumentDOM(),this._options.xhr&&this._instrumentXHR(),this._options.fetch&&this._instrumentFetch(),this._options.history&&this._instrumentHistory()},e.id="Breadcrumbs",e}();function gt(e){try{var t=JSON.parse(e);vt.addBreadcrumb({category:"sentry",event_id:t.event_id,level:t.level||Oe.fromString("error"),message:Object(se.d)(t)},{event:t})}catch(e){ae.a.error("Error while adding sentry type breadcrumb")}}var yt=function(){function e(t){this.name=e.id,this._options=re.a({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,Le(function(t,n,r){if(!(ot>0)){var o=Object(ie.a)().getIntegration(e);o&&Object(ie.a)().captureEvent(o._eventFromGlobalHandler(t,r),{data:{stack:t},originalException:r})}}),this._options.onerror&&(ae.a.log("Global Handler attached: onerror"),Ie()),this._options.onunhandledrejection&&(ae.a.log("Global Handler attached: onunhandledrejection"),Ue())},e.prototype._eventFromGlobalHandler=function(e,t){if(!Object(ue.h)(e.message)&&"onunhandledrejection"!==e.mechanism){var n=e.message;e.message=n.error&&Object(ue.h)(n.error.message)?n.error.message:"No error message"}if("onunhandledrejection"===e.mechanism&&e.incomplete)return this._eventFromIncompleteRejection(e,t);var r=Ve(e),o={mode:e.mode};e.message&&(o.message=e.message),e.name&&(o.name=e.name);var i=Object(ie.a)().getClient(),a=i&&i.getOptions().maxValueLength||250,s=e.original?le(JSON.stringify(Object(me.b)(e.original)),a):"",u="onunhandledrejection"===e.mechanism?"UnhandledRejection":"Error";return Object(se.a)(r,s,u,{data:o,handled:!1,type:e.mechanism}),r},e.prototype._eventFromIncompleteRejection=function(e,t){var n={level:Oe.Error};return Object(ue.f)(t)?n.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+t}]}:(n.exception={values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with keys: "+fe(Object.keys(t).sort())}]},n.extra={__serialized__:Object(me.c)(t)}),n.exception.values&&n.exception.values[0]&&(n.exception.values[0].mechanism={data:re.a({incomplete:!0,mode:e.mode},e.message&&{message:e.message},e.name&&{name:e.name}),handled:!1,type:e.mechanism}),n},e.id="GlobalHandlers",e}(),bt="cause",xt=5,_t=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||bt,this._limit=t.limit||xt}return e.prototype.setupOnce=function(){Object(oe.b)(function(t,n){var r=Object(ie.a)().getIntegration(e);return r?r._handler(t,n):t})},e.prototype._handler=function(e,t){if(!(e.exception&&e.exception.values&&t&&t.originalException instanceof Error))return e;var n=this._walkErrorTree(t.originalException,this._key);return e.exception.values=re.e(n,e.exception.values),e},e.prototype._walkErrorTree=function(e,t,n){if(void 0===n&&(n=[]),!(e[t]instanceof Error)||n.length+1>=this._limit)return n;var r=Be(qe(e[t]));return this._walkErrorTree(e[t],t,re.e([r],n))},e.id="LinkedErrors",e}(),wt=Object(se.e)(),Et=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Object(oe.b)(function(t){if(Object(ie.a)().getIntegration(e)){if(!wt.navigator||!wt.location)return t;var n=t.request||{};return n.url=n.url||wt.location.href,n.headers=n.headers||{},n.headers["User-Agent"]=wt.navigator.userAgent,re.a({},t,{request:n})}return t})},e.id="UserAgent",e}(),kt=[new r.InboundFilters,new r.FunctionToString,new pt,new vt,new yt,new _t,new Et];var St=n(4),Ot=n(110),jt=n.n(Ot),Ct=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Tt}(e)}(e)};var Tt="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Nt(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Mt((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function At(e,t,n){return e.concat(t).map(function(e){return Nt(e,n)})}function Mt(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||At,n.isMergeableObject=n.isMergeableObject||Ct;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){r[t]=Nt(e[t],n)}),Object.keys(t).forEach(function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=Mt(e[o],t[o],n):r[o]=Nt(t[o],n)}),r}(e,t,n):Nt(t,n)}Mt.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return Mt(e,n,t)},{})};var Pt=Mt,Rt=n(145),Ft=n.n(Rt),Dt=n(230),Lt=n.n(Dt);var It=function(){this.__data__=[],this.size=0};var Ut=function(e,t){return e===t||e!=e&&t!=t};var qt=function(e,t){for(var n=e.length;n--;)if(Ut(e[n][0],t))return n;return-1},zt=Array.prototype.splice;var Bt=function(e){var t=this.__data__,n=qt(t,e);return!(n<0)&&(n==t.length-1?t.pop():zt.call(t,n,1),--this.size,!0)};var Vt=function(e){var t=this.__data__,n=qt(t,e);return n<0?void 0:t[n][1]};var Ht=function(e){return qt(this.__data__,e)>-1};var $t=function(e,t){var n=this.__data__,r=qt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Wt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=kr},Or={};Or["[object Float32Array]"]=Or["[object Float64Array]"]=Or["[object Int8Array]"]=Or["[object Int16Array]"]=Or["[object Int32Array]"]=Or["[object Uint8Array]"]=Or["[object Uint8ClampedArray]"]=Or["[object Uint16Array]"]=Or["[object Uint32Array]"]=!0,Or["[object Arguments]"]=Or["[object Array]"]=Or["[object ArrayBuffer]"]=Or["[object Boolean]"]=Or["[object DataView]"]=Or["[object Date]"]=Or["[object Error]"]=Or["[object Function]"]=Or["[object Map]"]=Or["[object Number]"]=Or["[object Object]"]=Or["[object RegExp]"]=Or["[object Set]"]=Or["[object String]"]=Or["[object WeakMap]"]=!1;var jr=function(e){return pr(e)&&Sr(e.length)&&!!Or[fn(e)]};var Cr=function(e){return function(t){return e(t)}},Tr=n(39),Nr=Tr.a&&Tr.a.isTypedArray,Ar=Nr?Cr(Nr):jr,Mr=Object.prototype.hasOwnProperty;var Pr=function(e,t){var n=br(e),r=!n&&yr(e),o=!n&&!r&&Object(xr.a)(e),i=!n&&!r&&!o&&Ar(e),a=n||r||o||i,s=a?fr(e.length,String):[],u=s.length;for(var l in e)!t&&!Mr.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Er(l,u))||s.push(l);return s},Rr=Object.prototype;var Fr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Rr)};var Dr=function(e,t){return function(n){return e(t(n))}},Lr=Dr(Object.keys,Object),Ir=Object.prototype.hasOwnProperty;var Ur=function(e){if(!Fr(e))return Lr(e);var t=[];for(var n in Object(e))Ir.call(e,n)&&"constructor"!=n&&t.push(n);return t};var qr=function(e){return null!=e&&Sr(e.length)&&!yn(e)};var zr=function(e){return qr(e)?Pr(e):Ur(e)};var Br=function(e,t){return e&&cr(t,zr(t),e)};var Vr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Hr=Object.prototype.hasOwnProperty;var $r=function(e){if(!pn(e))return Vr(e);var t=Fr(e),n=[];for(var r in e)("constructor"!=r||!t&&Hr.call(e,r))&&n.push(r);return n};var Wr=function(e){return qr(e)?Pr(e,!0):$r(e)};var Yr=function(e,t){return e&&cr(t,Wr(t),e)},Gr=n(232);var Kr=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function ta(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o0?n.map(function(n){return t.runSingleFieldLevelValidation(n,Xi(e,n))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then(function(e){return e.reduce(function(e,t,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=ea(e,n[r],t)),e)},{})})},t.prototype.runValidateHandler=function(e){var t=this;return new Promise(function(n){var r=t.props.validate(e);void 0===r?n({}):Qi(r)?r.then(function(){n({})},function(e){n(e)}):n(r)})},t.prototype.render=function(){var e=this.props,t=e.component,n=e.render,r=e.children,o=this.getFormikBag(),i=this.getFormikContext();return Object(a.createElement)(Bi,{value:i},t?Object(a.createElement)(t,o):n?n(o):r?$i(r)?r(o):Zi(r)?null:a.Children.only(r):null)},t.defaultProps={validateOnChange:!0,validateOnBlur:!0,isInitialValid:!1,enableReinitialize:!1},t}(a.Component);function ra(e,t,n){var r=e.slice();return t.forEach(function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?Pt(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=Pt(e[o],t,n):-1===e.indexOf(t)&&r.push(t)}),r}var oa=Hi(function(e){function t(t){var n=e.call(this,t)||this;t.render,t.children,t.component;return n}return Object(re.b)(t,e),t.prototype.componentDidMount=function(){this.props.formik.registerField(this.props.name,this)},t.prototype.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,this)),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,this)},t.prototype.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},t.prototype.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.children,o=e.component,i=void 0===o?"input":o,s=e.formik,u=Object(re.d)(e,["validate","name","render","children","component","formik"]),l=(s.validate,s.validationSchema,Object(re.d)(s,["validate","validationSchema"])),c={value:"radio"===u.type||"checkbox"===u.type?u.value:Xi(s.values,t),name:t,onChange:s.handleChange,onBlur:s.handleBlur},f={field:c,form:l};if(n)return n(f);if($i(r))return r(f);if("string"==typeof i){var p=u.innerRef,d=Object(re.d)(u,["innerRef"]);return Object(a.createElement)(i,Object(re.a)({ref:p},c,d,{children:r}))}return Object(a.createElement)(i,Object(re.a)({},f,u,{children:r}))},t}(a.Component)),ia=Hi(function(e){var t=e.formik,n=t.handleReset,r=t.handleSubmit,o=Object(re.d)(e,["formik"]);return Object(a.createElement)("form",Object(re.a)({onReset:n,onSubmit:r},o))});ia.displayName="Form";var aa=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r.splice(t,1),r.splice(n,0,o),r},sa=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r[t]=r[n],r[n]=o,r},ua=function(e,t,n){var r=(e||[]).slice();return r.splice(t,0,n),r},la=function(e,t,n){var r=(e||[]).slice();return r[t]=n,r},ca=(a.Component,Hi(function(e){function t(t){var n=e.call(this,t)||this;t.render,t.children,t.component;return n}return Object(re.b)(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):Xi(this.props.formik.values,this.props.name)!==Xi(e.formik.values,this.props.name)||Xi(this.props.formik.errors,this.props.name)!==Xi(e.formik.errors,this.props.name)||Xi(this.props.formik.touched,this.props.name)!==Xi(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.props.formik.isSubmitting!==e.formik.isSubmitting},t.prototype.componentDidMount=function(){this.props.formik.registerField(this.props.name,this)},t.prototype.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,this)),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,this)},t.prototype.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},t.prototype.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.children,o=e.component,i=void 0===o?"input":o,s=e.formik,u=(e.shouldUpdate,Object(re.d)(e,["validate","name","render","children","component","formik","shouldUpdate"])),l=(s.validate,s.validationSchema,Object(re.d)(s,["validate","validationSchema"])),c={value:"radio"===u.type||"checkbox"===u.type?u.value:Xi(s.values,t),name:t,onChange:s.handleChange,onBlur:s.handleBlur},f={field:c,form:l};if(n)return n(f);if($i(r))return r(f);if("string"==typeof i){var p=u.innerRef,d=Object(re.d)(u,["innerRef"]);return Object(a.createElement)(i,Object(re.a)({ref:p},c,d,{children:r}))}return Object(a.createElement)(i,Object(re.a)({},f,u,{children:r}))},t}(a.Component))),fa=Hi(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(re.b)(t,e),t.prototype.shouldComponentUpdate=function(e){return Xi(this.props.formik.errors,this.props.name)!==Xi(e.formik.errors,this.props.name)||Xi(this.props.formik.touched,this.props.name)!==Xi(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},t.prototype.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,o=e.children,i=e.name,s=Object(re.d)(e,["component","formik","render","children","name"]),u=Xi(n.touched,i),l=Xi(n.errors,i);return u&&l?r?$i(r)?r(l):null:o?$i(o)?o(l):null:t?Object(a.createElement)(t,s,l):l:null},t}(a.Component)),pa=n(75),da=n.n(pa),ha=n(26);function ma(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function va(e){return e.split(" ").join("-")}function ga(e){return"boolean"==typeof e?e?"True":"False":e}function ya(e){for(var t=0,n=Object.entries(e);t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}xa.a.registerLanguage("python",wa.a),xa.a.registerLanguage("json",ka.a);var za=n(419);xa.a.initHighlightingOnLoad();new za({highlight:function(e,t){t&&xa.a.getLanguage(t);try{return xa.a.highlight(t,e).value}catch(e){}try{return xa.a.highlightAuto(e).value}catch(e){}return""}});function Ba(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null!=e.target.value&&""!==e.target.value?e.target.value:n;e.target.value="boolean"==typeof r?!r:"true"!==r,t(e)}var Va=function(e){var t=e.field,n=e.form,r=(n.touched,n.errors,qa(e,["field","form"])),o=r.placeholder?"":"fader";null!=t.value&&(o="true"===t.value.toString()?"":"fader");var i="btn btn-checkbox ".concat(o);return s.a.createElement(La,Ua({className:i},t,r,{placeholder:r.placeholder.toString(),key:"".concat(t.name,"-button"),type:"checkbox",value:t.value,onClick:function(e){e.preventDefault(),Ba(e,t.onChange,r.placeholder)}}),"CPI"," ")},Ha=function(e){var t=e.msg;e.props;return s.a.createElement("small",{className:"form-text text-muted"},t)},$a=function(e){var t=e.msg;e.props;return s.a.createElement("p",{className:"form-text font-weight-bold",style:{color:"#dc3545",fontSize:"80%"}},t)},Wa=function(e){var t,n=e.field,r=e.form,o=qa(e,["field","form"]);t=n.value?Array.isArray(n.value)?n.value.join(","):n.value:"";var i=Ia(s.a.useState(t),2),a=i[0],u=i[1];return s.a.createElement(s.a.Fragment,null,s.a.createElement("input",{className:"form-control",list:"datalist-".concat(n.name),id:"datalist-".concat(n.name,"-choice"),placeholder:o.placeholder,name:n.name,onChange:function(e){return u(e.target.value)},onBlur:function(e){r.setFieldValue(n.name,e.target.value),r.setFieldTouched(n.name,!0)},value:a,style:o.style}),s.a.createElement("datalist",{id:"datalist-".concat(n.name)},o.options))};function Ya(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=function(e){return e.map(function(e){return s.a.createElement("option",{key:e.toString(),value:e},e.toString())})};return"bool"==t.type?r=["true","false"]:t.validators&&t.validators.choice&&t.validators.choice.choices&&(r=t.validators.choice.choices),r?i?s.a.createElement(ca,{name:e,component:Wa,options:a(r),placeholder:n,style:o}):s.a.createElement(ca,{name:e,className:"form-control",component:"select",placeholder:n,style:o},a(t.validators.choice.choices)):s.a.createElement(ca,{className:"form-control",name:e,placeholder:n,style:o})}var Ga=n(31),Ka=n(74),Za=n.n(Ka),Qa=n(236),Ja=n.n(Qa),Xa=!1,es=s.a.createContext(null),ts="unmounted",ns="exited",rs="entering",os="entered",is=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=ns,r.appearStatus=rs):o=os:o=t.unmountOnExit||t.mountOnEnter?ts:ns,r.state={status:o},r.nextCallback=null,r}Object(Ga.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ts?{status:ns}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==rs&&n!==os&&(t=rs):n!==rs&&n!==os||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=i.a.findDOMNode(this);t===rs?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===ns&&this.setState({status:ts})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context?this.context.isMounting:t,i=this.getTimeouts(),a=o?i.appear:i.enter;!t&&!r||Xa?this.safeSetState({status:os},function(){n.props.onEntered(e)}):(this.props.onEnter(e,o),this.safeSetState({status:rs},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,a,function(){n.safeSetState({status:os},function(){n.props.onEntered(e,o)})})}))},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();n&&!Xa?(this.props.onExit(e),this.safeSetState({status:"exiting"},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:ns},function(){t.props.onExited(e)})})})):this.safeSetState({status:ns},function(){t.props.onExited(e)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;e&&!r?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ts)return null;var t=this.props,n=t.children,r=Object(Sa.a)(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return s.a.createElement(es.Provider,{value:null},n(e,r));var o=s.a.Children.only(n);return s.a.createElement(es.Provider,{value:null},s.a.cloneElement(o,r))},t}(s.a.Component);function as(){}is.contextType=es,is.propTypes={},is.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:as,onEntering:as,onEntered:as,onExit:as,onExiting:as,onExited:as},is.UNMOUNTED=0,is.EXITED=1,is.ENTERING=2,is.ENTERED=3,is.EXITING=4;var ss,us=is,ls=n(109),cs=n.n(ls);function fs(e){e.offsetHeight}var ps=((ss={})[rs]="show",ss[os]="show",ss),ds=s.a.forwardRef(function(e,t){var n=e.className,r=e.children,o=Object(Sa.a)(e,["className","children"]),i=Object(a.useCallback)(function(e){fs(e),o.onEnter&&o.onEnter(e)},[o]);return s.a.createElement(us,Object(p.a)({ref:t,addEndListener:cs.a},o,{onEnter:i}),function(e,t){return s.a.cloneElement(r,Object(p.a)({},t,{className:ja()("fade",n,r.props.className,ps[e])}))})});ds.defaultProps={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},ds.displayName="Fade";var hs=ds,ms={transition:hs,rootClose:!1,show:!1,placement:"top"};function vs(e){var t=e.children,n=e.transition,r=Object(Sa.a)(e,["children","transition"]);return n=!0===n?hs:n||null,s.a.createElement(Ja.a,Object(p.a)({},r,{transition:n}),function(e){var r=e.props,i=e.arrowProps,a=e.show,u=Object(Sa.a)(e,["props","arrowProps","show"]);return function(e,t){var n=e.ref,r=t.ref;e.ref=n.__wrapped||(n.__wrapped=function(e){return n(Object(o.findDOMNode)(e))}),t.ref=r.__wrapped||(r.__wrapped=function(e){return r(Object(o.findDOMNode)(e))})}(r,i),"function"==typeof t?t(Object(p.a)({},u,{},r,{show:a,arrowProps:i})):s.a.cloneElement(t,Object(p.a)({},u,{},r,{arrowProps:i,className:ja()(t.props.className,!n&&a&&"show"),style:Object(p.a)({},t.props.style,{},r.style)}))})}vs.defaultProps=ms;var gs=vs,ys=function(e){function t(){return e.apply(this,arguments)||this}return Object(Ga.a)(t,e),t.prototype.render=function(){return this.props.children},t}(s.a.Component),bs=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}},xs=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).getTarget=function(){return i.a.findDOMNode(r.trigger.current)},r.handleShow=function(){clearTimeout(r._timeout),r._hoverState="show";var e=bs(r.props.delay);e.show?r._timeout=setTimeout(function(){"show"===r._hoverState&&r.show()},e.show):r.show()},r.handleHide=function(){clearTimeout(r._timeout),r._hoverState="hide";var e=bs(r.props.delay);e.hide?r._timeout=setTimeout(function(){"hide"===r._hoverState&&r.hide()},e.hide):r.hide()},r.handleFocus=function(e){var t=r.getChildProps().onFocus;r.handleShow(e),t&&t(e)},r.handleBlur=function(e){var t=r.getChildProps().onBlur;r.handleHide(e),t&&t(e)},r.handleClick=function(e){var t=r.getChildProps().onClick;r.state.show?r.hide():r.show(),t&&t(e)},r.handleMouseOver=function(e){r.handleMouseOverOut(r.handleShow,e,"fromElement")},r.handleMouseOut=function(e){return r.handleMouseOverOut(r.handleHide,e,"toElement")},r.trigger=s.a.createRef(),r.state={show:!!t.defaultShow},r.ariaModifier={enabled:!0,order:900,fn:function(e){var t=e.instance.popper,n=r.getTarget();if(!r.state.show||!n)return e;var o=t.getAttribute("role")||"";return t.id&&"tooltip"===o.toLowerCase()&&n.setAttribute("aria-describedby",t.id),e}},r}Object(Ga.a)(t,e);var n=t.prototype;return n.componentWillUnmount=function(){clearTimeout(this._timeout)},n.getChildProps=function(){return s.a.Children.only(this.props.children).props},n.handleMouseOverOut=function(e,t,n){var r=t.currentTarget,o=t.relatedTarget||t.nativeEvent[n];o&&o===r||Za()(r,o)||e(t)},n.hide=function(){this.setState({show:!1})},n.show=function(){this.setState({show:!0})},n.render=function(){var e=this.props,t=e.trigger,n=e.overlay,r=e.children,o=e.popperConfig,i=void 0===o?{}:o,u=Object(Sa.a)(e,["trigger","overlay","children","popperConfig"]);delete u.delay,delete u.defaultShow;var l=s.a.Children.only(r),c={},f=null==t?[]:[].concat(t);return-1!==f.indexOf("click")&&(c.onClick=this.handleClick),-1!==f.indexOf("focus")&&(c.onFocus=this.handleShow,c.onBlur=this.handleHide),-1!==f.indexOf("hover")&&(c.onMouseOver=this.handleMouseOver,c.onMouseOut=this.handleMouseOut),s.a.createElement(s.a.Fragment,null,s.a.createElement(ys,{ref:this.trigger},Object(a.cloneElement)(l,c)),s.a.createElement(gs,Object(p.a)({},u,{popperConfig:Object(p.a)({},i,{modifiers:Object(p.a)({},i.modifiers,{ariaModifier:this.ariaModifier})}),show:this.state.show,onHide:this.handleHide,target:this.getTarget}),n))},t}(s.a.Component);xs.defaultProps={defaultOverlayShown:!1,trigger:["hover","focus"]};var _s=xs,ws=(n(479),s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.placement,o=e.className,i=e.style,a=e.children,u=e.arrowProps,l=(e.scheduleUpdate,e.outOfBoundaries,Object(Sa.a)(e,["bsPrefix","placement","className","style","children","arrowProps","scheduleUpdate","outOfBoundaries"]));return n=Aa(n,"tooltip"),s.a.createElement("div",Object(p.a)({ref:t,style:i,role:"tooltip","x-placement":r,className:ja()(o,n,"bs-tooltip-"+r)},l),s.a.createElement("div",Object(p.a)({className:"arrow"},u)),s.a.createElement("div",{className:n+"-inner"},a))}));ws.defaultProps={placement:"right"},ws.displayName="Tooltip";var Es=ws,ks=n(143),Ss=n.n(ks),Os=function(e){return e[0].toUpperCase()+Ss()(e).slice(1)};function js(e,t){var n=void 0===t?{}:t,r=n.displayName,o=void 0===r?Os(e):r,i=n.Component,a=void 0===i?"div":i,u=n.defaultProps,l=s.a.forwardRef(function(t,n){var r=t.className,o=t.bsPrefix,i=t.as,u=void 0===i?a:i,l=Object(Sa.a)(t,["className","bsPrefix","as"]),c=Aa(o,e);return s.a.createElement(u,Object(p.a)({ref:n,className:ja()(r,c)},l))});return l.defaultProps=u,l.displayName=o,l}var Cs=function(e){return s.a.forwardRef(function(t,n){return s.a.createElement("div",Object(p.a)({},t,{ref:n,className:ja()(t.className,e)}))})},Ts=s.a.createContext(null),Ns=s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.className,o=e.variant,i=e.as,a=void 0===i?"img":i,u=Object(Sa.a)(e,["bsPrefix","className","variant","as"]),l=Aa(n,"card-img");return s.a.createElement(a,Object(p.a)({ref:t,className:ja()(o?l+"-"+o:l,r)},u))});Ns.displayName="CardImg",Ns.defaultProps={variant:null};var As=Ns,Ms=Cs("h5"),Ps=Cs("h6"),Rs=js("card-body"),Fs=s.a.forwardRef(function(e,t){var n=e.bsPrefix,r=e.className,o=e.bg,i=e.text,u=e.border,l=e.body,c=e.children,f=e.as,d=void 0===f?"div":f,h=Object(Sa.a)(e,["bsPrefix","className","bg","text","border","body","children","as"]),m=Aa(n,"card"),v=Object(a.useMemo)(function(){return{cardHeaderBsPrefix:m+"-header"}},[m]);return s.a.createElement(Ts.Provider,{value:v},s.a.createElement(d,Object(p.a)({ref:t},h,{className:ja()(r,m,o&&"bg-"+o,i&&"text-"+i,u&&"border-"+u)}),l?s.a.createElement(Rs,null,c):c))});Fs.displayName="Card",Fs.defaultProps={body:!1},Fs.Img=As,Fs.Title=js("card-title",{Component:Ms}),Fs.Subtitle=js("card-subtitle",{Component:Ps}),Fs.Body=Rs,Fs.Link=js("card-link",{Component:"a"}),Fs.Text=js("card-text",{Component:"p"}),Fs.Header=js("card-header"),Fs.Footer=js("card-footer"),Fs.ImgOverlay=js("card-img-overlay");var Ds=Fs;function Ls(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Is(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Us=function(e){var t=e.param_data,n=e.checkbox,r=e.id,o=e.classes,i=void 0===o?"row has-statuses col-xs-12":o,a=s.a.createElement("div",null);return t.description&&(a=s.a.createElement(_s,{trigger:["hover","click"],overlay:s.a.createElement(Es,{id:"".concat(r,"-tooltip")},t.description)},s.a.createElement("span",{className:"d-inline-block"},s.a.createElement("label",null,s.a.createElement("i",{className:"fas fa-info-circle"}))))),s.a.createElement("div",{className:i},s.a.createElement("label",{id:r},t.title," ",a," ",n||null))},qs=function(e){var t=e.title,n=e.titleSize,r=e.titleClass,o=e.label,i=e.openDefault,a=void 0===i||i,u=Is(s.a.useState(a),2),l=u[0],c=u[1];return s.a.createElement("h1",{style:{fontSize:n},className:r||""},t,s.a.createElement("div",{className:"float-right"},s.a.createElement("button",{className:"btn collapse-button",type:"button","data-toggle":"collapse","data-target":"#".concat(va(t),"-collapse-").concat(o),"aria-expanded":"false","aria-controls":"".concat(va(t),"-collapse-").concat(o),style:{marginLeft:"20px"},onClick:function(e){return c(!l)}},s.a.createElement("i",{className:"far fa-".concat(l?"minus":"plus","-square"),style:{size:"5px"}}))))},zs=function(){return s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-sm-4"},s.a.createElement("ul",{className:"list-unstyled components sticky-top scroll-y"},s.a.createElement("li",null,s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"d-flex justify-content-center"},s.a.createElement(da.a,{type:"spokes",color:"#2b2c2d"})))))),s.a.createElement("div",{className:"col-sm-8"},s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"d-flex justify-content-center"},s.a.createElement(da.a,{type:"spokes",color:"#2b2c2d"})))))},Bs=s.a.memo(function(e){var t=e.meta_parameters,n=e.values,r=e.touched,o=e.resetInitialValues,i="meta_parameters"in r;return s.a.createElement("div",{className:"card card-body card-outer"},s.a.createElement("div",{className:"form-group"},s.a.createElement("ul",{className:"list-unstyled components"},Object.entries(t).map(function(e,n){var r="".concat(e[0]),o="meta_parameters.".concat(r);return s.a.createElement("li",{key:o,className:"mb-3 mt-1"},s.a.createElement(Us,{param_data:t[r],id:o,classes:""}),Ya(o,e[1],ga(e[1].value[0].value)),s.a.createElement(fa,{name:o,render:function(e){return s.a.createElement($a,{msg:e})}}))}),s.a.createElement("li",null,i?s.a.createElement("p",{className:"form-text text-muted"},"Click Reset to update the default values of the parameters."):s.a.createElement("div",null)))),s.a.createElement("button",{name:"reset",className:"btn btn-block btn-outline-dark mt-3",onClick:function(e){e.preventDefault(),o(n)}},"Reset"))},function(e,t){return Object(ha.isEqual)(e.values,t.values)}),Vs=s.a.memo(function(e){var t=e.fieldName,n=e.placeholder,r=e.colClass,o=e.data,i=e.isTouched,a=e.extend,u=e.label,l=i?{backgroundColor:"rgba(102, 175, 233, 0.2)"}:{};return s.a.createElement("div",{className:r,key:va(t)},u?s.a.createElement("small",{style:{padding:0}},u):null,Ya(t,o,n,l,a),i?s.a.createElement("small",{className:"ml-2",style:{color:"#869191"}},"Default: ",n):null,s.a.createElement(fa,{name:t,render:function(e){return s.a.createElement($a,{msg:e})}}))}),Hs=s.a.memo(function(e){var t=e.param,n=e.msect,r=e.data,o=e.values,i=e.extend,a=e.meta_parameters;if(1==Object.keys(r.form_fields).length)var u="col-6";else if("bool"===r.type||r.validators&&r.validators.choice)u="col-md-auto";else u="col";if("checkbox"in r)var l=s.a.createElement(ca,{name:"adjustment.".concat(n,".").concat(t,".checkbox"),placeholder:r.checkbox,component:Va});else l=null;var c=s.a.createElement(Us,{param_data:r,checkbox:l,id:"adjustment.".concat(n,".").concat(t)});return s.a.createElement("div",{className:"container mb-3",style:{padding:"left 0"},key:t},c,s.a.createElement("div",{className:"form-row has-statuses",style:{marginLeft:"-20px"}},Object.entries(r.form_fields).map(function(e,l){var c=e[0],f=r.value[l],p=Object.entries(f).filter(function(e){return"value"!=e[0]&&!(e[0]in a)}).map(function(e){return e[1]}).join(","),d="adjustment.".concat(n,".").concat(t,".").concat(c),h=ga(e[1]),m=!1;return c in o&&(m=Array.isArray(o[c])?o[c].length>0:!!o[c]),s.a.createElement(Vs,{key:d,fieldName:d,placeholder:h,colClass:u,data:r,isTouched:m,extend:i,label:p})})))},function(e,t){return Object(ha.isEqual)(e.values,t.values)}),$s=s.a.memo(function(e){var t=e.section_2,n=e.param_list,r=e.msect,o=e.model_parameters,i=e.values,a=e.extend,u=e.meta_parameters,l=va(t);return s.a.createElement("div",{key:l,className:"mb-2"},s.a.createElement("h3",{className:"mb-1"},t),n.map(function(e){return s.a.createElement(Hs,{key:"".concat(e,"-component"),param:e,msect:r,data:o[r][e],values:i[e],extend:a,meta_parameters:u})}))},function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=e.param_list[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(!Object(ha.isEqual)(e.values[s],t.values[s]))return!1}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return!0}),Ws=s.a.memo(function(e){var t=e.section_1,n=e.section_2_dict,r=e.msect,o=e.model_parameters,i=e.values,a=e.extend,u=e.meta_parameters,l=va(t);return s.a.createElement("div",{className:"inputs-block",id:l,key:l},s.a.createElement("div",{className:"card card-body card-outer mb-3 shadow-sm",style:{padding:"1rem"}},s.a.createElement(qs,{title:t,titleSize:"2.5rem",label:"section-1"}),s.a.createElement("div",{className:"collapse show collapse-plus-minus",id:"".concat(va(t),"-collapse-section-1")},s.a.createElement("div",{className:"card card-body card-inner mb-3",style:{padding:"0rem"}},Object.entries(n).map(function(e,t){var n=e[0],l=e[1];return s.a.createElement($s,{key:"".concat(va(n),"-component"),section_2:n,param_list:l,msect:r,model_parameters:o,values:i,extend:a,meta_parameters:u})})))))},function(e,t){for(var n=0,r=Object.entries(e.section_2_dict);n1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;iau()(e).documentElement.clientHeight;this.setState({style:{paddingRight:t&&!n?cu()():void 0,paddingLeft:!t&&n?cu()():void 0}})}},n.render=function(){var e=this.props,t=e.bsPrefix,n=e.className,r=e.style,o=e.dialogClassName,i=e.children,a=e.dialogAs,u=e.show,l=e.animation,c=e.backdrop,f=e.keyboard,d=e.manager,h=e.onEscapeKeyDown,m=e.onShow,v=e.onHide,g=e.container,y=e.autoFocus,b=e.enforceFocus,x=e.restoreFocus,_=e.onEntered,w=e.onExit,E=e.onExiting,k=(e.onExited,e.onEntering,e.onEnter,e.onEntering,e.backdropClassName,Object(Sa.a)(e,["bsPrefix","className","style","dialogClassName","children","dialogAs","show","animation","backdrop","keyboard","manager","onEscapeKeyDown","onShow","onHide","container","autoFocus","enforceFocus","restoreFocus","onEntered","onExit","onExiting","onExited","onEntering","onEnter","onEntering","backdropClassName"])),S=!0===c?this.handleClick:null,O=Object(p.a)({},r,{},this.state.style);return l||(O.display="block"),s.a.createElement(_u.Provider,{value:this.modalContext},s.a.createElement(pu.a,{show:u,backdrop:c,container:g,keyboard:f,autoFocus:y,enforceFocus:b,restoreFocus:x,onEscapeKeyDown:h,onShow:m,onHide:v,onEntered:_,onExit:w,onExiting:E,manager:d,ref:this.setModalRef,style:O,className:ja()(n,t),containerClassName:t+"-open",transition:l?Ru:void 0,backdropTransition:l?Fu:void 0,renderBackdrop:this.renderBackdrop,onClick:S,onMouseUp:this.handleMouseUp,onEnter:this.handleEnter,onEntering:this.handleEntering,onExited:this.handleExited},s.a.createElement(a,Object(p.a)({},k,{onMouseDown:this.handleDialogMouseDown,className:o}),i)))},t}(s.a.Component);Du.defaultProps=Pu;var Lu=function(e,t){"string"==typeof t&&(t={prefix:t});var n=e.prototype&&e.prototype.isReactComponent,r=t,o=r.prefix,i=r.forwardRefAs,a=void 0===i?n?"ref":"innerRef":i;return Ta()(function(t,n){var r=Object(p.a)({},t);r[a]=n;var i=Aa(r.bsPrefix,o);return s.a.createElement(e,Object(p.a)({},r,{bsPrefix:i}))},{displayName:"Bootstrap("+(e.displayName||e.name)+")"})}(Du,"modal");Lu.Body=du,Lu.Header=Eu,Lu.Title=ku,Lu.Footer=vu,Lu.Dialog=mu,Lu.TRANSITION_DURATION=300,Lu.BACKDROP_TRANSITION_DURATION=150;var Iu,Uu=Lu,qu={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};var zu=((Iu={})[ns]="collapse",Iu.exiting="collapsing",Iu[rs]="collapsing",Iu[os]="collapse show",Iu),Bu={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,dimension:"height",getDimensionValue:function(e,t){var n=t["offset"+e[0].toUpperCase()+e.slice(1)],r=qu[e];return n+parseInt(Cu()(t,r[0]),10)+parseInt(Cu()(t,r[1]),10)}},Vu=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o1&&void 0!==arguments[1]?arguments[1]:"year";"<"===e.value[0]&&(e.value.shift(),e[t]=e[t]-1);for(var n=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:"year";if(!e.length)return[];for(var r=[],o=0;o=e}}},wl=function(e){return{message:"Must be less than or equal to ${max}",name:"contrib.max",exclusive:!0,params:{max:e},test:function(t){return null==t||"*"===t||"<"===t||t<=e}}},El={message:"'<' can only be used as the first index and must be followed by one or more values.",name:"reverseOpValidator",exclusive:!0,params:{},test:function(e){if(!e||Array.isArray(e)&&0===e.lenghth)return!0;var t=e.indexOf("<");return!(t>0)&&((0!==t||1!==e.length)&&!(t>=0&&-1!==e.indexOf("<",t+1)))}},kl={message:hl,name:"contrib.integer",exclusive:!0,params:{},test:function(e){return null==e||"*"===e||"<"===e||Number.isInteger(e)}};function Sl(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(e){return r?St.array().of(e).transform(xl).compact(function(e){return null==e||""===e}).test(El):e},i="int"==(n=t.type)?St.number().typeError(hl).nullable().transform(bl).test(kl):"float"==n?St.number().typeError(ml).nullable().transform(bl):"bool"==n?St.bool().typeError(gl).nullable().transform(bl):"date"==n?St.date(vl).typeError(vl).nullable().transform(bl):St.string();if(!("validators"in t)||"bool"==t.type)return o(i);if("range"in t.validators){var a=null,s=null;"min"in t.validators.range&&((a=t.validators.range.min)in e||(i=i.test(_l(a)))),"max"in t.validators.range&&((s=t.validators.range.max)in e||(i=i.test(wl(s))))}return"choice"in t.validators&&(i=i.oneOf(Object(fl.union)(t.validators.choice.choices,[null,""]),yl)),o(i)}function Ol(e,t){var n=[];if(Object(ha.isEmpty)(t))return e;var r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){for(var u=a.value,l=[],c=0,f=Object.entries(t);c3&&void 0!==arguments[3]&&arguments[3],o=t.cast(e),i={},a={},s=0,u=Object.entries(o.meta_parameters);s0&&(a[m][x]=w)}}return[i,a]}function Nl(e){return(Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Al(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ml(e,t){for(var n=0;n0,c={"Unknown Parameters":{errors:{}}};if(l){var f=!0,p=!1,d=void 0;try{for(var h,m=this.state.unknownParams[Symbol.iterator]();!(f=(h=m.next()).done);f=!0){var v=h.value;c["Unknown Parameters"].errors[v]="This parameter is no longer used."}}catch(e){p=!0,d=e}finally{try{f||null==m.return||m.return()}finally{if(p)throw d}}}return this.state.initialServerErrors&&(t={serverErrors:this.state.initialServerErrors,status:"INVALID",editInputsUrl:this.state.editInputsUrl}),s.a.createElement("div",null,s.a.createElement(na,{initialValues:o,validationSchema:i,validateOnChange:!1,validateOnBlur:!0,enableReinitialize:!0,initialStatus:t,onSubmit:function(t,n){var r=Al(Tl(t,e.state.schema,Dl,e.state.extend),2),o=r[0],i=r[1];console.log("submitting"),console.log(i),console.log(o);var a=new FormData;a.append("adjustment",JSON.stringify(i)),a.append("meta_parameters",JSON.stringify(o)),a.append("client","web-beta"),e.props.doSubmit(a).then(function(t){console.log("success"),console.log(t.data.hashid),history.pushState(null,null,t.data.edit_inputs_url),n.setStatus({status:"PENDING",inputs_hashid:t.data.hashid,api_url:t.data.api_url,editInputsUrl:t.data.edit_inputs_url}),e.poll(n,t.data)}).catch(function(e){console.log("error",e),n.setSubmitting(!1),n.setStatus({status:null}),403==e.response.status&&n.setStatus({auth:"You must be logged in to publish a model."})})},render:function(t){var o=t.handleSubmit,f=t.handleChange,p=t.handleBlur,d=t.status,h=t.isSubmitting,m=t.errors,v=t.values,g=t.setFieldValue,y=t.touched;return s.a.createElement(ia,null,h?s.a.createElement(tl,null):s.a.createElement("div",null),d&&d.auth?s.a.createElement(ul,null):s.a.createElement("div",null),s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-sm-4"},s.a.createElement("ul",{className:"list-unstyled components sticky-top scroll-y"},s.a.createElement("li",null,s.a.createElement(Bs,{meta_parameters:n,values:v.meta_parameters,touched:y,resetInitialValues:e.resetInitialValues})),s.a.createElement("li",null,s.a.createElement(Gs,{sects:a})),s.a.createElement("li",null,s.a.createElement(sl,{handleSubmit:o,accessStatus:e.state.accessStatus})))),s.a.createElement("div",{className:"col-sm-8"},d&&"INVALID"===d.status&&d.serverErrors?s.a.createElement(Zs,{errorMsg:s.a.createElement("p",null,"Some fields have errors. These must be fixed before the simulation can be submitted. You may re-visit this page a later time by entering the following link:"," ",s.a.createElement("a",{href:d.editInputsUrl},d.editInputsUrl)),errors:d.serverErrors,model_parameters:r}):s.a.createElement("div",null),l?s.a.createElement(Zs,{errorMsg:s.a.createElement("p",null,"One or more parameters have been renamed or removed since this simulation was run on "+"".concat(e.state.creationDate," with version ").concat(e.state.modelVersion,". You may view the full simulation detail "),s.a.createElement("a",{href:e.state.detailAPIURL},"here.")),errors:c,model_parameters:{}}):s.a.createElement("div",null),s.a.createElement(Ks,{values:v,schema:i,tbLabelSchema:Dl,transformfunc:Tl,extend:u}),Object.entries(a).map(function(e,t){var i=e[0],a=e[1];return s.a.createElement(Ys,{key:"".concat(i,"-component"),msect:i,section_1_dict:a,meta_parameters:n,model_parameters:r,handleSubmit:o,handleChange:f,status:d,errors:m,values:v,setFieldValue:g,handleBlur:p,extend:u})}))))}}))}}])&&Ml(n.prototype,r),o&&Ml(n,o),t}();function Il(){return(Il=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?e[e.length-1].scope:void 0,n=a.a.clone(t);return this.getStack().push({client:this.getClient(),scope:n}),n},e.prototype.popScope=function(){return void 0!==this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=Object(o.g)(),i=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}i={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,r.a({},i,{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var i=this._lastEventId=Object(o.g)(),a=n;if(!n){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,r.a({},a,{event_id:i})),i},e.prototype.captureEvent=function(e,t){var n=this._lastEventId=Object(o.g)();return this._invokeClient("captureEvent",e,r.a({},t,{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop();if(n.scope&&n.client){var i=n.client.getOptions&&n.client.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,u=i.maxBreadcrumbs,l=void 0===u?30:u;if(!(l<=0)){var c=(new Date).getTime()/1e3,f=r.a({timestamp:c},e),p=s?Object(o.b)(function(){return s(f,t)}):f;null!==p&&n.scope.addBreadcrumb(p,Math.min(l,100))}}},e.prototype.setUser=function(e){var t=this.getStackTop();t.scope&&t.scope.setUser(e)},e.prototype.setTags=function(e){var t=this.getStackTop();t.scope&&t.scope.setTags(e)},e.prototype.setExtras=function(e){var t=this.getStackTop();t.scope&&t.scope.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getStackTop();n.scope&&n.scope.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop();t.scope&&t.client&&e(t.scope)},e.prototype.run=function(e){var t=c(this);try{e(this)}finally{c(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return i.a.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.traceHeaders=function(){var e=this.getStackTop();if(e.scope&&e.client){var t=e.scope.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}},e}();function l(){var e=Object(o.e)();return e.__SENTRY__=e.__SENTRY__||{hub:void 0},e}function c(e){var t=l(),n=d(t);return h(t,e),n}function f(){var t=l();p(t)&&!d(t).isOlderThan(s)||h(t,new u);try{var n=Object(o.c)(e,"domain").active;if(!n)return d(t);if(!p(n)||d(n).isOlderThan(s)){var r=d(t).getStackTop();h(n,new u(r.client,a.a.clone(r.scope)))}return d(n)}catch(e){return d(t)}}function p(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function d(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub?e.__SENTRY__.hub:(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new u,e.__SENTRY__.hub)}function h(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}}).call(this,n(99)(e))}]); \ No newline at end of file From 28995906c75bfda90fa4c3abf2547ca9a619a679 Mon Sep 17 00:00:00 2001 From: hdoupe Date: Wed, 2 Oct 2019 17:13:55 -0400 Subject: [PATCH 7/8] update docs --- docs/docs/api/guide.md | 28 +++++++++++++--------------- docs/docs/api/python.md | 8 ++++---- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/docs/api/guide.md b/docs/docs/api/guide.md index a1698d76..ff6c9779 100755 --- a/docs/docs/api/guide.md +++ b/docs/docs/api/guide.md @@ -6,14 +6,12 @@ More information about the data formats that are shown below can be found in the This guide details the Compute Studio API endpoints and schema. A more practical [Python example](/api/python/) is also provided. - ## /[owner]/[title]/api/v1/ Used for creating simulations. Supports POST HTTP actions. - ### Create simulation ```bash @@ -21,16 +19,17 @@ POST hdoupe/Matchups/api/v1/ ``` **Example:** + ```json { - "meta_parameters": { - "use_full_data": true - }, - "adjustment": { - "matchup": { - "pitcher": "Max Scherzer" - } + "meta_parameters": { + "use_full_data": true + }, + "adjustment": { + "matchup": { + "pitcher": "Max Scherzer" } + } } ``` @@ -65,7 +64,7 @@ Allow: GET, POST, HEAD, OPTIONS "warnings": {} } }, - "inputs_file": null, + "custom_adjustment": null, "meta_parameters": { "use_full_data": true } @@ -107,7 +106,7 @@ Vary: Accept "pitcher": "Max Scherzer" } }, - "inputs_file": null, + "custom_adjustment": null, "errors_warnings": { "API": { "errors": {}, @@ -171,8 +170,8 @@ Used for viewing the inputs for a given model. Supports GET and POST HTTP actions. - ### View inputs: + ```bash GET hdoupe/Matchups/api/v1/inputs/ ``` @@ -259,7 +258,7 @@ Vary: Accept "AJ Ramos", "Aaron Altherr", "Aaron Barrett", - + ... ``` @@ -273,7 +272,7 @@ POST /hdoupe/Matchups/api/v1/inputs/ ```json { - "meta_parameters": {"use_full_data": true} + "meta_parameters": { "use_full_data": true } } ``` @@ -356,6 +355,5 @@ Vary: Accept ... ``` - [1]: https://github.com/compute-tooling/compute-studio-kit#comp-studio-toolkit [2]: https://httpie.org/ diff --git a/docs/docs/api/python.md b/docs/docs/api/python.md index 2d44036b..19161f6c 100755 --- a/docs/docs/api/python.md +++ b/docs/docs/api/python.md @@ -19,13 +19,13 @@ res = api.create( } ) -# output: +# output: # {'inputs': {'meta_parameters': {'year': 2020, # 'data_source': 'PUF', # 'use_full_sample': True}, # 'adjustment': {'policy': {'II_em': [{'year': 2020, 'value': 5000}]}, # 'behavior': {}}, -# 'inputs_file': {'policy': {'II_em': {'2020': 5000}}, 'behavior': {}}, +# 'custom_adjustment': {'policy': {'II_em': {'2020': 5000}}, 'behavior': {}}, # 'errors_warnings': {'policy': {'errors': {}, 'warnings': {}}, # 'behavior': {'errors': {}, 'warnings': {}}, # 'GUI': {'errors': {}, 'warnings': {}}, @@ -37,7 +37,7 @@ res = api.create( # 'gui_url': '/PSLmodels/Tax-Brain/41105/', # 'eta': 5.0, # 'model_pk': 41105} - + ``` Retrieve the result as a Pandas DataFrame: @@ -184,7 +184,7 @@ class API: resp = requests.post( self.sim_url, json={ - "adjustment": adjustment, + "adjustment": adjustment, "meta_parameters": meta_parameters }, headers=self.auth_header From 66eb0e3475080fc9505016a8d0682462c0e91dd4 Mon Sep 17 00:00:00 2001 From: hdoupe Date: Wed, 2 Oct 2019 17:15:04 -0400 Subject: [PATCH 8/8] Rename inputs_file to custom_adjustment --- .../comp/migrations/0016_auto_20191001_1236.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 webapp/apps/comp/migrations/0016_auto_20191001_1236.py diff --git a/webapp/apps/comp/migrations/0016_auto_20191001_1236.py b/webapp/apps/comp/migrations/0016_auto_20191001_1236.py new file mode 100755 index 00000000..f9145ce9 --- /dev/null +++ b/webapp/apps/comp/migrations/0016_auto_20191001_1236.py @@ -0,0 +1,14 @@ +# Generated by Django 2.2.5 on 2019-10-01 17:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [("comp", "0015_auto_20190928_0840")] + + operations = [ + migrations.RenameField( + model_name="inputs", old_name="inputs_file", new_name="custom_adjustment" + ) + ]