slthcore 0.1.6__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of slthcore might be problematic. Click here for more details.

Files changed (84) hide show
  1. {slthcore-0.1.6/slthcore.egg-info → slthcore-0.1.7}/PKG-INFO +1 -1
  2. {slthcore-0.1.6 → slthcore-0.1.7}/setup.py +1 -1
  3. {slthcore-0.1.6 → slthcore-0.1.7}/slth/components.py +4 -5
  4. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/js/slth.min.js +6 -6
  5. {slthcore-0.1.6 → slthcore-0.1.7/slthcore.egg-info}/PKG-INFO +1 -1
  6. {slthcore-0.1.6 → slthcore-0.1.7}/MANIFEST.in +0 -0
  7. {slthcore-0.1.6 → slthcore-0.1.7}/setup.cfg +0 -0
  8. {slthcore-0.1.6 → slthcore-0.1.7}/slth/__init__.py +0 -0
  9. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/configure/__main__.py +0 -0
  10. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/__main__.py +0 -0
  11. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/.DS_Store +0 -0
  12. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/.gitignore +0 -0
  13. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/__init__.py +0 -0
  14. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/asgi.py +0 -0
  15. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/endpoints.py +0 -0
  16. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/models.py +0 -0
  17. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/settings.py +0 -0
  18. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/tests.py +0 -0
  19. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/urls.py +0 -0
  20. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/api/wsgi.py +0 -0
  21. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/application.yml +0 -0
  22. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/entrypoint.sh +0 -0
  23. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/manage.py +0 -0
  24. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/backend/requirements.txt +0 -0
  25. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/base.env +0 -0
  26. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/docker-compose.yml +0 -0
  27. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/frontend/package.json +0 -0
  28. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/frontend/src/main.jsx +0 -0
  29. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/frontend/vite.config.js +0 -0
  30. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/local.env +0 -0
  31. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/run.sh +0 -0
  32. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/selenium/run.sh +0 -0
  33. {slthcore-0.1.6 → slthcore-0.1.7}/slth/cmd/init/boilerplate/test.sh +0 -0
  34. {slthcore-0.1.6 → slthcore-0.1.7}/slth/db/__init__.py +0 -0
  35. {slthcore-0.1.6 → slthcore-0.1.7}/slth/db/generic.py +0 -0
  36. {slthcore-0.1.6 → slthcore-0.1.7}/slth/db/models.py +0 -0
  37. {slthcore-0.1.6 → slthcore-0.1.7}/slth/endpoints.py +0 -0
  38. {slthcore-0.1.6 → slthcore-0.1.7}/slth/exceptions.py +0 -0
  39. {slthcore-0.1.6 → slthcore-0.1.7}/slth/factory.py +0 -0
  40. {slthcore-0.1.6 → slthcore-0.1.7}/slth/forms.py +0 -0
  41. {slthcore-0.1.6 → slthcore-0.1.7}/slth/management/__init__.py +0 -0
  42. {slthcore-0.1.6 → slthcore-0.1.7}/slth/management/commands/__init__.py +0 -0
  43. {slthcore-0.1.6 → slthcore-0.1.7}/slth/management/commands/integration_test.py +0 -0
  44. {slthcore-0.1.6 → slthcore-0.1.7}/slth/management/commands/sync.py +0 -0
  45. {slthcore-0.1.6 → slthcore-0.1.7}/slth/middleware.py +0 -0
  46. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0001_initial.py +0 -0
  47. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0002_email_role_pushsubscription_error.py +0 -0
  48. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0003_rename_photo_profile_alter_profile_options.py +0 -0
  49. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0004_alter_profile_photo.py +0 -0
  50. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0005_alter_profile_photo.py +0 -0
  51. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0006_user.py +0 -0
  52. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/0007_deletion_log.py +0 -0
  53. {slthcore-0.1.6 → slthcore-0.1.7}/slth/migrations/__init__.py +0 -0
  54. {slthcore-0.1.6 → slthcore-0.1.7}/slth/models.py +0 -0
  55. {slthcore-0.1.6 → slthcore-0.1.7}/slth/notifications.py +0 -0
  56. {slthcore-0.1.6 → slthcore-0.1.7}/slth/oauth.py +0 -0
  57. {slthcore-0.1.6 → slthcore-0.1.7}/slth/pdf/__init__.py +0 -0
  58. {slthcore-0.1.6 → slthcore-0.1.7}/slth/pdf/tests.py +0 -0
  59. {slthcore-0.1.6 → slthcore-0.1.7}/slth/permissions.py +0 -0
  60. {slthcore-0.1.6 → slthcore-0.1.7}/slth/printer.py +0 -0
  61. {slthcore-0.1.6 → slthcore-0.1.7}/slth/queryset.py +0 -0
  62. {slthcore-0.1.6 → slthcore-0.1.7}/slth/roles.py +0 -0
  63. {slthcore-0.1.6 → slthcore-0.1.7}/slth/selenium/__init__.py +0 -0
  64. {slthcore-0.1.6 → slthcore-0.1.7}/slth/selenium/browser.py +0 -0
  65. {slthcore-0.1.6 → slthcore-0.1.7}/slth/serializer.py +0 -0
  66. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/.DS_Store +0 -0
  67. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/css/.DS_Store +0 -0
  68. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/css/slth.css +0 -0
  69. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/js/index.min.js +0 -0
  70. {slthcore-0.1.6 → slthcore-0.1.7}/slth/static/js/react.min.js +0 -0
  71. {slthcore-0.1.6 → slthcore-0.1.7}/slth/statistics.py +0 -0
  72. {slthcore-0.1.6 → slthcore-0.1.7}/slth/tasks.py +0 -0
  73. {slthcore-0.1.6 → slthcore-0.1.7}/slth/templates/index.html +0 -0
  74. {slthcore-0.1.6 → slthcore-0.1.7}/slth/templates/report.html +0 -0
  75. {slthcore-0.1.6 → slthcore-0.1.7}/slth/templates/service-worker.js +0 -0
  76. {slthcore-0.1.6 → slthcore-0.1.7}/slth/templates/signature.html +0 -0
  77. {slthcore-0.1.6 → slthcore-0.1.7}/slth/tests.py +0 -0
  78. {slthcore-0.1.6 → slthcore-0.1.7}/slth/threadlocal.py +0 -0
  79. {slthcore-0.1.6 → slthcore-0.1.7}/slth/urls.py +0 -0
  80. {slthcore-0.1.6 → slthcore-0.1.7}/slth/utils.py +0 -0
  81. {slthcore-0.1.6 → slthcore-0.1.7}/slth/views.py +0 -0
  82. {slthcore-0.1.6 → slthcore-0.1.7}/slthcore.egg-info/SOURCES.txt +0 -0
  83. {slthcore-0.1.6 → slthcore-0.1.7}/slthcore.egg-info/dependency_links.txt +0 -0
  84. {slthcore-0.1.6 → slthcore-0.1.7}/slthcore.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: slthcore
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: API generator based on yml file
5
5
  Home-page: https://github.com/brenokcc
6
6
  Author: Breno Silva
@@ -5,7 +5,7 @@ install_requires = []
5
5
 
6
6
  setup(
7
7
  name='slthcore',
8
- version='0.1.6',
8
+ version='0.1.7',
9
9
  packages=find_packages(),
10
10
  install_requires=install_requires,
11
11
  include_package_data=True,
@@ -208,13 +208,12 @@ class WebConf(dict):
208
208
  self["caller"] = caller
209
209
  self["receiver"] = receiver
210
210
 
211
+
211
212
  class ZoomMeet(dict):
212
- def __init__(self, number, password, name, host=0):
213
+ def __init__(self, token):
213
214
  self["type"] = "zoommeet"
214
- self["number"] = number
215
- self["password"] = password
216
- self["name"] = name
217
- self["host"] = host
215
+ self["token"] = token
216
+
218
217
 
219
218
  class Navbar(dict):
220
219
  def __init__(self, title, subtitle=None, logo=None, user=None, search=False, roles=None):
@@ -69,7 +69,7 @@ import{j as t,c as P,r as N,R as Te}from"./react.min.js";const p={colors:{primar
69
69
  .fieldset-title h2 {
70
70
  margin: 0
71
71
  }
72
- `);function n(){return t.jsxs("div",{className:"fieldset-title",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),e.data.actions&&e.data.actions.length>0&&t.jsx("div",{children:e.data.actions.map(function(a){return t.jsx(z,{data:a,default:!0},Math.random())})})]})}return n()}function $e(e){function n(){return t.jsx(Xe,{data:e.data})}function a(){return e.data.data.map(function(i,o){return t.jsx(x,{data:i},Math.random())})}function r(){return t.jsxs("div",{className:"object-viewer",children:[n(),a()]})}return r()}function Ve(e){function n(){return t.jsx(ke,{data:e.data})}function a(){const i={backgroundColor:"white"};return e.data.data.map(function(o,d){return t.jsx("div",{style:i,children:t.jsx(x,{data:o},Math.random())},Math.random())})}function r(){return t.jsxs(t.Fragment,{children:[n(),a()]})}return r()}function Je(e){A(`
72
+ `);function n(){return t.jsxs("div",{className:"fieldset-title",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),e.data.actions&&e.data.actions.length>0&&t.jsx("div",{children:e.data.actions.map(function(a){return t.jsx(z,{data:a,default:!0},Math.random())})})]})}return n()}function Ve(e){function n(){return t.jsx(Xe,{data:e.data})}function a(){return e.data.data.map(function(i,o){return t.jsx(x,{data:i},Math.random())})}function r(){return t.jsxs("div",{className:"object-viewer",children:[n(),a()]})}return r()}function $e(e){function n(){return t.jsx(ke,{data:e.data})}function a(){const i={backgroundColor:"white"};return e.data.data.map(function(o,d){return t.jsx("div",{style:i,children:t.jsx(x,{data:o},Math.random())},Math.random())})}function r(){return t.jsxs(t.Fragment,{children:[n(),a()]})}return r()}function Je(e){A(`
73
73
  .noscroll::-webkit-scrollbar {
74
74
  display: none;
75
75
  }
@@ -101,7 +101,7 @@ import{j as t,c as P,r as N,R as Te}from"./react.min.js";const p={colors:{primar
101
101
  .scheduler .hidden{
102
102
  display: none;
103
103
  }
104
- `),N.useEffect(()=>{document.getElementById(n).querySelector(".input-periodo-2").checked=!0,document.getElementById(n).querySelector(".input-periodo-3").checked=!0,window["reload-"+e.data.input_name+"-field"]=function(){const h=document.getElementsByName(e.data.input_name)[0].closest("form");q("GET",V(e.data.url,h,e.data.input_name),function(g){m(g)})}},[]);function f(h,g){return l.readonly?h==null?r:i:h==null?l.selectable==null?r:l.selectable.indexOf(g)>=0?d:r:h.text==null?i:o}function w(h){a=!0}function y(h){a=!1,document.getElementById("input"+n).value=JSON.stringify({select:c,deselect:s})}function b(h){if(!l.readonly&&!(e.data.single_selection&&k().length>0&&h.target.style.backgroundColor!=i)&&a&&h.target.tagName!="I"&&h.target.style.backgroundColor!=o){const g=h.target.dataset.day.split("/"),j=h.target.dataset.time.split(":"),C=h.target.dataset.day+" "+h.target.dataset.time;if(new Date(parseInt(g[2],10),parseInt(g[1],10)-1,parseInt(g[0],10),parseInt(j[0],10),parseInt(j[1],10))>new Date||e.data.weekly){if(e.data.single_selection){for(;s.length>0;)s.pop();for(;c.length>0;)c.pop()}(h.target.style.backgroundColor==r||h.target.style.backgroundColor==d)&&(l.selectable==null||l.selectable.indexOf(C)>=0)?(h.target.style.backgroundColor=i,console.log("MARCOU",h.target.dataset.day,h.target.dataset.time),c.push([h.target.dataset.day,h.target.dataset.time])):(l.selectable==null?h.target.style.backgroundColor=r:h.target.style.backgroundColor=l.selectable.indexOf(C)>=0?d:r,console.log("DEMARCOU",h.target.dataset.day,h.target.dataset.time),s.push([h.target.dataset.day,h.target.dataset.time]))}}}function D(h){const g=h.split("/");return u[new Date(parseInt(g[2],10),parseInt(g[1],10)-1,parseInt(g[0],10)).getDay()]}function k(){const h=[];return document.getElementById(n).querySelectorAll("td").forEach(function(g){g.style.backgroundColor==i&&h.push(g.dataset.day,g.dataset.time)}),h}function L(h){if(h=parseInt(h.split(":")[0]),h>=0&&h<6)return 1;if(h>=6&&h<12)return 2;if(h>=12&&h<18)return 3;if(h>=18&&h<24)return 4}function M(h){const g=L(h);var j="period-"+g;return T(g)||(j+=" hidden"),j}function v(h,g){document.getElementById(n).querySelectorAll(".period-"+h).forEach(function(j){j.style.display=g?"table-row":"none"})}function T(h){return h==2||h==3}function S(){const h={overflowX:"auto"},g={width:"100%",borderSpacing:0,borderCollapse:"collapse",marginTop:15,marginBottom:15},j={border:"solid 4px white",userSelect:"none"};return t.jsxs("div",{id:n,style:h,className:"scheduler",children:[e.data.title&&t.jsx("h2",{children:e.data.title}),t.jsx("input",{id:"input"+n,type:"hidden",name:e.data.input_name}),t.jsxs("div",{className:"periods",children:[t.jsx("input",{className:"input-periodo-1",type:"checkbox","data-label":"madrugada",onChange:C=>v(1,C.target.checked)})," ",t.jsx("span",{children:"Madrugada"}),t.jsx("input",{className:"input-periodo-2",type:"checkbox","data-label":"manha",onChange:C=>v(2,C.target.checked)})," ",t.jsx("span",{children:"Manhã"}),t.jsx("input",{className:"input-periodo-3",type:"checkbox","data-label":"tarde",onChange:C=>v(3,C.target.checked)})," ",t.jsx("span",{children:"Tarde"}),t.jsx("input",{className:"input-periodo-4",type:"checkbox","data-label":"noite",onChange:C=>v(4,C.target.checked)})," ",t.jsx("span",{children:"Noite"})]}),t.jsxs("table",{style:g,onMouseDown:w,onMouseUp:y,children:[t.jsx("thead",{children:t.jsx("tr",{children:l.matrix[0].map(function(C){return t.jsxs("th",{className:"bold",style:j,children:[D(C.text),!e.data.weekly&&t.jsx("br",{}),!e.data.weekly&&C.text]},Math.random())})})}),t.jsx("tbody",{children:l.matrix.map(function(C,B){if(B>0)return t.jsx("tr",{className:M(C[0].text),children:C.map(function(O,U){if(U==0)return t.jsx("th",{className:"bold",align:"center",style:j,children:O.text},Math.random());{const G=l.matrix[0][U].text+" "+C[0].text,te={backgroundColor:f(O,G),border:"solid 4px white",cursor:"pointer"};return t.jsx("td",{align:"center",style:te,onMouseDown:b,onMouseLeave:b,onMouseUp:b,"data-day":l.matrix[0][U].text,"data-time":C[0].text,"data-label":G,children:O&&O.text&&t.jsx(ft,{text:O.text,children:t.jsx(E,{icon:O.icon||"x",style:{color:"white",cursor:"help"}})})},Math.random())}})},Math.random())})})]})]})}return S()}function ft(e){function n(){return A(`
104
+ `),N.useEffect(()=>{document.getElementById(n).querySelector(".input-periodo-2").checked=!0,document.getElementById(n).querySelector(".input-periodo-3").checked=!0,window["reload-"+e.data.input_name+"-field"]=function(){const h=document.getElementsByName(e.data.input_name)[0].closest("form");q("GET",$(e.data.url,h,e.data.input_name),function(g){m(g)})}},[]);function f(h,g){return l.readonly?h==null?r:i:h==null?l.selectable==null?r:l.selectable.indexOf(g)>=0?d:r:h.text==null?i:o}function w(h){a=!0}function y(h){a=!1,document.getElementById("input"+n).value=JSON.stringify({select:c,deselect:s})}function b(h){if(!l.readonly&&!(e.data.single_selection&&k().length>0&&h.target.style.backgroundColor!=i)&&a&&h.target.tagName!="I"&&h.target.style.backgroundColor!=o){const g=h.target.dataset.day.split("/"),j=h.target.dataset.time.split(":"),C=h.target.dataset.day+" "+h.target.dataset.time;if(new Date(parseInt(g[2],10),parseInt(g[1],10)-1,parseInt(g[0],10),parseInt(j[0],10),parseInt(j[1],10))>new Date||e.data.weekly){if(e.data.single_selection){for(;s.length>0;)s.pop();for(;c.length>0;)c.pop()}(h.target.style.backgroundColor==r||h.target.style.backgroundColor==d)&&(l.selectable==null||l.selectable.indexOf(C)>=0)?(h.target.style.backgroundColor=i,console.log("MARCOU",h.target.dataset.day,h.target.dataset.time),c.push([h.target.dataset.day,h.target.dataset.time])):(l.selectable==null?h.target.style.backgroundColor=r:h.target.style.backgroundColor=l.selectable.indexOf(C)>=0?d:r,console.log("DEMARCOU",h.target.dataset.day,h.target.dataset.time),s.push([h.target.dataset.day,h.target.dataset.time]))}}}function D(h){const g=h.split("/");return u[new Date(parseInt(g[2],10),parseInt(g[1],10)-1,parseInt(g[0],10)).getDay()]}function k(){const h=[];return document.getElementById(n).querySelectorAll("td").forEach(function(g){g.style.backgroundColor==i&&h.push(g.dataset.day,g.dataset.time)}),h}function L(h){if(h=parseInt(h.split(":")[0]),h>=0&&h<6)return 1;if(h>=6&&h<12)return 2;if(h>=12&&h<18)return 3;if(h>=18&&h<24)return 4}function M(h){const g=L(h);var j="period-"+g;return T(g)||(j+=" hidden"),j}function v(h,g){document.getElementById(n).querySelectorAll(".period-"+h).forEach(function(j){j.style.display=g?"table-row":"none"})}function T(h){return h==2||h==3}function S(){const h={overflowX:"auto"},g={width:"100%",borderSpacing:0,borderCollapse:"collapse",marginTop:15,marginBottom:15},j={border:"solid 4px white",userSelect:"none"};return t.jsxs("div",{id:n,style:h,className:"scheduler",children:[e.data.title&&t.jsx("h2",{children:e.data.title}),t.jsx("input",{id:"input"+n,type:"hidden",name:e.data.input_name}),t.jsxs("div",{className:"periods",children:[t.jsx("input",{className:"input-periodo-1",type:"checkbox","data-label":"madrugada",onChange:C=>v(1,C.target.checked)})," ",t.jsx("span",{children:"Madrugada"}),t.jsx("input",{className:"input-periodo-2",type:"checkbox","data-label":"manha",onChange:C=>v(2,C.target.checked)})," ",t.jsx("span",{children:"Manhã"}),t.jsx("input",{className:"input-periodo-3",type:"checkbox","data-label":"tarde",onChange:C=>v(3,C.target.checked)})," ",t.jsx("span",{children:"Tarde"}),t.jsx("input",{className:"input-periodo-4",type:"checkbox","data-label":"noite",onChange:C=>v(4,C.target.checked)})," ",t.jsx("span",{children:"Noite"})]}),t.jsxs("table",{style:g,onMouseDown:w,onMouseUp:y,children:[t.jsx("thead",{children:t.jsx("tr",{children:l.matrix[0].map(function(C){return t.jsxs("th",{className:"bold",style:j,children:[D(C.text),!e.data.weekly&&t.jsx("br",{}),!e.data.weekly&&C.text]},Math.random())})})}),t.jsx("tbody",{children:l.matrix.map(function(C,B){if(B>0)return t.jsx("tr",{className:M(C[0].text),children:C.map(function(O,U){if(U==0)return t.jsx("th",{className:"bold",align:"center",style:j,children:O.text},Math.random());{const G=l.matrix[0][U].text+" "+C[0].text,te={backgroundColor:f(O,G),border:"solid 4px white",cursor:"pointer"};return t.jsx("td",{align:"center",style:te,onMouseDown:b,onMouseLeave:b,onMouseUp:b,"data-day":l.matrix[0][U].text,"data-time":C[0].text,"data-label":G,children:O&&O.text&&t.jsx(ft,{text:O.text,children:t.jsx(E,{icon:O.icon||"x",style:{color:"white",cursor:"help"}})})},Math.random())}})},Math.random())})})]})]})}return S()}function ft(e){function n(){return A(`
105
105
  .tooltip {
106
106
  position: relative;
107
107
  display: inline-block;
@@ -124,7 +124,7 @@ import{j as t,c as P,r as N,R as Te}from"./react.min.js";const p={colors:{primar
124
124
  .tooltip:hover .tooltiptext {
125
125
  visibility: visible;
126
126
  }
127
- `),t.jsxs("div",{className:"tooltip",children:[e.children,t.jsx("div",{className:"tooltiptext",children:H(e.text)})]})}return n()}const gt=["text","password","email","number","date","datetime-local","file","image","range","search","tel","time","url","week","hidden","color"],K={padding:15,border:"solid 1px #d9d9d9",borderRadius:5,backgroundColor:"white"};function xt(e,n){const a=new FormData(e);for(let[r,i]of Array.from(a.entries())){const o=e[r];n!=r&&(o.tagName=="SELECT"&&i!==""||o.tagName==null&&i!==""||o.type=="radio"&&i!==""||o.type=="checkbox"&&i!==""||a.delete(r))}return new URLSearchParams(a).toString()}function V(e,n,a){const r=e.indexOf("?")<0?"?":"&",i=xt(n,a);return e=e+(i?r+i:""),e}function le(e){if(e){const a=[".png",".jpeg",".jpeg",".gif"];for(var n=0;n<a.length;n++)if(e.toLowerCase().indexOf(a[n])>0)return!0}}function Z(e,n){q("GET",V(n,e.closest("form"),e.name),Ee)}function yt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="none");var a=document.querySelector(".form-group."+e);a&&(a.style.display="none")}}function vt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="block");var a=document.querySelector(".form-group."+e);a&&(a.style.display="block")}}function bt(e){const n="reload-"+e+"-field";window[n]&&window[n]()}function pt(e,n){var a=document.querySelector(".form-group."+e),r=a.querySelector('*[name="'+e+'"]');if(r.tagName=="INPUT")r.value=n;else if(r.tagName=="SELECT"){if(r.style.display!="none")r.dispatchEvent(new CustomEvent("customchange",{detail:{value:n}}));else for(var i=0;i<r.options.length;i++)if(r.options[i].value==n){r.selectedIndex=i;break}}}function Ee(e){if(e){for(var n=0;n<e.hide.length;n++)yt(e.hide[n]);for(var n=0;n<e.show.length;n++)vt(e.show[n]);for(var n=0;n<e.reload.length;n++)bt(e.reload[n]);for(var a in e.set)pt(a,e.set[a])}}function wt(e){function n(){const a={color:p.colors.info,backgroundColor:p.background.info,padding:20,display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10};return t.jsxs("div",{style:a,children:[t.jsxs("div",{children:[t.jsx(E,{icon:"circle-check",style:{color:p.colors.info,marginRight:20}}),e.data.text]}),e.children&&t.jsx("div",{children:e.children})]})}return n()}function jt(e){function n(){const a={color:"white",display:"none",backgroundColor:"#e52207",marginTop:2,marginBottom:2,padding:8};return t.jsxs("div",{style:a,id:e.id,className:"error",children:[t.jsx(E,{icon:"xmark-circle",style:{marginRight:5}}),t.jsx("span",{})]})}return n()}function kt(e){function n(){const a={marginTop:2,marginBottom:2,fontStyle:"italic"};return t.jsx("div",{style:a,children:t.jsx("span",{children:e.text})})}return n()}function ae(e){const n=e.data.name+Math.random();function a(){const c={display:"flex",justifyContent:"space-between",alignItems:"baseline"};return e.data.action&&(e.data.action.icon=null,e.data.action.modal=!0,e.data.action.urlfunc=function(){return V(e.data.action.url,document.getElementById(n).closest("form"))}),t.jsxs("div",{style:c,children:[t.jsxs("label",{className:"bold",children:[e.data.label," ",e.data.label&&e.data.required?"*":""]}),e.data.action&&t.jsx(z,{data:e.data.action,style:{padding:0,margin:0}})]})}function r(){return e.data.type=="datetime"&&(e.data.type="datetime-local"),gt.indexOf(e.data.type)>=0?t.jsx(ye,{data:e.data}):e.data.type=="choice"&&Array.isArray(e.data.choices)?e.data.pick?Array.isArray(e.data.value)?t.jsx(ve,{data:e.data}):t.jsx(de,{data:e.data}):t.jsx(Et,{data:e.data}):e.data.type=="choice"?e.data.pick?Array.isArray(e.data.value)?t.jsx(ve,{data:e.data}):t.jsx(de,{data:e.data}):t.jsx(Me,{data:e.data}):e.data.type=="decimal"?t.jsx(ye,{data:e.data}):e.data.type=="boolean"?t.jsx(Ct,{data:e.data}):e.data.type=="textarea"?t.jsx(St,{data:e.data}):e.data.type=="scheduler"?(e.data.scheduler.input_name=e.data.name,t.jsx(Ce,{data:e.data.scheduler})):t.jsx("span",{children:e.data.name})}function i(){return t.jsx("div",{children:t.jsx(jt,{id:e.data.name+"_error"})})}function o(){return e.data.help_text&&t.jsx(kt,{text:e.data.help_text})}function d(){const c={display:e.data.type=="hidden"?"none":"flex",flexDirection:"column",padding:5,width:"calc(100%-5px)"};return t.jsxs("div",{id:n,style:c,children:[a(),r(),o(),i()]})}return d()}function ye(e){var n="";const a=e.data.name+Math.random();e.data.mask=="decimal"&&(n="decimal",e.data.value&&(e.data.value=Math.round(parseFloat(e.data.value)).toFixed(2).replace(".",","))),N.useEffect(()=>{function d(u,l,m){var f=m.target,w=f.value.replace(/\D/g,""),y=f.value.length>l?1:0;VMasker(f).unMask(),VMasker(f).maskPattern(u[y]),f.value=VMasker.toPattern(w,u[y])}if(e.data.mask){var c=document.getElementById(a);if(e.data.mask=="decimal")VMasker(c).maskMoney({precision:2,separator:",",delimiter:"."});else if(e.data.mask.indexOf("|")>0){var s=e.data.mask.split("|");VMasker(c).maskPattern(s[0]),c.addEventListener("input",d.bind(void 0,s,14),!1)}else VMasker(c).maskPattern(e.data.mask)}},[]);function r(d){Z(d.target,e.data.onchange)}function i(d){if(e.data.type=="file"&&d.target.files){let s=d.target.files[0];var c=new FileReader;c.onload=function(u){if(le(s.name)){const w="display"+a;var l=document.createElement("img");l.id=d.target.id+"img",l.style.width="200px",l.style.display="block",l.style.margin="auto",l.style.marginTop="20px",l.onload=function(y){const b=e.data.width>e.data.height?e.data.width/l.width:e.data.height/l.height;var D=document.createElement("canvas");const k=D.getContext("2d");D.height=D.width*(l.height/l.width);const L=document.createElement("canvas"),M=L.getContext("2d");L.width=l.width*b,L.height=l.height*b,M.drawImage(l,0,0,L.width,L.height),k.drawImage(L,0,0,L.width*b,L.height*b,0,0,D.width,D.height),L.toBlob(function(T){const S=new DataTransfer;S.items.add(new File([T],s.name)),d.target.files=S.files});var v=document.getElementById(w);v==null?(v=document.createElement("div"),v.id=w):v.removeChild(v.childNodes[0]),v.appendChild(l),d.target.parentNode.appendChild(v)},l.src=u.target.result}const m=document.getElementById("fileinfo"+a);var f=s.size/1024;f<1024?f=parseInt(f)+" Kb":f=(f/1024).toFixed(2)+" Mb",m.innerHTML=s.name+" / "+f,e.data.max_size&&s.size/1024/1024>e.data.max_size&&alert("O limite de tamanho é "+e.data.max_size+"Mb. O arquivo informado possui "+f+". Por favor, adicione um arquivo menor.")},c.readAsDataURL(s)}}function o(){var d=e.data.type;if(d=="datetime"&&(d="datetime-regional"),d=="decimal"&&(d="text"),d=="file"){const u={alignContent:"center",minHeight:75,padding:5,maxWidth:"100%",margin:"auto"};var c=null;return e.data.extensions&&e.data.extensions.length>0&&(c=e.data.extensions.map(l=>"."+l).join(", ")),t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:window.innerWidth<800?"block":"flex",justifyContent:"space-between",backgroundColor:"rgba(15, 145, 210, 0.05)",border:"1px dashed rgba(15, 145, 210, 0.4)",borderRadius:10,textAlign:"center"},children:[t.jsx("div",{style:u,children:t.jsx(E,{icon:"cloud-upload",style:{fontSize:"2.5rem",color:p.colors.primary}})}),t.jsxs("div",{style:u,children:[e.data.value&&le(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:t.jsx("img",{src:e.data.value,height:50})}),e.data.value&&!le(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:e.data.value}),"Selecione um arquivo clicando no botão ao lado.",t.jsxs("div",{className:"bold",id:"fileinfo"+a,children:["O arquivo",e.data.max_size&&"deve possuir até "+e.data.max_size+" Mb e ","deve ter extensão"," ",e.data.extensions.map(l=>"."+l).join(" ou "),"."]})]}),t.jsx("div",{style:u,align:"center",children:t.jsx(_,{label:"Selecionar Arquivo",onClick:()=>document.getElementById(a).click()})})]}),t.jsx("input",{className:"form-control "+n,type:d,name:e.data.name,id:a,"data-label":I(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?r:null,onChange:i,style:{zIndex:"-1",marginTop:-20},accept:c})]})}else{var s=K;return d=="color"&&(s={...K},s.width="100%",s.backgroundColor="white",s.height=47.5),t.jsx("input",{className:"form-control "+n,type:d,name:e.data.name,id:a,defaultValue:e.data.value,"data-label":I(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?r:null,onChange:i,style:s})}}return o()}function Me(e){var n=[];Array.isArray(e.data.value)?e.data.value.forEach(function(v,T){n.push({id:v.id,value:v.label})}):e.data.value!=null&&n.push({id:e.data.value.id,value:e.data.value.label}),e.data.id==null&&(e.data.id=Math.random()),e.data.id2==null&&(e.data.id2=e.data.id+"__autocomplete");const a=e.data.id,r=e.data.id2,i=Array.isArray(e.data.value),[o,d]=N.useState(!1),[c,s]=N.useState(null);var u=!1;let l;N.useEffect(()=>{k(n,!0),document.getElementById(a).addEventListener("customchange",function(v){k(v.detail.value);const T=document.getElementById(e.data.name);T&&reactTriggerChange(T)})},[]);function m(){const v=document.getElementById(a);if(i){const T={padding:5,display:"inline"},S={cursor:"pointer",marginRight:5},h={fontSize:"0.8rem"};return t.jsxs("div",{children:[v==null&&n.map((g,j)=>t.jsxs("div",{style:T,children:[t.jsx("span",{onClick:()=>L(j),style:S,children:t.jsx(E,{icon:"trash-can",style:h})}),g.value]},Math.random())),v!=null&&Array.from(v.options).map((g,j)=>t.jsxs("div",{style:T,children:[t.jsx("span",{onClick:()=>L(j),style:S,children:t.jsx(E,{icon:"trash-can",style:h})}),g.innerHTML]},Math.random()))]})}}function f(){return t.jsx("select",{id:a,name:e.data.name,multiple:i,readOnly:!0,style:{display:"contents"}})}function w(){const v={...K,...e.style||{}},T={padding:0,margin:0,border:"solid 1px #d9d9d9",marginTop:-1,borderRadius:5,maxHeight:150,overflowY:"auto",zIndex:99999};T.position="absolute",T.backgroundColor="white";const S=document.getElementById(r);if(e.data.icon&&(v.paddingLeft=30),S){let B=null,O=S,U=null;for(;!U&&(O=O.parentElement)instanceof HTMLElement;)O.matches("dialog")&&(U=O);B=U;const G=S.getBoundingClientRect();var h=G.top+G.height,g=G.left;if(B){const te=B.getBoundingClientRect();h=h-te.top,g=g-te.left}else h+=window.scrollY,g+=window.scrollX;T.width=G.width,T.top=h,T.left=g}const j={cursor:"pointer",padding:10},C=!i&&n.length>0&&n[0].value||"";return t.jsxs(t.Fragment,{children:[e.data.icon&&t.jsx(E,{icon:e.data.icon,style:{position:"absolute",margin:13,color:"#d9d9d9"}}),t.jsx("input",{id:r,name:e.data.name+"__autocomplete",type:"text",className:"form-control",onFocus:B=>{B.target.select(),D(B)},onChange:D,onMouseLeave:y,onBlur:y,defaultValue:C,style:v,"data-label":I(e.data.label)}),c&&o&&t.jsxs("ul",{style:T,onMouseLeave:b,onMouseEnter:function(B){u=!0},children:[c.length==0&&t.jsx("li",{style:j,children:"Nenhuma opção encontrada."}),c.map(B=>t.jsx("li",{onClick:()=>{d(!1),e.onSelect?e.onSelect(B):k(B)},style:j,className:"autocomplete-item","data-label":I(B.value),children:B.value},Math.random()))]})]})}function y(v){u=!1,setTimeout(function(){u||b(v)},250)}function b(v){const T=document.getElementById(a);if(T){const S=document.getElementById(r);i||T.options.length>0&&S.value!=T.options[0].innerHTML&&(T.innerHTML="",S.value="",d(!1),e.data.onchange&&Z(S,e.data.onchange)),v.target.tagName=="UL"?d(!1):u||d(!1)}}function D(v){clearTimeout(l),l=setTimeout(function(){const T=v.target.closest("form"),S=e.data.choices.indexOf("?")<0?"?":"&";d(!0),q("GET",V(e.data.choices+S+"term="+v.target.value,T),function(g){s(g)})},1e3)}function k(v,T=!1){const S=document.getElementById(a),h=document.getElementById(r);S.innerHTML==null&&(S.innerHTML=""),Array.isArray(v)?S.innerHTML=v.map(g=>`<option selected value="${g.id}">${g.value}</option>`).join(""):v?i?(S.innerHTML+=`<option selected value="${v.id}">${v.value}</option>`,h.value=""):(S.innerHTML=`<option selected value="${v.id}">${v.value}</option>`,h.value=v.value):(S.innerHTML="",h.value=""),e.data.onchange&&!T&&Z(h,e.data.onchange)}function L(v){const T=document.getElementById(a);var S=Array.from(T.options);T.innerHTML=S.slice(0,v).concat(S.slice(v+1)).map(h=>`<option selected value="${h.value}">${h.innerHTML}</option>`).join(""),s([])}function M(){return t.jsxs(t.Fragment,{children:[m(),f(),w()]})}return M()}function St(e){function n(){var a={...K};return a.height=100,t.jsx("textarea",{id:e.data.name,name:e.data.name,"data-label":I(e.data.label),style:a,defaultValue:e.data.value||"",className:"form-control"})}return n()}function Ct(e){var n=e.data;return n.choices=[{id:!0,value:"Sim"},{id:!1,value:"Não"}],t.jsx(de,{data:n})}function de(e){const[n,a]=N.useState(e.data.choices);var r=Math.random(),i=e.data;function o(u){return i.value!=null?i.value==u.id?!0:i.value.id==u.id:!1}function d(u){var l=document.getElementById(u);i.checked&&(l.checked=!1),e.data.onchange&&Z(l,e.data.onchange)}function c(u){var l=document.getElementById(u);i.checked=l.checked}function s(){return window["reload-"+i.name+"-field"]=function(){q("GET",V(e.data.pick,document.querySelector(".radio-group."+i.name).closest("form")),function(l){a(l)})},n.length>0?t.jsx("div",{className:"radio-group "+i.name,children:n.map((u,l)=>(u.id||u.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:i.name+r+l,type:"radio",name:i.name,defaultValue:u.id,defaultChecked:o(u),"data-label":I(u.value),onClick:function(){d(i.name+r+l)},onMouseEnter:function(){c(i.name+r+l)}}),t.jsx("label",{htmlFor:i.name+r+l,children:u.value})]},r+l))}):t.jsx("div",{className:"radio-group empty "+i.name,children:t.jsx(ee,{data:{text:"Nenhuma opção disponível para seleção."}})})}return s()}function ve(e){const[n,a]=N.useState(e.data.choices);var r=Math.random(),i=e.data;function o(s){var u=!1;if(i.value)for(var l=0;l<i.value.length;l++){var m=i.value[l];(m==s.id||m.id==s.id)&&(u=!0)}return u}function d(s){e.data.onchange&&Z(s.target,e.data.onchange)}function c(){return window["reload-"+i.name+"-field"]=function(){q("GET",V(e.data.pick,document.querySelector(".checkbox-group."+i.name).closest("form")),function(u){a(u)})},n.length>0?t.jsx("div",{className:"checkbox-group "+i.name,children:n.map((s,u)=>(s.id||s.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:i.name+r+u,type:"checkbox",name:i.name,onClick:d,defaultValue:s.id,defaultChecked:o(s),"data-label":I(s.value)}),t.jsx("label",{htmlFor:i.name+r+u,children:s.value})]},r+u))}):t.jsx("div",{className:"checkbox-group empty "+i.name,children:t.jsx(ee,{data:{text:"Nenhuma opção disponível para seleção."}})})}return c()}function Et(e){var n=e.data;return t.jsx(t.Fragment,{children:t.jsx("select",{className:"form-control",id:n.name,name:n.name,"data-label":I(n.label),defaultValue:n.value,style:K,children:n.choices.map(a=>t.jsx("option",{value:a.id,children:a.value},Math.random()))})})}function Mt(e){const n=Math.random(),a=e.data.value[0],r=a.fields?a.fields[0]:a.fieldsets[0].fields[0][0];function i(){return!e.data.required&&t.jsx("div",{id:"info-"+n,children:t.jsxs(ee,{data:{text:"Esta informação é opcional. Controle seu preenchimento com o botão ao lado."},children:[t.jsx(_,{primary:!0,icon:"pen-clip",onClick:()=>o(!0),id:"show-"+n,display:r.value?"none":"inline"}),t.jsx(_,{primary:!0,icon:"trash",onClick:()=>o(!1),id:"hide-"+n,display:r.value?"inline":"none"})]})})}function o(s){const u=document.querySelector("input[name="+r.name+"]"),l=document.getElementById("inline-form-"+n),m=document.getElementById("show-"+n),f=document.getElementById("hide-"+n);l.style.display=s?"block":"none",m.style.display=s?"none":"inline",f.style.display=s?"inline":"none",s?u.value===""?u.value=0:u.value=-parseInt(u.value):parseInt(u.value)==0?u.value="":u.value=-parseInt(u.value)}function d(){const s={display:r.value?"block":"none"};return e.data.required&&(s.display="block",r.value===""&&(r.value=0)),t.jsx("div",{className:"fieldset-inline-forms",style:s,id:"inline-form-"+n,children:e.data.value.map(function(u){return t.jsx(he,{data:u},Math.random())})})}function c(){const s={margin:0};return t.jsxs("div",{className:"form-fieldset",children:[t.jsx("h2",{style:s,"data-label":I(e.data.label),children:e.data.label}),i(),d()]})}return c()}function Tt(e){var n=0;const a=Math.random();e.data.template==null&&(e.data.template=e.data.value.pop());function r(l,m){const f=n;return n+=1,t.jsxs("div",{style:{display:"block"},id:"form-"+f+"-"+a,children:[t.jsx(he,{data:l}),t.jsxs("div",{style:{textAlign:"center",marginTop:10,marginBottom:10},children:[t.jsx(_,{primary:!0,icon:"plus",onClick:()=>o(),id:"extra-add-"+f+"-",display:m}),t.jsx(_,{primary:!0,icon:"trash",onClick:()=>d(f),display:"inline"})]})]},Math.random())}function i(){const l=c(),m=l.length>0?"none":"inline";document.getElementById("add-"+a).style.display=m;for(var f=0;f<n;f++){var w=document.getElementById("extra-add-"+f+"-");w.style.display="none"}if(l.length>0){var w=document.getElementById("extra-add-"+l[l.length-1]+"-");w.style.display="inline"}}function o(){i();var l=JSON.parse(JSON.stringify(e.data.template));l.fields?(l.fields.map(function(m){m.name=m.name.replace("__n__","__"+n+"__")}),l.fields[0].value=0):l.fieldsets.map(function(m){m.fields.map(function(f){f.map(function(w){w.name=w.name.replace("__n__","__"+n+"__")}),f[0].value=0})}),P.createRoot(document.getElementById(a).appendChild(document.createElement("div"))).render(r(l,"inline")),setTimeout(i,100)}function d(l){const m=e.data.template,w=(m.fields?m.fields[0]:m.fieldsets[0].fields[0][0]).name.replace("__n__","__"+l+"__"),y=document.querySelector("input[name="+w+"]");parseInt(y.value)==0?y.value="":y.value=-parseInt(y.value),document.getElementById("form-"+l+"-"+a).style.display="none",i()}function c(){for(var l=[],m=0;m<n;m++)document.getElementById("form-"+m+"-"+a).style.display=="block"&&l.push(m);return l}function s(){return t.jsx("div",{id:"info-"+a,children:t.jsx(ee,{data:{text:'Clique no botão com o ícone de "+" para adicionar e com o ícone da "lixeira" para remover.'},children:t.jsx(_,{primary:!0,icon:"add",onClick:()=>o(),id:"add-"+a,display:e.data.value.length>0?"none":"inline"})})})}function u(){const l={margin:0};return t.jsxs("div",{className:"form-fieldset",children:[t.jsx("h2",{style:l,"data-label":I(e.data.label),children:e.data.label}),t.jsx("div",{children:!1}),t.jsxs("div",{id:a,className:"fieldset-inline-forms",children:[s(),e.data.value.map(function(m,f){return r(m,f==e.data.value.length-1?"inline":"none")})]})]})}return u()}function he(e){N.useEffect(()=>{e.data.controls&&Ee(e.data.controls)},[]);function n(r){return r.type=="inline"?r.max==r.min==1?t.jsx(Mt,{data:r},Math.random()):t.jsx(Tt,{data:r},Math.random()):t.jsx(ae,{data:r},Math.random())}function a(){return e.data.fields?t.jsx("div",{className:"form-fields",children:e.data.fields.map(r=>n(r))}):e.data.fieldsets.map(r=>t.jsx("div",{className:"form-fieldset",children:r.type=="inline"?n(r):t.jsxs(t.Fragment,{children:[t.jsx("h2",{"data-label":I(r.title),style:{margin:0},children:r.title}),r.fields.map(i=>t.jsx("div",{children:i.map(o=>t.jsx("div",{className:"form-group "+o.name,style:{verticalAlign:"bottom",width:100/i.length+"%",display:o.type=="hidden"?"none":"inline-block"},children:n(o)},Math.random()))},Math.random()))]})},Math.random()))}return a()}function It(e){const n=Math.random();function a(){const f={margin:0,color:p.colors.primary};return t.jsx("h1",{style:f,children:e.data.title})}function r(){return e.data.info&&t.jsx(wt,{data:{text:e.data.info}})}function i(){if(e.data.display)return t.jsxs(t.Fragment,{children:[e.data.display.map(f=>t.jsx(x,{data:f},Math.random())),t.jsx("div",{style:{marginTop:30}})]})}function o(){return t.jsx(he,{data:e.data})}function d(){return t.jsxs("div",{style:{marginTop:20,textAlign:"right"},children:[t.jsx(_,{onClick:l,label:"Cancelar",default:!0,display:"inline"}),t.jsx(_,{onClick:m,label:"Enviar",primary:!0,display:"inline",icon:"chevron-right",spin:!0})]})}function c(){return t.jsx("div",{id:"output",style:{marginTop:30}})}function s(){if(e.data.image)return t.jsx("div",{style:{margin:"auto",width:"100%",textAlign:"center"},children:t.jsx("img",{src:e.data.image})})}function u(){return t.jsxs("form",{id:n,className:e.data.key,action:e.data.url,style:{margin:"auto",backgroundColor:"white"},method:e.data.method,children:[t.jsx("div",{children:!1}),t.jsxs("div",{style:{padding:5},children:[a(),s(),r(),i(),o(),d(),c()]})]})}function l(){J()}function m(f){f.preventDefault();var w=e.data.url,y=document.getElementById(n),b=new FormData(y);if(y.method.toUpperCase()=="GET"){const D=w.indexOf("?")>=0?"&":"?";w=w+D+"form="+e.data.title+"&"+new URLSearchParams(b).toString(),b=null}q(y.method.toUpperCase(),w,function(k){if(y.querySelectorAll(".error").forEach(M=>M.style.display="none"),f.target.dataset.spinning&&(f.target.querySelector("i.fa-spin").style.display="none",f.target.querySelector("i.fa-"+f.target.dataset.spinning).style.display="inline-block"),k.type=="response")if(k.store&&Object.keys(k.store).map(function(M){k.store[M]?localStorage.setItem(M,k.store[M]):localStorage.removeItem(M,k.store[M])}),k.redirect&&k.redirect.length>2)k.message&&localStorage.setItem("message",k.message),document.location.href=X(k.redirect);else if(k.message&&W(k.message),k.task){let M=function(){q("GET","/api/taskprogress/"+k.task+"/",function(S){S==null||S.progress==100?f.target.innerHTML=v:(f.target.innerHTML="Aguarde... ("+S.progress+"%)",setTimeout(M,5e3))})};const v=f.target.innerHTML;f.target.innerHTML="Aguarde... (0%)",M()}else k.redirect==".."&&(document.getElementsByTagName("dialog").length==0?history.back():J()),k.redirect=="."&&y.reset(),k.dispose&&(y.style.display="none"),Ke();else if(k.type=="error"){var L=k.text;console.log(k),Object.keys(k.errors).map(function(M){if(M=="__all__")L=k.errors[M];else{const v=y.querySelector("#"+M+"_error");v==null?L=M+":"+k.errors[M]:(v.querySelector("span").innerHTML=k.errors[M],v.style.display="block")}}),W(L,!0)}else{const M=document.querySelector("#output");M.innerHTML="",P.createRoot(M.appendChild(document.createElement("div"))).render(t.jsx(x,{data:k}))}},b)}return u()}function Nt(e){A(`
127
+ `),t.jsxs("div",{className:"tooltip",children:[e.children,t.jsx("div",{className:"tooltiptext",children:H(e.text)})]})}return n()}const gt=["text","password","email","number","date","datetime-local","file","image","range","search","tel","time","url","week","hidden","color"],K={padding:15,border:"solid 1px #d9d9d9",borderRadius:5,backgroundColor:"white"};function xt(e,n){const a=new FormData(e);for(let[r,i]of Array.from(a.entries())){const o=e[r];n!=r&&(o.tagName=="SELECT"&&i!==""||o.tagName==null&&i!==""||o.type=="radio"&&i!==""||o.type=="checkbox"&&i!==""||a.delete(r))}return new URLSearchParams(a).toString()}function $(e,n,a){const r=e.indexOf("?")<0?"?":"&",i=xt(n,a);return e=e+(i?r+i:""),e}function le(e){if(e){const a=[".png",".jpeg",".jpeg",".gif"];for(var n=0;n<a.length;n++)if(e.toLowerCase().indexOf(a[n])>0)return!0}}function Z(e,n){q("GET",$(n,e.closest("form"),e.name),Ee)}function yt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="none");var a=document.querySelector(".form-group."+e);a&&(a.style.display="none")}}function vt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="block");var a=document.querySelector(".form-group."+e);a&&(a.style.display="block")}}function bt(e){const n="reload-"+e+"-field";window[n]&&window[n]()}function pt(e,n){var a=document.querySelector(".form-group."+e),r=a.querySelector('*[name="'+e+'"]');if(r.tagName=="INPUT")r.value=n;else if(r.tagName=="SELECT"){if(r.style.display!="none")r.dispatchEvent(new CustomEvent("customchange",{detail:{value:n}}));else for(var i=0;i<r.options.length;i++)if(r.options[i].value==n){r.selectedIndex=i;break}}}function Ee(e){if(e){for(var n=0;n<e.hide.length;n++)yt(e.hide[n]);for(var n=0;n<e.show.length;n++)vt(e.show[n]);for(var n=0;n<e.reload.length;n++)bt(e.reload[n]);for(var a in e.set)pt(a,e.set[a])}}function wt(e){function n(){const a={color:p.colors.info,backgroundColor:p.background.info,padding:20,display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10};return t.jsxs("div",{style:a,children:[t.jsxs("div",{children:[t.jsx(E,{icon:"circle-check",style:{color:p.colors.info,marginRight:20}}),e.data.text]}),e.children&&t.jsx("div",{children:e.children})]})}return n()}function jt(e){function n(){const a={color:"white",display:"none",backgroundColor:"#e52207",marginTop:2,marginBottom:2,padding:8};return t.jsxs("div",{style:a,id:e.id,className:"error",children:[t.jsx(E,{icon:"xmark-circle",style:{marginRight:5}}),t.jsx("span",{})]})}return n()}function kt(e){function n(){const a={marginTop:2,marginBottom:2,fontStyle:"italic"};return t.jsx("div",{style:a,children:t.jsx("span",{children:e.text})})}return n()}function ae(e){const n=e.data.name+Math.random();function a(){const c={display:"flex",justifyContent:"space-between",alignItems:"baseline"};return e.data.action&&(e.data.action.icon=null,e.data.action.modal=!0,e.data.action.urlfunc=function(){return $(e.data.action.url,document.getElementById(n).closest("form"))}),t.jsxs("div",{style:c,children:[t.jsxs("label",{className:"bold",children:[e.data.label," ",e.data.label&&e.data.required?"*":""]}),e.data.action&&t.jsx(z,{data:e.data.action,style:{padding:0,margin:0}})]})}function r(){return e.data.type=="datetime"&&(e.data.type="datetime-local"),gt.indexOf(e.data.type)>=0?t.jsx(ye,{data:e.data}):e.data.type=="choice"&&Array.isArray(e.data.choices)?e.data.pick?Array.isArray(e.data.value)?t.jsx(ve,{data:e.data}):t.jsx(de,{data:e.data}):t.jsx(Et,{data:e.data}):e.data.type=="choice"?e.data.pick?Array.isArray(e.data.value)?t.jsx(ve,{data:e.data}):t.jsx(de,{data:e.data}):t.jsx(Me,{data:e.data}):e.data.type=="decimal"?t.jsx(ye,{data:e.data}):e.data.type=="boolean"?t.jsx(Ct,{data:e.data}):e.data.type=="textarea"?t.jsx(St,{data:e.data}):e.data.type=="scheduler"?(e.data.scheduler.input_name=e.data.name,t.jsx(Ce,{data:e.data.scheduler})):t.jsx("span",{children:e.data.name})}function i(){return t.jsx("div",{children:t.jsx(jt,{id:e.data.name+"_error"})})}function o(){return e.data.help_text&&t.jsx(kt,{text:e.data.help_text})}function d(){const c={display:e.data.type=="hidden"?"none":"flex",flexDirection:"column",padding:5,width:"calc(100%-5px)"};return t.jsxs("div",{id:n,style:c,children:[a(),r(),o(),i()]})}return d()}function ye(e){var n="";const a=e.data.name+Math.random();e.data.mask=="decimal"&&(n="decimal",e.data.value&&(e.data.value=Math.round(parseFloat(e.data.value)).toFixed(2).replace(".",","))),N.useEffect(()=>{function d(u,l,m){var f=m.target,w=f.value.replace(/\D/g,""),y=f.value.length>l?1:0;VMasker(f).unMask(),VMasker(f).maskPattern(u[y]),f.value=VMasker.toPattern(w,u[y])}if(e.data.mask){var c=document.getElementById(a);if(e.data.mask=="decimal")VMasker(c).maskMoney({precision:2,separator:",",delimiter:"."});else if(e.data.mask.indexOf("|")>0){var s=e.data.mask.split("|");VMasker(c).maskPattern(s[0]),c.addEventListener("input",d.bind(void 0,s,14),!1)}else VMasker(c).maskPattern(e.data.mask)}},[]);function r(d){Z(d.target,e.data.onchange)}function i(d){if(e.data.type=="file"&&d.target.files){let s=d.target.files[0];var c=new FileReader;c.onload=function(u){if(le(s.name)){const w="display"+a;var l=document.createElement("img");l.id=d.target.id+"img",l.style.width="200px",l.style.display="block",l.style.margin="auto",l.style.marginTop="20px",l.onload=function(y){const b=e.data.width>e.data.height?e.data.width/l.width:e.data.height/l.height;var D=document.createElement("canvas");const k=D.getContext("2d");D.height=D.width*(l.height/l.width);const L=document.createElement("canvas"),M=L.getContext("2d");L.width=l.width*b,L.height=l.height*b,M.drawImage(l,0,0,L.width,L.height),k.drawImage(L,0,0,L.width*b,L.height*b,0,0,D.width,D.height),L.toBlob(function(T){const S=new DataTransfer;S.items.add(new File([T],s.name)),d.target.files=S.files});var v=document.getElementById(w);v==null?(v=document.createElement("div"),v.id=w):v.removeChild(v.childNodes[0]),v.appendChild(l),d.target.parentNode.appendChild(v)},l.src=u.target.result}const m=document.getElementById("fileinfo"+a);var f=s.size/1024;f<1024?f=parseInt(f)+" Kb":f=(f/1024).toFixed(2)+" Mb",m.innerHTML=s.name+" / "+f,e.data.max_size&&s.size/1024/1024>e.data.max_size&&alert("O limite de tamanho é "+e.data.max_size+"Mb. O arquivo informado possui "+f+". Por favor, adicione um arquivo menor.")},c.readAsDataURL(s)}}function o(){var d=e.data.type;if(d=="datetime"&&(d="datetime-regional"),d=="decimal"&&(d="text"),d=="file"){const u={alignContent:"center",minHeight:75,padding:5,maxWidth:"100%",margin:"auto"};var c=null;return e.data.extensions&&e.data.extensions.length>0&&(c=e.data.extensions.map(l=>"."+l).join(", ")),t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:window.innerWidth<800?"block":"flex",justifyContent:"space-between",backgroundColor:"rgba(15, 145, 210, 0.05)",border:"1px dashed rgba(15, 145, 210, 0.4)",borderRadius:10,textAlign:"center"},children:[t.jsx("div",{style:u,children:t.jsx(E,{icon:"cloud-upload",style:{fontSize:"2.5rem",color:p.colors.primary}})}),t.jsxs("div",{style:u,children:[e.data.value&&le(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:t.jsx("img",{src:e.data.value,height:50})}),e.data.value&&!le(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:e.data.value}),"Selecione um arquivo clicando no botão ao lado.",t.jsxs("div",{className:"bold",id:"fileinfo"+a,children:["O arquivo",e.data.max_size&&"deve possuir até "+e.data.max_size+" Mb e ","deve ter extensão"," ",e.data.extensions.map(l=>"."+l).join(" ou "),"."]})]}),t.jsx("div",{style:u,align:"center",children:t.jsx(_,{label:"Selecionar Arquivo",onClick:()=>document.getElementById(a).click()})})]}),t.jsx("input",{className:"form-control "+n,type:d,name:e.data.name,id:a,"data-label":I(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?r:null,onChange:i,style:{zIndex:"-1",marginTop:-20},accept:c})]})}else{var s=K;return d=="color"&&(s={...K},s.width="100%",s.backgroundColor="white",s.height=47.5),t.jsx("input",{className:"form-control "+n,type:d,name:e.data.name,id:a,defaultValue:e.data.value,"data-label":I(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?r:null,onChange:i,style:s})}}return o()}function Me(e){var n=[];Array.isArray(e.data.value)?e.data.value.forEach(function(v,T){n.push({id:v.id,value:v.label})}):e.data.value!=null&&n.push({id:e.data.value.id,value:e.data.value.label}),e.data.id==null&&(e.data.id=Math.random()),e.data.id2==null&&(e.data.id2=e.data.id+"__autocomplete");const a=e.data.id,r=e.data.id2,i=Array.isArray(e.data.value),[o,d]=N.useState(!1),[c,s]=N.useState(null);var u=!1;let l;N.useEffect(()=>{k(n,!0),document.getElementById(a).addEventListener("customchange",function(v){k(v.detail.value);const T=document.getElementById(e.data.name);T&&reactTriggerChange(T)})},[]);function m(){const v=document.getElementById(a);if(i){const T={padding:5,display:"inline"},S={cursor:"pointer",marginRight:5},h={fontSize:"0.8rem"};return t.jsxs("div",{children:[v==null&&n.map((g,j)=>t.jsxs("div",{style:T,children:[t.jsx("span",{onClick:()=>L(j),style:S,children:t.jsx(E,{icon:"trash-can",style:h})}),g.value]},Math.random())),v!=null&&Array.from(v.options).map((g,j)=>t.jsxs("div",{style:T,children:[t.jsx("span",{onClick:()=>L(j),style:S,children:t.jsx(E,{icon:"trash-can",style:h})}),g.innerHTML]},Math.random()))]})}}function f(){return t.jsx("select",{id:a,name:e.data.name,multiple:i,readOnly:!0,style:{display:"contents"}})}function w(){const v={...K,...e.style||{}},T={padding:0,margin:0,border:"solid 1px #d9d9d9",marginTop:-1,borderRadius:5,maxHeight:150,overflowY:"auto",zIndex:99999};T.position="absolute",T.backgroundColor="white";const S=document.getElementById(r);if(e.data.icon&&(v.paddingLeft=30),S){let B=null,O=S,U=null;for(;!U&&(O=O.parentElement)instanceof HTMLElement;)O.matches("dialog")&&(U=O);B=U;const G=S.getBoundingClientRect();var h=G.top+G.height,g=G.left;if(B){const te=B.getBoundingClientRect();h=h-te.top,g=g-te.left}else h+=window.scrollY,g+=window.scrollX;T.width=G.width,T.top=h,T.left=g}const j={cursor:"pointer",padding:10},C=!i&&n.length>0&&n[0].value||"";return t.jsxs(t.Fragment,{children:[e.data.icon&&t.jsx(E,{icon:e.data.icon,style:{position:"absolute",margin:13,color:"#d9d9d9"}}),t.jsx("input",{id:r,name:e.data.name+"__autocomplete",type:"text",className:"form-control",onFocus:B=>{B.target.select(),D(B)},onChange:D,onMouseLeave:y,onBlur:y,defaultValue:C,style:v,"data-label":I(e.data.label)}),c&&o&&t.jsxs("ul",{style:T,onMouseLeave:b,onMouseEnter:function(B){u=!0},children:[c.length==0&&t.jsx("li",{style:j,children:"Nenhuma opção encontrada."}),c.map(B=>t.jsx("li",{onClick:()=>{d(!1),e.onSelect?e.onSelect(B):k(B)},style:j,className:"autocomplete-item","data-label":I(B.value),children:B.value},Math.random()))]})]})}function y(v){u=!1,setTimeout(function(){u||b(v)},250)}function b(v){const T=document.getElementById(a);if(T){const S=document.getElementById(r);i||T.options.length>0&&S.value!=T.options[0].innerHTML&&(T.innerHTML="",S.value="",d(!1),e.data.onchange&&Z(S,e.data.onchange)),v.target.tagName=="UL"?d(!1):u||d(!1)}}function D(v){clearTimeout(l),l=setTimeout(function(){const T=v.target.closest("form"),S=e.data.choices.indexOf("?")<0?"?":"&";d(!0),q("GET",$(e.data.choices+S+"term="+v.target.value,T),function(g){s(g)})},1e3)}function k(v,T=!1){const S=document.getElementById(a),h=document.getElementById(r);S.innerHTML==null&&(S.innerHTML=""),Array.isArray(v)?S.innerHTML=v.map(g=>`<option selected value="${g.id}">${g.value}</option>`).join(""):v?i?(S.innerHTML+=`<option selected value="${v.id}">${v.value}</option>`,h.value=""):(S.innerHTML=`<option selected value="${v.id}">${v.value}</option>`,h.value=v.value):(S.innerHTML="",h.value=""),e.data.onchange&&!T&&Z(h,e.data.onchange)}function L(v){const T=document.getElementById(a);var S=Array.from(T.options);T.innerHTML=S.slice(0,v).concat(S.slice(v+1)).map(h=>`<option selected value="${h.value}">${h.innerHTML}</option>`).join(""),s([])}function M(){return t.jsxs(t.Fragment,{children:[m(),f(),w()]})}return M()}function St(e){function n(){var a={...K};return a.height=100,t.jsx("textarea",{id:e.data.name,name:e.data.name,"data-label":I(e.data.label),style:a,defaultValue:e.data.value||"",className:"form-control"})}return n()}function Ct(e){var n=e.data;return n.choices=[{id:!0,value:"Sim"},{id:!1,value:"Não"}],t.jsx(de,{data:n})}function de(e){const[n,a]=N.useState(e.data.choices);var r=Math.random(),i=e.data;function o(u){return i.value!=null?i.value==u.id?!0:i.value.id==u.id:!1}function d(u){var l=document.getElementById(u);i.checked&&(l.checked=!1),e.data.onchange&&Z(l,e.data.onchange)}function c(u){var l=document.getElementById(u);i.checked=l.checked}function s(){return window["reload-"+i.name+"-field"]=function(){q("GET",$(e.data.pick,document.querySelector(".radio-group."+i.name).closest("form")),function(l){a(l)})},n.length>0?t.jsx("div",{className:"radio-group "+i.name,children:n.map((u,l)=>(u.id||u.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:i.name+r+l,type:"radio",name:i.name,defaultValue:u.id,defaultChecked:o(u),"data-label":I(u.value),onClick:function(){d(i.name+r+l)},onMouseEnter:function(){c(i.name+r+l)}}),t.jsx("label",{htmlFor:i.name+r+l,children:u.value})]},r+l))}):t.jsx("div",{className:"radio-group empty "+i.name,children:t.jsx(ee,{data:{text:"Nenhuma opção disponível para seleção."}})})}return s()}function ve(e){const[n,a]=N.useState(e.data.choices);var r=Math.random(),i=e.data;function o(s){var u=!1;if(i.value)for(var l=0;l<i.value.length;l++){var m=i.value[l];(m==s.id||m.id==s.id)&&(u=!0)}return u}function d(s){e.data.onchange&&Z(s.target,e.data.onchange)}function c(){return window["reload-"+i.name+"-field"]=function(){q("GET",$(e.data.pick,document.querySelector(".checkbox-group."+i.name).closest("form")),function(u){a(u)})},n.length>0?t.jsx("div",{className:"checkbox-group "+i.name,children:n.map((s,u)=>(s.id||s.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:i.name+r+u,type:"checkbox",name:i.name,onClick:d,defaultValue:s.id,defaultChecked:o(s),"data-label":I(s.value)}),t.jsx("label",{htmlFor:i.name+r+u,children:s.value})]},r+u))}):t.jsx("div",{className:"checkbox-group empty "+i.name,children:t.jsx(ee,{data:{text:"Nenhuma opção disponível para seleção."}})})}return c()}function Et(e){var n=e.data;return t.jsx(t.Fragment,{children:t.jsx("select",{className:"form-control",id:n.name,name:n.name,"data-label":I(n.label),defaultValue:n.value,style:K,children:n.choices.map(a=>t.jsx("option",{value:a.id,children:a.value},Math.random()))})})}function Mt(e){const n=Math.random(),a=e.data.value[0],r=a.fields?a.fields[0]:a.fieldsets[0].fields[0][0];function i(){return!e.data.required&&t.jsx("div",{id:"info-"+n,children:t.jsxs(ee,{data:{text:"Esta informação é opcional. Controle seu preenchimento com o botão ao lado."},children:[t.jsx(_,{primary:!0,icon:"pen-clip",onClick:()=>o(!0),id:"show-"+n,display:r.value?"none":"inline"}),t.jsx(_,{primary:!0,icon:"trash",onClick:()=>o(!1),id:"hide-"+n,display:r.value?"inline":"none"})]})})}function o(s){const u=document.querySelector("input[name="+r.name+"]"),l=document.getElementById("inline-form-"+n),m=document.getElementById("show-"+n),f=document.getElementById("hide-"+n);l.style.display=s?"block":"none",m.style.display=s?"none":"inline",f.style.display=s?"inline":"none",s?u.value===""?u.value=0:u.value=-parseInt(u.value):parseInt(u.value)==0?u.value="":u.value=-parseInt(u.value)}function d(){const s={display:r.value?"block":"none"};return e.data.required&&(s.display="block",r.value===""&&(r.value=0)),t.jsx("div",{className:"fieldset-inline-forms",style:s,id:"inline-form-"+n,children:e.data.value.map(function(u){return t.jsx(he,{data:u},Math.random())})})}function c(){const s={margin:0};return t.jsxs("div",{className:"form-fieldset",children:[t.jsx("h2",{style:s,"data-label":I(e.data.label),children:e.data.label}),i(),d()]})}return c()}function Tt(e){var n=0;const a=Math.random();e.data.template==null&&(e.data.template=e.data.value.pop());function r(l,m){const f=n;return n+=1,t.jsxs("div",{style:{display:"block"},id:"form-"+f+"-"+a,children:[t.jsx(he,{data:l}),t.jsxs("div",{style:{textAlign:"center",marginTop:10,marginBottom:10},children:[t.jsx(_,{primary:!0,icon:"plus",onClick:()=>o(),id:"extra-add-"+f+"-",display:m}),t.jsx(_,{primary:!0,icon:"trash",onClick:()=>d(f),display:"inline"})]})]},Math.random())}function i(){const l=c(),m=l.length>0?"none":"inline";document.getElementById("add-"+a).style.display=m;for(var f=0;f<n;f++){var w=document.getElementById("extra-add-"+f+"-");w.style.display="none"}if(l.length>0){var w=document.getElementById("extra-add-"+l[l.length-1]+"-");w.style.display="inline"}}function o(){i();var l=JSON.parse(JSON.stringify(e.data.template));l.fields?(l.fields.map(function(m){m.name=m.name.replace("__n__","__"+n+"__")}),l.fields[0].value=0):l.fieldsets.map(function(m){m.fields.map(function(f){f.map(function(w){w.name=w.name.replace("__n__","__"+n+"__")}),f[0].value=0})}),P.createRoot(document.getElementById(a).appendChild(document.createElement("div"))).render(r(l,"inline")),setTimeout(i,100)}function d(l){const m=e.data.template,w=(m.fields?m.fields[0]:m.fieldsets[0].fields[0][0]).name.replace("__n__","__"+l+"__"),y=document.querySelector("input[name="+w+"]");parseInt(y.value)==0?y.value="":y.value=-parseInt(y.value),document.getElementById("form-"+l+"-"+a).style.display="none",i()}function c(){for(var l=[],m=0;m<n;m++)document.getElementById("form-"+m+"-"+a).style.display=="block"&&l.push(m);return l}function s(){return t.jsx("div",{id:"info-"+a,children:t.jsx(ee,{data:{text:'Clique no botão com o ícone de "+" para adicionar e com o ícone da "lixeira" para remover.'},children:t.jsx(_,{primary:!0,icon:"add",onClick:()=>o(),id:"add-"+a,display:e.data.value.length>0?"none":"inline"})})})}function u(){const l={margin:0};return t.jsxs("div",{className:"form-fieldset",children:[t.jsx("h2",{style:l,"data-label":I(e.data.label),children:e.data.label}),t.jsx("div",{children:!1}),t.jsxs("div",{id:a,className:"fieldset-inline-forms",children:[s(),e.data.value.map(function(m,f){return r(m,f==e.data.value.length-1?"inline":"none")})]})]})}return u()}function he(e){N.useEffect(()=>{e.data.controls&&Ee(e.data.controls)},[]);function n(r){return r.type=="inline"?r.max==r.min==1?t.jsx(Mt,{data:r},Math.random()):t.jsx(Tt,{data:r},Math.random()):t.jsx(ae,{data:r},Math.random())}function a(){return e.data.fields?t.jsx("div",{className:"form-fields",children:e.data.fields.map(r=>n(r))}):e.data.fieldsets.map(r=>t.jsx("div",{className:"form-fieldset",children:r.type=="inline"?n(r):t.jsxs(t.Fragment,{children:[t.jsx("h2",{"data-label":I(r.title),style:{margin:0},children:r.title}),r.fields.map(i=>t.jsx("div",{children:i.map(o=>t.jsx("div",{className:"form-group "+o.name,style:{verticalAlign:"bottom",width:100/i.length+"%",display:o.type=="hidden"?"none":"inline-block"},children:n(o)},Math.random()))},Math.random()))]})},Math.random()))}return a()}function It(e){const n=Math.random();function a(){const f={margin:0,color:p.colors.primary};return t.jsx("h1",{style:f,children:e.data.title})}function r(){return e.data.info&&t.jsx(wt,{data:{text:e.data.info}})}function i(){if(e.data.display)return t.jsxs(t.Fragment,{children:[e.data.display.map(f=>t.jsx(x,{data:f},Math.random())),t.jsx("div",{style:{marginTop:30}})]})}function o(){return t.jsx(he,{data:e.data})}function d(){return t.jsxs("div",{style:{marginTop:20,textAlign:"right"},children:[t.jsx(_,{onClick:l,label:"Cancelar",default:!0,display:"inline"}),t.jsx(_,{onClick:m,label:"Enviar",primary:!0,display:"inline",icon:"chevron-right",spin:!0})]})}function c(){return t.jsx("div",{id:"output",style:{marginTop:30}})}function s(){if(e.data.image)return t.jsx("div",{style:{margin:"auto",width:"100%",textAlign:"center"},children:t.jsx("img",{src:e.data.image})})}function u(){return t.jsxs("form",{id:n,className:e.data.key,action:e.data.url,style:{margin:"auto",backgroundColor:"white"},method:e.data.method,children:[t.jsx("div",{children:!1}),t.jsxs("div",{style:{padding:5},children:[a(),s(),r(),i(),o(),d(),c()]})]})}function l(){J()}function m(f){f.preventDefault();var w=e.data.url,y=document.getElementById(n),b=new FormData(y);if(y.method.toUpperCase()=="GET"){const D=w.indexOf("?")>=0?"&":"?";w=w+D+"form="+e.data.title+"&"+new URLSearchParams(b).toString(),b=null}q(y.method.toUpperCase(),w,function(k){if(y.querySelectorAll(".error").forEach(M=>M.style.display="none"),f.target.dataset.spinning&&(f.target.querySelector("i.fa-spin").style.display="none",f.target.querySelector("i.fa-"+f.target.dataset.spinning).style.display="inline-block"),k.type=="response")if(k.store&&Object.keys(k.store).map(function(M){k.store[M]?localStorage.setItem(M,k.store[M]):localStorage.removeItem(M,k.store[M])}),k.redirect&&k.redirect.length>2)k.message&&localStorage.setItem("message",k.message),document.location.href=X(k.redirect);else if(k.message&&W(k.message),k.task){let M=function(){q("GET","/api/taskprogress/"+k.task+"/",function(S){S==null||S.progress==100?f.target.innerHTML=v:(f.target.innerHTML="Aguarde... ("+S.progress+"%)",setTimeout(M,5e3))})};const v=f.target.innerHTML;f.target.innerHTML="Aguarde... (0%)",M()}else k.redirect==".."&&(document.getElementsByTagName("dialog").length==0?history.back():J()),k.redirect=="."&&y.reset(),k.dispose&&(y.style.display="none"),Ke();else if(k.type=="error"){var L=k.text;console.log(k),Object.keys(k.errors).map(function(M){if(M=="__all__")L=k.errors[M];else{const v=y.querySelector("#"+M+"_error");v==null?L=M+":"+k.errors[M]:(v.querySelector("span").innerHTML=k.errors[M],v.style.display="block")}}),W(L,!0)}else{const M=document.querySelector("#output");M.innerHTML="",P.createRoot(M.appendChild(document.createElement("div"))).render(t.jsx(x,{data:k}))}},b)}return u()}function Nt(e){A(`
128
128
  .calendar table{
129
129
  width: 100%;
130
130
  border-spacing: 0px;
@@ -213,11 +213,11 @@ import{j as t,c as P,r as N,R as Te}from"./react.min.js";const p={colors:{primar
213
213
  font-weight: active ? bold : normal;
214
214
  text-decoration: none;
215
215
  }
216
- `),e.data.id==null&&(e.data.id=Math.random());const[n,a]=N.useState(e.data);function r(){return n.attrname?t.jsx("h2",{"data-label":I(n.title),children:n.title}):t.jsxs("h1",{"data-label":I(n.title),children:[n.title," ",n.total>10&&"("+n.total+")"]})}function i(){return t.jsxs("div",{className:"title",children:[r(),t.jsx("i",{id:"loader-"+e.data.id,className:"fa-solid fa-circle-notch fa-spin fa-1x"})]})}function o(h){document.getElementById("loader-"+e.data.id).style.display=h?"block":"none"}function d(){return n.subsets&&t.jsx("div",{className:"tabs",children:n.subsets.map(function(h,g){var j=n.subset===h.name||!n.subset&&g==0;return t.jsxs(F,{href:"#",style:{borderBottom:j?"solid 3px #2670e8":0,color:"#0c326f"},onClick:function(C){C.preventDefault(),c(h.name)},dataLabel:I(h.label),children:[h.label," ",t.jsx(Lt,{total:h.count})]},Math.random())})})}function c(h){const g=document.getElementById("subset-"+e.data.id);g.value=h||"",M()}function s(h,g,j){const C=document.getElementById("form-"+e.data.id);C.querySelector("input[name="+n.calendar.field+"__day]").value=h||"",C.querySelector("input[name="+n.calendar.field+"__month]").value=g||"",C.querySelector("input[name="+n.calendar.field+"__year]").value=j||"",y(1)}function u(){if(n.calendar)return t.jsx(Nt,{data:n.calendar,onChange:s})}function l(h){const g={textAlign:"left",verticalAlign:"top",lineHeight:"1.2rem",color:p.colors.primary,padding:5};if(!(window.innerWidth<800))return t.jsxs("tr",{children:[h.map(function(j){return j.label!="ID"&&t.jsx("th",{style:g,className:"bold",children:j.label},Math.random())}),t.jsx("th",{style:g})]})}function m(h){const g={borderBottom:"solid 1px #DDD",padding:5},j={borderBottom:"solid 1px #DDD",lineHeight:"3rem",textAlign:"right"};return window.innerWidth<800?t.jsxs("tr",{children:[t.jsx("td",{style:g,children:h.title},Math.random()),t.jsx("td",{style:j,children:t.jsx("div",{style:{verticalAlign:"center"},children:t.jsx(E,{icon:"chevron-right",onClick:()=>Oe(h.actions),style:{cursor:"pointer",marginRight:20}})})})]},Math.random()):t.jsxs("tr",{children:[h.data.map(function(C){return C.label!="ID"&&t.jsx("td",{style:g,children:H(C.value)},Math.random())}),t.jsx("td",{style:j,children:t.jsx("div",{style:{verticalAlign:"center"},children:h.actions.map(function(C){return t.jsx(z,{data:C,default:!0},Math.random())})})})]},Math.random())}function f(){return n.data.length>0?(n.render==null&&window.innerWidth<800&&(n.renderer="rows"),n.renderer?n.renderer=="cards"?t.jsx(Y,{width:300,alignItems:"start",children:n.data.map(function(h){return h.type=n.renderer,t.jsx(x,{data:h},Math.random())})}):t.jsx("div",{style:{marginBottom:15},children:n.data.map(function(h){return h.type=n.renderer,t.jsx(x,{data:h},Math.random())})}):w()):t.jsx(ee,{data:{text:"Nenhum registro encontrado."}})}function w(){const h={width:"100%",overflowX:"auto"},g={width:"100%",lineHeight:"2rem",borderSpacing:0};return t.jsx("div",{style:h,children:t.jsxs("table",{style:g,children:[t.jsx("thead",{children:l(n.data[0].data)}),t.jsx("tbody",{children:n.data.map(function(j){return m(j)})})]})})}function y(h){const j=document.getElementById("form-"+e.data.id).querySelector("input[name=page]");j&&(j.value=h),M(),k()}function b(){const h=document.getElementById("form-"+e.data.id);if(h){const g=h.querySelector("input[name=page]");g&&(g.value=n.pagination.page.current)}return t.jsx(Dt,{data:n.pagination,onChange:y,total:n.total})}function D(){return t.jsx("div",{align:"right",style:{marginTop:20,marginBottom:20},children:n.actions.map(function(h){return t.jsx(z,{data:h,primary:!0},Math.random())})})}function k(){const h=document.getElementById(e.data.id).getBoundingClientRect().top+window.scrollY;console.log(h),console.log(e.data.id),window.scrollTo({top:h,behavior:"smooth"})}function L(){const h={backgroundColor:"#f8f8f8",borderBottom:"solid 1px #DDD",marginBottom:10,padding:10},g=n.search.length>0,j=n.filters.length>0;if((n.bi||n.data.length>=0)&&(g||j)){const C={name:"q",mask:null,type:"text",label:"Palavras-chaves",value:n.q};return t.jsxs("div",{style:h,children:[t.jsxs(Y,{width:250,children:[g&&t.jsx("div",{children:t.jsx(ae,{data:C})}),j&&n.filters.map(function(B){return B.type!="hidden"&&t.jsx("div",{children:t.jsx(ae,{data:B})},Math.random())}),t.jsx("div",{children:t.jsx(_,{onClick:M,label:"Filtrar",icon:"filter"})})]}),j&&n.filters.map(function(B){return B.type=="hidden"&&t.jsx("div",{children:t.jsx(ae,{data:B})},Math.random())})]})}}function M(){o(!0);var h;const g=new URLSearchParams(new FormData(document.getElementById("form-"+e.data.id))).toString();e.data.url.indexOf("?")>0?h=e.data.url+"&"+g:h=e.data.url+"?"+g,q("GET",h,function(j){a(j),o(!1)})}function v(){const h={color:p.colors.primary};return e.data.reloadable&&t.jsxs("div",{align:"center",children:[t.jsxs("i",{children:["Ultima atualização em ",new Date().toLocaleTimeString()]}),t.jsx("div",{children:t.jsx(F,{style:h,onClick:g=>{g.preventDefault(),M()},children:"Atualizar agora"})})]})}function T(){return n.bi?t.jsxs(t.Fragment,{children:[L(),n.bi.map(function(h){return t.jsx(Y,{width:300,alignItems:"start",children:h.map(function(g){return t.jsx("div",{children:t.jsx(x,{data:g})},Math.random())})},Math.random())})]}):t.jsxs("div",{className:"content",children:[v(),D(),d(),L(),u(),f(),b()]})}function S(){window[e.data.id]=()=>M();const h={backgroundColor:"white",padding:20};return t.jsx("div",{className:"reloadable queryset",id:e.data.id,sytle:h,children:t.jsxs("form",{id:"form-"+e.data.id,children:[t.jsx("div",{children:!1}),t.jsx("input",{type:"hidden",name:"subset",id:"subset-"+e.data.id}),i(),T()]})})}return S()}function oe(e){var n=Math.random();function a(){var r=document.getElementById(n);if(r){var i=echarts.init(r);i.setOption(e.option)}else setTimeout(a,1e3)}return setTimeout(a,1e3),t.jsx("div",{id:n,style:{width:"100%",height:300}})}function me(e){var n=[["70%","78%"],["60%","68%"],["50%","58%"],["40%","48%"],["30%","48%"],["20%","28%"],["10%","18%"]];function a(){return e.headers?e.headers.slice(1).map(function(i,o){return{name:i,type:"pie",radius:n[o],emphasis:{label:{show:!0,formatter:function(d){return d.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:null,data:e.rows.map(function(d){return{name:d[0],value:d[o+1]}})}}):{name:null,type:"pie",radius:e.donut?["25%","65%"]:["0%","75%"],emphasis:{label:{show:!0,formatter:function(i){return i.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:e.area?"area":null,data:e.rows.map(function(i,o){return{name:i[0],value:i[1]}})}}function r(){var i={tooltip:{trigger:"item",formatter:function(o){return`${o.name}: <b>${o.data.value.toLocaleString("pt-BR")}</b> (${o.percent.toLocaleString("pt-BR")}%)`}},legend:{},label:{show:!0,formatter(o){return o.name+" ("+o.percent.toLocaleString("pt-BR")+"%)"}},series:a()};return t.jsx(oe,{option:i})}return r()}function qt(e){return t.jsx(me,{donut:!0,headers:e.headers,rows:e.rows})}function At(e){return t.jsx(me,{area:!0,headers:e.headers,rows:e.rows})}function $(e){var n=e.invert||!1,a=e.type||"bar",r=e.stack,i={type:"value"},o={show:!0,feature:{mark:{show:!0},saveAsImage:{show:!0}}},d=e.area?{}:null;function c(){return e.headers?{type:"category",data:e.headers.slice(1)}:{type:"category",data:e.rows.map(function(l){return l[0]})}}function s(){return e.headers?e.rows.map(function(l){return{name:l[0],data:l.slice(1),type:a,stack:r,areaStyle:d}}):[{name:null,data:e.rows.map(function(l){return l[1]}),type:a,stack:r,areaStyle:d}]}function u(){var l={toolbox:o,tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(m){return`${m[0].name}: <b>${m[0].value.toLocaleString("pt-BR")}</b>`}},legend:{},label:{show:!0,formatter:function(m){return m.value.toLocaleString("pt-BR")}},xAxis:n?i:c(),yAxis:n?c():i,series:s()};return t.jsx(oe,{option:l})}return u()}function Ot(e){return t.jsx($,{headers:e.headers,rows:e.rows})}function Rt(e){return t.jsx($,{type:"line",headers:e.headers,rows:e.rows})}function _t(e){return t.jsx($,{area:!0,type:"line",headers:e.headers,rows:e.rows})}function Ft(e){return t.jsx($,{stack:"1",headers:e.headers,rows:e.rows})}function zt(e){return t.jsx($,{invert:!0,headers:e.headers,rows:e.rows})}function Wt(e){return t.jsx($,{invert:!0,stack:"1",headers:e.headers,rows:e.rows})}function Ht(e){function n(){return e.headers?[{type:"treemap",roam:"move",nodeClick:!0,data:e.headers.slice(1).map(function(r,i){return{name:r,type:"pie",children:e.rows.map(function(o){return{name:o[0],value:o[i+1]}})}})}]:[{type:"treemap",roam:"move",nodeClick:!1,data:e.rows.map(function(r){return{name:r[0],value:r[1]}})}]}function a(){var r={tooltip:{trigger:"item"},legend:{},label:{show:!0,formatter(i){return i.name+" ("+i.value.toLocaleString("pt-BR")+")"}},series:n()};return t.jsx(oe,{option:r})}return a()}function Pt(e){function n(){var a={series:[{type:"gauge",startAngle:0,endAngle:360,min:0,max:100,progress:{show:!0,width:38},pointer:null,axisTick:null,splitLine:{length:0},axisLine:{lineStyle:{width:38}},axisLabel:null,detail:{backgroundColor:"#fff",fontSize:"2.5rem",width:"60%",lineHeight:40,height:40,borderRadius:8,offsetCenter:[0,"0%"],valueAnimation:!0,formatter:function(r){return r.toFixed(0)+"%"}},data:[{value:e.value}]}]};return t.jsx(oe,{option:a})}return n()}function be(e){function n(){switch(e.type){case"pie":return t.jsx(me,{headers:e.headers,rows:e.rows});case"polar":return t.jsx(At,{headers:e.headers,rows:e.rows});case"donut":return t.jsx(qt,{headers:e.headers,rows:e.rows});case"bar":return t.jsx(Ot,{headers:e.headers,rows:e.rows});case"stacked_bar":return t.jsx(Ft,{headers:e.headers,rows:e.rows});case"column":return t.jsx(zt,{headers:e.headers,rows:e.rows});case"stacked_column":return t.jsx(Wt,{headers:e.headers,rows:e.rows});case"tree_map":return t.jsx(Ht,{headers:e.headers,rows:e.rows});case"line":return t.jsx(Rt,{headers:e.headers,rows:e.rows});case"area":return t.jsx(_t,{headers:e.headers,rows:e.rows});case"progress":return t.jsx(Pt,{headers:e.headers,rows:e.rows});default:return t.jsx($,{headers:e.headers,rows:e.rows})}}function a(){return t.jsxs("div",{style:{width:"100%",margin:"auto"},children:[e.title&&t.jsx("h2",{className:"title",children:e.title}),n()]})}return a()}function Ut(e){A(`
216
+ `),e.data.id==null&&(e.data.id=Math.random());const[n,a]=N.useState(e.data);function r(){return n.attrname?t.jsx("h2",{"data-label":I(n.title),children:n.title}):t.jsxs("h1",{"data-label":I(n.title),children:[n.title," ",n.total>10&&"("+n.total+")"]})}function i(){return t.jsxs("div",{className:"title",children:[r(),t.jsx("i",{id:"loader-"+e.data.id,className:"fa-solid fa-circle-notch fa-spin fa-1x"})]})}function o(h){document.getElementById("loader-"+e.data.id).style.display=h?"block":"none"}function d(){return n.subsets&&t.jsx("div",{className:"tabs",children:n.subsets.map(function(h,g){var j=n.subset===h.name||!n.subset&&g==0;return t.jsxs(F,{href:"#",style:{borderBottom:j?"solid 3px #2670e8":0,color:"#0c326f"},onClick:function(C){C.preventDefault(),c(h.name)},dataLabel:I(h.label),children:[h.label," ",t.jsx(Lt,{total:h.count})]},Math.random())})})}function c(h){const g=document.getElementById("subset-"+e.data.id);g.value=h||"",M()}function s(h,g,j){const C=document.getElementById("form-"+e.data.id);C.querySelector("input[name="+n.calendar.field+"__day]").value=h||"",C.querySelector("input[name="+n.calendar.field+"__month]").value=g||"",C.querySelector("input[name="+n.calendar.field+"__year]").value=j||"",y(1)}function u(){if(n.calendar)return t.jsx(Nt,{data:n.calendar,onChange:s})}function l(h){const g={textAlign:"left",verticalAlign:"top",lineHeight:"1.2rem",color:p.colors.primary,padding:5};if(!(window.innerWidth<800))return t.jsxs("tr",{children:[h.map(function(j){return j.label!="ID"&&t.jsx("th",{style:g,className:"bold",children:j.label},Math.random())}),t.jsx("th",{style:g})]})}function m(h){const g={borderBottom:"solid 1px #DDD",padding:5},j={borderBottom:"solid 1px #DDD",lineHeight:"3rem",textAlign:"right"};return window.innerWidth<800?t.jsxs("tr",{children:[t.jsx("td",{style:g,children:h.title},Math.random()),t.jsx("td",{style:j,children:t.jsx("div",{style:{verticalAlign:"center"},children:t.jsx(E,{icon:"chevron-right",onClick:()=>Oe(h.actions),style:{cursor:"pointer",marginRight:20}})})})]},Math.random()):t.jsxs("tr",{children:[h.data.map(function(C){return C.label!="ID"&&t.jsx("td",{style:g,children:H(C.value)},Math.random())}),t.jsx("td",{style:j,children:t.jsx("div",{style:{verticalAlign:"center"},children:h.actions.map(function(C){return t.jsx(z,{data:C,default:!0},Math.random())})})})]},Math.random())}function f(){return n.data.length>0?(n.render==null&&window.innerWidth<800&&(n.renderer="rows"),n.renderer?n.renderer=="cards"?t.jsx(Y,{width:300,alignItems:"start",children:n.data.map(function(h){return h.type=n.renderer,t.jsx(x,{data:h},Math.random())})}):t.jsx("div",{style:{marginBottom:15},children:n.data.map(function(h){return h.type=n.renderer,t.jsx(x,{data:h},Math.random())})}):w()):t.jsx(ee,{data:{text:"Nenhum registro encontrado."}})}function w(){const h={width:"100%",overflowX:"auto"},g={width:"100%",lineHeight:"2rem",borderSpacing:0};return t.jsx("div",{style:h,children:t.jsxs("table",{style:g,children:[t.jsx("thead",{children:l(n.data[0].data)}),t.jsx("tbody",{children:n.data.map(function(j){return m(j)})})]})})}function y(h){const j=document.getElementById("form-"+e.data.id).querySelector("input[name=page]");j&&(j.value=h),M(),k()}function b(){const h=document.getElementById("form-"+e.data.id);if(h){const g=h.querySelector("input[name=page]");g&&(g.value=n.pagination.page.current)}return t.jsx(Dt,{data:n.pagination,onChange:y,total:n.total})}function D(){return t.jsx("div",{align:"right",style:{marginTop:20,marginBottom:20},children:n.actions.map(function(h){return t.jsx(z,{data:h,primary:!0},Math.random())})})}function k(){const h=document.getElementById(e.data.id).getBoundingClientRect().top+window.scrollY;console.log(h),console.log(e.data.id),window.scrollTo({top:h,behavior:"smooth"})}function L(){const h={backgroundColor:"#f8f8f8",borderBottom:"solid 1px #DDD",marginBottom:10,padding:10},g=n.search.length>0,j=n.filters.length>0;if((n.bi||n.data.length>=0)&&(g||j)){const C={name:"q",mask:null,type:"text",label:"Palavras-chaves",value:n.q};return t.jsxs("div",{style:h,children:[t.jsxs(Y,{width:250,children:[g&&t.jsx("div",{children:t.jsx(ae,{data:C})}),j&&n.filters.map(function(B){return B.type!="hidden"&&t.jsx("div",{children:t.jsx(ae,{data:B})},Math.random())}),t.jsx("div",{children:t.jsx(_,{onClick:M,label:"Filtrar",icon:"filter"})})]}),j&&n.filters.map(function(B){return B.type=="hidden"&&t.jsx("div",{children:t.jsx(ae,{data:B})},Math.random())})]})}}function M(){o(!0);var h;const g=new URLSearchParams(new FormData(document.getElementById("form-"+e.data.id))).toString();e.data.url.indexOf("?")>0?h=e.data.url+"&"+g:h=e.data.url+"?"+g,q("GET",h,function(j){a(j),o(!1)})}function v(){const h={color:p.colors.primary};return e.data.reloadable&&t.jsxs("div",{align:"center",children:[t.jsxs("i",{children:["Ultima atualização em ",new Date().toLocaleTimeString()]}),t.jsx("div",{children:t.jsx(F,{style:h,onClick:g=>{g.preventDefault(),M()},children:"Atualizar agora"})})]})}function T(){return n.bi?t.jsxs(t.Fragment,{children:[L(),n.bi.map(function(h){return t.jsx(Y,{width:300,alignItems:"start",children:h.map(function(g){return t.jsx("div",{children:t.jsx(x,{data:g})},Math.random())})},Math.random())})]}):t.jsxs("div",{className:"content",children:[v(),D(),d(),L(),u(),f(),b()]})}function S(){window[e.data.id]=()=>M();const h={backgroundColor:"white",padding:20};return t.jsx("div",{className:"reloadable queryset",id:e.data.id,sytle:h,children:t.jsxs("form",{id:"form-"+e.data.id,children:[t.jsx("div",{children:!1}),t.jsx("input",{type:"hidden",name:"subset",id:"subset-"+e.data.id}),i(),T()]})})}return S()}function oe(e){var n=Math.random();function a(){var r=document.getElementById(n);if(r){var i=echarts.init(r);i.setOption(e.option)}else setTimeout(a,1e3)}return setTimeout(a,1e3),t.jsx("div",{id:n,style:{width:"100%",height:300}})}function me(e){var n=[["70%","78%"],["60%","68%"],["50%","58%"],["40%","48%"],["30%","48%"],["20%","28%"],["10%","18%"]];function a(){return e.headers?e.headers.slice(1).map(function(i,o){return{name:i,type:"pie",radius:n[o],emphasis:{label:{show:!0,formatter:function(d){return d.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:null,data:e.rows.map(function(d){return{name:d[0],value:d[o+1]}})}}):{name:null,type:"pie",radius:e.donut?["25%","65%"]:["0%","75%"],emphasis:{label:{show:!0,formatter:function(i){return i.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:e.area?"area":null,data:e.rows.map(function(i,o){return{name:i[0],value:i[1]}})}}function r(){var i={tooltip:{trigger:"item",formatter:function(o){return`${o.name}: <b>${o.data.value.toLocaleString("pt-BR")}</b> (${o.percent.toLocaleString("pt-BR")}%)`}},legend:{},label:{show:!0,formatter(o){return o.name+" ("+o.percent.toLocaleString("pt-BR")+"%)"}},series:a()};return t.jsx(oe,{option:i})}return r()}function qt(e){return t.jsx(me,{donut:!0,headers:e.headers,rows:e.rows})}function At(e){return t.jsx(me,{area:!0,headers:e.headers,rows:e.rows})}function V(e){var n=e.invert||!1,a=e.type||"bar",r=e.stack,i={type:"value"},o={show:!0,feature:{mark:{show:!0},saveAsImage:{show:!0}}},d=e.area?{}:null;function c(){return e.headers?{type:"category",data:e.headers.slice(1)}:{type:"category",data:e.rows.map(function(l){return l[0]})}}function s(){return e.headers?e.rows.map(function(l){return{name:l[0],data:l.slice(1),type:a,stack:r,areaStyle:d}}):[{name:null,data:e.rows.map(function(l){return l[1]}),type:a,stack:r,areaStyle:d}]}function u(){var l={toolbox:o,tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(m){return`${m[0].name}: <b>${m[0].value.toLocaleString("pt-BR")}</b>`}},legend:{},label:{show:!0,formatter:function(m){return m.value.toLocaleString("pt-BR")}},xAxis:n?i:c(),yAxis:n?c():i,series:s()};return t.jsx(oe,{option:l})}return u()}function Ot(e){return t.jsx(V,{headers:e.headers,rows:e.rows})}function Rt(e){return t.jsx(V,{type:"line",headers:e.headers,rows:e.rows})}function _t(e){return t.jsx(V,{area:!0,type:"line",headers:e.headers,rows:e.rows})}function Ft(e){return t.jsx(V,{stack:"1",headers:e.headers,rows:e.rows})}function zt(e){return t.jsx(V,{invert:!0,headers:e.headers,rows:e.rows})}function Wt(e){return t.jsx(V,{invert:!0,stack:"1",headers:e.headers,rows:e.rows})}function Ht(e){function n(){return e.headers?[{type:"treemap",roam:"move",nodeClick:!0,data:e.headers.slice(1).map(function(r,i){return{name:r,type:"pie",children:e.rows.map(function(o){return{name:o[0],value:o[i+1]}})}})}]:[{type:"treemap",roam:"move",nodeClick:!1,data:e.rows.map(function(r){return{name:r[0],value:r[1]}})}]}function a(){var r={tooltip:{trigger:"item"},legend:{},label:{show:!0,formatter(i){return i.name+" ("+i.value.toLocaleString("pt-BR")+")"}},series:n()};return t.jsx(oe,{option:r})}return a()}function Pt(e){function n(){var a={series:[{type:"gauge",startAngle:0,endAngle:360,min:0,max:100,progress:{show:!0,width:38},pointer:null,axisTick:null,splitLine:{length:0},axisLine:{lineStyle:{width:38}},axisLabel:null,detail:{backgroundColor:"#fff",fontSize:"2.5rem",width:"60%",lineHeight:40,height:40,borderRadius:8,offsetCenter:[0,"0%"],valueAnimation:!0,formatter:function(r){return r.toFixed(0)+"%"}},data:[{value:e.value}]}]};return t.jsx(oe,{option:a})}return n()}function be(e){function n(){switch(e.type){case"pie":return t.jsx(me,{headers:e.headers,rows:e.rows});case"polar":return t.jsx(At,{headers:e.headers,rows:e.rows});case"donut":return t.jsx(qt,{headers:e.headers,rows:e.rows});case"bar":return t.jsx(Ot,{headers:e.headers,rows:e.rows});case"stacked_bar":return t.jsx(Ft,{headers:e.headers,rows:e.rows});case"column":return t.jsx(zt,{headers:e.headers,rows:e.rows});case"stacked_column":return t.jsx(Wt,{headers:e.headers,rows:e.rows});case"tree_map":return t.jsx(Ht,{headers:e.headers,rows:e.rows});case"line":return t.jsx(Rt,{headers:e.headers,rows:e.rows});case"area":return t.jsx(_t,{headers:e.headers,rows:e.rows});case"progress":return t.jsx(Pt,{headers:e.headers,rows:e.rows});default:return t.jsx(V,{headers:e.headers,rows:e.rows})}}function a(){return t.jsxs("div",{style:{width:"100%",margin:"auto"},children:[e.title&&t.jsx("h2",{className:"title",children:e.title}),n()]})}return a()}function Ut(e){A(`
217
217
  .statistics .odd {
218
218
  background-color: #EEE;
219
219
  }
220
- `);function n(){for(var r=[],i=0;i<e.data.series.length;i++)r.push([e.data.series[i][0],e.data.series[i][1]]);return e.data.chart?t.jsx(be,{type:e.data.chart,title:e.data.title,rows:r}):t.jsxs("div",{className:"statistics",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),t.jsx("table",{style:{width:"100%",borderSpacing:0},children:t.jsx("tbody",{children:r.map((o,d)=>t.jsx("tr",{children:o.map((c,s)=>s==0?t.jsx("th",{style:{textAlign:"left",lineHeight:"2rem",padding:5},className:d%2==0?"even":"odd",children:c},Math.random()):t.jsx("td",{className:d%2==0?"even":"odd",children:H(c)},Math.random()))},Math.random()))})})]})}function a(){for(var r=[],i=[],o=Object.keys(e.data.series),d=[],c=0;c<o.length;c++){c==0&&r.push("");for(var s=[o[c]],u=0,l=0;l<e.data.series[o[c]].length;l++){var m=e.data.series[o[c]];c==0&&r.push(m[l][0]),s.push(m[l][1]),u+=m[l][1],o.length>1&&(c==0?d.push(m[l][1]):d[l]+=m[l][1],l>0&&l==e.data.series[o[c]].length-1&&(c==0?d.push(u):d[l+1]+=u))}s.length>2&&(c==0&&r.push(""),s.push(u)),i.push(s)}return e.data.chart?t.jsx(be,{type:e.data.chart,title:e.data.title,headers:r,rows:i}):t.jsxs("div",{className:"statistics",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),t.jsxs("table",{style:{width:"100%",borderSpacing:0},children:[r&&t.jsx("thead",{children:t.jsx("tr",{children:r.map(f=>t.jsx("th",{className:"bold",style:{textAlign:"left",padding:5},children:f},Math.random()))})}),t.jsxs("tbody",{children:[i.map((f,w)=>t.jsx("tr",{children:f.map((y,b)=>b==0?t.jsx("th",{className:w%2==0?"even":"odd",style:{textAlign:"left",padding:5},children:y},Math.random()):t.jsx("td",{align:"center",className:(b==f.length-1&&r&&r[r.length-1]==""?"bold":"")+" "+(w%2==0?"even":"odd"),children:H(y)},Math.random()))},Math.random())),d.length>0&&t.jsxs("tr",{children:[t.jsx("th",{}),d.map(f=>t.jsxs("td",{align:"center",className:"bold",children:[H(f)," "]},Math.random()))]},Math.random())]})]})]})}return Array.isArray(e.data.series)?n():a()}function Gt(){function e(){const o={width:150,height:150,borderRadius:"50%",objectFit:"cover",backgroundColor:p.colors.success};return window.application.menu.user&&t.jsxs("div",{align:"center",children:[window.application.menu.image&&t.jsx("div",{children:t.jsx("img",{src:window.application.menu.image,style:o})}),t.jsx("div",{children:t.jsx(F,{dataLabel:"Editar Perfil",href:"/api/editprofile/",style:{textDecoration:"none"},children:window.application.menu.user})})]})}function n(o){var d=o.target;const c=d.querySelector(":scope > ul, :scope > li");if(c){c.offsetParent===null?d.querySelectorAll(":scope > ul, :scope > li, :scope > ul > li").forEach(function(l){l.style.display="block"}):d.querySelectorAll(":scope > ul, :scope > li").forEach(function(l){l.style.display="none"});const s=d.querySelector(":scope > i.fa-solid.fa-chevron-right"),u=d.querySelector(":scope > i.fa-solid.fa-chevron-up");return s&&(s.classList.remove("fa-chevron-right"),s.classList.add("fa-chevron-up")),u&&(u.classList.remove("fa-chevron-up"),u.classList.add("fa-chevron-right")),o.preventDefault(),o.stopPropagation(),o.cancelBubble=!0,!1}else{const s=document.querySelector("aside");s.style.display=window.innerWidth<800?"none":"inline-block"}}function a(o,d){const c={display:d==0?"block":"none",cursor:"pointer",paddingLeft:15,paddingRight:20,paddingTop:10,paddingBottom:10,lineHeight:"2rem",color:p.colors.primary},s={padding:5,fontSize:"1.2rem"};return o.url?t.jsx("li",{style:c,onClick:n,className:"item",children:t.jsxs(F,{href:o.url,dataLabel:I(o.label),style:{textDecoration:"none",display:"block",width:"100%"},children:[d==0&&t.jsx(E,{icon:o.icon||"dot-circle",style:s}),o.label]})},Math.random()):o.items.length>0&&t.jsxs("li",{onClick:n,style:c,"data-label":I(o.label),children:[d==0&&t.jsx(E,{icon:o.icon||"dot-circle",style:s}),o.label,t.jsx(E,{icon:"chevron-right",style:{float:"right",paddingTop:8}}),t.jsx("ul",{style:{display:"none",paddingLeft:15},children:o.items.map(function(u){return a(u,d+1)})})]},Math.random())}function r(){const o={padding:0};return window.application.menu.items.length>0&&t.jsx("ul",{style:o,children:window.application.menu.items.map(function(d){return a(d,0)})})}function i(){const o={marginTop:10,height:"100%",borderRight:"solid 1px #EEE"};return t.jsxs("div",{style:o,className:"menu",children:[e(),r()]})}return i()}function Yt(e){var n;function a(o){const d="=".repeat((4-o.length%4)%4),c=(o+d).replace(/\-/g,"+").replace(/_/g,"/"),s=window.atob(c),u=new Uint8Array(s.length);for(let l=0;l<s.length;++l)u[l]=s.charCodeAt(l);return u}function r(){"serviceWorker"in navigator&&"PushManager"in window?navigator.serviceWorker.getRegistration().then(function(o){if(o){const d=a("BLoLJSopQbe04v_zpegJmayhH2Px0EGzrFIlM0OedSOTYsMpO5YGmHOxbpPXdM09ttIuDaDTI86uC85JXZPpEtA");o.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:d}).then(function(c){if(console.log(c),n=JSON.stringify(c),console.log(n),c){alert("Notificação ativada com sucesso.");var s=new FormData;s.append("subscription",n),q("POST","/api/pushsubscribe/",function(u){console.log(u)},s)}else{alert("Problema ao ativar notificações.");return}}).catch(function(c){alert("Problema ao tentar ativar notificações."),console.log("Failed to subscribe the user: ",c)})}else console.log("No registered service worker.")}).catch(function(o){alert("Erro"),console.error("Service Worker Error",o)}):alert("Push messaging is not supported")}function i(){return t.jsx(E,{onClick:r,icon:"bell",style:{cursor:"pointer",color:p.colors.primary}})}return i()}function Xt(e,n){var a={startX:0,startY:0,endX:0,endY:0,minX:30,maxX:30,minY:50,maxY:60},r=null;e.addEventListener("touchstart",function(i){var o=i.touches[0];a.startX=o.screenX,a.startY=o.screenY}),e.addEventListener("touchmove",function(i){var o=i.touches[0];a.endX=o.screenX,a.endY=o.screenY}),e.addEventListener("touchend",function(i){Math.abs(a.endX-a.startX)>a.minX&&Math.abs(a.endY-a.startY)<a.maxY?r=a.endX>a.startX?"right":"left":Math.abs(a.endY-a.startY)>a.minY&&Math.abs(a.endX-a.startX)<a.maxX&&(r=a.endY>a.startY?"down":"up"),r!==null&&typeof n=="function"&&n(e,r)})}function $t(e){function n(){if(window.innerWidth>800)return;const a={position:"fixed",display:"flex",width:50,height:50,backgroundColor:p.colors.primary,color:"white",right:10,borderRadius:"50%",cursor:"pointer"},r={paddingLeft:14,paddingTop:12,fontSize:"1.8rem"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...a,bottom:100},onClick:()=>history.back(),children:t.jsx(E,{icon:"arrow-left",style:r})}),t.jsx("div",{style:{...a,bottom:20},onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:t.jsx(E,{icon:"arrow-up",style:r})})]})}return n()}function Vt(e){const[n,a]=N.useState(e.data);window.loaddata=i=>a(i);function r(){const i={minHeight:400,margin:window.innerWidth>800?20:5};return t.jsx("div",{style:i,id:"container",children:t.jsx(x,{data:n},Math.random())})}return r()}function Jt(e){N.useEffect(()=>{const l=localStorage.getItem("message");l&&(localStorage.removeItem("message"),W(l)),window.addEventListener("resize",()=>{const m=document.querySelector("aside");m&&(m.style.display=window.innerWidth<800?"none":"inline-block")}),Xt(document.querySelector("main"),function(m,f){console.log(m,f)})},[]);function a(){const l=document.querySelector("aside"),m=document.querySelector("main");l.style.display=l.style.display=="none"?"inline-block":"none",m.style.width=l.style.display=="none"?"100%":"calc(100% - 350px)"}function r(l){const m=l.target.tagName=="A"?l.target:l.target.closest("a");l.preventDefault(),window.load(m.href)}function i(){const l={display:"flex",width:"100%",justifyContent:"space-between",boxShadow:"0px 15px 10px -15px #DDD",overflowX:"hidden"},m={choices:"/api/search/",help_text:null,label:null,mask:null,name:"search",required:!1,type:"choice",icon:"search"};return e.data.navbar?t.jsxs("div",{style:l,children:[t.jsxs("div",{style:{padding:20},children:[e.data.menu&&t.jsx(E,{icon:"navicon",style:{fontSize:"1.5rem",marginRight:10,cursor:"pointer"},onClick:a}),t.jsxs("a",{className:"brand",href:"/app/home/",onClick:r,style:{fontSize:"1.5rem",textDecoration:"none"},children:[e.data.navbar.logo&&t.jsx("img",{src:e.data.navbar.logo,height:20,style:{marginRight:10}}),t.jsx("span",{children:e.data.navbar.title})]}),t.jsx("div",{children:e.data.navbar.subtitle})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.data.navbar.adder.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.adder,position:{},dataLabel:"plus",children:t.jsx(E,{icon:"plus",style:{cursor:"pointer",color:p.colors.primary}})})}),t.jsx("div",{style:{padding:10},children:t.jsx(Yt,{})}),e.data.navbar.toolbar&&window.innerWidth>800&&e.data.navbar.toolbar.length>0&&t.jsx("div",{className:"toolbar",children:e.data.navbar.toolbar.map(function(f){return t.jsx(z,{data:f,primary:!0,compact:!0},Math.random())})}),e.data.navbar.actions&&e.data.navbar.actions.length>0&&e.data.navbar.actions.map(function(f){return f.url=="/api/login/"&&(e.data.navbar.user||document.location.pathname=="/app/login/")?null:t.jsx("div",{children:t.jsx(z,{data:f,primary:!0},Math.random())},Math.random())}),e.data.oauth&&e.data.oauth.length>0&&e.data.navbar.user==null&&e.data.oauth.map(function(f){return t.jsx(F,{href:f.url,style:{marginRight:10},children:f.label},Math.random())}),e.data.navbar.tools.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.tools,position:{},dataLabel:"tools",children:t.jsx(E,{icon:"tools",style:{cursor:"pointer",color:p.colors.primary}})})}),e.data.navbar.settings.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.settings,position:{},dataLabel:"gear",children:t.jsx(E,{icon:"gear",style:{cursor:"pointer",color:p.colors.primary}})})}),window.innerWidth>800&&e.data.navbar.user&&e.data.navbar.search&&t.jsx("div",{children:t.jsx(Me,{data:m,style:{padding:10},onSelect:f=>document.location.href=X(f.id)})}),e.data.navbar.user&&e.data.navbar.usermenu.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.usermenu,position:{},dataLabel:I(e.data.navbar.user),children:t.jsx("img",{src:"/static/images/user.svg",style:{width:30,height:30,borderRadius:"50%",objectFit:"cover",backgroundColor:p.colors.primary}})})})]})]}):null}function o(){return window.application.menu&&window.application.menu.items.length>0&&t.jsx("aside",{style:{verticalAlign:"top",maxWidth:"350px",minWidth:"350px",display:window.innerWidth<800?"none":"inline-block"},children:t.jsx(Gt,{})})}function d(){const l={margin:15,display:"flex",justifyContent:"space-between"},m={color:p.colors.primary};return e.data.navbar&&e.data.navbar.user&&t.jsxs("div",{style:l,children:[t.jsxs("div",{children:[t.jsx(F,{href:"/app/dashboard/",style:{marginRight:10},children:t.jsx(E,{icon:"home",style:m})}),"Área Administrativa"]}),t.jsx("div",{title:e.data.navbar.roles,children:e.data.navbar.user})]})}function c(){const l=e.data.menu&&e.data.menu.items.length>0?350:0;return t.jsxs("main",{id:"main",style:{display:"inline-block",width:"calc(100% - "+l+"px)"},children:[d(),t.jsx(Vt,{data:e.data.content}),t.jsx("footer",{children:s()}),t.jsx($t,{})]})}function s(){return e.data.footer?t.jsxs("div",{align:"center",children:[t.jsx("div",{children:window.application.sponsors&&window.application.sponsors.length>0&&t.jsx("div",{children:window.application.sponsors.map(function(l){return t.jsx("img",{src:l,style:{height:30,padding:5}},Math.random())})})}),t.jsx("div",{children:"Todos os direitos reservados"}),t.jsx("div",{children:e.data.footer.version})]}):null}function u(){return t.jsxs("div",{children:[t.jsx("header",{children:i()}),t.jsxs("div",{style:{width:"100%",display:"block",minHeight:window.innerHeight-70},children:[o(),c()]})]})}return u()}function Qt(e){var n=null,a=null,r=null,i=!1,o=null,d=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,c={constraints:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0},offerToReceiveAudio:1,offerToReceiveVideo:1},sdpTransform:y=>y.replace("a=fmtp:111 minptime=10;useinbandfec=1","a=fmtp:111 ptime=5;useinbandfec=1;stereo=1;maxplaybackrate=48000;maxaveragebitrat=128000;sprop-stereo=1")};function s(){console.log("Trying to connect..."),n=new Peer("999123"+e.data.caller.replaceAll(".","").replaceAll("-","")),n.on("open",function(y){document.getElementById("callerid").innerHTML=e.data.caller,f(),o=setInterval(function(){i?W("Em conexão com "+e.data.receiver+"."):(W("Tentando estabeler conexão com "+e.data.receiver+"..."),f())},15e3)}),n.on("call",function(y){var b=document.getElementById("video2");b.addEventListener("loadedmetadata",function(D){b.style.width=this.videoWidth/4+"px",b.style.height=this.videoHeight/4+"px",b.style.marginLeft=-this.videoWidth/4+"px",b.style.visibility="visible"},!1),b.srcObject=a,y.answer(a),y.on("stream",function(D){r=D,document.getElementById("video1").srcObject=r,i=!0}),y.on("close",function(){console.log("Closed!"),i=!1})}),n.on("error",function(y){y.type=="browser-incompatible"?alert("Navegador incompatível."):y.type=="invalid-id"?alert("Usuário inexistente."):y.type=="network"?(i=!1,console.log("Problema na conexão do usuário. Tentando novamente em 5 segundos."),setTimeout(s,5e3)):y.type=="peer-unavailable"&&(console.log("Usuário indisponível!"),i=!1)})}N.useEffect(()=>(s(),function(){clearInterval(o),u(),W("Desconectado!")}),[]);function u(){l(a,"audio"),l(a,"video"),l(r,"audio"),l(r,"video"),a=null,r=null;const y=document.getElementById("video1"),b=document.getElementById("video2");y&&(y.srcObject=null),b&&(b.srcObject=null),console.log("Stopped!"),i=!1}function l(y,b){y!=null&&y.getTracks().forEach(D=>{D.kind===b&&D.stop()})}function m(){var y=n.call("999123"+e.data.receiver.replaceAll(".","").replaceAll("-",""),a,c);y&&(y.on("stream",function(b){r=b,document.getElementById("video1").srcObject=r,i=!0}),y.on("close",function(){console.log("Closed!"),i=!1}))}function f(){if(a!=null&&!i)return m();a==null&&d({video:!0,audio:{autoGainControl:!1,echoCancellation:!1,googGainControl:!1,noiseSuppression:!1}},function(y){a=y;var b=document.getElementById("video2");b.addEventListener("loadedmetadata",function(D){b.style.width=this.videoWidth/4+"px",b.style.height=this.videoHeight/4+"px",b.style.marginLeft=-this.videoWidth/4+"px",b.style.visibility="visible"},!1),b.srcObject=a,m()},function(y){alert("Failed to get local stream.")})}function w(){return t.jsx("iframe",{width:"100%",height:700,style:{border:0},src:"https://us05web.zoom.us/j/82130251231?pwd=o46UhcNlDRq13oO1maHiaRLVOaxxnZ.1",allow:"camera; microphone; display-capture"})}return w()}function Kt(e){A(`
220
+ `);function n(){for(var r=[],i=0;i<e.data.series.length;i++)r.push([e.data.series[i][0],e.data.series[i][1]]);return e.data.chart?t.jsx(be,{type:e.data.chart,title:e.data.title,rows:r}):t.jsxs("div",{className:"statistics",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),t.jsx("table",{style:{width:"100%",borderSpacing:0},children:t.jsx("tbody",{children:r.map((o,d)=>t.jsx("tr",{children:o.map((c,s)=>s==0?t.jsx("th",{style:{textAlign:"left",lineHeight:"2rem",padding:5},className:d%2==0?"even":"odd",children:c},Math.random()):t.jsx("td",{className:d%2==0?"even":"odd",children:H(c)},Math.random()))},Math.random()))})})]})}function a(){for(var r=[],i=[],o=Object.keys(e.data.series),d=[],c=0;c<o.length;c++){c==0&&r.push("");for(var s=[o[c]],u=0,l=0;l<e.data.series[o[c]].length;l++){var m=e.data.series[o[c]];c==0&&r.push(m[l][0]),s.push(m[l][1]),u+=m[l][1],o.length>1&&(c==0?d.push(m[l][1]):d[l]+=m[l][1],l>0&&l==e.data.series[o[c]].length-1&&(c==0?d.push(u):d[l+1]+=u))}s.length>2&&(c==0&&r.push(""),s.push(u)),i.push(s)}return e.data.chart?t.jsx(be,{type:e.data.chart,title:e.data.title,headers:r,rows:i}):t.jsxs("div",{className:"statistics",children:[e.data.title&&t.jsx("h2",{"data-label":I(e.data.title),children:e.data.title}),t.jsxs("table",{style:{width:"100%",borderSpacing:0},children:[r&&t.jsx("thead",{children:t.jsx("tr",{children:r.map(f=>t.jsx("th",{className:"bold",style:{textAlign:"left",padding:5},children:f},Math.random()))})}),t.jsxs("tbody",{children:[i.map((f,w)=>t.jsx("tr",{children:f.map((y,b)=>b==0?t.jsx("th",{className:w%2==0?"even":"odd",style:{textAlign:"left",padding:5},children:y},Math.random()):t.jsx("td",{align:"center",className:(b==f.length-1&&r&&r[r.length-1]==""?"bold":"")+" "+(w%2==0?"even":"odd"),children:H(y)},Math.random()))},Math.random())),d.length>0&&t.jsxs("tr",{children:[t.jsx("th",{}),d.map(f=>t.jsxs("td",{align:"center",className:"bold",children:[H(f)," "]},Math.random()))]},Math.random())]})]})]})}return Array.isArray(e.data.series)?n():a()}function Gt(){function e(){const o={width:150,height:150,borderRadius:"50%",objectFit:"cover",backgroundColor:p.colors.success};return window.application.menu.user&&t.jsxs("div",{align:"center",children:[window.application.menu.image&&t.jsx("div",{children:t.jsx("img",{src:window.application.menu.image,style:o})}),t.jsx("div",{children:t.jsx(F,{dataLabel:"Editar Perfil",href:"/api/editprofile/",style:{textDecoration:"none"},children:window.application.menu.user})})]})}function n(o){var d=o.target;const c=d.querySelector(":scope > ul, :scope > li");if(c){c.offsetParent===null?d.querySelectorAll(":scope > ul, :scope > li, :scope > ul > li").forEach(function(l){l.style.display="block"}):d.querySelectorAll(":scope > ul, :scope > li").forEach(function(l){l.style.display="none"});const s=d.querySelector(":scope > i.fa-solid.fa-chevron-right"),u=d.querySelector(":scope > i.fa-solid.fa-chevron-up");return s&&(s.classList.remove("fa-chevron-right"),s.classList.add("fa-chevron-up")),u&&(u.classList.remove("fa-chevron-up"),u.classList.add("fa-chevron-right")),o.preventDefault(),o.stopPropagation(),o.cancelBubble=!0,!1}else{const s=document.querySelector("aside");s.style.display=window.innerWidth<800?"none":"inline-block"}}function a(o,d){const c={display:d==0?"block":"none",cursor:"pointer",paddingLeft:15,paddingRight:20,paddingTop:10,paddingBottom:10,lineHeight:"2rem",color:p.colors.primary},s={padding:5,fontSize:"1.2rem"};return o.url?t.jsx("li",{style:c,onClick:n,className:"item",children:t.jsxs(F,{href:o.url,dataLabel:I(o.label),style:{textDecoration:"none",display:"block",width:"100%"},children:[d==0&&t.jsx(E,{icon:o.icon||"dot-circle",style:s}),o.label]})},Math.random()):o.items.length>0&&t.jsxs("li",{onClick:n,style:c,"data-label":I(o.label),children:[d==0&&t.jsx(E,{icon:o.icon||"dot-circle",style:s}),o.label,t.jsx(E,{icon:"chevron-right",style:{float:"right",paddingTop:8}}),t.jsx("ul",{style:{display:"none",paddingLeft:15},children:o.items.map(function(u){return a(u,d+1)})})]},Math.random())}function r(){const o={padding:0};return window.application.menu.items.length>0&&t.jsx("ul",{style:o,children:window.application.menu.items.map(function(d){return a(d,0)})})}function i(){const o={marginTop:10,height:"100%",borderRight:"solid 1px #EEE"};return t.jsxs("div",{style:o,className:"menu",children:[e(),r()]})}return i()}function Yt(e){var n;function a(o){const d="=".repeat((4-o.length%4)%4),c=(o+d).replace(/\-/g,"+").replace(/_/g,"/"),s=window.atob(c),u=new Uint8Array(s.length);for(let l=0;l<s.length;++l)u[l]=s.charCodeAt(l);return u}function r(){"serviceWorker"in navigator&&"PushManager"in window?navigator.serviceWorker.getRegistration().then(function(o){if(o){const d=a("BLoLJSopQbe04v_zpegJmayhH2Px0EGzrFIlM0OedSOTYsMpO5YGmHOxbpPXdM09ttIuDaDTI86uC85JXZPpEtA");o.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:d}).then(function(c){if(console.log(c),n=JSON.stringify(c),console.log(n),c){alert("Notificação ativada com sucesso.");var s=new FormData;s.append("subscription",n),q("POST","/api/pushsubscribe/",function(u){console.log(u)},s)}else{alert("Problema ao ativar notificações.");return}}).catch(function(c){alert("Problema ao tentar ativar notificações."),console.log("Failed to subscribe the user: ",c)})}else console.log("No registered service worker.")}).catch(function(o){alert("Erro"),console.error("Service Worker Error",o)}):alert("Push messaging is not supported")}function i(){return t.jsx(E,{onClick:r,icon:"bell",style:{cursor:"pointer",color:p.colors.primary}})}return i()}function Xt(e,n){var a={startX:0,startY:0,endX:0,endY:0,minX:30,maxX:30,minY:50,maxY:60},r=null;e.addEventListener("touchstart",function(i){var o=i.touches[0];a.startX=o.screenX,a.startY=o.screenY}),e.addEventListener("touchmove",function(i){var o=i.touches[0];a.endX=o.screenX,a.endY=o.screenY}),e.addEventListener("touchend",function(i){Math.abs(a.endX-a.startX)>a.minX&&Math.abs(a.endY-a.startY)<a.maxY?r=a.endX>a.startX?"right":"left":Math.abs(a.endY-a.startY)>a.minY&&Math.abs(a.endX-a.startX)<a.maxX&&(r=a.endY>a.startY?"down":"up"),r!==null&&typeof n=="function"&&n(e,r)})}function Vt(e){function n(){if(window.innerWidth>800)return;const a={position:"fixed",display:"flex",width:50,height:50,backgroundColor:p.colors.primary,color:"white",right:10,borderRadius:"50%",cursor:"pointer"},r={paddingLeft:14,paddingTop:12,fontSize:"1.8rem"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...a,bottom:100},onClick:()=>history.back(),children:t.jsx(E,{icon:"arrow-left",style:r})}),t.jsx("div",{style:{...a,bottom:20},onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:t.jsx(E,{icon:"arrow-up",style:r})})]})}return n()}function $t(e){const[n,a]=N.useState(e.data);window.loaddata=i=>a(i);function r(){const i={minHeight:400,margin:window.innerWidth>800?20:5};return t.jsx("div",{style:i,id:"container",children:t.jsx(x,{data:n},Math.random())})}return r()}function Jt(e){N.useEffect(()=>{const l=localStorage.getItem("message");l&&(localStorage.removeItem("message"),W(l)),window.addEventListener("resize",()=>{const m=document.querySelector("aside");m&&(m.style.display=window.innerWidth<800?"none":"inline-block")}),Xt(document.querySelector("main"),function(m,f){console.log(m,f)})},[]);function a(){const l=document.querySelector("aside"),m=document.querySelector("main");l.style.display=l.style.display=="none"?"inline-block":"none",m.style.width=l.style.display=="none"?"100%":"calc(100% - 350px)"}function r(l){const m=l.target.tagName=="A"?l.target:l.target.closest("a");l.preventDefault(),window.load(m.href)}function i(){const l={display:"flex",width:"100%",justifyContent:"space-between",boxShadow:"0px 15px 10px -15px #DDD",overflowX:"hidden"},m={choices:"/api/search/",help_text:null,label:null,mask:null,name:"search",required:!1,type:"choice",icon:"search"};return e.data.navbar?t.jsxs("div",{style:l,children:[t.jsxs("div",{style:{padding:20},children:[e.data.menu&&t.jsx(E,{icon:"navicon",style:{fontSize:"1.5rem",marginRight:10,cursor:"pointer"},onClick:a}),t.jsxs("a",{className:"brand",href:"/app/home/",onClick:r,style:{fontSize:"1.5rem",textDecoration:"none"},children:[e.data.navbar.logo&&t.jsx("img",{src:e.data.navbar.logo,height:20,style:{marginRight:10}}),t.jsx("span",{children:e.data.navbar.title})]}),t.jsx("div",{children:e.data.navbar.subtitle})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.data.navbar.adder.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.adder,position:{},dataLabel:"plus",children:t.jsx(E,{icon:"plus",style:{cursor:"pointer",color:p.colors.primary}})})}),t.jsx("div",{style:{padding:10},children:t.jsx(Yt,{})}),e.data.navbar.toolbar&&window.innerWidth>800&&e.data.navbar.toolbar.length>0&&t.jsx("div",{className:"toolbar",children:e.data.navbar.toolbar.map(function(f){return t.jsx(z,{data:f,primary:!0,compact:!0},Math.random())})}),e.data.navbar.actions&&e.data.navbar.actions.length>0&&e.data.navbar.actions.map(function(f){return f.url=="/api/login/"&&(e.data.navbar.user||document.location.pathname=="/app/login/")?null:t.jsx("div",{children:t.jsx(z,{data:f,primary:!0},Math.random())},Math.random())}),e.data.oauth&&e.data.oauth.length>0&&e.data.navbar.user==null&&e.data.oauth.map(function(f){return t.jsx(F,{href:f.url,style:{marginRight:10},children:f.label},Math.random())}),e.data.navbar.tools.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.tools,position:{},dataLabel:"tools",children:t.jsx(E,{icon:"tools",style:{cursor:"pointer",color:p.colors.primary}})})}),e.data.navbar.settings.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.settings,position:{},dataLabel:"gear",children:t.jsx(E,{icon:"gear",style:{cursor:"pointer",color:p.colors.primary}})})}),window.innerWidth>800&&e.data.navbar.user&&e.data.navbar.search&&t.jsx("div",{children:t.jsx(Me,{data:m,style:{padding:10},onSelect:f=>document.location.href=X(f.id)})}),e.data.navbar.user&&e.data.navbar.usermenu.length>0&&t.jsx("div",{style:{padding:10},children:t.jsx(ne,{actions:e.data.navbar.usermenu,position:{},dataLabel:I(e.data.navbar.user),children:t.jsx("img",{src:"/static/images/user.svg",style:{width:30,height:30,borderRadius:"50%",objectFit:"cover",backgroundColor:p.colors.primary}})})})]})]}):null}function o(){return window.application.menu&&window.application.menu.items.length>0&&t.jsx("aside",{style:{verticalAlign:"top",maxWidth:"350px",minWidth:"350px",display:window.innerWidth<800?"none":"inline-block"},children:t.jsx(Gt,{})})}function d(){const l={margin:15,display:"flex",justifyContent:"space-between"},m={color:p.colors.primary};return e.data.navbar&&e.data.navbar.user&&t.jsxs("div",{style:l,children:[t.jsxs("div",{children:[t.jsx(F,{href:"/app/dashboard/",style:{marginRight:10},children:t.jsx(E,{icon:"home",style:m})}),"Área Administrativa"]}),t.jsx("div",{title:e.data.navbar.roles,children:e.data.navbar.user})]})}function c(){const l=e.data.menu&&e.data.menu.items.length>0?350:0;return t.jsxs("main",{id:"main",style:{display:"inline-block",width:"calc(100% - "+l+"px)"},children:[d(),t.jsx($t,{data:e.data.content}),t.jsx("footer",{children:s()}),t.jsx(Vt,{})]})}function s(){return e.data.footer?t.jsxs("div",{align:"center",children:[t.jsx("div",{children:window.application.sponsors&&window.application.sponsors.length>0&&t.jsx("div",{children:window.application.sponsors.map(function(l){return t.jsx("img",{src:l,style:{height:30,padding:5}},Math.random())})})}),t.jsx("div",{children:"Todos os direitos reservados"}),t.jsx("div",{children:e.data.footer.version})]}):null}function u(){return t.jsxs("div",{children:[t.jsx("header",{children:i()}),t.jsxs("div",{style:{width:"100%",display:"block",minHeight:window.innerHeight-70},children:[o(),c()]})]})}return u()}function Qt(e){var n=null,a=null,r=null,i=!1,o=null,d=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,c={constraints:{mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0},offerToReceiveAudio:1,offerToReceiveVideo:1},sdpTransform:y=>y.replace("a=fmtp:111 minptime=10;useinbandfec=1","a=fmtp:111 ptime=5;useinbandfec=1;stereo=1;maxplaybackrate=48000;maxaveragebitrat=128000;sprop-stereo=1")};function s(){console.log("Trying to connect..."),n=new Peer("999123"+e.data.caller.replaceAll(".","").replaceAll("-","")),n.on("open",function(y){document.getElementById("callerid").innerHTML=e.data.caller,f(),o=setInterval(function(){i?W("Em conexão com "+e.data.receiver+"."):(W("Tentando estabeler conexão com "+e.data.receiver+"..."),f())},15e3)}),n.on("call",function(y){var b=document.getElementById("video2");b.addEventListener("loadedmetadata",function(D){b.style.width=this.videoWidth/4+"px",b.style.height=this.videoHeight/4+"px",b.style.marginLeft=-this.videoWidth/4+"px",b.style.visibility="visible"},!1),b.srcObject=a,y.answer(a),y.on("stream",function(D){r=D,document.getElementById("video1").srcObject=r,i=!0}),y.on("close",function(){console.log("Closed!"),i=!1})}),n.on("error",function(y){y.type=="browser-incompatible"?alert("Navegador incompatível."):y.type=="invalid-id"?alert("Usuário inexistente."):y.type=="network"?(i=!1,console.log("Problema na conexão do usuário. Tentando novamente em 5 segundos."),setTimeout(s,5e3)):y.type=="peer-unavailable"&&(console.log("Usuário indisponível!"),i=!1)})}N.useEffect(()=>(s(),function(){clearInterval(o),u(),W("Desconectado!")}),[]);function u(){l(a,"audio"),l(a,"video"),l(r,"audio"),l(r,"video"),a=null,r=null;const y=document.getElementById("video1"),b=document.getElementById("video2");y&&(y.srcObject=null),b&&(b.srcObject=null),console.log("Stopped!"),i=!1}function l(y,b){y!=null&&y.getTracks().forEach(D=>{D.kind===b&&D.stop()})}function m(){var y=n.call("999123"+e.data.receiver.replaceAll(".","").replaceAll("-",""),a,c);y&&(y.on("stream",function(b){r=b,document.getElementById("video1").srcObject=r,i=!0}),y.on("close",function(){console.log("Closed!"),i=!1}))}function f(){if(a!=null&&!i)return m();a==null&&d({video:!0,audio:{autoGainControl:!1,echoCancellation:!1,googGainControl:!1,noiseSuppression:!1}},function(y){a=y;var b=document.getElementById("video2");b.addEventListener("loadedmetadata",function(D){b.style.width=this.videoWidth/4+"px",b.style.height=this.videoHeight/4+"px",b.style.marginLeft=-this.videoWidth/4+"px",b.style.visibility="visible"},!1),b.srcObject=a,m()},function(y){alert("Failed to get local stream.")})}function w(){return t.jsx("iframe",{width:"100%",height:700,style:{border:0},src:"https://us05web.zoom.us/j/82130251231?pwd=o46UhcNlDRq13oO1maHiaRLVOaxxnZ.1",allow:"camera; microphone; display-capture"})}return w()}function Kt(e){A(`
221
221
  .container {
222
222
  position: relative;
223
223
  width: 100%;
@@ -234,4 +234,4 @@ import{j as t,c as P,r as N,R as Te}from"./react.min.js";const p={colors:{primar
234
234
  height: 100%;
235
235
  border: none;
236
236
  }
237
- `);function n(){const r=`/zoom/?number=${e.data.number}&password=${e.data.password}&name=${e.data.name}&host=${e.data.host}`;return t.jsx("div",{className:"container",children:t.jsx("iframe",{onLoad:a,className:"responsive-iframe",src:r})})}function a(r){r.target.contentWindow.location.href.indexOf("/zoom/")<0&&(r.target.parentNode.style.display="none")}return n()}function Zt(e){const n={color:e.data.color};function a(){return t.jsx("div",{style:n,children:e.data.text})}return a()}var re,fe={};const en="/api/application/",pe=localStorage.getItem("application");function x(e){const n=fe[e.data.type];return n?Te.createElement(n,{data:e.data}):t.jsx("div",{children:JSON.stringify(e.data)})}x.register=function(e,n){fe[n.toLowerCase()]=e};x.render=function(e){re=e,document.location.pathname=="/"?localStorage.getItem("token")?window.reload("/app/dashboard/"):window.reload("/app/home/"):document.location.pathname=="/app/login/"&&(localStorage.getItem("token")||localStorage.getItem("application"))?(localStorage.removeItem("token"),localStorage.removeItem("application"),document.location.reload()):window.reload(document.location.href)};x.register(mt,"Counter");x.register(It,"Form");x.register(Bt,"QuerySet");x.register(Ge,"Fieldset");x.register(Q,"Field");x.register($e,"Object");x.register(Ve,"Section");x.register(Qe,"Group");x.register(Ut,"Statistics");x.register(tt,"Image");x.register(et,"Banner");x.register(nt,"Map");x.register(at,"Steps");x.register(ct,"QrCode");x.register(Se,"Badge");x.register(it,"Status");x.register(rt,"Progress");x.register(Ie,"Color");x.register(ot,"Boxes");x.register(ut,"Indicators");x.register(lt,"Shell");x.register(dt,"FileLink");x.register(st,"FilePreview");x.register(qe,"Response");x.register(Jt,"Application");x.register(Ne,"IconSet");x.register(ht,"Grid");x.register(He,"Rows");x.register(Pe,"Cards");x.register(Ue,"Timeline");x.register(Ce,"Scheduler");x.register(Qt,"WebConf");x.register(Zt,"Text");x.register(Ze,"Html");x.register(Kt,"ZoomMeet");window.addEventListener("popstate",e=>{window.reload(e.currentTarget.location.href)});window.reload=function(e){e==null&&(e=document.location.href);const n=e.split("/app/")[1].split("/")[0];fe[n]?q("GET",R(e),function(a){re.render(t.jsx(x,{data:{type:n,data:a}}))}):(e!=document.location.href&&window.history.pushState({url:e},"",e),pe?(window.application=JSON.parse(pe),q("GET",R(e),function(a){window.application.content=a,re.render(t.jsx(x,{data:window.application},Math.random()))})):q("GET",en,function(r){window.application=r,localStorage.setItem("application",JSON.stringify(window.application)),q("GET",R(e),function(i){window.application.content=i,re.render(t.jsx(x,{data:window.application},Math.random()))})}))};window.load=function(e){e.indexOf(window.origin)>=0||e.startsWith("/")?q("GET",R(e),function(n){e!=document.location.href&&e!=document.location.pathname&&window.history.pushState({url:e},"",e),window.loaddata(n),window.scrollTo({top:0,behavior:"smooth"})}):document.location.href=e};x.render(P.createRoot(document.getElementById("root")));
237
+ `);function n(){const r=`/zoom/?token=${e.data.token}`;return t.jsx("div",{className:"container",children:t.jsx("iframe",{onLoad:a,className:"responsive-iframe",src:r})})}function a(r){r.target.contentWindow.location.href.indexOf("/zoom/")<0&&(r.target.parentNode.style.display="none")}return n()}function Zt(e){const n={color:e.data.color};function a(){return t.jsx("div",{style:n,children:e.data.text})}return a()}var re,fe={};const en="/api/application/",pe=localStorage.getItem("application");function x(e){const n=fe[e.data.type];return n?Te.createElement(n,{data:e.data}):t.jsx("div",{children:JSON.stringify(e.data)})}x.register=function(e,n){fe[n.toLowerCase()]=e};x.render=function(e){re=e,document.location.pathname=="/"?localStorage.getItem("token")?window.reload("/app/dashboard/"):window.reload("/app/home/"):document.location.pathname=="/app/login/"&&(localStorage.getItem("token")||localStorage.getItem("application"))?(localStorage.removeItem("token"),localStorage.removeItem("application"),document.location.reload()):window.reload(document.location.href)};x.register(mt,"Counter");x.register(It,"Form");x.register(Bt,"QuerySet");x.register(Ge,"Fieldset");x.register(Q,"Field");x.register(Ve,"Object");x.register($e,"Section");x.register(Qe,"Group");x.register(Ut,"Statistics");x.register(tt,"Image");x.register(et,"Banner");x.register(nt,"Map");x.register(at,"Steps");x.register(ct,"QrCode");x.register(Se,"Badge");x.register(it,"Status");x.register(rt,"Progress");x.register(Ie,"Color");x.register(ot,"Boxes");x.register(ut,"Indicators");x.register(lt,"Shell");x.register(dt,"FileLink");x.register(st,"FilePreview");x.register(qe,"Response");x.register(Jt,"Application");x.register(Ne,"IconSet");x.register(ht,"Grid");x.register(He,"Rows");x.register(Pe,"Cards");x.register(Ue,"Timeline");x.register(Ce,"Scheduler");x.register(Qt,"WebConf");x.register(Zt,"Text");x.register(Ze,"Html");x.register(Kt,"ZoomMeet");window.addEventListener("popstate",e=>{window.reload(e.currentTarget.location.href)});window.reload=function(e){e==null&&(e=document.location.href);const n=e.split("/app/")[1].split("/")[0];fe[n]?q("GET",R(e),function(a){re.render(t.jsx(x,{data:{type:n,data:a}}))}):(e!=document.location.href&&window.history.pushState({url:e},"",e),pe?(window.application=JSON.parse(pe),q("GET",R(e),function(a){window.application.content=a,re.render(t.jsx(x,{data:window.application},Math.random()))})):q("GET",en,function(r){window.application=r,localStorage.setItem("application",JSON.stringify(window.application)),q("GET",R(e),function(i){window.application.content=i,re.render(t.jsx(x,{data:window.application},Math.random()))})}))};window.load=function(e){e.indexOf(window.origin)>=0||e.startsWith("/")?q("GET",R(e),function(n){e!=document.location.href&&e!=document.location.pathname&&window.history.pushState({url:e},"",e),window.loaddata(n),window.scrollTo({top:0,behavior:"smooth"})}):document.location.href=e};x.render(P.createRoot(document.getElementById("root")));
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: slthcore
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: API generator based on yml file
5
5
  Home-page: https://github.com/brenokcc
6
6
  Author: Breno Silva
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes